PDA

View Full Version : Missing Pixel



gimp
08-10-2004, 03:14 PM
I have a tiny problem that is driving me nut's. I've lost a pixel. I've reduced the problem down to this:



glBegin(GL_LINE_STRIP);
glVertex2f(200, 400);
glVertex2f(0, 400);
glVertex2f(0, 0);
glEnd();
This creates an elbow shape, like an upside down L. In the join I have the corner pixel missing. I have tried also submiting this shape as GL_LINES and got the same result. If I reverse the winding I get the same result. Odd thing is, if I continue and add a third line with glVertex2f(200, 0) the problem no longer occurs.

Any idea's as to why this has happened?

arekkusu
08-10-2004, 05:01 PM
GL doesn't ensure any precise rendering. Your pixel may be missing on one video card and present on another.

But, try specifying your line vertices on pixel centers, i.e. (0.5, 400.5)

gimp
08-10-2004, 06:11 PM
Your on to something with the 0.5 suggestion. The missing pixel moved to the bottom left corner of my box from the top right. Odd...

...and your correct. My ATI Radeon doesn't have this problem but other low end cards do.