Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Ogre::GpuProgramParameters Class Reference

Collects together the program parameters used for a GpuProgram. More...

#include <OgreGpuProgram.h>

List of all members.

Public Types

typedef ConstVectorIterator<
RealConstantList
RealConstantIterator
typedef ConstVectorIterator<
IntConstantList
IntConstantIterator
typedef ConstVectorIterator<
AutoConstantList
AutoConstantIterator
enum  AutoConstantType {
  ACT_WORLD_MATRIX, ACT_INVERSE_WORLD_MATRIX, ACT_TRANSPOSE_WORLD_MATRIX, ACT_INVERSE_TRANSPOSE_WORLD_MATRIX,
  ACT_WORLD_MATRIX_ARRAY_3x4, ACT_WORLD_MATRIX_ARRAY, ACT_VIEW_MATRIX, ACT_INVERSE_VIEW_MATRIX,
  ACT_TRANSPOSE_VIEW_MATRIX, ACT_INVERSE_TRANSPOSE_VIEW_MATRIX, ACT_PROJECTION_MATRIX, ACT_INVERSE_PROJECTION_MATRIX,
  ACT_TRANSPOSE_PROJECTION_MATRIX, ACT_INVERSE_TRANSPOSE_PROJECTION_MATRIX, ACT_VIEWPROJ_MATRIX, ACT_INVERSE_VIEWPROJ_MATRIX,
  ACT_TRANSPOSE_VIEWPROJ_MATRIX, ACT_INVERSE_TRANSPOSE_VIEWPROJ_MATRIX, ACT_WORLDVIEW_MATRIX, ACT_INVERSE_WORLDVIEW_MATRIX,
  ACT_TRANSPOSE_WORLDVIEW_MATRIX, ACT_INVERSE_TRANSPOSE_WORLDVIEW_MATRIX, ACT_WORLDVIEWPROJ_MATRIX, ACT_INVERSE_WORLDVIEWPROJ_MATRIX,
  ACT_TRANSPOSE_WORLDVIEWPROJ_MATRIX, ACT_INVERSE_TRANSPOSE_WORLDVIEWPROJ_MATRIX, ACT_RENDER_TARGET_FLIPPING, ACT_FOG_COLOUR,
  ACT_FOG_PARAMS, ACT_AMBIENT_LIGHT_COLOUR, ACT_LIGHT_DIFFUSE_COLOUR, ACT_LIGHT_SPECULAR_COLOUR,
  ACT_LIGHT_ATTENUATION, ACT_LIGHT_POSITION, ACT_LIGHT_POSITION_OBJECT_SPACE, ACT_LIGHT_POSITION_VIEW_SPACE,
  ACT_LIGHT_DIRECTION, ACT_LIGHT_DIRECTION_OBJECT_SPACE, ACT_LIGHT_DIRECTION_VIEW_SPACE, ACT_LIGHT_DISTANCE_OBJECT_SPACE,
  ACT_LIGHT_POWER_SCALE, ACT_SHADOW_EXTRUSION_DISTANCE, ACT_CAMERA_POSITION, ACT_CAMERA_POSITION_OBJECT_SPACE,
  ACT_TEXTURE_VIEWPROJ_MATRIX, ACT_CUSTOM, ACT_TIME, ACT_TIME_0_X,
  ACT_COSTIME_0_X, ACT_SINTIME_0_X, ACT_TANTIME_0_X, ACT_TIME_0_X_PACKED,
  ACT_TIME_0_1, ACT_COSTIME_0_1, ACT_SINTIME_0_1, ACT_TANTIME_0_1,
  ACT_TIME_0_1_PACKED, ACT_TIME_0_2PI, ACT_COSTIME_0_2PI, ACT_SINTIME_0_2PI,
  ACT_TANTIME_0_2PI, ACT_TIME_0_2PI_PACKED, ACT_FRAME_TIME, ACT_FPS,
  ACT_VIEWPORT_WIDTH, ACT_VIEWPORT_HEIGHT, ACT_INVERSE_VIEWPORT_WIDTH, ACT_INVERSE_VIEWPORT_HEIGHT,
  ACT_VIEWPORT_SIZE, ACT_VIEW_DIRECTION, ACT_VIEW_SIDE_VECTOR, ACT_VIEW_UP_VECTOR,
  ACT_FOV, ACT_NEAR_CLIP_DISTANCE, ACT_FAR_CLIP_DISTANCE, ACT_PASS_NUMBER,
  ACT_PASS_ITERATION_NUMBER, ACT_ANIMATION_PARAMETRIC
}
 Defines the types of automatically updated values that may be bound to GpuProgram parameters, or used to modify parameters on a per-object basis. More...

enum  ACDataType { ACDT_NONE, ACDT_INT, ACDT_REAL }
 Defines the type of the extra data item used by the auto constant. More...

enum  ElementType { ET_INT, ET_REAL }
 Defines the base element type of the auto constant. More...


Public Member Functions

 GpuProgramParameters ()
 ~GpuProgramParameters ()
 GpuProgramParameters (const GpuProgramParameters &oth)
 Copy constructor.

GpuProgramParametersoperator= (const GpuProgramParameters &oth)
 Operator = overload.

void setConstant (size_t index, const Vector4 &vec)
 Sets a 4-element floating-point parameter to the program.

void setConstant (size_t index, Real val)
 Sets a single floating-point parameter to the program.

void setConstant (size_t index, const Vector3 &vec)
 Sets a 4-element floating-point parameter to the program via Vector3.

void setConstant (size_t index, const Matrix4 &m)
 Sets a Matrix4 parameter to the program.

void setConstant (size_t index, const Matrix4 *m, size_t numEntries)
 Sets a list of Matrix4 parameters to the program.

void setConstant (size_t index, const float *val, size_t count)
 Sets a multiple value constant floating-point parameter to the program.

void setConstant (size_t index, const double *val, size_t count)
 Sets a multiple value constant floating-point parameter to the program.

void setConstant (size_t index, const ColourValue &colour)
 Sets a ColourValue parameter to the program.

