Archived

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

Viscous-Flow

Z-fighting, bleeding, and stitching...need help!

Recommended Posts

Viscous-Flow    122
Z-fighting, bleeding, and stitching all stand for the same thing. When two polygons are draw on the same plane with different vertices, floating point round off errors occur. Thus, the two polygons tend to mix and create undesirable effects. That was what I read on the OpenGL website. Does anyone know of a way to combat these problems WITHOUT disabling GL_DEPTH_TEST? I tried what they showed on the website, but it doesn't work right/I couldn't get it to work. Any help would be greatly appreciated! Edited by - Viscous-Flow on August 31, 2001 10:32:30 PM

Share this post


Link to post
Share on other sites
nosfy    194
You can move the far plane. All objects you will draw afterwards will have a lower z value... Pretty neat.

Patrick Lafleur

System Engineer
Creation Objet Inc.

Share this post


Link to post
Share on other sites
zedzeek    528
fighting should only occur if u use 2 diferent methods for drawing eg one with clipping and one without. but if youre only changing textures on the 2nd pass then no fighting should occur.
if fighting occurs u can use glPolygonOffset(..) to combat it

Share this post


Link to post
Share on other sites
Dodger    122
Yes, z-fighting can always occur when drawing polys with very little angle in between them
Especially at extreme z-coordinates of the vertices of those polys, due to non-linearity of the z-buffer (move the polys a little closer to the near plane and the fighting will most likely disappear). The easiest way to get rid of z-fighting without disableing depth test is moving the far plane closer to the view point or the near plane further away - in other words, decrease the distance between them. That increases your z-buffer resolution (in z-depth/world unit) and the fighting should disappear.
If that''s not an option, try glPolygonOffset to offset the z-values of one of the polys.

Share this post


Link to post
Share on other sites