ATI problem.. z buffer pass early z rejection

Started by
2 comments, last by James Trotter 18 years, 7 months ago
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.
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)
-* So many things to do, so little time to spend. *-
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.
Changing the depth testing function can be expensive. Also, in the OpenGL performance tuning slides, ATI warns against using equal and notequal for depth testing. As has been said, using lessequal should solve your problem.

This topic is closed to new replies.

Advertisement