Skip to main content
gamedev.net
🔒 Locked

D3D Stencil buffer

Started by bob_bubba77 0 replies 300+ views
Original Post
bob_bubba77
bob_bubba77
hi, I''m using the DX9 sdk. I''d like to know if the values in the stencil buffer are signed or not. (is this device dependant?) I''d also like to know if the Z test is performed before or after the stencil test. (does it even matter?) I''m currently playing around with volume shadows, and I haven''t been able to find the answer to these questions in the sdk doc. I''ve also looked in the DirectX Caps Viewer, and I can see that my adaptor supports D3DFMT_D24S8 for example, but the documentation doesn''t specify if those 8 bit of stencil buffer are signed or not. thanks.
jacklin
jacklin
Stencil buffer values are unsigned. When rendering, stencil test is performed, then depth test is performed.

For shadow volumes, the order in which the tests are performed does not matter. When you render the shadow volume, you always pass the stencil test and update stencil values based on the result of the depth test.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.