hey all,
I am trying to use the "mod" function (which can be replaced with the "floor" function) in a fragment shader I wrote and it's working fine on my windows desktop PC but when I try to run it on the raspberry pi, I am getting this error:
OpenGL Shader Link Failed: ERROR:CUSTOM-11 (line 6) No declared overload matches function call arguments
The shader is:
const char *cpszRGBAFragmentShader =
"uniform sampler2D RGBAtexEven, RGBAtexOdd;\n"
"uniform float fFrameHeight;\n"
"varying vec2 fragTexCoord;\n"
"void main(void) {\n"
" float fY = fragTexCoord.y * fFrameHeight;\n"
" float fMod = mod(fY,2);\n"
" if (fMod < 1.0) gl_FragColor=texture2D(RGBAtexEven,fragTexCoord);\n"
" else if (fMod > 1.0) gl_FragColor=texture2D(RGBAtexOdd,fragTexCoord);\n"
" else gl_FragColor=vec4(1, 0, 1, 1);\n"
"}\n";
The compile process adds precision definitions for GLES2 (as I mentioned I test this on a desktop PC also which isn't completely compatible with GLES2).
Neither mod nor floor seem to work. Does anyone know what I am doing wrong?