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 - ???
No D3DRS_CCW_STENCIL* for stencil write mask and reference value?
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:
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement