OGRE: Ogre::HlmsBlendblock Struct Reference

| OGRE 2.2.4 Object-Oriented Graphics Rendering Engine

Public Types | Public Member Functions | Public Attributes | List of all members
Ogre::HlmsBlendblock Struct Reference
Core » Resources

A blend block contains settings that rarely change, and thus are common to many materials. More...

`#include <OgreHlmsDatablock.h>`

Inheritance diagram for Ogre::HlmsBlendblock:
[legend]

## Public Types
enum | BlendChannelMasks { BlendChannelRed = 0x01, BlendChannelGreen = 0x02, BlendChannelBlue = 0x04, BlendChannelAlpha = 0x08, BlendChannelAll }

## Public Member Functions
| HlmsBlendblock ()
bool | isAutoTransparent (void) const
bool | isForcedTransparent (void) const
bool | operator!= (const HlmsBlendblock &_r) const
bool | operator== (const HlmsBlendblock &_r) const
void | setBlendType (SceneBlendType blendType)
| Shortcut to set the blend factors to common blending operations. More...
void | setBlendType (SceneBlendType colour, SceneBlendType alpha)
| Shortcut to set the blend factors to common blending operations. More...
void | setForceTransparentRenderOrder (bool bForceTransparent)
| Sometimes you want to force the RenderQueue to render back to front even if the object isn't alpha blended (e.g. More...

## Public Attributes
uint8 | mAllowGlobalDefaults
| When zero, HlmsManager cannot override the block's values with enforced global settings. More...
bool | mAlphaToCoverageEnabled
uint8 | mBlendChannelMask
| Masks which colour channels will be writing to. More...
SceneBlendOperation | mBlendOperation
SceneBlendOperation | mBlendOperationAlpha
uint8 | mBlockType
SceneBlendFactor | mDestBlendFactor
SceneBlendFactor | mDestBlendFactorAlpha
uint16 | mId
| The mId is only valid while mRefCount > 0; which means mRsData may contain valid data, else it's null. More...
uint8 | mIsTransparent
| This value calculated by HlmsManager::getBlendblock mIsTransparent = 0 -> Not transparent mIsTransparent |= 1 -> Automatically determined as transparent mIsTransparent |= 2 -> Forced to be considered as transparent by RenderQueue for render order mIsTransparent = 3 -> Forced & also automatically determined as transparent. More...
uint16 | mLifetimeId
| Except for HlmsSamplerblocks, mLifetimeId is valid throghout the entire life of HlmsManager. More...
uint16 | mRefCount
| Render-System specific data. More...
void * | mRsData
bool | mSeparateBlend
| Used to determine if separate alpha blending should be used for color and alpha channels. More...
SceneBlendFactor | mSourceBlendFactor
SceneBlendFactor | mSourceBlendFactorAlpha

## Detailed Description

A blend block contains settings that rarely change, and thus are common to many materials.

The reasons this structure isn't joined with HlmsMacroblock is that: The D3D11 API makes this distinction (much higher API overhead if we change i.e. depth settings) due to D3D11_RASTERIZER_DESC. This block contains information of whether the material is transparent. Transparent materials are sorted differently than opaque ones. Up to 32 different blocks are allowed!

## Member Enumeration Documentation

## ◆ BlendChannelMasks

enum Ogre::HlmsBlendblock::BlendChannelMasks

Enumerator
BlendChannelRed |
BlendChannelGreen |
BlendChannelBlue |
BlendChannelAlpha |
BlendChannelAll |

## Constructor & Destructor Documentation

## ◆ HlmsBlendblock()

Ogre::HlmsBlendblock::HlmsBlendblock | ( |  | ) |

## Member Function Documentation

## ◆ isAutoTransparent()

bool Ogre::HlmsBlendblock::isAutoTransparent | ( | void |  | ) | const
| inline

## ◆ isForcedTransparent()

bool Ogre::HlmsBlendblock::isForcedTransparent | ( | void |  | ) | const
| inline

## ◆ operator!=()

bool Ogre::HlmsBlendblock::operator!= | ( | const HlmsBlendblock & | _r | ) | const
| inline

References Ogre::BasicBlock::mAllowGlobalDefaults, mAlphaToCoverageEnabled, mBlendChannelMask, mBlendOperation, mBlendOperationAlpha, mDestBlendFactor, mDestBlendFactorAlpha, mIsTransparent, mSeparateBlend, mSourceBlendFactor, and mSourceBlendFactorAlpha.

## ◆ operator==()

bool Ogre::HlmsBlendblock::operator== | ( | const HlmsBlendblock & | _r | ) | const
| inline

