The floor function returns the largest integer number that is smaller or equal to x.
Glsl floor negative.
Glsl mix man page glsl 4 20 8 specification section 8 3 common functions parameters in x.
A more accessible description of the opengl es shading language is given in chapter 5 and appendix b of the book opengl es 2 0 programming guide by aaftab munshi dan.
Opengl es shading language built in functions.
The input parameter can be a floating scalar or a float vector.
Returns true if x holds a positive infinity or negative infinity representation in the underlying implementation s set of floating point representations.
Glsl floor man page glsl 4 20 8 specification section 8 3 common functions.
The abs function returns the absolute value of x i e.
Therefore almost all of its operators are overloaded to perform standard vector and matrix operations as defined in linear algebra in cases where an operation is not defined in linear algebra the operation is typically done component wise where the operation is performed on each.
Yes unfortunately hlsl s fmod is different from glsl s mod if one of the args is negative.
In my old generator i solved this with a macro define mod x y x y floor x y since it was a macro it worked automatically for all types.
The input parameter.
X when x is positive or zero and x for negative x.