void setConstant (size_t index, const int *val, size_t count)
 Sets a multiple value constant integer parameter to the program.

void resetRealConstants (void)
 Deletes the contents of the Real constants registers.

void resetIntConstants (void)
 Deletes the contents of the int constants registers.

RealConstantIterator getRealConstantIterator (void) const
 Gets an iterator over the Real constant parameters.

IntConstantIterator getIntConstantIterator (void) const
 Gets an iterator over the integer constant parameters.

RealConstantEntrygetRealConstantEntry (const size_t index)
 Gets a specific Real Constant entry if index is in valid range otherwise returns a NULL.

IntConstantEntrygetIntConstantEntry (const size_t index)
 Gets a specific Int Constant entry if index is in valid range otherwise returns a NULL.

RealConstantEntrygetNamedRealConstantEntry (const String &name)
 Gets a Named Real Constant entry if the name is found otherwise returns a NULL.

IntConstantEntrygetNamedIntConstantEntry (const String &name)
 Gets a named Int Constant entry if name is found otherwise returns a NULL.

size_t getRealConstantCount (void) const
 Gets the number of Real constants that have been set.

size_t getIntConstantCount (void) const
 Gets the number of int constants that have been set.

bool hasRealConstantParams (void) const
 Returns true if there are any Real constants contained here.

bool hasIntConstantParams (void) const
 Returns true if there are any int constants contained here.

void setAutoConstant (size_t index, AutoConstantType acType, size_t extraInfo=0)
 Sets up a constant which will automatically be updated by the system.

void setAutoConstantReal (size_t index, AutoConstantType acType, Real rData)
void setConstantFromTime (size_t index, Real factor)
 Sets a named parameter up to track a derivation of the current time.

void clearAutoConstants (void)
 Clears all the existing automatic constants.

AutoConstantIterator getAutoConstantIterator (void) const
 Gets an iterator over the automatic constant bindings currently in place.

size_t getAutoConstantCount (void) const
 Gets the number of int constants that have been set.

AutoConstantEntrygetAutoConstantEntry (const size_t index)
 Gets a specific Auto Constant entry if index is in valid range otherwise returns a NULL.

bool hasAutoConstants (void) const
 Returns true if this instance has any automatic constants.

void _updateAutoParamsNoLights (const AutoParamDataSource &source)
 Updates the automatic parameters (except lights) based on the details provided.

void _updateAutoParamsLightsOnly (const AutoParamDataSource &source)
 Updates the automatic parameters for lights based on the details provided.

void setAutoAddParamName (bool state)
 Sets the auto add parameter name flag.

void setNamedConstant (const String &name, Real val)
 Sets a single value constant floating-point parameter to the program.

void setNamedConstant (const String &name, int val)
 Sets a single value constant integer parameter to the program.

void setNamedConstant (const String &name, const Vector4 &vec)
 Sets a Vector4 parameter to the program.

void setNamedConstant (const String &name, const Vector3 &vec)
 Sets a Vector3 parameter to the program.

void setNamedConstant (const String &name, const Matrix4 &m)
 Sets a Matrix4 parameter to the program.

void setNamedConstant (const String &name, const Matrix4 *m, size_t numEntries)
 Sets a list of Matrix4 parameters to the program.

void setNamedConstant (const String &name, const float *val, size_t count)
 Sets a multiple value constant floating-point parameter to the program.

void setNamedConstant (const String &name, const double *val, size_t count)
 Sets a multiple value constant floating-point parameter to the program.

void setNamedConstant (const String &name, const ColourValue &colour)
 Sets a ColourValue parameter to the program.

void setNamedConstant (const String &name, const int *val, size_t count)
 Sets a multiple value constant integer parameter to the program.

void setNamedAutoConstant (const String &name, AutoConstantType acType, size_t extraInfo=0)
 Sets up a constant which will automatically be updated by the system.

void setNamedConstantFromTime (const String &name, Real factor)
 Sets a named parameter up to track a derivation of the current time.

void _mapParameterNameToIndex (const String &name, const size_t index)
 Internal method for associating a parameter name with an index.

size_t getParamIndex (const String &name)
 Gets the constant index associated with a named parameter.

void setTransposeMatrices (bool val)
 Sets whether or not we need to transpose the matrices passed in from the rest of OGRE.

bool getTransposeMatrices (void) const
 Gets whether or not matrices are to be transposed when set.

void copyConstantsFrom (const GpuProgramParameters &source)
 Copies the values of all constants (including auto constants) from another GpuProgramParameters object.

size_t addConstantDefinition (const String &name, const size_t index, const size_t elementCount, const ElementType elementType)
 Add (or update) a constant definition which describes a constant.

const ConstantDefinitiongetConstantDefinition (const String &name) const
 gets the constant definition associated with name if found else returns NULL

const ConstantDefinitiongetConstantDefinition (const size_t idx) const
 gets the constant definition using an index into the constant definition array.

const ConstantDefinitionfindMatchingConstantDefinition (const String &name, const size_t entryIndex, const ElementType elementType) const
 Find a matching constant defintion.

size_t getNumConstantDefinitions (void) const
 Returns the number of constant definitions.

void setConstantDefinitionAutoState (const size_t index, const bool isAuto, const size_t autoIndex)
 Set the constant definition's Auto state.

void incPassIterationNumber (void)
 increments the multipass number entry by 1 if it exists

RealConstantEntrygetPassIterationEntry (void)
 gets the MultipassEntry if it exists.

size_t getPassIterationEntryIndex (void) const
 gets the MultipassEntry index.


Static Public Member Functions

const AutoConstantDefinitiongetAutoConstantDefinition (const String &name)
 gets the auto constant definition associated with name if found else returns NULL

const AutoConstantDefinitiongetAutoConstantDefinition (const size_t idx)
 gets the auto constant definition using an index into the auto constant definition array.

size_t getNumAutoConstantDefinitions (void)
 Returns the number of auto constant definitions.


Protected Types

