PDA

View Full Version : simple depth test question



jide
03-15-2005, 08:56 AM
Is it best to call Disable (GL_DEPTH_TEST) or DepthMask (GL_FALSE) ?

I speak in term of performance.

Aeluned
03-15-2005, 09:15 AM
They both serve different purposes.

DepthMask enables/disables writes to the depth buffer so that future incoming fragments can be tested against the current one in the pipeline.

DepthTesting compares the current fragment to the contents of the z-buffer.

You can, I suppose, disable depth writes so that future fragments may always pass the depth test irrespective of the current one.

Modern graphics hardware usually has an early z-fail mechanism, meaning that the fragment can fail the z test early in the pipeline and be discarded sooner.

In this respect, I suppose you'd want to keep depth testing active so that you can take advantage of that.

jide
03-15-2005, 09:37 AM
Sorry, my question was stupid. I realized it too lately. Like what I can misunderstand things for a while...

thanks.