Sign in to follow this  
user88

pixel processing question

Recommended Posts

I believe that is dependant on the hardware implementation. Since the depth value can be written to in the pixel shader, I seem to recall that there were some cases where it would still be run even though the depth test fails.

Share this post


Link to post
Share on other sites
If the pixel shader outputs a modified depth value then it'll probably be run all the time (as that change could affect the test).

Other than that I can't think of any reason for it to run.

Share this post


Link to post
Share on other sites
Pretty much any ATI or Nvidia card made in the last decade supports some sort of hierarchical Z funcitonality, which allows them to reject entire groups of pixels before the pixel shader gets run. This is the basis of the depth prepass technique, which is where you do a Z-only pass first so that only visible pixels get shaded.

As others have mentioned you'll lose this if you output a depth value from your pixel shader.

Share this post


Link to post
Share on other sites
Tangentially, does anyone know what the deal is with this and swapping shaders? I've been considering adding proper Z support to my VDM technqiues and was wondering if some of the cost could be mitigated by drawing all the geometry using a Z-modifying shader and then swapping it out for a more conventional one for geometry that doesn't need it.
EDIT: This is in a deferred shading context, to be clear.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this