Advertisement

seams when drawing in ortho mode

Started by June 13, 2002 10:34 PM
4 comments, last by jasonf 22 years, 8 months ago
i''m using glOrtho to display a graphic window. that works - the problem is that there are visable seams in the intersections of the various quads that i''ve drawn. i''ve heard of this before, and heard that turning off mipmapping will solve this, but i''m not using mipmapping. here''s a link to a pic of the problem, and an example of how i''m drawing the quads in ortho space. glBindTexture(GL_TEXTURE_2D,menutex[7].texID); glBegin(GL_QUADS); glTexCoord2d(0, 0); glVertex3d(0, 0, 0); glTexCoord2d(1, 0); glVertex3d(128, 0, 0); glTexCoord2d(1, 1); glVertex3d(128, 32, 0); glTexCoord2d(0, 1); glVertex3d(0, 32, 0); glEnd(); glTranslated(128,0,0); glBindTexture(GL_TEXTURE_2D,menutex[7].texID); glBegin(GL_QUADS); glTexCoord2d(0, 0); glVertex3d(0, 0, 0); glTexCoord2d(1, 0); glVertex3d(sizex-160, 0, 0); glTexCoord2d(1, 1); glVertex3d(sizex-160, 32, 0); glTexCoord2d(0, 1); glVertex3d(0, 32, 0); glEnd(); FYI -> just in case you are wondering, sizex is a parameter that the function receives. here''s the link.. http://www.elasticvisuals.com/problem.jpg thanks in advance.
Jason FeserCode Geek / Visuals Guyelasticmediaproductionshttp://www.elasticvisuals.com
oh yes, and before you suggest it, I _am_ clamping my texture s and t. the alpha level of the graphics does not show the seams, nor does the rgb layer. i can piece the menu together in a paint package and it matches up perfectly. if this were a situation where I was using floats, i''d just knock it back a tenth of a unit for float imprecision, but i''m using decimal/ortho....

just an fyi
Jason FeserCode Geek / Visuals Guyelasticmediaproductionshttp://www.elasticvisuals.com
Advertisement
Got it.

Jason FeserCode Geek / Visuals Guyelasticmediaproductionshttp://www.elasticvisuals.com
If you use linear filtering (ie GL_LINEAR) then you will see seams even if mipmapping is disabled. Mipmapping does not really add seams, it just shows them bigger.

Instead of GL_CLAMP, you HAVE to use GL_CLAMP_TO_EDGE to remove seams.
On most nVidia cards you don''t need to do it but in fact that''s just *luck*.

BTW using texture coordinates in the range [0.01, 0.99] instead of [0, 1] doesn not really remove the problem.
thanks for the reply.

it''s working, but i''m going to switch to CLAMP_TO_EDGE from CLAMP anyway, just in case...

i''ve got myself a nice little skinnable resizable window class with all sorts of cool stuff like transparency, priority, color, position, fade in/out effects etc...

yippee!

Jason FeserCode Geek / Visuals Guyelasticmediaproductionshttp://www.elasticvisuals.com
heres a link to the finished product just in case you wanted to have a look....

http://www.elasticvisuals.com/plasm1.jpg

Jason FeserCode Geek / Visuals Guyelasticmediaproductionshttp://www.elasticvisuals.com

This topic is closed to new replies.

Advertisement