Loading...
Searching...
No Matches
Ogre::RTShader::Parameter Class Reference
Optional Components » RTShaderSystem

A class that represents a shader based program parameter. More...

`#include <OgreShaderParameter.h>`

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

## Public Types

enum

Content {
SPC_UNKNOWN , SPC_POSITION_OBJECT_SPACE , SPC_POSITION_WORLD_SPACE , SPC_POSITION_VIEW_SPACE ,
SPC_POSITION_PROJECTIVE_SPACE , SPC_POSITION_LIGHT_SPACE0 , SPC_POSITION_LIGHT_SPACE1 , SPC_POSITION_LIGHT_SPACE2 ,
SPC_POSITION_LIGHT_SPACE3 , SPC_POSITION_LIGHT_SPACE4 , SPC_POSITION_LIGHT_SPACE5 , SPC_POSITION_LIGHT_SPACE6 ,
SPC_POSITION_LIGHT_SPACE7 , SPC_NORMAL_OBJECT_SPACE , SPC_NORMAL_WORLD_SPACE , SPC_NORMAL_VIEW_SPACE ,
SPC_POSTOCAMERA_OBJECT_SPACE , SPC_POSTOCAMERA_WORLD_SPACE , SPC_POSTOCAMERA_VIEW_SPACE , SPC_BLEND_WEIGHTS ,
SPC_BLEND_INDICES , SPC_TANGENT_OBJECT_SPACE , SPC_TANGENT_WORLD_SPACE , SPC_TANGENT_VIEW_SPACE ,
SPC_BINORMAL_OBJECT_SPACE , SPC_BINORMAL_WORLD_SPACE , SPC_BINORMAL_VIEW_SPACE , SPC_COLOR_DIFFUSE ,
SPC_COLOR_SPECULAR , SPC_DEPTH_WORLD_SPACE , SPC_DEPTH_VIEW_SPACE , SPC_DEPTH_PROJECTIVE_SPACE ,
SPC_TEXTURE_COORDINATE0 , SPC_TEXTURE_COORDINATE1 , SPC_TEXTURE_COORDINATE2 , SPC_TEXTURE_COORDINATE3 ,
SPC_TEXTURE_COORDINATE4 , SPC_TEXTURE_COORDINATE5 , SPC_TEXTURE_COORDINATE6 , SPC_TEXTURE_COORDINATE7 ,
SPC_POINTSPRITE_COORDINATE , SPC_POINTSPRITE_SIZE , SPC_FRONT_FACING , SPC_LAYER ,
SPC_CUSTOM_CONTENT_BEGIN = 1000 , SPC_CUSTOM_CONTENT_END = 2000
}

| Shader parameter content. More...
enum | Semantic { SPS_UNKNOWN = 0 , SPS_POSITION = 1 , SPS_BLEND_WEIGHTS = 2 , SPS_BLEND_INDICES = 3 , SPS_NORMAL = 4 , SPS_COLOR = 5 , SPS_TEXTURE_COORDINATES = 7 , SPS_BINORMAL = 8 , SPS_TANGENT = 9 , SPS_FRONT_FACING , SPS_LAYER }

## Public Member Functions

| Parameter ()
| Parameter (GpuConstantType type, const String &name, const Semantic &semantic, int index, int content, size_t size=0)
| Class constructor.
virtual | ~Parameter ()
| Class destructor.
void | _rename (const String &newName, bool onlyLocal=false)
| internal function for aliasing to GLSL builtins e.g. gl_Position
int | getContent () const
| Return the content of this parameter.
int | getIndex () const
| Get the index of this parameter.
const String & | getName () const
| Get the name of this parameter.
const Semantic & | getSemantic () const
| Get the semantic of this parameter.
size_t | getSize () const
| Returns the number of elements in the parameter (for arrays).
const String & | getStructType () const
GpuConstantType | getType () const
| Get the type of this parameter.
bool | isArray () const
| Returns Whether this parameter is an array.
virtual bool | isConstParameter () const
| Returns true if this instance is a ConstParameter otherwise false.
bool | isHighP () const
| Is highp needed when using GLSL ES.
bool | isUsed ()
void | setHighP (bool highP)
void | setSize (size_t size)
| Sets the number of elements in the parameter (for arrays).
void | setStructType (const String &structType)
void | setUsed (bool used)
| track whether this was used
virtual String | toString () const
| Returns the string representation of this parameter.

