Basic OpenGL ES2 (iPhone Simulator) question...
- by David
Hi!
I'm trying to modify the fragment shader which is part of the standard iPhone/XCode OpenGL ES template. I want to make it so that every other row of pixels is transparent. I have this code so far:
varying lowp vec4 colorVarying;
void main()
{
gl_FragColor = vec4(colorVarying.x, colorVarying.y, colorVarying.z, floor(mod(gl_FragCoord.y, 2.0)));
}
But when I compile and run I still get the same square moving up and down with no other effects.
What am I doing wrong here? I'm a complete n00b at Glsl - I'm trying to teach myself the very basics. (starting with this tutorial - http://www.mobileorchard.com/getting-started-with-opengl-es-20-on-the-iphone-3gs/)
Please help! Thanks! David :)