RTShaderSystem Class Reference

Implements Ogre's Run-Time Shader system. More...

#include <rendering/rendering.hh>

Inherits SingletonT< RTShaderSystem >.

Public Types

enum  LightingModel { SSLM_PerVertexLighting, SSLM_PerPixelLighting, SSLM_NormalMapLightingTangentSpace, SSLM_NormalMapLightingObjectSpace }
 

Public Member Functions

void AddScene (ScenePtr _scene)
 Add a scene manager. More...
 
void ApplyShadows (ScenePtr _scene)
 Apply shadows to a scene. More...
 
void AttachEntity (Visual *vis) GAZEBO_DEPRECATED(7.0)
 Set an Ogre::Entity to use RT shaders. More...
 
void Clear () GAZEBO_DEPRECATED(7.0)
 Clear the shader system. More...
 
void DetachEntity (Visual *_vis) GAZEBO_DEPRECATED(7.0)
 Remove and entity. More...
 
void Fini ()
 Finalize the shader system. More...
 
void GenerateShaders (Visual *_vis) GAZEBO_DEPRECATED(7.0)
 Generate shaders for an entity. More...
 
void GenerateShaders (const VisualPtr &_vis)
 Generate shaders for an entity. More...
 
Ogre::PSSMShadowCameraSetup * GetPSSMShadowCameraSetup () const
 Get the Ogre PSSM Shadows camera setup. More...
 
void Init ()
 Init the run time shader system. More...
 
void RemoveScene (ScenePtr _scene)
 Remove a scene. More...
 
void RemoveScene (const std::string &_scene)
 Remove a scene. More...
 
void RemoveShadows (ScenePtr _scene)
 Remove shadows from a scene. More...
 
void SetPerPixelLighting (bool _set)
 Set the lighting model to per pixel or per vertex. More...
 
void Update ()
 Update the RT shaders. This should not be called frequently. More...
 
void UpdateShaders ()
 Queue a call to update the shaders. More...
 

Static Public Member Functions

static void AttachViewport (Ogre::Viewport *_viewport, ScenePtr _scene)
 Set a viewport to use shaders. More...
 
static void DetachViewport (Ogre::Viewport *_viewport, ScenePtr _scene)
 Set a viewport to not use shaders. More...
 
static RTShaderSystemInstance ()
 Get an instance of the singleton. More...
 

Detailed Description

Implements Ogre's Run-Time Shader system.

This class allows Gazebo to generate per-pixel shaders for every material at run-time.

Member Enumeration Documentation

§ LightingModel

The type of lighting.

Enumerator
SSLM_PerVertexLighting 

Per-Vertex lighting: best performance.

SSLM_PerPixelLighting 

Per-Pixel lighting: best look.

SSLM_NormalMapLightingTangentSpace 

Normal Map lighting: lighting calculations have been stored in a light map (texture) using tangent space.

SSLM_NormalMapLightingObjectSpace 

Normal Map lighting: lighting calculations have been stored in a light map (texture) using object space.

Member Function Documentation

§ AddScene()

void AddScene ( ScenePtr  _scene)

Add a scene manager.

Parameters
[in]_sceneThe scene to process

§ ApplyShadows()

void ApplyShadows ( ScenePtr  _scene)

Apply shadows to a scene.

Parameters
[in]_sceneThe scene to receive shadows.

§ AttachEntity()

void AttachEntity ( Visual vis)

Set an Ogre::Entity to use RT shaders.

Parameters
[in]_visVisual that will use the RTShaderSystem.
Deprecated:
This function is no longer needed, and has no implementation.

§ AttachViewport()

static void AttachViewport ( Ogre::Viewport *  _viewport,
ScenePtr  _scene 
)
static

Set a viewport to use shaders.

Parameters
[in]_viewportThe viewport to add.
[in]_sceneThe scene that the viewport uses.

§ Clear()

void Clear ( )

Clear the shader system.

§ DetachEntity()

void DetachEntity ( Visual _vis)

Remove and entity.

Parameters
[in]_visRemove this visual.
Deprecated:
This function is no longer needed, and has no implementation.

§ DetachViewport()

static void DetachViewport ( Ogre::Viewport *  _viewport,
ScenePtr  _scene 
)
static

Set a viewport to not use shaders.

Parameters
[in]_viewportThe viewport to remove.
[in]_sceneThe scene that the viewport uses.

§ Fini()

void Fini ( )

Finalize the shader system.

§ GenerateShaders() [1/2]

void GenerateShaders ( Visual _vis)

Generate shaders for an entity.

Parameters
[in]_visThe visual to generate shaders for.
See also
GenerateShaders(const VisualPtr &_vis)

§ GenerateShaders() [2/2]

void GenerateShaders ( const VisualPtr _vis)

Generate shaders for an entity.

Parameters
[in]_visThe visual to generate shaders for.

§ GetPSSMShadowCameraSetup()

Ogre::PSSMShadowCameraSetup* GetPSSMShadowCameraSetup ( ) const

Get the Ogre PSSM Shadows camera setup.

Returns
The Ogre PSSM Shadows camera setup.

§ Init()

void Init ( )

Init the run time shader system.

§ Instance()

static RTShaderSystem * Instance ( )
inlinestaticinherited

Get an instance of the singleton.

§ RemoveScene() [1/2]

void RemoveScene ( ScenePtr  _scene)

Remove a scene.

Parameters
[in]Thescene to remove

§ RemoveScene() [2/2]

void RemoveScene ( const std::string &  _scene)

Remove a scene.

Parameters
[in]Nameof the scene to remove.

§ RemoveShadows()

void RemoveShadows ( ScenePtr  _scene)

Remove shadows from a scene.

Parameters
[in]_sceneThe scene to remove shadows from.

§ SetPerPixelLighting()

void SetPerPixelLighting ( bool  _set)

Set the lighting model to per pixel or per vertex.

Parameters
[in]_setTrue means to use per-pixel shaders.

§ Update()

void Update ( )

Update the RT shaders. This should not be called frequently.

§ UpdateShaders()

void UpdateShaders ( )

Queue a call to update the shaders.


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