I have come across a problem with point sprites and fragment shaders that I would like to share. First of all, here’s my code:
***Fragment shader***
uniform sampler2D testTexture;
void main( void )
{
gl_FragColor = gl_Color*texture2D( testTexture, v_texCoord );
}
The weird thing is, that if v_texCoord is NOT defined (as above) the program works, but I get an error. As soon as I define it to be anything my point sprites are not shown on the screen.
glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE);
Is done in my main app.
There is info about point sprites here
I find it hard to understand how varying data from a vertex shader could be interpolated across a point. Is there any defined behaviour for this?