Jump to content
  • Advertisement
Sign in to follow this  
-indirectX-

Z-Buffer/polygon/rippling problem

This topic is 4838 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've loaded in a 3ds file into my program with textures and animation and it looks good except for a strange problem where I get a kind of rippling effect in places. I thought it might be that there are two polygons overlapping and so both are being rendered simultaneously. I am using directX to automatically control z-buffering (in RenderState). Has anyone seen this before/know the solution to it? Here is a screen shot of the problem. It's a little hard to see but basically there is overlapping. All the best, Hugh

Share this post


Link to post
Share on other sites
Advertisement
That wouldn't happen to be a model from Deus Ex would it? [wink]

Anyway, it looks like a classic case of Z-Precision issues... there can be a few causes for this as well as solutions [smile]

Firstly you want to check your projection matrix - particularly the "near" value. Ideally you want a near/far combination that accurately encloses the model you are rendering - that way the Z-Buffer values will be distributed over a range that is *actually* useful to you [smile]

Also, values for zNear that are less than 1.0f can cause numerical instabilities in the projection matrix. If yours breaks this rule, set it to 1.0 or above.

Another thing to check is the scaling of your geometry - if you're shrinking your geometry by a large factor you might be getting numerical instabilities where parts of the geometry and generating the same Z value and thus appear to be overlapping.

You could, as an easy solution, try increasing the depth buffer precision - D3DFMT_D16 is the usual value, but you can have (if your hardware supports it) D3DFMT_D24X8 and D3DFMT_D32 - offering 24 and 32 bits of depth precision respectively. If this solves your problem great, but it's not necessarily a good permanent solution because your program may not always be running on hardware that supports high resolution depth buffers [smile]

hth
Jack

Share this post


Link to post
Share on other sites
Hi there, Excellent advice jollyjeffers! It was the near clipping plane that was the problem - it was set to 0.1 instead of 1.0. Now everything looks fantastic!
Thanks very much and yes, it is a deus ex model, been having fun today importing loads of different ones. This is my favourite tho!

Thanks again,

Hugh

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!