The greaterThanEqual()
function in GLSL is used to compare two values and return a boolean result indicating whether the first value is greater than or equal to the second value.
bool greaterThanEqual(T x, T y)
x
: The first value to be compared, of any type T
.y
: The second value to be compared, of the same type T
as x
.The greaterThanEqual()
function returns a boolean value indicating whether x
is greater than or equal to y
. If x
is greater than or equal to y
, it returns true
. Otherwise, it returns false
.
float a = 5.0;
float b = 3.0;
bool result = greaterThanEqual(a, b); // Returns true
int x = 10;
int y = 20;
bool result = greaterThanEqual(x, y); // Returns false
vec3 p = vec3(1.0, 2.0, 3.0);
vec3 q = vec3(1.0, 0.0, 5.0);
bvec3 result = greaterThanEqual(p, q); // Returns bvec3(true, true, false)
greaterThanEqual()
function can only be used with numerical data types (float
, int
, uint
, double
) and vectors/matrices composed of numerical data types.greaterThanEqual()
function returns a boolean vector/matrix in which each element of the result corresponds to the comparison of the respective elements of the input vectors/matrices.greaterThanEqual()
function is part of the GLSL version 1.20 specification and is supported by most modern GPUs.