OGRE: RTShaderSystem

| OGRE 14.5 Object-Oriented Graphics Rendering Engine

Loading...
Searching...
No Matches
RTShaderSystem
Optional Components

Real Time Shader System: enables GPU program generation during the runtime of a process. More...

## Classes
class | Ogre::RTShader::AssignmentAtom
| shorthand for "lhs = rhs;" insted of using FFP_Assign(rhs, lhs) More...
struct | Ogre::RTShader::At
| shorthand for operator[] on preceding operand. e.g. myArray[p] More...
class | Ogre::RTShader::BinaryOpAtom
| shorthand for "dst = a OP b;" More...
class | Ogre::RTShader::BuiltinFunctionAtom
| shorthand for "dst = BUILTIN(args);" More...
class | Ogre::RTShader::ConstParameter< valueType >
| Helper template which is the base for our ConstParameters. More...
class | Ogre::RTShader::FFPTexturing
| Texturing sub render state implementation of the Fixed Function Pipeline. More...
class | Ogre::RTShader::Function
| A class that represents a shader based program function. More...
class | Ogre::RTShader::FunctionAtom
| A class that represents an atomic code section of shader based program function. More...
class | Ogre::RTShader::FunctionInvocation
| A class that represents function invocation code from shader based program function. More...
class | Ogre::RTShader::FunctionStageRef
| represents a FFPShaderStage, part of a Function More...
class | Ogre::RTShader::HardwareSkinningFactory
| A factory that enables creation of HardwareSkinning instances. More...
struct | Ogre::RTShader::In
struct | Ogre::RTShader::InOut
class | Ogre::RTShader::Operand
| A class that represents a function operand (its the combination of a parameter the in/out semantic and the used fields). More...
struct | Ogre::RTShader::Out
class | Ogre::RTShader::Parameter
| A class that represents a shader based program parameter. More...
class | Ogre::RTShader::ParameterFactory
| Helper utility class that creates common parameters. More...
class | Ogre::RTShader::Program
| A class that represents a shader based program. More...
class | Ogre::RTShader::ProgramManager
| A singleton manager class that manages shader based programs. More...
class | Ogre::RTShader::ProgramSet
| Container class for shader based programs. More...
class | Ogre::RTShader::ProgramWriter
| Base class interface for shader program writers. More...
class | Ogre::RTShader::ProgramWriterManager
class | Ogre::RTShader::RenderState
| This is a container class for sub render state class. More...
class | Ogre::RTShader::SampleTextureAtom
| shorthand for "dst = texture(sampler, uv);" instead of using FFP_SampleTexture More...
class | Ogre::RTShader::SGScriptTranslator
| This class responsible for translating core features of the RT Shader System for Ogre material scripts. More...
class | Ogre::RTShader::ShaderGenerator
| Shader generator system main interface. More...
class | Ogre::RTShader::SubRenderState
| This class is the base interface of sub part from a shader based rendering pipeline. More...
class | Ogre::RTShader::SubRenderStateAccessor
| This class uses as accessor from a template SubRenderState to all of its instances that created based on it. More...
class | Ogre::RTShader::SubRenderStateFactory
| Abstract factory interface for creating SubRenderState implementation instances. More...
class | Ogre::RTShader::TargetRenderState
| This is the target render state. More...
class | Ogre::RTShader::UniformParameter
| Uniform parameter class. More...