typedef std::vector< RealConstantEntryRealConstantList
typedef std::vector< IntConstantEntryIntConstantList
typedef std::vector< AutoConstantEntryAutoConstantList
typedef std::vector< ConstantDefinitionConstantDefinitionContainer
typedef std::map< String,
size_t > 
ParamNameMap
 Mapping from parameter names to NamedConstantEntry - high-level programs are expected to populate this.


Protected Attributes

RealConstantList mRealConstants
 Packed list of floating-point constants.

IntConstantList mIntConstants
 Packed list of integer constants.

AutoConstantList mAutoConstants
 List of automatically updated parameters.

ConstantDefinitionContainer mConstantDefinitions
 Container of parameter definitions.

ParamNameMap mParamNameMap
bool mTransposeMatrices
 Do we need to transpose matrices?

bool mAutoAddParamName
 flag to indicate if names not found will be automatically added

RealConstantEntrymActivePassIterationEntry
 active pass iteration parameter real constant entry;

size_t mActivePassIterationEntryIndex
 index for active pass iteration parameter real constant entry;


Static Protected Attributes

AutoConstantDefinition AutoConstantDictionary []


Detailed Description

Collects together the program parameters used for a GpuProgram.

Remarks:
Gpu program state includes constant parameters used by the program, and bindings to render system state which is propagated into the constants by the engine automatically if requested.
GpuProgramParameters objects should be created through the GpuProgramManager and may be shared between multiple GpuProgram instances. For this reason they are managed using a shared pointer, which will ensure they are automatically deleted when no program is using them anymore.

Definition at line 55 of file OgreGpuProgram.h.


Member Typedef Documentation

typedef ConstVectorIterator<AutoConstantList> Ogre::GpuProgramParameters::AutoConstantIterator
 

Definition at line 613 of file OgreGpuProgram.h.

typedef std::vector<AutoConstantEntry> Ogre::GpuProgramParameters::AutoConstantList [protected]
 

Definition at line 442 of file OgreGpuProgram.h.

typedef std::vector<ConstantDefinition> Ogre::GpuProgramParameters::ConstantDefinitionContainer [protected]
 

Definition at line 444 of file OgreGpuProgram.h.

typedef ConstVectorIterator<IntConstantList> Ogre::GpuProgramParameters::IntConstantIterator
 

Definition at line 556 of file OgreGpuProgram.h.

typedef std::vector<IntConstantEntry> Ogre::GpuProgramParameters::IntConstantList [protected]
 

Definition at line 440 of file OgreGpuProgram.h.

typedef std::map<String, size_t> Ogre::GpuProgramParameters::ParamNameMap [protected]
 

Mapping from parameter names to NamedConstantEntry - high-level programs are expected to populate this.

Definition at line 454 of file OgreGpuProgram.h.

typedef ConstVectorIterator<RealConstantList> Ogre::GpuProgramParameters::RealConstantIterator
 

Definition at line 555 of file OgreGpuProgram.h.

typedef std::vector<RealConstantEntry> Ogre::GpuProgramParameters::RealConstantList [protected]
 

Definition at line 439 of file OgreGpuProgram.h.


Member Enumeration Documentation

enum Ogre::GpuProgramParameters::ACDataType
 

Defines the type of the extra data item used by the auto constant.

Enumeration values:
ACDT_NONE  no data is required
ACDT_INT  the auto constant requires data of type int
ACDT_REAL  the auto constant requires data of type real

Definition at line 330 of file OgreGpuProgram.h.

enum Ogre::GpuProgramParameters::AutoConstantType
 

Defines the types of automatically updated values that may be bound to GpuProgram parameters, or used to modify parameters on a per-object basis.

Enumeration values:
ACT_WORLD_MATRIX  The current world matrix.
ACT_INVERSE_WORLD_MATRIX  The current world matrix, inverted.
ACT_TRANSPOSE_WORLD_MATRIX  Provides transpose of world matrix.

Equivalent to RenderMonkey's "WorldTranspose".

ACT_INVERSE_TRANSPOSE_WORLD_MATRIX  The current world matrix, inverted & transposed.
ACT_WORLD_MATRIX_ARRAY_3x4  The current array of world matrices, as a 3x4 matrix, used for blending.
ACT_WORLD_MATRIX_ARRAY  The current array of world matrices, used for blending.
ACT_VIEW_MATRIX  The current view matrix.
ACT_INVERSE_VIEW_MATRIX  The current view matrix, inverted.
ACT_TRANSPOSE_VIEW_MATRIX  Provides transpose of view matrix.

Equivalent to RenderMonkey's "ViewTranspose".

ACT_INVERSE_TRANSPOSE_VIEW_MATRIX  Provides inverse transpose of view matrix.

Equivalent to RenderMonkey's "ViewInverseTranspose".

ACT_PROJECTION_MATRIX  The current projection matrix.
ACT_INVERSE_PROJECTION_MATRIX  Provides inverse of projection matrix.

Equivalent to RenderMonkey's "ProjectionInverse".

ACT_TRANSPOSE_PROJECTION_MATRIX  Provides transpose of projection matrix.

Equivalent to RenderMonkey's "ProjectionTranspose".

ACT_INVERSE_TRANSPOSE_PROJECTION_MATRIX  Provides inverse transpose of projection matrix.

Equivalent to RenderMonkey's "ProjectionInverseTranspose".

ACT_VIEWPROJ_MATRIX  The current view & projection matrices concatenated.
ACT_INVERSE_VIEWPROJ_MATRIX  Provides inverse of concatenated view and projection matrices.

Equivalent to RenderMonkey's "ViewProjectionInverse".

ACT_TRANSPOSE_VIEWPROJ_MATRIX  Provides transpose of concatenated view and projection matrices.

Equivalent to RenderMonkey's "ViewProjectionTranspose".

ACT_INVERSE_TRANSPOSE_VIEWPROJ_MATRIX  Provides inverse transpose of concatenated view and projection matrices.

Equivalent to RenderMonkey's "ViewProjectionInverseTranspose".

