Is is possible to use GL_POINT_SPRITE_ARB with a glsl vertex and fragement shader?

Its possible with GLSL Ver. 1.2 thanks to the new buildin variables “gl_PointSize” and “gl_PointCoord”.
As far as I know ATI only supports GLSL 1.1, so you have
to write a fallback for these cards.

Have a look at this thread for some shadersource.

For the record and just to clarify:

I want to use GL_POINT_SPRITE so that I only send a list of points, but the vertex shader receives three verts for each point submitted, and the fragment shader receives automatic teture coords.

It appears this does work. I draw the points with a vbo
glDrawArrays(GL_POINTS, 0, pointCount);

and the currently enabled vertex and fragment shaders are recieving the billboarded tris with texture coords set.

btw - This is on a mac with a GeForce 8600 GTM

I dont think you are seeing what you think you are. Unless I’m mistaken the ‘billboard’ is created in the rasterization stage, after the vertex shader. You will only receive one vertex for each point sprite (the one you specify).

You are probably right - I may only be seeing one vert in the vert shader…not sure how to tell.

But I was unclear whether I could use a custom fragment shader - and the answer to that is yes :slight_smile:

Thanks for your post…