Graphics Reference
In-Depth Information
Table B-3
Common Functions
(continued)
Syntax
Description
genType
clamp
(genType
x
,
genType
minVal
,
genType
maxVal
)
genType
clamp
(genType
x
,
loat
minVal
,
loat
maxVal
)
genIType
clamp
(genIType
x
,
genIType
minVal
,
genIType
maxVal
)
genIType
clamp
(genIType
x
,
int
minVal
,
int
maxVal
)
genUType
clamp
(genUType
x
,
genUType
minVal
,
genUType
maxVal
)
genUType
clamp
(genUType
x
,
uint
minVal
,
uint
maxVal
)
Returns
min (max
(
x
,
minVal
),
maxVal
)
Results are undefined if
minVal
>
maxVal
.
genType
mix
(genType
x,
genType
y,
genType
a
)
genType
mix
(genType
x,
genType
y,
float
a
)
Returns the linear blend of
x
and
y
,
i.e.,
x
* (1 -
a
) +
y
*
a
.
genType
mix
(genType
x
,
genType
y,
genBType
a
)
Selects which vector each returned
component comes from. For a
component of
a
that is false, the
corresponding component of
x
is
returned. For a component of
a
that is
true, the corresponding component of
y
is returned. Components of
x
and
y
that
are not selected are allowed to be invalid
floating-point values and will have no
effect on the results. Thus, this provides
different functionality than genType
mix
(genType
x
, genType
y
, genType(
a
))
where
a
is a boolean vector.
(continues)