I’m having some trouble with the builtin mod() function on NVIDIA hardware. Shouldn’t
float x = IDX; while (x >= SIZE) x -= SIZE;
lead to the same result as
float x = mod(IDX, SIZE);
At least in my case it does not. In fact
seems to be returning a value equal to SIZE. Could this be some floating point precision issue? Is the while loop exeuted on hardware as well or is there some software emulation going on? At least that would be an explanation for the different results then…
SIZE is a component of a uniform vec3 and IDX is a component of the first texture coordinate set.
uniform vec3 u_sec_size #define SIZE u_sec_size #define IDX gl_MultiTexCoord0
Hardware/driver configuration available online.
Thanx for any help!