ACT_WORLDVIEW_MATRIX  The current world & view matrices concatenated.
ACT_INVERSE_WORLDVIEW_MATRIX  The current world & view matrices concatenated, then inverted.
ACT_TRANSPOSE_WORLDVIEW_MATRIX  Provides transpose of concatenated world and view matrices.

Equivalent to RenderMonkey's "WorldViewTranspose".

ACT_INVERSE_TRANSPOSE_WORLDVIEW_MATRIX  The current world & view matrices concatenated, then inverted & tranposed.
ACT_WORLDVIEWPROJ_MATRIX  view matrices. The current world, view & projection matrices concatenated
ACT_INVERSE_WORLDVIEWPROJ_MATRIX  Provides inverse of concatenated world, view and projection matrices.

Equivalent to RenderMonkey's "WorldViewProjectionInverse".

ACT_TRANSPOSE_WORLDVIEWPROJ_MATRIX  Provides transpose of concatenated world, view and projection matrices.

Equivalent to RenderMonkey's "WorldViewProjectionTranspose".

ACT_INVERSE_TRANSPOSE_WORLDVIEWPROJ_MATRIX  Provides inverse transpose of concatenated world, view and projection matrices.

Equivalent to RenderMonkey's "WorldViewProjectionInverseTranspose".

ACT_RENDER_TARGET_FLIPPING  -1 if requires texture flipping, +1 otherwise.

It's useful when you bypassed projection matrix transform, still able use this value to adjust transformed y position.

ACT_FOG_COLOUR  Fog colour.
ACT_FOG_PARAMS  Fog params: density, linear start, linear end, 1/(end-start).
ACT_AMBIENT_LIGHT_COLOUR  The ambient light colour set in the scene.
ACT_LIGHT_DIFFUSE_COLOUR  Light diffuse colour (index determined by setAutoConstant call).
ACT_LIGHT_SPECULAR_COLOUR  Light diffuse colour (index determined by setAutoConstant call).
ACT_LIGHT_ATTENUATION  Light attenuation parameters, Vector4(range, constant, linear, quadric).
ACT_LIGHT_POSITION  A light position in world space (index determined by setAutoConstant call).
ACT_LIGHT_POSITION_OBJECT_SPACE  A light position in object space (index determined by setAutoConstant call).
ACT_LIGHT_POSITION_VIEW_SPACE  A light position in view space (index determined by setAutoConstant call).
ACT_LIGHT_DIRECTION  A light direction in world space (index determined by setAutoConstant call).
ACT_LIGHT_DIRECTION_OBJECT_SPACE  A light direction in object space (index determined by setAutoConstant call).
ACT_LIGHT_DIRECTION_VIEW_SPACE  A light direction in view space (index determined by setAutoConstant call).
ACT_LIGHT_DISTANCE_OBJECT_SPACE  The distance of the light from the center of the object a useful approximation as an alternative to per-vertex distance calculations.

ACT_LIGHT_POWER_SCALE  Light power level, a single scalar as set in Light::setPowerScale (index determined by setAutoConstant call).
ACT_SHADOW_EXTRUSION_DISTANCE  The distance a shadow volume should be extruded when using finite extrusion programs.

ACT_CAMERA_POSITION  The current camera's position in world space.
ACT_CAMERA_POSITION_OBJECT_SPACE  The current camera's position in object space.
ACT_TEXTURE_VIEWPROJ_MATRIX  The view/projection matrix of the assigned texture projection frustum.
ACT_CUSTOM  A custom parameter which will come from the renderable, using 'data' as the identifier.
ACT_TIME  provides current elapsed time
ACT_TIME_0_X  Single float value, which repeats itself based on given as parameter "cycle time".

Equivalent to RenderMonkey's "Time0_X".

ACT_COSTIME_0_X  Cosine of "Time0_X". Equivalent to RenderMonkey's "CosTime0_X".
ACT_SINTIME_0_X  Sine of "Time0_X". Equivalent to RenderMonkey's "SinTime0_X".
ACT_TANTIME_0_X  Tangent of "Time0_X". Equivalent to RenderMonkey's "TanTime0_X".
ACT_TIME_0_X_PACKED  Vector of "Time0_X", "SinTime0_X", "CosTime0_X", "TanTime0_X".

Equivalent to RenderMonkey's "Time0_X_Packed".

ACT_TIME_0_1  Single float value, which represents scaled time value [0..1], which repeats itself based on given as parameter "cycle time".

Equivalent to RenderMonkey's "Time0_1".

ACT_COSTIME_0_1  Cosine of "Time0_1". Equivalent to RenderMonkey's "CosTime0_1".
ACT_SINTIME_0_1  Sine of "Time0_1". Equivalent to RenderMonkey's "SinTime0_1".
ACT_TANTIME_0_1  Tangent of "Time0_1". Equivalent to RenderMonkey's "TanTime0_1".
ACT_TIME_0_1_PACKED  Vector of "Time0_1", "SinTime0_1", "CosTime0_1", "TanTime0_1".

Equivalent to RenderMonkey's "Time0_1_Packed".

ACT_TIME_0_2PI  Single float value, which represents scaled time value [0..2*Pi], which repeats itself based on given as parameter "cycle time".

Equivalent to RenderMonkey's "Time0_2PI".

ACT_COSTIME_0_2PI  Cosine of "Time0_2PI". Equivalent to RenderMonkey's "CosTime0_2PI".
ACT_SINTIME_0_2PI  Sine of "Time0_2PI". Equivalent to RenderMonkey's "SinTime0_2PI".
ACT_TANTIME_0_2PI  Tangent of "Time0_2PI". Equivalent to RenderMonkey's "TanTime0_2PI".
ACT_TIME_0_2PI_PACKED  Vector of "Time0_2PI", "SinTime0_2PI", "CosTime0_2PI", "TanTime0_2PI".

Equivalent to RenderMonkey's "Time0_2PI_Packed".

