PDA

View Full Version : Early-Z on FX



KlausE
05-27-2003, 04:22 PM
Hi everybody,
does anybody know how to enable early-z tests on FX boards ? There is a decent performance increase with deferred shading algorithms on the R9700, but there is none on FX boards.

Early-Z seems to be disabled in current drivers due to Viewperf performance decreases.

At least a registry key would be great ...

madmanchan
05-27-2003, 05:07 PM
How are you setting up your deferred shading algorithms on the FX?

Eric

KlausE
05-27-2003, 06:16 PM
Well,
1st pass: simpel shader, write z-values dependent on some criteria to select fragment for later shading (e.g., z=0 for no shading, z=1 for shading)
2nd pass: complex shader, no z-writes!, z-test=LEQUAL

Works fine on R9700 - up to 3x performance.

M/\dm/\n
05-27-2003, 11:21 PM
You can download Rivatuner, it'll alow you to enable Z-oclussion culling, enabled by default, at (www.guru3d.com).
BTW, is there some point in performing somthing like this:
1st pass: color writes off, do only geometry shaders -> render geometry;
2nd pass: color writes on, depth writes off, DepthFunc(GL_EQUAL), render geometry.
This way doesn't take performance hit as on GF2, but isn't working faster either for 4x overdraw on FX5200, where fillrate is an issue. Have I forgot something?

KlausE
05-28-2003, 05:04 AM
Thanks for the tip. There is only a checkbox for "Enable early Z-occlusions culling" in the Direct3D settings of the LMA tab. It is enabled ...

There seems to be no corresponding checkbox in the OpenGL settings.

DepthFunc(GL_EQUAL) and glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE) does not help ...

M/\dm/\n
05-28-2003, 05:10 AM
DepthFunc(GL_EQUAL) and glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE) does not help ...
It shouldn't as in the first pass when color writes are of DeptfFunc must be LEQUAL to get correct values in depth buffer, in second pass you should use EQUAL, to write color values (shaded) only wher z pases.

Korval
05-28-2003, 09:02 AM
If I recall a .pdf correctly, using EQUAL/NOTEQUAL on Radeon's is a bad idea. Their hierarchial-Z buffer doesn't work very well with EQUAL/NOTEQUAL.

LEQUAL should give you the exact same functionality.

That same performance.pdf (from GDC2003) says not to switch depth tests mid-frame.

[This message has been edited by Korval (edited 05-28-2003).]

Humus
05-28-2003, 01:02 PM
Switching depth-tests should be fine as long as you're not reversing it. Switching between GL_LESS and GL_LEQUAL should be fine, but don't switch from GL_LESS to GL_GREATER.

Either way, it seems the original poster had problems with GFFX and not the Radeons.