Archived

This topic is now archived and is closed to further replies.

RPTD

GL_QUADS plays jerky in 2d...

Recommended Posts

for rendering text i wanna use a GL_QUAD with the right texture. the texture is ok and correctly loaded (it renders in 3d on a quad without problem). now if i use the same quad in 2d mode suddenly the quad plays dull and jerky. it renders one triangle correct with texture and the other triangle is a complete mess. anybody knows what stupid glEnable/Disable the GL_QUAD relies on? i''ve had no chance getting this to run so far and it drives me nuts. entering 2d mode makes this with me: OGL_CHECK( glDisable(GL_TEXTURE_2D) ); OGL_CHECK( glDisable(GL_DEPTH_TEST) ); OGL_CHECK( glDisable(GL_CULL_FACE) ); OGL_CHECK( glDisable(GL_LIGHTING) ); OGL_CHECK( glDisable(GL_BLEND) ); OGL_CHECK( glEnable(GL_LINE_SMOOTH) ); OGL_CHECK( glEnable(GL_POINT_SMOOTH) ); OGL_CHECK( glEnable(GL_POLYGON_SMOOTH) );

Share this post


Link to post
Share on other sites
yeah... i found out myself last night. i somehow managed to mix up the order of the glVertex and glTexCoord commands. st00pid myself. it works now with rendering the quad.

only problem the aliasing is awefull. i tried to read the manual but i somehow am not sure if i get it right.
if I do glEnable(GL_POLYGON_SMOOTH), does this now disable or enable anti-aliasing of the polygon? i think glEnable disables anti-aliasing but i still get completly vashed letters on the screen making it damn hard to read the text.

Share this post


Link to post
Share on other sites
GL_POLYGON_SMOOTH smoothes the edges of the polygons, which if I understand isn''t what you want.

I think you want to use glTexParameter to set the texture min/mag filtering. You probably want GL_LINEAR if you''re drawing the text bigger or smaller than the actual size or GL_NEAREST if you''re drawing it exactly the right size and don''t want it to seem blurred.

eg:
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);

Share this post


Link to post
Share on other sites