ACT_FRAME_TIME  provides the scaled frame time, returned as a floating point value.
ACT_FPS  provides the calculated frames per second, returned as a floating point value.
ACT_VIEWPORT_WIDTH  Current viewport width (in pixels) as floating point value.

Equivalent to RenderMonkey's "ViewportWidth".

ACT_VIEWPORT_HEIGHT  Current viewport height (in pixels) as floating point value.

Equivalent to RenderMonkey's "ViewportHeight".

ACT_INVERSE_VIEWPORT_WIDTH  This variable represents 1.0/ViewportWidth.

Equivalent to RenderMonkey's "ViewportWidthInverse".

ACT_INVERSE_VIEWPORT_HEIGHT  This variable represents 1.0/ViewportHeight.

Equivalent to RenderMonkey's "ViewportHeightInverse".

ACT_VIEWPORT_SIZE  Packed of "ViewportWidth", "ViewportHeight", "ViewportWidthInverse", "ViewportHeightInverse".
ACT_VIEW_DIRECTION  This variable provides the view direction vector (world space).

Equivalent to RenderMonkey's "ViewDirection".

ACT_VIEW_SIDE_VECTOR  This variable provides the view side vector (world space).

Equivalent to RenderMonkey's "ViewSideVector".

ACT_VIEW_UP_VECTOR  This variable provides the view up vector (world space).

Equivalent to RenderMonkey's "ViewUpVector".

ACT_FOV  This variable provides the field of view as a floating point value.

Equivalent to RenderMonkey's "FOV".

ACT_NEAR_CLIP_DISTANCE  This variable provides the near clip distance as a floating point value.

Equivalent to RenderMonkey's "NearClipPlane".

ACT_FAR_CLIP_DISTANCE  This variable provides the far clip distance as a floating point value.

Equivalent to RenderMonkey's "FarClipPlane".

ACT_PASS_NUMBER  provides the pass index number within the technique of the active materil.
ACT_PASS_ITERATION_NUMBER  provides the current iteration number of the pass.

The iteration number is the number of times the current render operation has been drawn for the acitve pass.

ACT_ANIMATION_PARAMETRIC  Provides a parametric animation value [0..1], only available where the renderable specifically implements it.

Definition at line 61 of file OgreGpuProgram.h.

enum Ogre::GpuProgramParameters::ElementType
 

Defines the base element type of the auto constant.

Enumeration values:
ET_INT 
ET_REAL 

Definition at line 341 of file OgreGpuProgram.h.


Constructor & Destructor Documentation

Ogre::GpuProgramParameters::GpuProgramParameters  ) 
 

Ogre::GpuProgramParameters::~GpuProgramParameters  ) 
 

Definition at line 468 of file OgreGpuProgram.h.

Ogre::GpuProgramParameters::GpuProgramParameters const GpuProgramParameters oth  ) 
 

Copy constructor.


Member Function Documentation

void Ogre::GpuProgramParameters::_mapParameterNameToIndex const String name,
const size_t  index
 

Internal method for associating a parameter name with an index.

void Ogre::GpuProgramParameters::_updateAutoParamsLightsOnly const AutoParamDataSource source  ) 
 

Updates the automatic parameters for lights based on the details provided.

void Ogre::GpuProgramParameters::_updateAutoParamsNoLights const AutoParamDataSource source  ) 
 

Updates the automatic parameters (except lights) based on the details provided.

size_t Ogre::GpuProgramParameters::addConstantDefinition const String name,
const size_t  index,
const size_t  elementCount,
const ElementType  elementType
 

Add (or update) a constant definition which describes a constant.

Remarks:
Mainly used for Material serialization but could also be used by material editors. Returns the index of the constant definition.
Parameters:
name The name of the parameter.
index The constant index at which to place the parameter (each constant is a 4D float).
elementCount The number of elements that make up the parameter. An example is if the parameter is a matrix4x4 then there are 16 elements.
isReal If true then indicates that the elements are float else they are int.

void Ogre::GpuProgramParameters::clearAutoConstants void   ) 
 

Clears all the existing automatic constants.

void Ogre::GpuProgramParameters::copyConstantsFrom const GpuProgramParameters source  ) 
 

Copies the values of all constants (including auto constants) from another GpuProgramParameters object.

const ConstantDefinition* Ogre::GpuProgramParameters::findMatchingConstantDefinition const String name,
const size_t  entryIndex,
const ElementType  elementType
const
 

Find a matching constant defintion.

Matches name, entry index, and element type.

Returns:
NULL if no match is found.

size_t Ogre::GpuProgramParameters::getAutoConstantCount void   )  const
 

Gets the number of int constants that have been set.

Definition at line 617 of file OgreGpuProgram.h.

const AutoConstantDefinition* Ogre::GpuProgramParameters::getAutoConstantDefinition const size_t  idx  )  [static]
 

gets the auto constant definition using an index into the auto constant definition array.

If the index is out of bounds then NULL is returned;

Parameters:
idx The auto constant index

const AutoConstantDefinition* Ogre::GpuProgramParameters::getAutoConstantDefinition const String name  )  [static]
 

gets the auto constant definition associated with name if found else returns NULL

Parameters:
name The name of the auto constant

AutoConstantEntry* Ogre::GpuProgramParameters::getAutoConstantEntry const size_t  index  ) 
 

Gets a specific Auto Constant entry if index is in valid range otherwise returns a NULL.

index which entry is to be retrieved

AutoConstantIterator Ogre::GpuProgramParameters::getAutoConstantIterator void   )  const
 

Gets an iterator over the automatic constant bindings currently in place.

const ConstantDefinition* Ogre::GpuProgramParameters::getConstantDefinition const size_t  idx  )  const
 

gets the constant definition using an index into the constant definition array.

If the index is out of bounds then NULL is returned;

Parameters:
idx The constant index

const ConstantDefinition* Ogre::GpuProgramParameters::getConstantDefinition const String name  )  const
 

gets the constant definition associated with name if found else returns NULL

Parameters:
name The name of the constant

size_t Ogre::GpuProgramParameters::getIntConstantCount void   )  const
 

Gets the number of int constants that have been set.

