ugly zig-zag

Started by
6 comments, last by gahre 22 years, 4 months ago
How can I avoid this ugly zig-zag pattern at the crossing edge of polygons (I hope you know what I mean)? I already tried to increase the z-buffer bits from 8 to 16 and to 32 (<< BTW, does that work???) - but nothing changed. Gahre
Advertisement
You can contact me via ICQ if you want to see a screenshot.You can also browse my ICQ shared files folder if I''m online, the name is: "ugly zig-zag.bmp" (what a surprise!!!)
the "fightin''-pixel-problem" can be removed by different approaches.
i know two of them:
1. scale down your models, reduce sight-range.
2. switch to a higher z-buffer resolution.

btw, you have to make sure the z-buffer really has a greater bitdepth. my good ol'' tnt2 card, i.e. only supports 24-bit z-buffer if you''re running at a 32-bit pixel bitdepth. if one doesn''t know it can very well take some hours till you find out, ouch... 8(

cu
the "fightin''-pixel-problem" can be removed by different approaches.
i know two of them:
1. scale down your models, reduce sight-range.
2. switch to a higher z-buffer resolution.

btw, you have to make sure the z-buffer really has a greater bitdepth. my good ol'' tnt2 card, i.e. only supports 24-bit z-buffer if you''re running at a 32-bit pixel bitdepth. if one doesn''t know it can very well take some hours till you find out, ouch... 8(

cu
in this line...your numbers are gonna be diffrent
gluPerspective(fov,screenratio,minseperation,maxview_dist);

for what i''ve done, setting minseperation to .1 or below fixes the problem, play with this value to get somthing that prevents the jagged intersections...this might not be the propper way to do it but it worked for me
Wow! Didn''t know that this value would solve my problem, but it did! I decreased it from 0.1 to 0.05 just for testing and I noticed that it got even worse, so I changed it to 2.0 and it''s gone! But why does this solve the problem? How come? I thought it would just change the near clipping value?
its because of the way z-values are distributed in the z-buffer... its not linear from near to far... its a curve (can''t think what type off hand... squared? cubic? exponential?), with more precision close to the near plane, and reduced precision the further away you get (towards the far clip plane)

Thats why its always good to push the near clip plane out as far as you can... it gives better precision further out
I think depth coordinates are also normalized/clamped to 0.0-1.0, so if you have a huge distance between your frustum''s near/far planes you''re going to run into innaccuracies, which manifests itself as jaggy edges because the z-buffer can''t be more precise.

This topic is closed to new replies.

Advertisement