• Advertisement
Sign in to follow this  

question about z-pass

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

hi, since I'm using a z-pre pass just to fill the device zbuffer, is it possible to speed up the shader avoiding it to write the COLOR0 value ?

Share this post


Link to post
Share on other sites
Advertisement
Yes. Disable color writes, and don't write to depth in the pixel shader.

Share this post


Link to post
Share on other sites
Thank you, I'm trying to use SetRenderState(D3DRS_COLORWRITEENABLE ...

But the shader compiler doesn't allow me to use a pixel shader that doesn't write COLOR0.
How do I resolve this ?

Share this post


Link to post
Share on other sites
Don't worry about it. Just write black. As long as color writes are disabled, you'll get the Z prepass speed-up.

Share this post


Link to post
Share on other sites
Quote:
Original post by Sneftel
Don't worry about it. Just write black. As long as color writes are disabled, you'll get the Z prepass speed-up.


Great !
Thank you ;)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement