PDA

View Full Version : Polys drawn so small they disappear



inept
02-05-2003, 06:53 AM
* Runway lines - done as long rectangular white boxes sitting on the runway polygons.
* Go mad with polygonoffset because you think it's depth fighting.
* Decide to remove runway for the hell of it.
* So lots of long rectangular boxes going off into the distance (in an empty zbuffer).
* Distant boxes get rendered so small that the 0 pixels of the jaggies win in the end and all 6 faces of the box disappear. Eaten by the jaggies.
* Decide to render the boxes as solid polys and then a second pass rendering them as wireframe polys.

Runway lines suddenly behave themselves.

Anyone else been through this strange experience?
I know polys have zero thickness, but even so - it's mad that a whole object gets aliased away...is there a more elegant solution than rendering wireframe on top of filled?

Adrian
02-05-2003, 07:04 AM
Maybe you could use polygon_smooth. The runway lines would just appear fainter instead of disappearing.

inept
02-05-2003, 07:24 AM
polygon_smooth requires you to alpha blend, doesn't it? which in turn means depth sorting your polys etc.
Even then, are you sure that it would work for very distant objects?
Even the 9tap antialiasing on this quadro4 doesn't solve the problem, so I'm not sure polysmooth will do it.
The wireframe second pass works a treat - I'm beginning to feel like I've stumbled on some great advancement in antialiasing technology! http://www.opengl.org/discussion_boards/ubb/wink.gif

Relic
02-05-2003, 07:59 AM
You experienced one of the basic rasterization rules. Only fragments which touch the center of a pixel are rendered. That guarantees that adjacent polygons never render pixels twice (would disturb blending and logic ops) and never generate cracks.
Try three differently colored quads at pixel coordinates (0.2, 0.2) to (0.4, 0.4), one from (0.4, 0.4) to (0.6, 0.6, and a third from (0.6, 0.6) to (0.8, 0.8).
Which one rendered the pixel? http://www.opengl.org/discussion_boards/ubb/wink.gif

inept
02-05-2003, 11:08 AM
Spoilsport! http://www.opengl.org/discussion_boards/ubb/smile.gif

pocketmoon
02-05-2003, 03:18 PM
Originally posted by inept:
[SNIP]Even the 9tap antialiasing on this quadro4 doesn't solve the problem, so I'm not sure polysmooth will do it.
The wireframe second pass works a treat - I'm beginning to feel like I've stumbled on some great advancement in antialiasing technology! http://www.opengl.org/discussion_boards/ubb/wink.gif

That's why I like SuperSampling http://www.opengl.org/discussion_boards/ubb/smile.gif
http://homepage.ntlworld.com/pocketmoon/mwcomp.jpg

SuperSampling AA on left, no AA on right.

rgpc
02-05-2003, 05:54 PM
Originally posted by inept:
The wireframe second pass works a treat - I'm beginning to feel like I've stumbled on some great advancement in antialiasing technology! http://www.opengl.org/discussion_boards/ubb/wink.gif

Maybe you should build it so a single, wireframe pass is done as a type of LOD? Isn't there some performance hit on non-Quadro nvidias when doing wireframe?

Can't remember whether it's just the drawing of wireframe or if it's smooth wireframe that causes the hit.