## Typedefs
typedef FunctionAtomInstanceList::const_iterator | Ogre::RTShader::FunctionAtomInstanceConstIterator
typedef FunctionAtomInstanceList::iterator | Ogre::RTShader::FunctionAtomInstanceIterator
typedef std::vector< FunctionAtom * > | Ogre::RTShader::FunctionAtomInstanceList
typedef ShaderFunctionList::const_iterator | Ogre::RTShader::ShaderFunctionConstIterator
typedef ShaderFunctionList::iterator | Ogre::RTShader::ShaderFunctionIterator
typedef std::vector< Function * > | Ogre::RTShader::ShaderFunctionList
typedef ShaderParameterList::const_iterator | Ogre::RTShader::ShaderParameterConstIterator
typedef ShaderParameterList::iterator | Ogre::RTShader::ShaderParameterIterator
typedef SharedPtr< SubRenderStateAccessor > | Ogre::RTShader::SubRenderStateAccessorPtr
typedef std::vector< SubRenderState * > | Ogre::RTShader::SubRenderStateList
typedef SubRenderStateList::const_iterator | Ogre::RTShader::SubRenderStateListConstIterator
typedef SubRenderStateList::iterator | Ogre::RTShader::SubRenderStateListIterator
typedef std::set< SubRenderState * > | Ogre::RTShader::SubRenderStateSet
typedef SubRenderStateSet::const_iterator | Ogre::RTShader::SubRenderStateSetConstIterator
typedef SubRenderStateSet::iterator | Ogre::RTShader::SubRenderStateSetIterator
typedef std::shared_ptr< TargetRenderState > | Ogre::RTShader::TargetRenderStatePtr
typedef UniformParameterList::const_iterator | Ogre::RTShader::UniformParameterConstIterator
typedef UniformParameterList::iterator | Ogre::RTShader::UniformParameterIterator
typedef std::vector< UniformParameterPtr > | Ogre::RTShader::UniformParameterList

## Enumerations
enum | Ogre::RTShader::FFPFragmentShaderStage { Ogre::RTShader::FFP_PS_PRE_PROCESS = 0 , Ogre::RTShader::FFP_PS_COLOUR_BEGIN = 100 , Ogre::RTShader::FFP_PS_SAMPLING = 150 , Ogre::RTShader::FFP_PS_TEXTURING = 200 , Ogre::RTShader::FFP_PS_ALPHA_TEST = 250 , Ogre::RTShader::FFP_PS_COLOUR_END = 300 , Ogre::RTShader::FFP_PS_PBR_LIGHTING_BEGIN = 350 , Ogre::RTShader::FFP_PS_PBR_LIGHTING_END = 360 , Ogre::RTShader::FFP_PS_FOG = 400 , Ogre::RTShader::FFP_PS_POST_PROCESS = 500 }
enum | Ogre::RTShader::FFPShaderStage { Ogre::RTShader::FFP_PRE_PROCESS = 0 , Ogre::RTShader::FFP_TRANSFORM = 100 , Ogre::RTShader::FFP_COLOUR = 200 , Ogre::RTShader::FFP_LIGHTING = 300 , Ogre::RTShader::FFP_TEXTURING = 400 , Ogre::RTShader::FFP_FOG = 500 , Ogre::RTShader::FFP_POST_PROCESS = 600 , Ogre::RTShader::FFP_ALPHA_TEST = 1000 }
enum | Ogre::RTShader::FFPVertexShaderStage { Ogre::RTShader::FFP_VS_PRE_PROCESS = 0 , Ogre::RTShader::FFP_VS_TRANSFORM = 100 , Ogre::RTShader::FFP_VS_COLOUR = 200 , Ogre::RTShader::FFP_VS_LIGHTING = 300 , Ogre::RTShader::FFP_VS_TEXTURING = 400 , Ogre::RTShader::FFP_VS_FOG = 500 , Ogre::RTShader::FFP_VS_POST_PROCESS = 2000 }
enum | Ogre::RTShader::SkinningType { Ogre::RTShader::ST_LINEAR , Ogre::RTShader::ST_DUAL_QUATERNION }

## Functions
| Ogre::RTShader::SGScriptTranslator::SGScriptTranslator ()
void | Ogre::RTShader::SGScriptTranslator::emitError (const String &msg=BLANKSTRING, uint32 code=ScriptCompiler::CE_INVALIDPARAMETERS)
virtual SubRenderState * | Ogre::RTShader::SGScriptTranslator::getGeneratedSubRenderState (const String &typeName)
| Returns a sub render state of a given name which has already been created for material currently being generated by the script translator.
void | Ogre::RTShader::SGScriptTranslator::translate (ScriptCompiler *compiler, const AbstractNodePtr &node) override

