Sets the OpenGL stencil function of node
<node3d>.stencilFunc( | |
stencil | |
node = '' | |
op = viz.OP_DEFAULT | |
) |
Op modes | |
viz.OP_TRAVERSE | When performing an operation on a node, traverse the entire subgraph and process all subnodes as well. This is the default value. |
viz.OP_OVERRIDE | When applying attributes, have them override attributes of subnodes. |
viz.OP_ROOT | When performing an operation on the node, start at the root transform of the node, instead of the model. Processing the root will include all child Vizard nodes. |
Attribute | Description |
func | Specifies the test function. Eight symbolic constants are valid: viz.GL_NEVER, viz.GL_LESS, viz.GL_LEQUAL, viz.GL_GREATER, viz.GL_GEQUAL, viz.GL_EQUAL, viz.GL_NOTEQUAL, and viz.GL_ALWAYS. The initial value is viz.GL_ALWAYS. |
funcRef | Specifies the reference value for the stencil test. The value is clamped to the range 0 2 n - 1 , where n is the number of bitplanes in the stencil buffer. The initial value is 0. |
funcMask | Specifies a mask that is ANDed with both the reference value and the stored stencil value when the test is done. The initial value is all 1's. |
sfail | Specifies the action to take when the stencil test fails. Eight symbolic constants are accepted: viz.GL_KEEP, viz.GL_ZERO, viz.GL_REPLACE, viz.GL_INCR, viz.GL_INCR_WRAP, viz.GL_DECR, viz.GL_DECR_WRAP, and viz.GL_INVERT. The initial value is viz.GL_KEEP. |
zfail | Specifies the stencil action when the stencil test passes, but the depth test fails. zfail accepts the same symbolic constants as sfail. The initial value is viz.GL_KEEP. |
zpass | Specifies the stencil action when both the stencil test and the depth test pass, or when the stencil test passes and either there is no depth buffer or depth testing is not enabled. zpass accepts the same symbolic constants as sfail. The initial value is viz.GL_KEEP. |
writeMask | Specifies a bit mask to enable and disable writing of individual bits in the stencil planes. Initially, the mask is all 1's. |
Method | Description |
RenderMask(mask=1) | Writes the specified mask value to the stencil buffer wherever the node is rendered. |
RenderInsideMask(mask=1) | Only renders the node wherever any of the specified mask bits are set. |
RenderOutsideMask(mask=1) | Only renders the node wherever none of the specified mask bits are set. |