Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#Actualic0de

Posted 20 September 2012 - 06:28 PM

So I have this problem where my point sprites are not becoming smaller as the get farther from the camera but rather larger. I tried GL_POINT_DISTANCE_ATTENUATION but it didn't seem to have any affect. I also wrote a shader to scale the point sprites based on there distance:

gl_PointSize = scr_h / distance(-(gl_ModelViewMatrix * gl_Vertex), gl_Vertex);

This works but doesn't stop the sprites from getting bigger, what happens is that the sprite gets smaller with distance but only starting at a certain point before that the are growing forming a sort of "bulge" in the middle of a row of sprites. Any idea where this scaling upward is coming from, is there something that I can disable? I certainly didn't enable anything except this:

glEnable(GL_POINT_SPRITE);
glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE);
glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);

#1ic0de

Posted 20 September 2012 - 06:08 PM

So I have this problem where my point sprites are not becoming smaller as the get farther from the camera but rather larger. I tried GL_POINT_DISTANCE_ATTENUATION but it didn't seem to have any affect. I also wrote a shader to scale the point sprites based on there distance:

gl_PointSize = scr_h / distance(-(gl_ModelViewMatrix * gl_Vertex), gl_Vertex);

This works but doesn't stop the sprites from getting bigger, what happens is that the sprite gets smaller with distance but only starting at a certain point before that the are growing forming a sort of "bulge" in the middle of a row of sprites. Any idea where this scaling upward is coming from, is there something that I can disable? I certainly didn't enable anything except this:

glEnable(GL_POINT_SPRITE);
glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE);
glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);

PARTNERS