Definition at line 584 of file OgreGpuProgram.h.

IntConstantEntry* Ogre::GpuProgramParameters::getIntConstantEntry const size_t  index  ) 
 

Gets a specific Int Constant entry if index is in valid range otherwise returns a NULL.

index which entry is to be retrieved

IntConstantIterator Ogre::GpuProgramParameters::getIntConstantIterator void   )  const
 

Gets an iterator over the integer constant parameters.

IntConstantEntry* Ogre::GpuProgramParameters::getNamedIntConstantEntry const String name  ) 
 

Gets a named Int Constant entry if name is found otherwise returns a NULL.

name The name of the entry to be retrieved

RealConstantEntry* Ogre::GpuProgramParameters::getNamedRealConstantEntry const String name  ) 
 

Gets a Named Real Constant entry if the name is found otherwise returns a NULL.

name The name of the entry to be retrieved

size_t Ogre::GpuProgramParameters::getNumAutoConstantDefinitions void   )  [static]
 

Returns the number of auto constant definitions.

size_t Ogre::GpuProgramParameters::getNumConstantDefinitions void   )  const
 

Returns the number of constant definitions.

Definition at line 863 of file OgreGpuProgram.h.

size_t Ogre::GpuProgramParameters::getParamIndex const String name  ) 
 

Gets the constant index associated with a named parameter.

RealConstantEntry* Ogre::GpuProgramParameters::getPassIterationEntry void   ) 
 

gets the MultipassEntry if it exists.

Returns:
NULL if a Multipass constant entry does not exist.

size_t Ogre::GpuProgramParameters::getPassIterationEntryIndex void   )  const
 

gets the MultipassEntry index.

The value returned is only valid if if getMultipassEntry() does not return NULL.

Definition at line 893 of file OgreGpuProgram.h.

size_t Ogre::GpuProgramParameters::getRealConstantCount void   )  const
 

Gets the number of Real constants that have been set.

Definition at line 582 of file OgreGpuProgram.h.

RealConstantEntry* Ogre::GpuProgramParameters::getRealConstantEntry const size_t  index  ) 
 

Gets a specific Real Constant entry if index is in valid range otherwise returns a NULL.

index which entry is to be retrieved

RealConstantIterator Ogre::GpuProgramParameters::getRealConstantIterator void   )  const
 

Gets an iterator over the Real constant parameters.

bool Ogre::GpuProgramParameters::getTransposeMatrices void   )  const
 

Gets whether or not matrices are to be transposed when set.

Definition at line 824 of file OgreGpuProgram.h.

bool Ogre::GpuProgramParameters::hasAutoConstants void   )  const
 

Returns true if this instance has any automatic constants.

Definition at line 624 of file OgreGpuProgram.h.

bool Ogre::GpuProgramParameters::hasIntConstantParams void   )  const
 

Returns true if there are any int constants contained here.

Definition at line 588 of file OgreGpuProgram.h.

bool Ogre::GpuProgramParameters::hasRealConstantParams void   )  const
 

Returns true if there are any Real constants contained here.

Definition at line 586 of file OgreGpuProgram.h.

void Ogre::GpuProgramParameters::incPassIterationNumber void   ) 
 

increments the multipass number entry by 1 if it exists

GpuProgramParameters& Ogre::GpuProgramParameters::operator= const GpuProgramParameters oth  ) 
 

Operator = overload.

void Ogre::GpuProgramParameters::resetIntConstants void   ) 
 

Deletes the contents of the int constants registers.

Definition at line 553 of file OgreGpuProgram.h.

void Ogre::GpuProgramParameters::resetRealConstants void   ) 
 

Deletes the contents of the Real constants registers.

Definition at line 551 of file OgreGpuProgram.h.

void Ogre::GpuProgramParameters::setAutoAddParamName bool  state  ) 
 

Sets the auto add parameter name flag.

Remarks:
Not all GPU programs make named parameters available after the high level source is compiled. GLSL is one such case. If parameter names are not loaded prior to the material serializer reading in parameter names in a script then an exception is generated. Set AutoAddParamName to true to have names not found in the map added to the map.
Note:
The index of the parameter name will be set to the end of the Real Constant List.
Parameters:
state true to enable automatic name

Definition at line 641 of file OgreGpuProgram.h.

void Ogre::GpuProgramParameters::setAutoConstant size_t  index,
AutoConstantType  acType,
size_t  extraInfo = 0
 

Sets up a constant which will automatically be updated by the system.

Remarks:
Vertex and fragment programs often need parameters which are to do with the current render state, or particular values which may very well change over time, and often between objects which are being rendered. This feature allows you to set up a certain number of predefined parameter mappings that are kept up to date for you.
Parameters:
index The location in the constant list to place this updated constant every time it is changed. Note that because of the nature of the types, we know how big the parameter details will be so you don't need to set that like you do for manual constants.
acType The type of automatic constant to set
extraInfo If the constant type needs more information (like a light index) put it here.

void Ogre::GpuProgramParameters::setAutoConstantReal size_t  index,
AutoConstantType  acType,
Real  rData
 

void Ogre::GpuProgramParameters::setConstant size_t  index,
const int *  val,
size_t  count
 

Sets a multiple value constant integer parameter to the program.

Remarks:
Different types of GPU programs support different types of constant parameters. For example, it's relatively common to find that vertex programs only support floating point constants, and that fragment programs only support integer (fixed point) parameters. This can vary depending on the program version supported by the graphics card being used. You should consult the documentation for the type of low level program you are using, or alternatively use the methods provided on RenderSystemCapabilities to determine the options.
Parameters:
index The constant index at which to place the parameter (each constant is a 4D integer)
val Pointer to the values to write, must contain 4*count ints
count The number of groups of 4 ints to write

void Ogre::GpuProgramParameters::setConstant size_t  index,
const ColourValue colour
 

Sets a ColourValue parameter to the program.

Parameters:
index The constant index at which to place the parameter (each constant is a 4D float)
colour The value to set

