D3DX Util, Voodoo2 and strange effects

Started by
12 comments, last by AntonyHirst 24 years, 2 months ago
Errm,

I know it works in other apps. How about that offer of the code sample so I can see why it doesn''t work in mine.

Tony
Tony
Advertisement
Problem bl**dy solved!!

Right then. After reading the documentation and applying common sense I assumed the following process.

1) Initialise
2) Render Loop
3) Clear Z-Buffer
4) Render Object
5) Get Next Object
6) Goto 2 until no more objects
7) Flip surface

What I actually needed to do was:
1) Initialise
2) Clear Z-Buffer
3) Render Loop
4) Render Object
5) Clear Z-Buffer
6) Get Next Object
7) Goto 3 until no more objects
8) Flip surface.

Why you need to clear the Z-buffer before flipping is just a mystery to me. Expecially when the Z-buffer is turned off!!!





Tony
Tony
Sounds like what you are describing is Z-Fighting. Polygons that are fairly close will sometimes screw up visually because the Z-Buffer precision isn''t high enough for the closely lying polys.

There are ways to help solve this (use 32 bit zbuffer, use wbuffers (for some types of scenes), changing the near and far clip planes) etc. etc...

I would recommend going to NVidia''s site and read the articles there about Z-Buffering/W-Buffering...
Thanks for the reply,

However, I don''t see how the requirement to clear the z-buffer after the final render and before the flip has any effect on near plane precision problems. A very import and strange point is that I would have the problems with the z/w-buffer switched off and the also with the w-buffer switched on.

If you are not convinced by that, I also reduced my projection matrix planes from 0.1-10,0000 to 1-300 to make remove any doubt about z precision.

Now that I do clear the z/w-buffer after the last render and before the flip I get a perfect render.

It looks bootiful!

Tony.

Tony
Tony

This topic is closed to new replies.

Advertisement