OGRE  1.12.9
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
 If set to true, then if you render both back and front faces (you'll have to turn off culling) then these parameters will apply for front faces, and the inverse of them will happen for back faces (keep remains the same) 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.

Referenced by Ogre::RenderSystem::setStencilState().

◆ stencilFailOp

StencilOperation Ogre::StencilState::stencilFailOp

The action to perform when the stencil check fails.

Referenced by Ogre::RenderSystem::setStencilState().

◆ depthFailOp

StencilOperation Ogre::StencilState::depthFailOp

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

Referenced by Ogre::RenderSystem::setStencilState().

◆ depthStencilPassOp

StencilOperation Ogre::StencilState::depthStencilPassOp

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

Referenced by Ogre::RenderSystem::setStencilState().

◆ referenceValue

uint32 Ogre::StencilState::referenceValue

The reference value used in the stencil comparison.

Referenced by Ogre::RenderSystem::setStencilState().

◆ compareMask

uint32 Ogre::StencilState::compareMask

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

Referenced by Ogre::RenderSystem::setStencilState().

◆ 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 Ogre::RenderSystem::setStencilState().

◆ enabled

bool Ogre::StencilState::enabled

Turns stencil buffer checking on or off.

Referenced by Ogre::RenderSystem::setStencilState().

◆ twoSidedOperation

bool Ogre::StencilState::twoSidedOperation

If set to true, then if you render both back and front faces (you'll have to turn off culling) then these parameters will apply for front faces, and the inverse of them will happen for back faces (keep remains the same)

Referenced by Ogre::RenderSystem::setStencilState().


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