## ◆ setBlendType() [1/2]

void Ogre::HlmsBlendblock::setBlendType | ( | SceneBlendType | blendType | ) |

Shortcut to set the blend factors to common blending operations.

Sets both blend and alpha to the same value and mSeparateBlend is turned off.

## ◆ setBlendType() [2/2]

void Ogre::HlmsBlendblock::setBlendType | ( | SceneBlendType | colour,
|  | SceneBlendType | alpha
| ) |  |

Shortcut to set the blend factors to common blending operations.

Sets colour and alpha individually, turns mSeparateBlend on.

## ◆ setForceTransparentRenderOrder()

void Ogre::HlmsBlendblock::setForceTransparentRenderOrder | ( | bool | bForceTransparent | ) |

Sometimes you want to force the RenderQueue to render back to front even if the object isn't alpha blended (e.g.

you're rendering refractive materials)

Parameters

  bForceTransparent | True to always render back to front, like any transparent. False for default behavior (opaque objects are rendered front to back, alpha blended objects are rendered back to front)

## Member Data Documentation

## ◆ mAllowGlobalDefaults

uint8 Ogre::BasicBlock::mAllowGlobalDefaults
| inherited

When zero, HlmsManager cannot override the block's values with enforced global settings.

See also
  HlmsBasicBlock (such as lower quality texture filtering or turning off depth checks for debugging)

Referenced by operator!=(), Ogre::HlmsMacroblock::operator!=(), and Ogre::HlmsSamplerblock::operator!=().

## ◆ mAlphaToCoverageEnabled

bool Ogre::HlmsBlendblock::mAlphaToCoverageEnabled

Referenced by operator!=().

## ◆ mBlendChannelMask

uint8 Ogre::HlmsBlendblock::mBlendChannelMask

Masks which colour channels will be writing to.

Default: BlendChannelAll For some advanced effects, you may wish to turn off the writing of certain colour channels, or even all of the colour channels so that only the depth buffer is updated in a rendering pass (if depth writes are on; may be you want to only update the stencil buffer).

Referenced by operator!=().

## ◆ mBlendOperation

SceneBlendOperation Ogre::HlmsBlendblock::mBlendOperation

Referenced by operator!=().

## ◆ mBlendOperationAlpha

SceneBlendOperation Ogre::HlmsBlendblock::mBlendOperationAlpha

Referenced by operator!=().

## ◆ mBlockType

uint8 Ogre::BasicBlock::mBlockType
| inherited

## ◆ mDestBlendFactor

SceneBlendFactor Ogre::HlmsBlendblock::mDestBlendFactor

Referenced by operator!=().

## ◆ mDestBlendFactorAlpha

SceneBlendFactor Ogre::HlmsBlendblock::mDestBlendFactorAlpha

Referenced by operator!=().

## ◆ mId

uint16 Ogre::BasicBlock::mId
| inherited

The mId is only valid while mRefCount > 0; which means mRsData may contain valid data, else it's null.

## ◆ mIsTransparent

uint8 Ogre::HlmsBlendblock::mIsTransparent

This value calculated by HlmsManager::getBlendblock mIsTransparent = 0 -> Not transparent mIsTransparent |= 1 -> Automatically determined as transparent mIsTransparent |= 2 -> Forced to be considered as transparent by RenderQueue for render order mIsTransparent = 3 -> Forced & also automatically determined as transparent.

Referenced by operator!=().

## ◆ mLifetimeId

uint16 Ogre::BasicBlock::mLifetimeId
| inherited

Except for HlmsSamplerblocks, mLifetimeId is valid throghout the entire life of HlmsManager.

This guarantees HlmsMacroblock & HlmsBlendblock pointers are always valid, although they may be inactive (i.e. mId invalid, mRefCount = 0 and mRsData = 0)

## ◆ mRefCount

uint16 Ogre::BasicBlock::mRefCount
| inherited

Render-System specific data.

## ◆ mRsData

void* Ogre::BasicBlock::mRsData
| inherited

## ◆ mSeparateBlend

bool Ogre::HlmsBlendblock::mSeparateBlend

Used to determine if separate alpha blending should be used for color and alpha channels.

Referenced by operator!=().

## ◆ mSourceBlendFactor

SceneBlendFactor Ogre::HlmsBlendblock::mSourceBlendFactor

Referenced by operator!=().

## ◆ mSourceBlendFactorAlpha

SceneBlendFactor Ogre::HlmsBlendblock::mSourceBlendFactorAlpha

Referenced by operator!=().

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

- OgreHlmsDatablock.h