Jump to content
  • Advertisement
Sign in to follow this  
jorgander

OpenGL No D3DRS_CCW_STENCIL* for stencil write mask and reference value?

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

I suppose I could have posted this in either the OpenGL or Direct3D forum. For two sided-stencilling, how come OpenGL seems to allow setting the write mask, reference value, and mask for both front and back, but Direct3D seems to to only support them for the front? I'm basing my assumption about OpenGL on sample code such as the following:
glActiveStencilFaceEXT(GL_BACK);
glStencilOp(...);
glStencilMask(...);
glStencilFunc(...);

glActiveStencilFaceEXT(GL_FRONT);
glStencilOp(...);
glStencilMask(...);
glStencilFunc(...);
And I'm basing my assumption about Direct3D because, as the title says, there are no D3DRS_CCW_STENCIL* parameters to SetRenderState to control those stencil values for "back-facing" triangles. A quick-n-dirty table to illustrate my confusion: "front facing" - "back facing" ------------------------------ D3DRS_STENCILFAIL - D3DRS_CCW_STENCILFAIL D3DRS_STENCILZFAIL - D3DRS_CCW_STENCILZFAIL D3DRS_STENCILPASS - D3DRS_CCW_STENCILPASS D3DRS_STENCILFUNC - D3DRS_CCW_STENCILFUNC D3DRS_STENCILREF - ??? D3DRS_STENCILMASK - ??? D3DRS_STENCILWRITEMASK - ???

Share this post


Link to post
Share on other sites
Advertisement
The same ref and masks are used for both front and back faces. This unfortunately is more limited than what the OpenGL extension provides. It's the same for both DX9 and DX10.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!