I have a program that draws a series of points distributed in the scene. Added to that, I have a vertex shader that I use, among other things, for modifying the size of the points according to the distance to the points from the viewer using gl_PointSize.
Without the usage of gl_PointSize, the scene draws without problems, I can even call glPointSize(the opengl instructin) outside of the shader without any problem, however when using gl_PointSize(the glsl variable) I get the following artifacts (the green and purple points are part of my simulation. The artifacts are the ones that are sort of arranged in lines.)
Some additional information:
- It doesn’t matter what value I send to gl_PointSize, even when sending it a 1 the line artifacts will show.
- I am properly calling glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
- Calling glEnable(GL_POINT_SPRITE); doesn’t help one way or the other
- Not calling either one of those makes it so that gl_PointSize no longer affects the size of my points, but the line artifacts still appear.
- So in summary, the mere action of assigning a value of gl_PointSize causes the error.
- The points are being drawn using a glDrawArrays. I’m positive that I’m not overflowing the array where the points coords are located.
I’d appreciate if anyone could point me in the right direction to correct this.