• Advertisement
Sign in to follow this  

stencil write mask question

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

In the D3D10_DEPTH_STENCIL_DESC there is the StencilWriteMask

 

does someone knows what is the exact operation that is done when writing to the stencil when I have a mask?

 

I think the D3D10_STENCIL_OP_INCR doesn't works when using a writing mask like 11000000(binary)

Edited by lomateron

Share this post


Link to post
Share on other sites
Advertisement

the value that will be written to the stencil buffer is the result of a logical AND of the actual value and the mask ( --> WriteValue = StencilValue & WriteMask ).

Incrementing using that mask does work but it will only save bit 7 and 8, so most likely your stencil value doesn't have those bits set and you end up with zero.

Share this post


Link to post
Share on other sites

yeah, the creators of that write mask should have made possible to add one to just the unmasked bits

That will increase a lot the things that can be done with the stencil thing, and in my case I could have gain a lot of performance, now I have to clear the stencil a lot of times.

Edited by lomateron

Share this post


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

  • Advertisement