Loading...
Searching...
No Matches
Ogre::RTShader::SubRenderState Class Referenceabstract
Optional Components » RTShaderSystem

This class is the base interface of sub part from a shader based rendering pipeline. More...

`#include <OgreShaderSubRenderState.h>`

Inheritance diagram for Ogre::RTShader::SubRenderState:
[legend]

## Public Member Functions

| SubRenderState ()
| Class default constructor.
virtual | ~SubRenderState ()
| Class destructor.
virtual void | copyFrom (const SubRenderState &rhs)=0
| Copy details from a given sub render state to this one.
virtual bool | createCpuSubPrograms (ProgramSet *programSet)
| Create sub programs that represents this sub render state as part of a program set.
SubRenderStateAccessorPtr | getAccessor ()
| Return the accessor object to this sub render state.
SubRenderStateAccessorPtr | getAccessor () const
| Return the accessor object to this sub render state.
virtual int | getExecutionOrder () const =0
| Get the execution order of this sub render state.
virtual const String & | getType () const =0
| Get the type of this sub render state.
SubRenderState & | operator= (const SubRenderState &rhs)
| Operator = declaration.
virtual bool | preAddToRenderState (const RenderState *renderState, Pass *srcPass, Pass *dstPass)
| Called before adding this sub render state to the given render state.
virtual void | setParameter (const String &name, const Any &value)
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
bool | setParameter (const String &name, const char *value)
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
virtual bool | setParameter (const String &name, const String &value)
| generic set method for parameters that connot be derived in preAddToRenderState
virtual void | updateGpuProgramsParams (Renderable *rend, const Pass *pass, const AutoParamDataSource *source, const LightList *pLightList)
| Update GPU programs parameters before a rendering operation occurs.

## Detailed Description

This class is the base interface of sub part from a shader based rendering pipeline.

All sub parts implementations should derive from it and implement the needed methods. A simple example of sub class of this interface will be the transform sub state of the fixed pipeline.

## Constructor & Destructor Documentation

## SubRenderState()

Ogre::RTShader::SubRenderState::SubRenderState | ( |  | ) |

Class default constructor.

Referenced by Ogre::RTShader::FFPTexturing::copyFrom(), copyFrom(), and operator=().

## ~SubRenderState()

virtual Ogre::RTShader::SubRenderState::~SubRenderState | ( |  | ) |

virtual

Class destructor.

## Member Function Documentation

## getType()

virtual const String & Ogre::RTShader::SubRenderState::getType | ( |  | ) | const

pure virtual

Get the type of this sub render state.

The type string should be unique among all registered sub render states.

Implemented in Ogre::RTShader::FFPTexturing, and Ogre::RTShader::LayeredBlending.

## getExecutionOrder()

virtual int Ogre::RTShader::SubRenderState::getExecutionOrder | ( |  | ) | const

pure virtual

Get the execution order of this sub render state.

The return value should be synchronized with the predefined values of the FFPShaderStage enum.

Implemented in Ogre::RTShader::FFPTexturing.

## copyFrom()

virtual void Ogre::RTShader::SubRenderState::copyFrom | ( | const SubRenderState & | rhs | ) |

pure virtual

Copy details from a given sub render state to this one.

Parameters

  rhs | the source sub state to copy from.

Implemented in Ogre::RTShader::FFPTexturing, and Ogre::RTShader::LayeredBlending.

References SubRenderState().

## operator=()

SubRenderState & Ogre::RTShader::SubRenderState::operator= | ( | const SubRenderState & | rhs | ) |

Operator = declaration.

Assign the given source sub state to this sub state.

Parameters

  rhs | the source sub state to copy from.

References SubRenderState().

## createCpuSubPrograms()

virtual bool Ogre::RTShader::SubRenderState::createCpuSubPrograms | ( | ProgramSet * | programSet | ) |

virtual

Create sub programs that represents this sub render state as part of a program set.

The given program set contains CPU programs that represents a vertex shader and pixel shader. One should use these program class API to create a representation of the sub state he wished to implement.

Parameters

  programSet | container class of CPU and GPU programs that this sub state will affect on.

## updateGpuProgramsParams()

virtual void Ogre::RTShader::SubRenderState::updateGpuProgramsParams | ( | Renderable * | rend,
|  | const Pass * | pass,
|  | const AutoParamDataSource * | source,
|  | const LightList * | pLightList )

inline virtual

Update GPU programs parameters before a rendering operation occurs.

This method is called in the context of SceneManager::renderSingle object via the RenderObjectListener interface and lets this sub render state instance opportunity to update custom GPU program parameters before the rendering action occurs.

See also
  RenderObjectListener::notifyRenderSingleObject.

Parameters

  rend | The renderable that is about to be rendered.
  pass | The pass that used for this rendering.
  source | The auto parameter source.
  pLightList | The light list used in the current rendering context.

## preAddToRenderState()

virtual bool Ogre::RTShader::SubRenderState::preAddToRenderState | ( | const RenderState * | renderState,
|  | Pass * | srcPass,
|  | Pass * | dstPass )

inline virtual

Called before adding this sub render state to the given render state.

Allows this sub render state class to configure specific parameters depending on source pass or parent render state. Return of false value will cause canceling the add operation.

Parameters

  renderState | The target render state container this sub render state is about to be added.
  srcPass | The source pass.
  dstPass | The destination pass.

Reimplemented in Ogre::RTShader::FFPTexturing.

## getAccessor() [1/2]

SubRenderStateAccessorPtr Ogre::RTShader::SubRenderState::getAccessor | ( |  | ) |

Return the accessor object to this sub render state.

See also
  SubRenderStateAccessor.

## getAccessor() [2/2]

SubRenderStateAccessorPtr Ogre::RTShader::SubRenderState::getAccessor | ( |  | ) | const

Return the accessor object to this sub render state.

See also
  SubRenderStateAccessor.

## setParameter() [1/3]

virtual bool Ogre::RTShader::SubRenderState::setParameter | ( | const String & | name,
|  | const String & | value )

inline virtual

generic set method for parameters that connot be derived in preAddToRenderState

## setParameter() [2/3]

bool Ogre::RTShader::SubRenderState::setParameter | ( | const String & | name,
|  | const char * | value )

inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

References setParameter().

Referenced by setParameter().

## setParameter() [3/3]

virtual void Ogre::RTShader::SubRenderState::setParameter | ( | const String & | name,
|  | const Any & | value )

inline virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

References Ogre::Exception::ERR_INVALIDPARAMS, and OGRE_EXCEPT.

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

- OgreShaderSubRenderState.h