## Variables
_OgreRTSSExport const String | Ogre::RTShader::SRS_ALPHA_TEST
| Enables alpha-testing.
_OgreRTSSExport const String | Ogre::RTShader::SRS_COOK_TORRANCE_LIGHTING
| Use metal roughness parametrisation for lighting calulations.
_OgreRTSSExport const String | Ogre::RTShader::SRS_FOG
| Modulates the color of a pixel based on the scene or object fog parameters.
_OgreRTSSExport const String | Ogre::RTShader::SRS_GBUFFER
| Redirects rendering results into gbuffers for e.g. deferred shading.
_OgreRTSSExport const String | Ogre::RTShader::SRS_HARDWARE_SKINNING
| Include skinning calculations for Skeletal Animation in the shader to move computations to the GPU.
_OgreRTSSExport const String | Ogre::RTShader::SRS_IMAGE_BASED_LIGHTING
| Adds calculations for indirect image based lighting (IBL).
_OgreRTSSExport const String | Ogre::RTShader::SRS_INTEGRATED_PSSM3
_OgreRTSSExport const String | Ogre::RTShader::SRS_LAYERED_BLENDING
| Apply photoshop-like blend effects to texture layers.
_OgreRTSSExport const String | Ogre::RTShader::SRS_NORMALMAP
| Use a normal map to derive normals.
_OgreRTSSExport const String | Ogre::RTShader::SRS_PER_PIXEL_LIGHTING
| Adds per-pixel lighting calulations (Phong Shading).
_OgreRTSSExport const String | Ogre::RTShader::SRS_PER_VERTEX_LIGHTING
| Adds per-vertex (FFP) lighting calulations (Gouraud Shading).
_OgreRTSSExport const String | Ogre::RTShader::SRS_SHADOW_MAPPING
| shadow mapping receiver with multiple lights or single PSSM light with up to 3 custom splits.
_OgreRTSSExport const String | Ogre::RTShader::SRS_TEXTURING
| Computes FFP texture transform and blending based on the assigned textures.
_OgreRTSSExport const String | Ogre::RTShader::SRS_TRANSFORM
| Computes the position of the vertex in projection space, allows using instancing.
_OgreRTSSExport const String | Ogre::RTShader::SRS_TRIPLANAR_TEXTURING
| enable triplanar texture mapping
_OgreRTSSExport const String | Ogre::RTShader::SRS_VERTEX_COLOUR
| Enables vertex-colors, always required.
_OgreRTSSExport const String | Ogre::RTShader::SRS_WBOIT
| Redirects rendering results into intermediate buffers for the WBOIT algorithm.

## Detailed Description

Real Time Shader System: enables GPU program generation during the runtime of a process.

The main interface to do that is the ShaderGenerator singleton. A typical usage of this system would be to create shader based technique from an existing technique and associate it with a destination scheme name (see ShaderGenerator::createShaderBasedTechnique). The source technique must include only fixed function based passes, otherwise the method will fail. Once this task accomplished, one may switch the scheme of the current viewport(s) he uses, to the scheme he associate previously, and then a technique based on the original one will be used but this time it will be based on GPU programs the were generated by this component.

The following are the highlights applications of this system.

- Fixed function emulation for Render Systems that supports only shader based rendering. (D3D11 for example). Using this component will allow one to seamlessly use existing FFP techniques on these render systems.
- Global custom shader based pipeline. One can extended the system to allow creation of custom shader based rendering techniques such as per pixel lighting, bump map, etc and apply it to all of the materials. That approach has the advantages of low maintenance of shader code since the code is the same for all materials instead of being spread around many different materials and programs.

## Typedef Documentation

## ◆ ShaderFunctionList

typedef std::vector<Function*> Ogre::RTShader::ShaderFunctionList

## ◆ ShaderFunctionIterator

typedef ShaderFunctionList::iterator Ogre::RTShader::ShaderFunctionIterator

## ◆ ShaderFunctionConstIterator

typedef ShaderFunctionList::const_iterator Ogre::RTShader::ShaderFunctionConstIterator

## ◆ FunctionAtomInstanceList

typedef std::vector<FunctionAtom*> Ogre::RTShader::FunctionAtomInstanceList

## ◆ FunctionAtomInstanceIterator

typedef FunctionAtomInstanceList::iterator Ogre::RTShader::FunctionAtomInstanceIterator

## ◆ FunctionAtomInstanceConstIterator