void Ogre::GpuProgramParameters::setConstant size_t  index,
const double *  val,
size_t  count
 

Sets a multiple value constant floating-point parameter to the program.

Parameters:
index The constant index at which to start placing parameters (each constant is a 4D float)
val Pointer to the values to write, must contain 4*count floats
count The number of groups of 4 floats to write

void Ogre::GpuProgramParameters::setConstant size_t  index,
const float *  val,
size_t  count
 

Sets a multiple value constant floating-point parameter to the program.

Parameters:
index The constant index at which to start placing parameters (each constant is a 4D float)
val Pointer to the values to write, must contain 4*count floats
count The number of groups of 4 floats to write

void Ogre::GpuProgramParameters::setConstant size_t  index,
const Matrix4 m,
size_t  numEntries
 

Sets a list of Matrix4 parameters to the program.

Parameters:
index The constant index at which to start placing the parameter (each constant is a 4D float). NB since a Matrix4 is 16 floats long, so each entry will take up 4 indexes.
m Pointer to an array of matrices to set
numEntries Number of Matrix4 entries

void Ogre::GpuProgramParameters::setConstant size_t  index,
const Matrix4 m
 

Sets a Matrix4 parameter to the program.

Parameters:
index The constant index at which to place the parameter (each constant is a 4D float). NB since a Matrix4 is 16 floats long, this parameter will take up 4 indexes.
m The value to set

void Ogre::GpuProgramParameters::setConstant size_t  index,
const Vector3 vec
 

Sets a 4-element floating-point parameter to the program via Vector3.

Parameters:
index The constant index at which to place the parameter (each constant is a 4D float). Note that since you're passing a Vector3, the last element of the 4-element value will be set to 1 (a homogenous vector)
vec The value to set

void Ogre::GpuProgramParameters::setConstant size_t  index,
Real  val
 

Sets a single floating-point parameter to the program.

Note:
This is actually equivalent to calling setConstant(index Vector4(val, 0, 0, 0)) since all constants are 4D.
Parameters:
index The constant index at which to place the parameter (each constant is a 4D float)
val The value to set

void Ogre::GpuProgramParameters::setConstant size_t  index,
const Vector4 vec
 

Sets a 4-element floating-point parameter to the program.

Parameters:
index The constant index at which to place the parameter (each constant is a 4D float)
vec The value to set

Referenced by Ogre::Renderable::_updateCustomGpuParameter().

void Ogre::GpuProgramParameters::setConstantDefinitionAutoState const size_t  index,
const bool  isAuto,
const size_t  autoIndex
 

Set the constant definition's Auto state.

Parameters:
index The index of the constant definition.
isAuto If true then constant is being updated automatically.
autoIndex Index for AutoConstantEntry.

void Ogre::GpuProgramParameters::setConstantFromTime size_t  index,
Real  factor
 

Sets a named parameter up to track a derivation of the current time.

Parameters:
index The index of the parameter
factor The amount by which to scale the time value

void Ogre::GpuProgramParameters::setNamedAutoConstant const String name,
AutoConstantType  acType,
size_t  extraInfo = 0
 

Sets up a constant which will automatically be updated by the system.

Remarks:
Vertex and fragment programs often need parameters which are to do with the current render state, or particular values which may very well change over time, and often between objects which are being rendered. This feature allows you to set up a certain number of predefined parameter mappings that are kept up to date for you.
Note:
This named option will only work if you are using a parameters object created from a high-level program (HighLevelGpuProgram).
Parameters:
name The name of the parameter
acType The type of automatic constant to set
extraInfo If the constant type needs more information (like a light index) put it here.

void Ogre::GpuProgramParameters::setNamedConstant const String name,
const int *  val,
size_t  count
 

Sets a multiple value constant integer parameter to the program.

Remarks:
Different types of GPU programs support different types of constant parameters. For example, it's relatively common to find that vertex programs only support floating point constants, and that fragment programs only support integer (fixed point) parameters. This can vary depending on the program version supported by the graphics card being used. You should consult the documentation for the type of low level program you are using, or alternatively use the methods provided on RenderSystemCapabilities to determine the options.
Another possible limitation is that some systems only allow constants to be set on certain boundaries, e.g. in sets of 4 values for example. Again, see RenderSystemCapabilities for full details.
Note:
This named option will only work if you are using a parameters object created from a high-level program (HighLevelGpuProgram).
Parameters:
name The name of the parameter
val Pointer to the values to write
count The number of integers to write

void Ogre::GpuProgramParameters::setNamedConstant const String name,
const ColourValue colour
 

Sets a ColourValue parameter to the program.

Parameters:
name The name of the parameter
colour The value to set

void Ogre::GpuProgramParameters::setNamedConstant const String name,
const double *  val,
size_t  count
 

Sets a multiple value constant floating-point parameter to the program.

Remarks:
Different types of GPU programs support different types of constant parameters. For example, it's relatively common to find that vertex programs only support floating point constants, and that fragment programs only support integer (fixed point) parameters. This can vary depending on the program version supported by the graphics card being used. You should consult the documentation for the type of low level program you are using, or alternatively use the methods provided on RenderSystemCapabilities to determine the options.
Another possible limitation is that some systems only allow constants to be set on certain boundaries, e.g. in sets of 4 values for example. Again, see RenderSystemCapabilities for full details.
Note:
This named option will only work if you are using a parameters object created from a high-level program (HighLevelGpuProgram).
Parameters:
name The name of the parameter
val Pointer to the values to write
count The number of floats to write

void Ogre::GpuProgramParameters::setNamedConstant const String name,
const float *  val,
size_t  count
 

Sets a multiple value constant floating-point parameter to the program.

Remarks:
Different types of GPU programs support different types of constant parameters. For example, it's relatively common to find that vertex programs only support floating point constants, and that fragment programs only support integer (fixed point) parameters. This can vary depending on the program version supported by the graphics card being used. You should consult the documentation for the type of low level program you are using, or alternatively use the methods provided on RenderSystemCapabilities to determine the options.
Another possible limitation is that some systems only allow constants to be set on certain boundaries, e.g. in sets of 4 values for example. Again, see RenderSystemCapabilities for full details.
Note:
This named option will only work if you are using a parameters object created from a high-level program (HighLevelGpuProgram).
Parameters:
name The name of the parameter
val Pointer to the values to write
count The number of floats to write

