glStencilFunc Function
GL_APICALL void GL_APIENTRY glStencilFunc(
GLenum func,
GLint ref,
GLuint mask
);
| Name | Description | |
|---|---|---|
| in | func | Comparison function |
| in | ref | Reference value |
| in | mask | Mask value |
Configures the comparison function, reference value, and mask value used by the stencil test.
You can set func to GL_NEVER, GL_ALWAYS, GL_LESS, GL_LEQUAL, GL_EQUAL, GL_GREATER, GL_GEQUAL, or GL_NOTEQUAL. Set ref to the reference value. Set mask to the mask value.
Given a stencil buffer value of stencil, the stencil test passes or fails according to the following conditions specified by func.
| GL_NEVER | The stencil test always fails. |
|---|---|
| GL_ALWAYS | The stencil test always passes. |
| GL_LESS | Passes when (ref & mask) < (stencil & mask). |
| GL_LEQUAL | Passes when (ref & mask) <= (stencil & mask). |
| GL_EQUAL | Passes when (ref & mask) == (stencil & mask). |
| GL_GREATER | Passes when (ref & mask) > (stencil & mask). |
| GL_GEQUAL | Passes when (ref & mask) >= (stencil & mask). |
| GL_NOTEQUAL | Passes when (ref & mask) != (stencil & mask). |
This function generates the following errors.
| GL_INVALID_ENUM | The func argument was set to an invalid value. |
|---|---|
| GL_INVALID_OPERATION | This function was called without any command-list objects bound. |
CONFIDENTIAL