OGRE: Ogre::RTShader::UniformParameter Class Reference

| OGRE 14.5 Object-Oriented Graphics Rendering Engine

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

Uniform parameter class. More...

`#include <OgreShaderParameter.h>`

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

## Public Member Functions
| UniformParameter (GpuConstantType type, const String &name, const Semantic &semantic, int index, int content, uint16 variability, size_t size)
| Class constructor.
| UniformParameter (GpuProgramParameters::AutoConstantType autoType, float fAutoConstantData, size_t size)
| Class constructor.
| UniformParameter (GpuProgramParameters::AutoConstantType autoType, float fAutoConstantData, size_t size, GpuConstantType type)
| Class constructor.
| UniformParameter (GpuProgramParameters::AutoConstantType autoType, uint32 nAutoConstantData, size_t size)
| Class constructor.
| UniformParameter (GpuProgramParameters::AutoConstantType autoType, uint32 nAutoConstantData, size_t size, GpuConstantType type)
| Class constructor.
void | bind (GpuProgramParametersSharedPtr paramsPtr)
| Bind this parameter to the corresponding GPU parameter.
uint32 | getAutoConstantIntData () const
| Get auto constant int data of this parameter, in case it is auto constant parameter.
float | getAutoConstantRealData () const
| Get auto constant real data of this parameter, in case it is auto constant parameter.
GpuProgramParameters::AutoConstantType | getAutoConstantType () const
| Return the auto constant type of this parameter.
uint16 | getVariability () const
| Return the variability of this parameter.
bool | isAutoConstantIntParameter () const
| Return true if this parameter an auto constant with int data type, false otherwise.
bool | isAutoConstantParameter () const
| Return true if this parameter is an auto constant parameter, false otherwise.
bool | isAutoConstantRealParameter () const
| Return true if this parameter an auto constant with real data type, false otherwise.
bool | isFloat () const
| Return true if this parameter is a floating point type, false otherwise.
bool | isSampler () const
| Return true if this parameter is a texture sampler type, false otherwise.
void | setGpuParameter (const ColourValue &val)
| Update the GPU parameter with the given value.
void | setGpuParameter (const double *val, size_t count, size_t multiple=4)
| Update the GPU parameter with the given value.
void | setGpuParameter (const float *val, size_t count, size_t multiple=4)
| Update the GPU parameter with the given value.
void | setGpuParameter (const int *val, size_t count, size_t multiple=4)
| Update the GPU parameter with the given value.
void | setGpuParameter (const Matrix3 &val)
void | setGpuParameter (const Matrix4 &val)
| Update the GPU parameter with the given value.
void | setGpuParameter (const Vector2 &val)
| Update the GPU parameter with the given value.
void | setGpuParameter (const Vector3 &val)
| Update the GPU parameter with the given value.
void | setGpuParameter (const Vector4 &val)
| Update the GPU parameter with the given value.
void | setGpuParameter (int val)
| Update the GPU parameter with the given value.
void | setGpuParameter (Real val)
| Update the GPU parameter with the given value.
void | updateExtraInfo (uint32 data)
| light index or array size
Public Member Functions inherited from Ogre::RTShader::Parameter
| 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.

## Additional Inherited Members
Public Types inherited from Ogre::RTShader::Parameter
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 }

## Detailed Description

Uniform parameter class.

Allow fast access to GPU parameter updates.

## Constructor & Destructor Documentation

## ◆ UniformParameter() [1/5]

Ogre::RTShader::UniformParameter::UniformParameter | ( | GpuConstantType | type,
|  | const String & | name,
|  | const Semantic & | semantic,
|  | int | index,
|  | int | content,
|  | uint16 | variability,
|  | size_t | size )

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.
  variability | How this parameter varies (bitwise combination of GpuProgramVariability).
  size | number of elements in the parameter.

## ◆ UniformParameter() [2/5]

Ogre::RTShader::UniformParameter::UniformParameter | ( | GpuProgramParameters::AutoConstantType | autoType,
|  | float | fAutoConstantData,
|  | size_t | size )

Class constructor.

Parameters

  autoType | The auto type of this parameter.
  fAutoConstantData | The real data for this auto constant parameter.
  size | number of elements in the parameter.

## ◆ UniformParameter() [3/5]

Ogre::RTShader::UniformParameter::UniformParameter | ( | GpuProgramParameters::AutoConstantType | autoType,
|  | float | fAutoConstantData,
|  | size_t | size,
|  | GpuConstantType | type )

Class constructor.

Parameters

  autoType | The auto type of this parameter.
  fAutoConstantData | The real data for this auto constant parameter.
  size | number of elements in the parameter.
  type | The desired data type of this auto constant parameter.

## ◆ UniformParameter() [4/5]

Ogre::RTShader::UniformParameter::UniformParameter | ( | GpuProgramParameters::AutoConstantType | autoType,
|  | uint32 | nAutoConstantData,
|  | size_t | size )

Class constructor.

Parameters

  autoType | The auto type of this parameter.
  nAutoConstantData | The int data for this auto constant parameter.
  size | number of elements in the parameter.

## ◆ UniformParameter() [5/5]

Ogre::RTShader::UniformParameter::UniformParameter | ( | GpuProgramParameters::AutoConstantType | autoType,
|  | uint32 | nAutoConstantData,
|  | size_t | size,
|  | GpuConstantType | type )

Class constructor.