## Detailed Description

A class that represents a shader based program parameter.

## Member Enumeration Documentation

## Semantic

enum Ogre::RTShader::Parameter::Semantic

Enumerator
SPS_UNKNOWN | Unknown semantic.
SPS_POSITION | Position.
SPS_BLEND_WEIGHTS | Blending weights.
SPS_BLEND_INDICES | Blending indices.
SPS_NORMAL | Normal, 3 reals per vertex.
SPS_COLOR | General floating point color.
SPS_TEXTURE_COORDINATES | Texture coordinates.
SPS_BINORMAL | Binormal (Y axis if normal is Z).
SPS_TANGENT | Tangent (X axis if normal is Z).
SPS_FRONT_FACING | VFACE.
SPS_LAYER | SV_RenderTargetArrayIndex.

## Content

enum Ogre::RTShader::Parameter::Content

Shader parameter content.

used to resolve Parameters across different SubRenderState instances Think of it as Semantic extended to the actual parameter content.

Enumerator
SPC_UNKNOWN | Unknown content.
SPC_POSITION_OBJECT_SPACE | Position in object space.
SPC_POSITION_WORLD_SPACE | Position in world space.
SPC_POSITION_VIEW_SPACE | Position in view space.
SPC_POSITION_PROJECTIVE_SPACE | Position in projective space.
SPC_POSITION_LIGHT_SPACE0 | Position in light space index 0-7.
SPC_POSITION_LIGHT_SPACE1 |
SPC_POSITION_LIGHT_SPACE2 |
SPC_POSITION_LIGHT_SPACE3 |
SPC_POSITION_LIGHT_SPACE4 |
SPC_POSITION_LIGHT_SPACE5 |
SPC_POSITION_LIGHT_SPACE6 |
SPC_POSITION_LIGHT_SPACE7 |
SPC_NORMAL_OBJECT_SPACE | Normal in object space.
SPC_NORMAL_WORLD_SPACE | Normal in world space.
SPC_NORMAL_VIEW_SPACE | Normal in view space.
SPC_POSTOCAMERA_OBJECT_SPACE | View vector in object space.
SPC_POSTOCAMERA_WORLD_SPACE | View vector in world space.
SPC_POSTOCAMERA_VIEW_SPACE | View vector in view space.
SPC_BLEND_WEIGHTS | Blending weights.
SPC_BLEND_INDICES | Blending indices.
SPC_TANGENT_OBJECT_SPACE | Tangent in object space.
SPC_TANGENT_WORLD_SPACE | Tangent in world space.
SPC_TANGENT_VIEW_SPACE | Tangent in view space.
SPC_BINORMAL_OBJECT_SPACE | Binormal in object space.
SPC_BINORMAL_WORLD_SPACE | Binormal in world space.
SPC_BINORMAL_VIEW_SPACE | Binormal in view space.
SPC_COLOR_DIFFUSE | Diffuse color.
SPC_COLOR_SPECULAR | Specular color.
SPC_DEPTH_WORLD_SPACE | Depth in world space.
SPC_DEPTH_VIEW_SPACE | Depth in view space.
SPC_DEPTH_PROJECTIVE_SPACE | Depth in projective space.
SPC_TEXTURE_COORDINATE0 | Texture coordinate set index 0-7.
SPC_TEXTURE_COORDINATE1 |
SPC_TEXTURE_COORDINATE2 |
SPC_TEXTURE_COORDINATE3 |
SPC_TEXTURE_COORDINATE4 |
SPC_TEXTURE_COORDINATE5 |
SPC_TEXTURE_COORDINATE6 |
SPC_TEXTURE_COORDINATE7 |
SPC_POINTSPRITE_COORDINATE | point sprite coordinates
SPC_POINTSPRITE_SIZE | point sprite size
SPC_FRONT_FACING | gl_FrontFacing
SPC_LAYER | gl_Layer
SPC_CUSTOM_CONTENT_BEGIN | Reserved custom content range to be used by user custom shader extensions.
SPC_CUSTOM_CONTENT_END |

