If a vertex shader is active and vertex program point size mode is enabled,
then the derived point size is taken from the (potentially clipped) shader builtin
gl_PointSize and clamped to the implementation-dependent point size range.
If a vertex shader is active and vertex program point size mode is disabled,
then the derived point size is taken from the point size state as specified by the
PointSize command. In this case no distance attenuation is performed.
I think it means the point’s size will change against the distance when the vertex shader and vertex program point size are both enabled. It’s not true, however, in my programm. Anyone met this problem before?
I think you have it backwards. It is saying that if you have a vertex shader enabled, and you do not have GL_VERTEX_PROGRAM_POINT_SIZE enabled, it will use the value supplied to glPointSize. If you have program point size enabled, then you specify the point size to be whatever you want in you program, by writing to gl_PointSize.
Well, “gl_PointSize” is the built-in vertex shader variable, “PointSize command” is glPointSize from the fixed pipleline.
But what I concerned is, when vertex shader actived and GL_VERTEX_PROGRAM_POINT_SIZE enabled, the closer to view the point sprites, the smaller the particle is… Shouldn’t it be the closer the bigger?
But what I concerned is, when vertex shader actived and GL_VERTEX_PROGRAM_POINT_SIZE enabled, the closer to view the point sprites, the smaller the particle is… Shouldn’t it be the closer the bigger?
Are you sure it’s actually getting smaller (your links don’t work)? It’s easy to mistake something getting smaller for something that’s staying the same size when the world around it is getting bigger.
Having a vertex shader and GL_VERTEX_PROGRAM_POINT_SIZE enabled is not enough to get a light point attenuation with the distance. What that means is you can then set the size to the value you want using gl_PointSize. If you want an attenuation, you have to reduce gl_PointSize with the distance yourself in the vertex shader. That’s pretty much what ehart was saying…