typedef FunctionAtomInstanceList::const_iterator Ogre::RTShader::FunctionAtomInstanceConstIterator

## ◆ ShaderParameterIterator

typedef ShaderParameterList::iterator Ogre::RTShader::ShaderParameterIterator

## ◆ ShaderParameterConstIterator

typedef ShaderParameterList::const_iterator Ogre::RTShader::ShaderParameterConstIterator

## ◆ UniformParameterList

typedef std::vector<UniformParameterPtr> Ogre::RTShader::UniformParameterList

## ◆ UniformParameterIterator

typedef UniformParameterList::iterator Ogre::RTShader::UniformParameterIterator

## ◆ UniformParameterConstIterator

typedef UniformParameterList::const_iterator Ogre::RTShader::UniformParameterConstIterator

## ◆ TargetRenderStatePtr

typedef std::shared_ptr<TargetRenderState> Ogre::RTShader::TargetRenderStatePtr

## ◆ SubRenderStateAccessorPtr

typedef SharedPtr<SubRenderStateAccessor> Ogre::RTShader::SubRenderStateAccessorPtr

## ◆ SubRenderStateList

typedef std::vector<SubRenderState*> Ogre::RTShader::SubRenderStateList

## ◆ SubRenderStateListIterator

typedef SubRenderStateList::iterator Ogre::RTShader::SubRenderStateListIterator

## ◆ SubRenderStateListConstIterator

typedef SubRenderStateList::const_iterator Ogre::RTShader::SubRenderStateListConstIterator

## ◆ SubRenderStateSet

typedef std::set<SubRenderState*> Ogre::RTShader::SubRenderStateSet

## ◆ SubRenderStateSetIterator

typedef SubRenderStateSet::iterator Ogre::RTShader::SubRenderStateSetIterator

## ◆ SubRenderStateSetConstIterator

typedef SubRenderStateSet::const_iterator Ogre::RTShader::SubRenderStateSetConstIterator

## Enumeration Type Documentation

## ◆ SkinningType

enum Ogre::RTShader::SkinningType

Enumerator
ST_LINEAR |
ST_DUAL_QUATERNION |

## ◆ FFPVertexShaderStage

enum Ogre::RTShader::FFPVertexShaderStage

Enumerator
FFP_VS_PRE_PROCESS |
FFP_VS_TRANSFORM |
FFP_VS_COLOUR |
FFP_VS_LIGHTING |
FFP_VS_TEXTURING |
FFP_VS_FOG |
FFP_VS_POST_PROCESS |

## ◆ FFPFragmentShaderStage

enum Ogre::RTShader::FFPFragmentShaderStage

Enumerator
FFP_PS_PRE_PROCESS |
FFP_PS_COLOUR_BEGIN |
FFP_PS_SAMPLING |
FFP_PS_TEXTURING |
FFP_PS_ALPHA_TEST |
FFP_PS_COLOUR_END |
FFP_PS_PBR_LIGHTING_BEGIN |
FFP_PS_PBR_LIGHTING_END |
FFP_PS_FOG |
FFP_PS_POST_PROCESS |

## ◆ FFPShaderStage

enum Ogre::RTShader::FFPShaderStage

Enumerator
FFP_PRE_PROCESS |
FFP_TRANSFORM |
FFP_COLOUR |
FFP_LIGHTING |
FFP_TEXTURING |
FFP_FOG |
FFP_POST_PROCESS |
FFP_ALPHA_TEST |

## Function Documentation

## ◆ SGScriptTranslator()

Ogre::RTShader::SGScriptTranslator::SGScriptTranslator | ( |  | ) |

## ◆ translate()

void Ogre::RTShader::SGScriptTranslator::translate | ( | ScriptCompiler * | compiler,
|  | const AbstractNodePtr & | node )
| overridevirtual

See also
  ScriptTranslator::translate.

Implements Ogre::ScriptTranslator.

## ◆ getGeneratedSubRenderState()

virtual SubRenderState * Ogre::RTShader::SGScriptTranslator::getGeneratedSubRenderState | ( | const String & | typeName | ) |
| virtual

Returns a sub render state of a given name which has already been created for material currently being generated by the script translator.

