• Advertisement
Sign in to follow this  

pixel processing question

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

Advertisement
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
Sign in to follow this  

  • Advertisement