## Constructor & Destructor Documentation

## Parameter() [1/2]

Ogre::RTShader::Parameter::Parameter | ( |  | ) |

Referenced by Ogre::RTShader::ConstParameter< valueType >::ConstParameter().

## Parameter() [2/2]

Ogre::RTShader::Parameter::Parameter | ( | GpuConstantType | type,
|  | const String & | name,
|  | const Semantic & | semantic,
|  | int | index,
|  | int | content,
|  | size_t | size = 0 )

Class constructor.

Parameters

  type | The type of this parameter.
  name | The name of this parameter.
  semantic | The semantic of this parameter.
  index | The index of this parameter.
  content | The content of this parameter.
  size |

## ~Parameter()

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

inline virtual

Class destructor.

## Member Function Documentation

## getName()

const String & Ogre::RTShader::Parameter::getName | ( |  | ) | const

inline

Get the name of this parameter.

## _rename()

void Ogre::RTShader::Parameter::_rename | ( | const String & | newName,
|  | bool | onlyLocal = false )

inline

internal function for aliasing to GLSL builtins e.g. gl_Position

## getType()

GpuConstantType Ogre::RTShader::Parameter::getType | ( |  | ) | const

inline

Get the type of this parameter.

## getSemantic()

const Semantic & Ogre::RTShader::Parameter::getSemantic | ( |  | ) | const

inline

Get the semantic of this parameter.

## getIndex()

int Ogre::RTShader::Parameter::getIndex | ( |  | ) | const

inline

Get the index of this parameter.

## getContent()

int Ogre::RTShader::Parameter::getContent | ( |  | ) | const

inline

Return the content of this parameter.

## isConstParameter()

virtual bool Ogre::RTShader::Parameter::isConstParameter | ( |  | ) | const

inline virtual

Returns true if this instance is a ConstParameter otherwise false.

Reimplemented in Ogre::RTShader::ConstParameter< valueType >.

## toString()

virtual String Ogre::RTShader::Parameter::toString | ( |  | ) | const

inline virtual

Returns the string representation of this parameter.

Reimplemented in Ogre::RTShader::ConstParameter< valueType >.

## isArray()

bool Ogre::RTShader::Parameter::isArray | ( |  | ) | const

inline

Returns Whether this parameter is an array.

Referenced by Ogre::RTShader::UniformParameter::getAutoConstantIntData().

## getSize()

size_t Ogre::RTShader::Parameter::getSize | ( |  | ) | const

inline

Returns the number of elements in the parameter (for arrays).

Referenced by Ogre::RTShader::UniformParameter::getAutoConstantIntData().

## setSize()

void Ogre::RTShader::Parameter::setSize | ( | size_t | size | ) |

inline

Sets the number of elements in the parameter (for arrays).

## setUsed()

void Ogre::RTShader::Parameter::setUsed | ( | bool | used | ) |

inline

track whether this was used

## isUsed()

bool Ogre::RTShader::Parameter::isUsed | ( |  | ) |

inline

## isHighP()

bool Ogre::RTShader::Parameter::isHighP | ( |  | ) | const

inline

Is highp needed when using GLSL ES.

## setHighP()

void Ogre::RTShader::Parameter::setHighP | ( | bool | highP | ) |

inline

## getStructType()

const String & Ogre::RTShader::Parameter::getStructType | ( |  | ) | const

inline

## setStructType()

void Ogre::RTShader::Parameter::setStructType | ( | const String & | structType | ) |

inline

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

- OgreShaderParameter.h