Note
  This function is meant to be used from within the createInstance function of sub-render state factories to avoid creating multiple sub-render state to the same material.

Parameters

  typeName | The type of the sub-render state to find.

## ◆ emitError()

void Ogre::RTShader::SGScriptTranslator::emitError | ( | const String & | msg = BLANKSTRING,
|  | uint32 | code = ScriptCompiler::CE_INVALIDPARAMETERS )

References Ogre::BLANKSTRING, and Ogre::ScriptCompiler::CE_INVALIDPARAMETERS.

## Variable Documentation

## ◆ SRS_TRANSFORM

_OgreRTSSExport const String Ogre::RTShader::SRS_TRANSFORM
| extern

Computes the position of the vertex in projection space, allows using instancing.

## ◆ SRS_VERTEX_COLOUR

_OgreRTSSExport const String Ogre::RTShader::SRS_VERTEX_COLOUR
| extern

Enables vertex-colors, always required.

## ◆ SRS_TEXTURING

_OgreRTSSExport const String Ogre::RTShader::SRS_TEXTURING
| extern

Computes FFP texture transform and blending based on the assigned textures.

## ◆ SRS_PER_VERTEX_LIGHTING

_OgreRTSSExport const String Ogre::RTShader::SRS_PER_VERTEX_LIGHTING
| extern

Adds per-vertex (FFP) lighting calulations (Gouraud Shading).

## ◆ SRS_FOG

_OgreRTSSExport const String Ogre::RTShader::SRS_FOG
| extern

Modulates the color of a pixel based on the scene or object fog parameters.

## ◆ SRS_ALPHA_TEST

_OgreRTSSExport const String Ogre::RTShader::SRS_ALPHA_TEST
| extern

Enables alpha-testing.

## ◆ SRS_INTEGRATED_PSSM3

_OgreRTSSExport const String Ogre::RTShader::SRS_INTEGRATED_PSSM3
| extern

Deprecated
  use SRS_SHADOW_MAPPING

## ◆ SRS_SHADOW_MAPPING

_OgreRTSSExport const String Ogre::RTShader::SRS_SHADOW_MAPPING
| extern

shadow mapping receiver with multiple lights or single PSSM light with up to 3 custom splits.

## ◆ SRS_PER_PIXEL_LIGHTING

_OgreRTSSExport const String Ogre::RTShader::SRS_PER_PIXEL_LIGHTING
| extern

Adds per-pixel lighting calulations (Phong Shading).

## ◆ SRS_COOK_TORRANCE_LIGHTING

_OgreRTSSExport const String Ogre::RTShader::SRS_COOK_TORRANCE_LIGHTING
| extern

Use metal roughness parametrisation for lighting calulations.

## ◆ SRS_IMAGE_BASED_LIGHTING

_OgreRTSSExport const String Ogre::RTShader::SRS_IMAGE_BASED_LIGHTING
| extern

Adds calculations for indirect image based lighting (IBL).

## ◆ SRS_NORMALMAP

_OgreRTSSExport const String Ogre::RTShader::SRS_NORMALMAP
| extern

Use a normal map to derive normals.

## ◆ SRS_WBOIT

_OgreRTSSExport const String Ogre::RTShader::SRS_WBOIT
| extern

Redirects rendering results into intermediate buffers for the WBOIT algorithm.

## ◆ SRS_GBUFFER

_OgreRTSSExport const String Ogre::RTShader::SRS_GBUFFER
| extern

Redirects rendering results into gbuffers for e.g. deferred shading.

## ◆ SRS_TRIPLANAR_TEXTURING

_OgreRTSSExport const String Ogre::RTShader::SRS_TRIPLANAR_TEXTURING
| extern

enable triplanar texture mapping

## ◆ SRS_LAYERED_BLENDING

_OgreRTSSExport const String Ogre::RTShader::SRS_LAYERED_BLENDING
| extern

Apply photoshop-like blend effects to texture layers.

## ◆ SRS_HARDWARE_SKINNING

_OgreRTSSExport const String Ogre::RTShader::SRS_HARDWARE_SKINNING
| extern

Include skinning calculations for Skeletal Animation in the shader to move computations to the GPU.