Jump to content
  • Advertisement
Sign in to follow this  
Matt Aufderheide

ATI problem.. z buffer pass early z rejection

This topic is 4776 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

In my D3D9 engine i render a z-buffer only pass before rendering with shaders. This is to allow a z rejection in the shader passes, which improves framerate. Basically, my z-buffer pass sets COLORWRITEENABLE=FALSE and so forth.. and just renders the geometry depth values to the z buffer. Then i render my shader passes, setting zenable=true and zwriteenable=false, and zfunc=equal. This method works perfectly on Nvidia cards. However, it fails on all ATI cards i ave tried.. including radeon 9700, x800 and so on. MY question is then, what is difference in how ATI and Nvidia cards deal with z buffer writes and z func.. and does nayone have any experience or code that does the same thing i'm trying to do that works with ATI cards.

Share this post


Link to post
Share on other sites
Advertisement
Try changing zfunc to lessequal, due to floating point precision issues you might have slight difference, even more if you are using a Zpass only with standard T&L and the shader pass with ... he.. the shader ^^
(Shader Transform & Standard Transform are likely to mismatch)

Share this post


Link to post
Share on other sites
ATI heirarchial z doesn't work if you change the zbuffer direction. For example, if you do your pre-pass using lessequal, then you must continue to use lessequal or less (since its the same "direction") but equal, greater or greaterequal will all turn off the fast z reject. This is different behavior then NVidia hardware.

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!