Loading...
Searching...
No Matches
Ogre::StencilState Struct Reference
Core » RenderSystem

Describes the stencil buffer operation. More...

`#include <OgreRenderSystem.h>`

## Public Member Functions

| StencilState ()

## Public Attributes

uint32 | compareMask
| The bitmask applied to both the stencil value and the reference value before comparison.
CompareFunction | compareOp
| Comparison operator for the stencil test.
StencilOperation | depthFailOp
| The action to perform when the stencil check passes, but the depth buffer check fails.
StencilOperation | depthStencilPassOp
| The action to take when both the stencil and depth check pass.
bool | enabled: 1
| Turns stencil buffer checking on or off.
uint32 | referenceValue
| The reference value used in the stencil comparison.
StencilOperation | stencilFailOp
| The action to perform when the stencil check fails.
bool | twoSidedOperation: 1
| Toggles two-sided stencil operation, which swaps increment and decrement for back-facing polygons.
uint32 | writeMask
| The bitmask the controls which bits from stencilRefValue will be written to stencil buffer (valid for operations such as SOP_REPLACE).

## Detailed Description

Describes the stencil buffer operation.

The stencil buffer is used to mask out pixels in the render target, allowing you to do effects like mirrors, cut-outs, stencil shadows and more. Each of your batches of rendering is likely to ignore the stencil buffer, update it with new values, or apply it to mask the output of the render.

The stencil test is: $$(referenceValue\,\&\,compareMask)\;compareOp\;(stencilBuffer\,\&\,compareMask)$$

The result of this will cause one of 3 actions depending on whether

1. the stencil test fails
2. the stencil test succeeds but the depth buffer check fails
3. both depth buffer check and stencil test pass

## Constructor & Destructor Documentation

## StencilState()

Ogre::StencilState::StencilState | ( |  | ) |

inline

References Ogre::CMPF_LESS_EQUAL, compareMask, compareOp, depthFailOp, depthStencilPassOp, enabled, referenceValue, Ogre::SOP_KEEP, stencilFailOp, twoSidedOperation, and writeMask.

## Member Data Documentation

## compareOp

CompareFunction Ogre::StencilState::compareOp

Comparison operator for the stencil test.

Referenced by StencilState().

## stencilFailOp

StencilOperation Ogre::StencilState::stencilFailOp

The action to perform when the stencil check fails.

Referenced by StencilState().

## depthFailOp

StencilOperation Ogre::StencilState::depthFailOp

The action to perform when the stencil check passes, but the depth buffer check fails.

Referenced by StencilState().

## depthStencilPassOp

StencilOperation Ogre::StencilState::depthStencilPassOp

The action to take when both the stencil and depth check pass.

Referenced by StencilState().

## referenceValue

uint32 Ogre::StencilState::referenceValue

The reference value used in the stencil comparison.

Referenced by StencilState().

## compareMask

uint32 Ogre::StencilState::compareMask

The bitmask applied to both the stencil value and the reference value before comparison.

Referenced by StencilState().

## writeMask

uint32 Ogre::StencilState::writeMask

The bitmask the controls which bits from stencilRefValue will be written to stencil buffer (valid for operations such as SOP_REPLACE).

Referenced by StencilState().

## enabled

bool Ogre::StencilState::enabled

Turns stencil buffer checking on or off.

Referenced by StencilState().

## twoSidedOperation

bool Ogre::StencilState::twoSidedOperation

Toggles two-sided stencil operation, which swaps increment and decrement for back-facing polygons.

Referenced by StencilState().

The documentation for this struct was generated from the following file:

- OgreRenderSystem.h