void Ogre::GpuProgramParameters::setNamedConstant const String name,
const Matrix4 m,
size_t  numEntries
 

Sets a list of Matrix4 parameters to the program.

Parameters:
name The name of the parameter; this must be the first index of an array, for examples 'matrices[0]' NB since a Matrix4 is 16 floats long, so each entry will take up 4 indexes.
m Pointer to an array of matrices to set
numEntries Number of Matrix4 entries

void Ogre::GpuProgramParameters::setNamedConstant const String name,
const Matrix4 m
 

Sets a Matrix4 parameter to the program.

Parameters:
name The name of the parameter
m The value to set

void Ogre::GpuProgramParameters::setNamedConstant const String name,
const Vector3 vec
 

Sets a Vector3 parameter to the program.

Note:
This named option will only work if you are using a parameters object created from a high-level program (HighLevelGpuProgram).
Parameters:
index The index at which to place the parameter NB this index refers to the number of floats, so a Vector3 is 3. Note that many rendersystems & programs assume that every floating point parameter is passed in as a vector of 4 items, so you are strongly advised to check with RenderSystemCapabilities before using this version - if in doubt use Vector4 or ColourValue instead (both are 4D).
vec The value to set

void Ogre::GpuProgramParameters::setNamedConstant const String name,
const Vector4 vec
 

Sets a Vector4 parameter to the program.

Parameters:
name The name of the parameter
vec The value to set

void Ogre::GpuProgramParameters::setNamedConstant const String name,
int  val
 

Sets a single value constant integer parameter to the program.

Remarks:
Different types of GPU programs support different types of constant parameters. For example, it's relatively common to find that vertex programs only support floating point constants, and that fragment programs only support integer (fixed point) parameters. This can vary depending on the program version supported by the graphics card being used. You should consult the documentation for the type of low level program you are using, or alternatively use the methods provided on RenderSystemCapabilities to determine the options.
Another possible limitation is that some systems only allow constants to be set on certain boundaries, e.g. in sets of 4 values for example. Again, see RenderSystemCapabilities for full details.
Note:
This named option will only work if you are using a parameters object created from a high-level program (HighLevelGpuProgram).
Parameters:
name The name of the parameter
val The value to set

void Ogre::GpuProgramParameters::setNamedConstant const String name,
Real  val
 

Sets a single value constant floating-point parameter to the program.

Remarks:
Different types of GPU programs support different types of constant parameters. For example, it's relatively common to find that vertex programs only support floating point constants, and that fragment programs only support integer (fixed point) parameters. This can vary depending on the program version supported by the graphics card being used. You should consult the documentation for the type of low level program you are using, or alternatively use the methods provided on RenderSystemCapabilities to determine the options.
Another possible limitation is that some systems only allow constants to be set on certain boundaries, e.g. in sets of 4 values for example. Again, see RenderSystemCapabilities for full details.
Note:
This named option will only work if you are using a parameters object created from a high-level program (HighLevelGpuProgram).
Parameters:
name The name of the parameter
val The value to set

void Ogre::GpuProgramParameters::setNamedConstantFromTime const String name,
Real  factor
 

Sets a named parameter up to track a derivation of the current time.

Note:
This named option will only work if you are using a parameters object created from a high-level program (HighLevelGpuProgram).
Parameters:
name The name of the parameter
factor The amount by which to scale the time value

void Ogre::GpuProgramParameters::setTransposeMatrices bool  val  ) 
 

Sets whether or not we need to transpose the matrices passed in from the rest of OGRE.

Remarks:
D3D uses transposed matrices compared to GL and OGRE; this is not important when you use programs which are written to process row-major matrices, such as those generated by Cg, but if you use a program written to D3D's matrix layout you will need to enable this flag.

Definition at line 822 of file OgreGpuProgram.h.


Member Data Documentation

AutoConstantDefinition Ogre::GpuProgramParameters::AutoConstantDictionary[] [static, protected]
 

Definition at line 437 of file OgreGpuProgram.h.

RealConstantEntry* Ogre::GpuProgramParameters::mActivePassIterationEntry [protected]
 

active pass iteration parameter real constant entry;

Definition at line 461 of file OgreGpuProgram.h.

size_t Ogre::GpuProgramParameters::mActivePassIterationEntryIndex [protected]
 

index for active pass iteration parameter real constant entry;

Definition at line 463 of file OgreGpuProgram.h.

bool Ogre::GpuProgramParameters::mAutoAddParamName [protected]
 

flag to indicate if names not found will be automatically added

Definition at line 459 of file OgreGpuProgram.h.

AutoConstantList Ogre::GpuProgramParameters::mAutoConstants [protected]
 

List of automatically updated parameters.

Definition at line 450 of file OgreGpuProgram.h.

ConstantDefinitionContainer Ogre::GpuProgramParameters::mConstantDefinitions [protected]
 

Container of parameter definitions.

Definition at line 452 of file OgreGpuProgram.h.

IntConstantList Ogre::GpuProgramParameters::mIntConstants [protected]
 

Packed list of integer constants.

Definition at line 448 of file OgreGpuProgram.h.

ParamNameMap Ogre::GpuProgramParameters::mParamNameMap [protected]
 

Definition at line 455 of file OgreGpuProgram.h.

RealConstantList Ogre::GpuProgramParameters::mRealConstants [protected]
 

Packed list of floating-point constants.

Definition at line 446 of file OgreGpuProgram.h.

bool Ogre::GpuProgramParameters::mTransposeMatrices [protected]
 

Do we need to transpose matrices?

Definition at line 457 of file OgreGpuProgram.h.


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

Copyright © 2000-2005 by The OGRE Team
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Mar 12 14:39:03 2006