Parameters

  autoType | The auto type of this parameter.
  nAutoConstantData | The int data for this auto constant parameter.
  size | number of elements in the parameter.
  type | The desired data type of this auto constant parameter.

## Member Function Documentation

## ◆ getAutoConstantIntData()

uint32 Ogre::RTShader::UniformParameter::getAutoConstantIntData | ( |  | ) | const
| inline

Get auto constant int data of this parameter, in case it is auto constant parameter.

References Ogre::RTShader::Parameter::getSize(), Ogre::RTShader::Parameter::isArray(), and mAutoConstantIntData.

## ◆ getAutoConstantRealData()

float Ogre::RTShader::UniformParameter::getAutoConstantRealData | ( |  | ) | const
| inline

Get auto constant real data of this parameter, in case it is auto constant parameter.

References mAutoConstantRealData.

## ◆ isFloat()

bool Ogre::RTShader::UniformParameter::isFloat | ( |  | ) | const
| inline

Return true if this parameter is a floating point type, false otherwise.

References Ogre::GpuConstantDefinition::isFloat().

## ◆ isSampler()

bool Ogre::RTShader::UniformParameter::isSampler | ( |  | ) | const
| inline

Return true if this parameter is a texture sampler type, false otherwise.

References Ogre::GpuConstantDefinition::isSampler().

## ◆ isAutoConstantParameter()

bool Ogre::RTShader::UniformParameter::isAutoConstantParameter | ( |  | ) | const
| inline

Return true if this parameter is an auto constant parameter, false otherwise.

## ◆ isAutoConstantIntParameter()

bool Ogre::RTShader::UniformParameter::isAutoConstantIntParameter | ( |  | ) | const
| inline

Return true if this parameter an auto constant with int data type, false otherwise.

## ◆ isAutoConstantRealParameter()

bool Ogre::RTShader::UniformParameter::isAutoConstantRealParameter | ( |  | ) | const
| inline

Return true if this parameter an auto constant with real data type, false otherwise.

## ◆ getAutoConstantType()

GpuProgramParameters::AutoConstantType Ogre::RTShader::UniformParameter::getAutoConstantType | ( |  | ) | const
| inline

Return the auto constant type of this parameter.

## ◆ getVariability()

uint16 Ogre::RTShader::UniformParameter::getVariability | ( |  | ) | const
| inline

Return the variability of this parameter.

## ◆ bind()

void Ogre::RTShader::UniformParameter::bind | ( | GpuProgramParametersSharedPtr | paramsPtr | ) |

Bind this parameter to the corresponding GPU parameter.

## ◆ setGpuParameter() [1/11]

void Ogre::RTShader::UniformParameter::setGpuParameter | ( | int | val | ) |
| inline

Update the GPU parameter with the given value.

## ◆ setGpuParameter() [2/11]

void Ogre::RTShader::UniformParameter::setGpuParameter | ( | Real | val | ) |
| inline

Update the GPU parameter with the given value.

## ◆ setGpuParameter() [3/11]

void Ogre::RTShader::UniformParameter::setGpuParameter | ( | const ColourValue & | val | ) |
| inline

Update the GPU parameter with the given value.

## ◆ setGpuParameter() [4/11]

void Ogre::RTShader::UniformParameter::setGpuParameter | ( | const Vector2 & | val | ) |
| inline

Update the GPU parameter with the given value.

References Ogre::VectorBase< dims, T >::ptr().

## ◆ setGpuParameter() [5/11]

void Ogre::RTShader::UniformParameter::setGpuParameter | ( | const Vector3 & | val | ) |
| inline

Update the GPU parameter with the given value.

## ◆ setGpuParameter() [6/11]

void Ogre::RTShader::UniformParameter::setGpuParameter | ( | const Vector4 & | val | ) |
| inline

Update the GPU parameter with the given value.

## ◆ setGpuParameter() [7/11]

void Ogre::RTShader::UniformParameter::setGpuParameter | ( | const Matrix3 & | val | ) |
| inline

## ◆ setGpuParameter() [8/11]

void Ogre::RTShader::UniformParameter::setGpuParameter | ( | const Matrix4 & | val | ) |
| inline

Update the GPU parameter with the given value.

## ◆ setGpuParameter() [9/11]

void Ogre::RTShader::UniformParameter::setGpuParameter | ( | const float * | val,
|  | size_t | count,
|  | size_t | multiple = 4 )
| inline

Update the GPU parameter with the given value.

## ◆ setGpuParameter() [10/11]

void Ogre::RTShader::UniformParameter::setGpuParameter | ( | const double * | val,
|  | size_t | count,
|  | size_t | multiple = 4 )
| inline

Update the GPU parameter with the given value.

## ◆ setGpuParameter() [11/11]

void Ogre::RTShader::UniformParameter::setGpuParameter | ( | const int * | val,
|  | size_t | count,
|  | size_t | multiple = 4 )
| inline

Update the GPU parameter with the given value.

## ◆ updateExtraInfo()

void Ogre::RTShader::UniformParameter::updateExtraInfo | ( | uint32 | data | ) |
| inline

light index or array size

## Member Data Documentation

## ◆ mAutoConstantIntData

uint32 Ogre::RTShader::UniformParameter::mAutoConstantIntData

Referenced by getAutoConstantIntData().

## ◆ mAutoConstantRealData

float Ogre::RTShader::UniformParameter::mAutoConstantRealData

Referenced by getAutoConstantRealData().

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

- OgreShaderParameter.h