point sprites and fragment shaders

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?

im pretty sure u need to write to this
gl_PointSize = X
in the vertex shader
also stick this in somewhere
glEnable( GL_VERTEX_PROGRAM_POINT_SIZE_ARB );

Originally posted by thinks:
[b]I have come across a problem with point

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?[/b]
if your vertex program passes something to the fragment program through an interpolator it stays constant for every fragment of the point. only if texcoord replacement is enabled the specified texture coordinate is being interpolated over the point (ignoring everything you pass as this coordinate to the gpu)

The solution was to use the built in texture coordinates, gl_TexCoord[0].st. In fact this is not entirely true either. What I used was gl_TexCoord[0], without .st. This seems to be a bug. I was told that my program should not compile with this sort of code. Isn’t gl_TexCoord[0] a vec4? Doesn’t texture2D want vec2?