OGRE  13.6
Object-Oriented Graphics Rendering Engine
Ogre::StencilState Struct Reference

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

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

Member Data Documentation

◆ compareOp

CompareFunction Ogre::StencilState::compareOp

Comparison operator for the stencil test.

◆ stencilFailOp

StencilOperation Ogre::StencilState::stencilFailOp

The action to perform when the stencil check fails.

◆ depthFailOp

StencilOperation Ogre::StencilState::depthFailOp

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

◆ depthStencilPassOp

StencilOperation Ogre::StencilState::depthStencilPassOp

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

◆ referenceValue

uint32 Ogre::StencilState::referenceValue

The reference value used in the stencil comparison.

◆ compareMask

uint32 Ogre::StencilState::compareMask

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

◆ 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)

◆ enabled

bool Ogre::StencilState::enabled

Turns stencil buffer checking on or off.

◆ twoSidedOperation

bool Ogre::StencilState::twoSidedOperation

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


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