Graphics Reference
In-Depth Information
Vector Relational Functions
Relational and equality operators (<, <=, >, >=, ==, !=) are defined to
produce scalar boolean results. For vector results, use the following built-
in functions. In Table B-7, “bvec” is a placeholder for one of bvec2 ,
bvec3 , or bvec4 ; “ivec” is a placeholder for one of ivec2 , ivec3 , or
ivec4 ; “uvec” is a placeholder for uvec2 , uvec3 , or uvec4 ; and “vec” is
a placeholder for vec2 , vec3 , or vec4 . In all cases, the sizes of the input
and return vectors for any particular call must match.
Table B-7
Vector Relational Functions
Syntax
Description
bvec lessThan (vec x, vec y )
bvec lessThan (ivec x, ivec y )
bvec lessThan (uvec x, uvec y )
Returns the component-wise
compare of x < y .
bvec lessThanEqual (vec x, vec y )
bvec lessThanEqual (ivec x, ivec y )
bvec lessThanEqual (uvec x, uvec y )
Returns the component-wise
compare of x <= y .
bvec greaterThan (vec x, vec y )
bvec greaterThan (ivec x, ivec y )
bvec greaterThan (uvec x, uvec y )
Returns the component-wise
compare of x > y .
bvec greaterThanEqual (vec x, vec y )
bvec greaterThanEqual (ivec x, ivec y )
bvec greaterThanEqual (uvec x, uvec y )
Returns the component-wise
compare of x >= y .
bvec equal (vec x, vec y )
bvec equal (ivec x, ivec y )
bvec equal (uvec x, uvec y )
Returns the component-wise
compare of x == y .
bvec notEqual (vec x, vec y )
bvec notEqual (ivec x, ivec y )
bvec notEqual (uvec x, uvec y )
Returns the component-wise
compare of x != y .
bool any (bvec2 x )
bool any (bvec3 x )
bool any (bvec4 x )
Returns true if any component of x
is true .
bool all (bvec2 x )
bool all (bvec3 x )
bool all (bvec4 x )
Returns true only if all components
of x are true .
bvec2 not (bvec2 x )
bvec3 not (bvec3 x )
bvec4 not (bvec4 x )
Returns the component-wise logical
complement of x.
 
 
 
Search WWH ::




Custom Search