Archived

This topic is now archived and is closed to further replies.

puzzed with D3DRS_STENCILMASK and D3DRS_STENCILWRITEMASK

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

here is dx doc expain: D3DRS_STENCILMASK Mask applied to the reference value and each stencil buffer entry to determine the significant bits for the stencil test. The default mask is 0xFFFFFFFF. D3DRS_STENCILWRITEMASK Write mask applied to values written into the stencil buffer. The default mask is 0xFFFFFFFF. and if the equation like this (StencilRef & StencilMask) CompFunc (StencilBuffervalue & StencilMask) Ref -- controled by D3DRS_STENCILREF Mask-- controled by D3DRS_STENCILMASK I am puzzled what''s use for D3DRS_STENCILWRITEMASK If you love someone, let it be and set her free. If she comes back to you, it''''s meant to be.

Share this post


Link to post
Share on other sites
After doing stencil comparison, you have the option of changing the current stencil value. How it is changed is determined by the render states D3DRS_STENCILFAIL, D3DRS_STENCILZFAIL, and D3DRS_STENCILPASS.

D3DRS_STENCILWRITEMASK can be used to control what bits are effected by this write-back operation.

Share this post


Link to post
Share on other sites