Jump to content
  • Advertisement
Sign in to follow this  

STENCIL_OP_DECR_SAT and Stencil(Read/Write)Mask

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


if I set StencilFailOp = D3D11_STENCIL_OP_DECR_SAT; and the Stencil(Read/Write)Mask to something != 0xff, will that mask be honored when decreasing the stencil value?

For example I have both masks set to ~64. I look for stencil values equal to 1. If I encounter a pixel with stencil == 2, I want it to become 1. If I encounter a pixel with stencil == 64 I want it to remain exactly the way it is.
I thought because of the read mask, such a pixel would be read as 0, decrementing it would yield 0 again. Writing 0 except the masked bit would change nothing. But the stencil value seems to change never the less.

Any idea where my thinking is wrong?

Share this post

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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!