OGRE  1.10.12
Object-Oriented Graphics Rendering Engine
Ogre::GpuProgramParameters Class Reference

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

#include <OgreGpuProgramParams.h>

+ Inheritance diagram for Ogre::GpuProgramParameters:

Classes

struct  AutoConstantDefinition
 Structure defining an auto constant that's available for use in a parameters object. More...
 
class  AutoConstantEntry
 Structure recording the use of an automatic parameter. More...
 

Public Types

enum  ACDataType { ACDT_NONE, ACDT_INT, ACDT_REAL }
 Defines the type of the extra data item used by the auto constant. More...
 
typedef ConstVectorIterator< AutoConstantListAutoConstantIterator
 
typedef vector< AutoConstantEntry >::type AutoConstantList
 
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_WORLD_DUALQUATERNION_ARRAY_2x4, ACT_WORLD_SCALE_SHEAR_MATRIX_ARRAY_3x4,
  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_VERTEX_WINDING, ACT_FOG_COLOUR, ACT_FOG_PARAMS,
  ACT_SURFACE_AMBIENT_COLOUR, ACT_SURFACE_DIFFUSE_COLOUR, ACT_SURFACE_SPECULAR_COLOUR, ACT_SURFACE_EMISSIVE_COLOUR,
  ACT_SURFACE_SHININESS, ACT_SURFACE_ALPHA_REJECTION_VALUE, ACT_LIGHT_COUNT, ACT_AMBIENT_LIGHT_COLOUR,
  ACT_LIGHT_DIFFUSE_COLOUR, ACT_LIGHT_SPECULAR_COLOUR, ACT_LIGHT_ATTENUATION, ACT_SPOTLIGHT_PARAMS,
  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_LIGHT_DIFFUSE_COLOUR_POWER_SCALED, ACT_LIGHT_SPECULAR_COLOUR_POWER_SCALED, ACT_LIGHT_DIFFUSE_COLOUR_ARRAY, ACT_LIGHT_SPECULAR_COLOUR_ARRAY,
  ACT_LIGHT_DIFFUSE_COLOUR_POWER_SCALED_ARRAY, ACT_LIGHT_SPECULAR_COLOUR_POWER_SCALED_ARRAY, ACT_LIGHT_ATTENUATION_ARRAY, ACT_LIGHT_POSITION_ARRAY,
  ACT_LIGHT_POSITION_OBJECT_SPACE_ARRAY, ACT_LIGHT_POSITION_VIEW_SPACE_ARRAY, ACT_LIGHT_DIRECTION_ARRAY, ACT_LIGHT_DIRECTION_OBJECT_SPACE_ARRAY,
  ACT_LIGHT_DIRECTION_VIEW_SPACE_ARRAY, ACT_LIGHT_DISTANCE_OBJECT_SPACE_ARRAY, ACT_LIGHT_POWER_SCALE_ARRAY, ACT_SPOTLIGHT_PARAMS_ARRAY,
  ACT_DERIVED_AMBIENT_LIGHT_COLOUR, ACT_DERIVED_SCENE_COLOUR, ACT_DERIVED_LIGHT_DIFFUSE_COLOUR, ACT_DERIVED_LIGHT_SPECULAR_COLOUR,
  ACT_DERIVED_LIGHT_DIFFUSE_COLOUR_ARRAY, ACT_DERIVED_LIGHT_SPECULAR_COLOUR_ARRAY, ACT_LIGHT_NUMBER, ACT_LIGHT_CASTS_SHADOWS,
  ACT_LIGHT_CASTS_SHADOWS_ARRAY, ACT_SHADOW_EXTRUSION_DISTANCE, ACT_CAMERA_POSITION, ACT_CAMERA_POSITION_OBJECT_SPACE,
  ACT_TEXTURE_VIEWPROJ_MATRIX, ACT_TEXTURE_VIEWPROJ_MATRIX_ARRAY, ACT_TEXTURE_WORLDVIEWPROJ_MATRIX, ACT_TEXTURE_WORLDVIEWPROJ_MATRIX_ARRAY,
  ACT_SPOTLIGHT_VIEWPROJ_MATRIX, ACT_SPOTLIGHT_VIEWPROJ_MATRIX_ARRAY, ACT_SPOTLIGHT_WORLDVIEWPROJ_MATRIX, ACT_SPOTLIGHT_WORLDVIEWPROJ_MATRIX_ARRAY,
  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, ACT_TEXEL_OFFSETS, ACT_SCENE_DEPTH_RANGE, ACT_SHADOW_SCENE_DEPTH_RANGE,
  ACT_SHADOW_SCENE_DEPTH_RANGE_ARRAY, ACT_SHADOW_COLOUR, ACT_TEXTURE_SIZE, ACT_INVERSE_TEXTURE_SIZE,
  ACT_PACKED_TEXTURE_SIZE, ACT_TEXTURE_MATRIX, ACT_LOD_CAMERA_POSITION, ACT_LOD_CAMERA_POSITION_OBJECT_SPACE,
  ACT_LIGHT_CUSTOM, ACT_POINT_PARAMS, ACT_UNKNOWN = 999
}
 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  ElementType { ET_INT, ET_REAL }
 Defines the base element type of the auto constant. More...
 
typedef vector< GpuSharedParametersUsage >::type GpuSharedParamUsageList
 
typedef OGRE_HashMap< size_t, String >::const_iterator SubroutineIterator
 
typedef OGRE_HashMap< size_t, StringSubroutineMap
 

Public Member Functions

 GpuProgramParameters ()
 
 GpuProgramParameters (const GpuProgramParameters &oth)
 Copy constructor. More...
 
 ~GpuProgramParameters ()
 
void _copySharedParams ()
 Update the parameters by copying the data from the shared parameters. More...
 
const GpuConstantDefinition_findNamedConstantDefinition (const String &name, bool throwExceptionIfMissing=false) const
 Find a constant definition for a named parameter. More...
 
const AutoConstantEntry_findRawAutoConstantEntryBool (size_t physicalIndex) const
 Finds an auto constant that's affecting a given physical position in the boolean buffer. More...
 
const AutoConstantEntry_findRawAutoConstantEntryDouble (size_t physicalIndex) const
 Finds an auto constant that's affecting a given physical position in the double-point buffer. More...
 
const AutoConstantEntry_findRawAutoConstantEntryFloat (size_t physicalIndex) const
 Finds an auto constant that's affecting a given physical position in the floating-point buffer. More...
 
const AutoConstantEntry_findRawAutoConstantEntryInt (size_t physicalIndex) const
 Finds an auto constant that's affecting a given physical position in the integer buffer. More...
 
const AutoConstantEntry_findRawAutoConstantEntryUnsignedInt (size_t physicalIndex) const
 Finds an auto constant that's affecting a given physical position in the unsigned integer buffer. More...
 
size_t _getDoubleConstantPhysicalIndex (size_t logicalIndex, size_t requestedSize, uint16 variability)
 Gets the physical buffer index associated with a logical double constant index. More...
 
size_t _getFloatConstantPhysicalIndex (size_t logicalIndex, size_t requestedSize, uint16 variability)
 Gets the physical buffer index associated with a logical float constant index. More...
 
size_t _getIntConstantPhysicalIndex (size_t logicalIndex, size_t requestedSize, uint16 variability)
 Gets the physical buffer index associated with a logical int constant index. More...
 
const Any_getRenderSystemData () const
 Internal method that the RenderSystem might use to store optional data. More...
 
size_t _getUnsignedIntConstantPhysicalIndex (size_t logicalIndex, size_t requestedSize, uint16 variability)
 Gets the physical buffer index associated with a logical unsigned int constant index. More...
 
void _readRawConstants (size_t physicalIndex, size_t count, float *dest)
 Read a series of floating point values from the underlying float constant buffer at the given physical index. More...
 
void _readRawConstants (size_t physicalIndex, size_t count, int *dest)
 Read a series of integer values from the underlying integer constant buffer at the given physical index. More...
 
void _setLogicalIndexes (const GpuLogicalBufferStructPtr &floatIndexMap, const GpuLogicalBufferStructPtr &doubleIndexMap, const GpuLogicalBufferStructPtr &intIndexMap, const GpuLogicalBufferStructPtr &uintIndexMap, const GpuLogicalBufferStructPtr &boolIndexMap)
 Internal method for providing a link to a logical index->physical index map for parameters. More...
 
void _setNamedConstants (const GpuNamedConstantsPtr &constantmap)
 Internal method for providing a link to a name->definition map for parameters. More...
 
void _setRawAutoConstant (size_t physicalIndex, AutoConstantType acType, size_t extraInfo, uint16 variability, size_t elementSize=4)
 As setAutoConstant, but sets up the auto constant directly against a physical buffer index. More...
 
void _setRawAutoConstantReal (size_t physicalIndex, AutoConstantType acType, Real rData, uint16 variability, size_t elementSize=4)
 As setAutoConstantReal, but sets up the auto constant directly against a physical buffer index. More...
 
void _setRenderSystemData (const Any &data) const
 Internal method that the RenderSystem might use to store optional data. More...
 
void _updateAutoParams (const AutoParamDataSource *source, uint16 variabilityMask)
 Update automatic parameters. More...
 
void _writeRawConstant (size_t physicalIndex, const Vector4 &vec, size_t count=4)
 Write a 4-element floating-point parameter to the program directly to the underlying constants buffer. More...
 
void _writeRawConstant (size_t physicalIndex, Real val)
 Write a single floating-point parameter to the program. More...
 
void _writeRawConstant (size_t physicalIndex, Real val, size_t count)
 Write a variable number of floating-point parameters to the program. More...
 
void _writeRawConstant (size_t physicalIndex, int val)
 Write a single integer parameter to the program. More...
 
void _writeRawConstant (size_t physicalIndex, uint val)
 Write a single unsigned integer parameter to the program. More...
 
void _writeRawConstant (size_t physicalIndex, const Vector3 &vec)
 Write a 3-element floating-point parameter to the program via Vector3. More...
 
void _writeRawConstant (size_t physicalIndex, const Vector2 &vec)
 Write a 2-element floating-point parameter to the program via Vector2. More...
 
void _writeRawConstant (size_t physicalIndex, const Matrix4 &m, size_t elementCount)
 Write a Matrix4 parameter to the program. More...
 
void _writeRawConstant (size_t physicalIndex, const Matrix4 *m, size_t numEntries)
 Write a list of Matrix4 parameters to the program. More...
 
void _writeRawConstant (size_t physicalIndex, const ColourValue &colour, size_t count=4)
 Write a ColourValue parameter to the program. More...
 
void _writeRawConstants (size_t physicalIndex, const float *val, size_t count)
 Write a series of floating point values into the underlying float constant buffer at the given physical index. More...
 
void _writeRawConstants (size_t physicalIndex, const double *val, size_t count)
 Write a series of floating point values into the underlying float constant buffer at the given physical index. More...
 
void _writeRawConstants (size_t physicalIndex, const int *val, size_t count)
 Write a series of integer values into the underlying integer constant buffer at the given physical index. More...
 
void _writeRawConstants (size_t physicalIndex, const uint *val, size_t count)
 Write a series of unsigned integer values into the underlying integer constant buffer at the given physical index. More...
 
void addSharedParameters (GpuSharedParametersPtr sharedParams)
 Use a set of shared parameters in this parameters object. More...
 
void addSharedParameters (const String &sharedParamsName)
 Use a set of shared parameters in this parameters object. More...
 
size_t calculateSize (void) const
 
void clearAutoConstant (size_t index)
 Unbind an auto constant so that the constant is manually controlled again. More...
 
void clearAutoConstants (void)
 Clears all the existing automatic constants. More...
 
void clearNamedAutoConstant (const String &name)
 Unbind an auto constant so that the constant is manually controlled again. More...
 
void copyConstantsFrom (const GpuProgramParameters &source)
 Copies the values of all constants (including auto constants) from another GpuProgramParameters object. More...
 
void copyMatchingNamedConstantsFrom (const GpuProgramParameters &source)
 Copies the values of all matching named constants (including auto constants) from another GpuProgramParameters object. More...
 
const AutoConstantEntryfindAutoConstantEntry (const String &paramName) const
 Finds an auto constant that's affecting a given named parameter index. More...
 
const AutoConstantEntryfindDoubleAutoConstantEntry (size_t logicalIndex)
 Finds an auto constant that's affecting a given logical parameter index for double-point values. More...
 
const AutoConstantEntryfindFloatAutoConstantEntry (size_t logicalIndex)
 Finds an auto constant that's affecting a given logical parameter index for floating-point values. More...
 
const AutoConstantEntryfindIntAutoConstantEntry (size_t logicalIndex)
 Finds an auto constant that's affecting a given logical parameter index for integer values. More...
 
const AutoConstantEntryfindUnsignedIntAutoConstantEntry (size_t logicalIndex)
 Finds an auto constant that's affecting a given logical parameter index for unsigned integer values. More...
 
size_t getAutoConstantCount (void) const
 Gets the number of int constants that have been set. More...
 
AutoConstantEntrygetAutoConstantEntry (const size_t index)
 Gets a specific Auto Constant entry if index is in valid range otherwise returns a NULL. More...
 
AutoConstantIterator getAutoConstantIterator (void) const
 Gets an iterator over the automatic constant bindings currently in place. More...
 
const AutoConstantListgetAutoConstantList () const
 Get a reference to the list of auto constant bindings. More...
 
const AutoConstantListgetAutoConstants () const
 Gets the automatic constant bindings currently in place. More...
 
const GpuLogicalBufferStructPtrgetBoolLogicalBufferStruct () const
 Get the current list of mappings from low-level logical param indexes to physical buffer locations in the integer buffer. More...
 
size_t getBoolLogicalIndexForPhysicalIndex (size_t physicalIndex)
 Retrieves the logical index relating to a physical index in the bool buffer, for programs which support that (low-level programs and high-level programs which use logical parameter indexes). More...
 
const GpuConstantDefinitiongetConstantDefinition (const String &name) const
 Get a specific GpuConstantDefinition for a named parameter. More...
 
GpuConstantDefinitionIterator getConstantDefinitionIterator (void) const
 Gets an iterator over the named GpuConstantDefinition instances as defined by the program for which these parameters exist. More...
 
const GpuNamedConstantsgetConstantDefinitions () const
 Get the full list of GpuConstantDefinition instances. More...
 
const DoubleConstantListgetDoubleConstantList () const
 Get a reference to the list of double constants. More...
 
const GpuLogicalBufferStructPtrgetDoubleLogicalBufferStruct () const
 Get the current list of mappings from low-level logical param indexes to physical buffer locations in the double buffer. More...
 
size_t getDoubleLogicalIndexForPhysicalIndex (size_t physicalIndex)
 Retrieves the logical index relating to a physical index in the double buffer, for programs which support that (low-level programs and high-level programs which use logical parameter indexes). More...
 
double * getDoublePointer (size_t pos)
 Get a pointer to the 'nth' item in the double buffer. More...
 
const double * getDoublePointer (size_t pos) const
 Get a pointer to the 'nth' item in the double buffer. More...
 
const FloatConstantListgetFloatConstantList () const
 Get a reference to the list of float constants. More...
 
const GpuLogicalBufferStructPtrgetFloatLogicalBufferStruct () const
 Get the current list of mappings from low-level logical param indexes to physical buffer locations in the float buffer. More...
 
size_t getFloatLogicalIndexForPhysicalIndex (size_t physicalIndex)
 Retrieves the logical index relating to a physical index in the float buffer, for programs which support that (low-level programs and high-level programs which use logical parameter indexes). More...
 
float * getFloatPointer (size_t pos)
 Get a pointer to the 'nth' item in the float buffer. More...
 
const float * getFloatPointer (size_t pos) const
 Get a pointer to the 'nth' item in the float buffer. More...
 
const IntConstantListgetIntConstantList () const
 Get a reference to the list of int constants. More...
 
const GpuLogicalBufferStructPtrgetIntLogicalBufferStruct () const
 Get the current list of mappings from low-level logical param indexes to physical buffer locations in the integer buffer. More...
 
size_t getIntLogicalIndexForPhysicalIndex (size_t physicalIndex)
 Retrieves the logical index relating to a physical index in the int buffer, for programs which support that (low-level programs and high-level programs which use logical parameter indexes). More...
 
int * getIntPointer (size_t pos)
 Get a pointer to the 'nth' item in the int buffer. More...
 
const int * getIntPointer (size_t pos) const
 Get a pointer to the 'nth' item in the int buffer. More...
 
size_t getPassIterationNumberIndex () const
 Get the physical buffer index of the pass iteration number constant. More...
 
const GpuSharedParamUsageListgetSharedParameters () const
 Get the list of shared parameter sets. More...
 
const SubroutineMapgetSubroutineMap () const
 Get map with. More...
 
bool getTransposeMatrices (void) const
 Gets whether or not matrices are to be transposed when set. More...
 
const UnsignedIntConstantListgetUnsignedIntConstantList () const
 Get a reference to the list of uint constants. More...
 
const GpuLogicalBufferStructPtrgetUnsignedIntLogicalBufferStruct () const
 Get the current list of mappings from low-level logical param indexes to physical buffer locations in the integer buffer. More...
 
size_t getUnsignedIntLogicalIndexForPhysicalIndex (size_t physicalIndex)
 Retrieves the logical index relating to a physical index in the uint buffer, for programs which support that (low-level programs and high-level programs which use logical parameter indexes). More...
 
uintgetUnsignedIntPointer (size_t pos)
 Get a pointer to the 'nth' item in the uint buffer. More...
 
const uintgetUnsignedIntPointer (size_t pos) const
 Get a pointer to the 'nth' item in the uint buffer. More...
 
bool hasAutoConstants (void) const
 Returns true if this instance has any automatic constants. More...
 
bool hasLogicalIndexedParameters () const
 Does this parameter set include logically indexed parameters? More...
 
bool hasNamedParameters () const
 Does this parameter set include named parameters? More...
 
bool hasPassIterationNumber () const
 Does this parameters object have a pass iteration number constant? More...
 
void incPassIterationNumber (void)
 increments the multipass number entry by 1 if it exists More...
 
bool isUsingSharedParameters (const String &sharedParamsName) const
 Returns whether this parameter set is using the named shared parameter set. More...
 
GpuProgramParametersoperator= (const GpuProgramParameters &oth)
 Operator = overload. More...
 
void removeAllSharedParameters ()
 Stop using all shared parameter sets. More...
 
void removeSharedParameters (const String &sharedParamsName)
 Stop using the named shared parameter set. More...
 
void setAutoConstant (size_t index, AutoConstantType acType, size_t extraInfo=0)
 Sets up a constant which will automatically be updated by the system. More...
 
void setAutoConstant (size_t index, AutoConstantType acType, uint16 extraInfo1, uint16 extraInfo2)
 Sets up a constant which will automatically be updated by the system. More...
 
void setAutoConstantReal (size_t index, AutoConstantType acType, Real rData)
 
void setConstant (size_t index, const Vector4 &vec)
 Sets a 4-element floating-point parameter to the program. More...
 
void setConstant (size_t index, Real val)
 Sets a single floating-point parameter to the program. More...
 
void setConstant (size_t index, const Vector3 &vec)
 Sets a 4-element floating-point parameter to the program via Vector3. More...
 
void setConstant (size_t index, const Vector2 &vec)
 Sets a 4-element floating-point parameter to the program via Vector2. More...
 
void setConstant (size_t index, const Matrix4 &m)
 Sets a Matrix4 parameter to the program. More...
 
void setConstant (size_t index, const Matrix4 *m, size_t numEntries)
 Sets a list of Matrix4 parameters to the program. More...
 
void setConstant (size_t index, const ColourValue &colour)
 Sets a ColourValue parameter to the program. More...
 
void setConstant (size_t index, const float *val, size_t count)
 Sets a multiple value constant floating-point parameter to the program. More...
 
void setConstant (size_t index, const double *val, size_t count)
 Sets a multiple value constant floating-point parameter to the program. More...
 
void setConstant (size_t index, const int *val, size_t count)
 Sets a multiple value constant integer parameter to the program. More...
 
void setConstant (size_t index, const uint *val, size_t count)
 Sets a multiple value constant unsigned integer parameter to the program. More...
 
void setConstantFromTime (size_t index, Real factor)
 Sets a named parameter up to track a derivation of the current time. More...
 
void setIgnoreMissingParams (bool state)
 Tells the program whether to ignore missing parameters or not. More...
 
void setNamedAutoConstant (const String &name, AutoConstantType acType, size_t extraInfo=0)
 Sets up a constant which will automatically be updated by the system. More...
 
void setNamedAutoConstant (const String &name, AutoConstantType acType, uint16 extraInfo1, uint16 extraInfo2)
 Sets up a constant which will automatically be updated by the system. More...
 
void setNamedAutoConstantReal (const String &name, AutoConstantType acType, Real rData)
 
void setNamedConstant (const String &name, Real val)
 Sets a single value constant floating-point parameter to the program. More...
 
void setNamedConstant (const String &name, int val)
 Sets a single value constant integer parameter to the program. More...
 
void setNamedConstant (const String &name, uint val)
 Sets a single value constant unsigned integer parameter to the program. More...
 
void setNamedConstant (const String &name, const Vector4 &vec)
 Sets a Vector4 parameter to the program. More...
 
void setNamedConstant (const String &name, const Vector3 &vec)
 Sets a Vector3 parameter to the program. More...
 
void setNamedConstant (const String &name, const Vector2 &vec)
 Sets a Vector2 parameter to the program. More...
 
void setNamedConstant (const String &name, const Matrix4 &m)
 Sets a Matrix4 parameter to the program. More...
 
void setNamedConstant (const String &name, const Matrix4 *m, size_t numEntries)
 Sets a list of Matrix4 parameters to the program. More...
 
void setNamedConstant (const String &name, const ColourValue &colour)
 Sets a ColourValue parameter to the program. More...
 
void setNamedConstant (const String &name, const float *val, size_t count, size_t multiple=4)
 Sets a multiple value constant floating-point parameter to the program. More...
 
void setNamedConstant (const String &name, const double *val, size_t count, size_t multiple=4)
 Sets a multiple value constant floating-point parameter to the program. More...
 
void setNamedConstant (const String &name, const int *val, size_t count, size_t multiple=4)
 Sets a multiple value constant integer parameter to the program. More...
 
void setNamedConstant (const String &name, const uint *val, size_t count, size_t multiple=4)
 Sets a multiple value constant unsigned integer parameter to the program. More...
 
void setNamedConstantFromTime (const String &name, Real factor)
 Sets a named parameter up to track a derivation of the current time. More...
 
void setNamedSubroutine (const String &subroutineSlot, const String &subroutine)
 Set subroutine name by slot name. More...
 
void setSubroutine (size_t index, const String &subroutine)
 Set subroutine name by slot index. More...
 
void setTransposeMatrices (bool val)
 Sets whether or not we need to transpose the matrices passed in from the rest of OGRE. More...
 

Static Public Member Functions

static const AutoConstantDefinitiongetAutoConstantDefinition (const String &name)
 gets the auto constant definition associated with name if found else returns NULL More...
 
static const AutoConstantDefinitiongetAutoConstantDefinition (const size_t idx)
 gets the auto constant definition using an index into the auto constant definition array. More...
 
static size_t getNumAutoConstantDefinitions (void)
 Returns the number of auto constant definitions. More...
 

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 GpuProgram and may be shared between multiple Pass instances. For this reason they are managed using a shared pointer, which will ensure they are automatically deleted when no Pass is using them anymore.
High-level programs use named parameters (uniforms), low-level programs use indexed constants. This class supports both, but you can tell whether named constants are supported by calling hasNamedParameters(). There are references in the documentation below to 'logical' and 'physical' indexes; logical indexes are the indexes used by low-level programs and represent indexes into an array of float4's, some of which may be settable, some of which may be predefined constants in the program. We only store those constants which have actually been set, therefore our buffer could have gaps if we used the logical indexes in our own buffers. So instead we map these logical indexes to physical indexes in our buffer. When using high-level programs, logical indexes don't necessarily exist, although they might if the high-level program has a direct, exposed mapping from parameter names to logical indexes. In addition, high-level languages may or may not pack arrays of elements that are smaller than float4 (e.g. float2/vec2) contiguously. This kind of information is held in the ConstantDefinition structure which is only populated for high-level programs. You don't have to worry about any of this unless you intend to read parameters back from this structure rather than just setting them.

Member Typedef Documentation

◆ AutoConstantList

◆ GpuSharedParamUsageList

◆ SubroutineMap

◆ SubroutineIterator

◆ AutoConstantIterator

Member Enumeration Documentation

◆ 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.

For use in Parameter specification, drop the ACT_ prefix. E.g. ACT_WORLD_MATRIX becomes world_matrix.

Enumerator
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 

An array of world matrices, each represented as only a 3x4 matrix (3 rows of 4columns) usually for doing hardware skinning.

You should make enough entries available in your vertex program for the number of bones in use, i.e. an array of numBones*3 float4’s.

ACT_WORLD_MATRIX_ARRAY 

The current array of world matrices, used for blending.

ACT_WORLD_DUALQUATERNION_ARRAY_2x4 

The current array of world matrices transformed to an array of dual quaternions, represented as a 2x4 matrix.

ACT_WORLD_SCALE_SHEAR_MATRIX_ARRAY_3x4 

The scale and shear components of the current array of world matrices.

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 & transposed.

ACT_WORLDVIEWPROJ_MATRIX 

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_VERTEX_WINDING 

-1 if the winding has been inverted (e.g.

for reflections), +1 otherwise.

ACT_FOG_COLOUR 

Fog colour.

ACT_FOG_PARAMS 

Fog params: density, linear start, linear end, 1/(end-start)

ACT_SURFACE_AMBIENT_COLOUR 

Surface ambient colour, as set in Pass::setAmbient.

ACT_SURFACE_DIFFUSE_COLOUR 

Surface diffuse colour, as set in Pass::setDiffuse.

ACT_SURFACE_SPECULAR_COLOUR 

Surface specular colour, as set in Pass::setSpecular.

ACT_SURFACE_EMISSIVE_COLOUR 

Surface emissive colour, as set in Pass::setSelfIllumination.

ACT_SURFACE_SHININESS 

Surface shininess, as set in Pass::setShininess.

ACT_SURFACE_ALPHA_REJECTION_VALUE 

Surface alpha rejection value, not as set in Pass::setAlphaRejectionValue, but a floating number between 0.0f and 1.0f instead (255.0f / Pass::getAlphaRejectionValue())

ACT_LIGHT_COUNT 

The number of active light sources (better than gl_MaxLights)

ACT_AMBIENT_LIGHT_COLOUR 

The ambient light colour set in the scene.

ACT_LIGHT_DIFFUSE_COLOUR 

Light diffuse colour (index determined by setAutoConstant call)

this requires an index in the ’extra_params’ field, and relates to the ’nth’ closest light which could affect this object (i.e. 0 refers to the closest light - note that directional lights are always first in the list and always present). NB if there are no lights this close, then the parameter will be set to black.

ACT_LIGHT_SPECULAR_COLOUR 

Light specular colour (index determined by setAutoConstant call)

ACT_LIGHT_ATTENUATION 

Light attenuation parameters, Vector4(range, constant, linear, quadric)

ACT_SPOTLIGHT_PARAMS 

Spotlight parameters, Vector4(innerFactor, outerFactor, falloff, isSpot) innerFactor and outerFactor are cos(angle/2) The isSpot parameter is 0.0f for non-spotlights, 1.0f for spotlights.

Also for non-spotlights the inner and outer factors are 1 and nearly 1 respectively

ACT_LIGHT_POSITION 

A light position in world space (index determined by setAutoConstant call)

This requires an index in the ’extra_params’ field, and relates to the ’nth’ closest light which could affect this object (i.e. 0 refers to the closest light). NB if there are no lights this close, then the parameter will be set to all zeroes. Note that this property will work with all kinds of lights, even directional lights, since the parameter is set as a 4D vector. Point lights will be (pos.x, pos.y, pos.z, 1.0f) whilst directional lights will be (-dir.x, -dir.y, -dir.z, 0.0f). Operations like dot products will work consistently on both.

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)

Deprecated:
this property only works on directional lights, and we recommend that you use light_position instead since that returns a generic 4D vector.
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_LIGHT_DIFFUSE_COLOUR_POWER_SCALED 

Light diffuse colour pre-scaled by Light::setPowerScale (index determined by setAutoConstant call)

ACT_LIGHT_SPECULAR_COLOUR_POWER_SCALED 

Light specular colour pre-scaled by Light::setPowerScale (index determined by setAutoConstant call)

ACT_LIGHT_DIFFUSE_COLOUR_ARRAY 

Array of light diffuse colours (count set by extra param)

ACT_LIGHT_SPECULAR_COLOUR_ARRAY 

Array of light specular colours (count set by extra param)

ACT_LIGHT_DIFFUSE_COLOUR_POWER_SCALED_ARRAY 

Array of light diffuse colours scaled by light power (count set by extra param)

ACT_LIGHT_SPECULAR_COLOUR_POWER_SCALED_ARRAY 

Array of light specular colours scaled by light power (count set by extra param)

ACT_LIGHT_ATTENUATION_ARRAY 

Array of light attenuation parameters, Vector4(range, constant, linear, quadric) (count set by extra param)

ACT_LIGHT_POSITION_ARRAY 

Array of light positions in world space (count set by extra param)

ACT_LIGHT_POSITION_OBJECT_SPACE_ARRAY 

Array of light positions in object space (count set by extra param)

ACT_LIGHT_POSITION_VIEW_SPACE_ARRAY 

Array of light positions in view space (count set by extra param)

ACT_LIGHT_DIRECTION_ARRAY 

Array of light directions in world space (count set by extra param)

ACT_LIGHT_DIRECTION_OBJECT_SPACE_ARRAY 

Array of light directions in object space (count set by extra param)

ACT_LIGHT_DIRECTION_VIEW_SPACE_ARRAY 

Array of light directions in view space (count set by extra param)

ACT_LIGHT_DISTANCE_OBJECT_SPACE_ARRAY 

Array of distances of the lights from the center of the object a useful approximation as an alternative to per-vertex distance calculations.

(count set by extra param)

ACT_LIGHT_POWER_SCALE_ARRAY 

Array of light power levels, a single scalar as set in Light::setPowerScale (count set by extra param)

ACT_SPOTLIGHT_PARAMS_ARRAY 

Spotlight parameters array of Vector4(innerFactor, outerFactor, falloff, isSpot) innerFactor and outerFactor are cos(angle/2) The isSpot parameter is 0.0f for non-spotlights, 1.0f for spotlights.

Also for non-spotlights the inner and outer factors are 1 and nearly 1 respectively. (count set by extra param)

ACT_DERIVED_AMBIENT_LIGHT_COLOUR 

The derived ambient light colour, with 'r', 'g', 'b' components filled with product of surface ambient colour and ambient light colour, respectively, and 'a' component filled with surface ambient alpha component.

ACT_DERIVED_SCENE_COLOUR 

The derived scene colour, with 'r', 'g' and 'b' components filled with sum of derived ambient light colour and surface emissive colour, respectively, and 'a' component filled with surface diffuse alpha component.

ACT_DERIVED_LIGHT_DIFFUSE_COLOUR 

The derived light diffuse colour (index determined by setAutoConstant call), with 'r', 'g' and 'b' components filled with product of surface diffuse colour, light power scale and light diffuse colour, respectively, and 'a' component filled with surface diffuse alpha component.

ACT_DERIVED_LIGHT_SPECULAR_COLOUR 

The derived light specular colour (index determined by setAutoConstant call), with 'r', 'g' and 'b' components filled with product of surface specular colour and light specular colour, respectively, and 'a' component filled with surface specular alpha component.

ACT_DERIVED_LIGHT_DIFFUSE_COLOUR_ARRAY 

Array of derived light diffuse colours (count set by extra param)

ACT_DERIVED_LIGHT_SPECULAR_COLOUR_ARRAY 

Array of derived light specular colours (count set by extra param)

ACT_LIGHT_NUMBER 

The absolute light number of a local light index.

Each pass may have a number of lights passed to it, and each of these lights will have an index in the overall light list, which will differ from the local light index due to factors like setStartLight and setIteratePerLight. This binding provides the global light index for a local index.

ACT_LIGHT_CASTS_SHADOWS 

Returns (int) 1 if the given light casts shadows, 0 otherwise (index set in extra param)

ACT_LIGHT_CASTS_SHADOWS_ARRAY 

Returns (int) 1 if the given light casts shadows, 0 otherwise (index set in extra param)

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.

Applicable to vertex programs which have been specified as the ’shadow receiver’ vertex program alternative, or where a texture unit is marked as content_type shadow; this provides details of the view/projection matrix for the current shadow projector. The optional ’extra_params’ entry specifies which light the projector refers to (for the case of content_type shadow where more than one shadow texture may be present in a single pass), where 0 is the default and refers to the first light referenced in this pass.

ACT_TEXTURE_VIEWPROJ_MATRIX_ARRAY 

Array of view/projection matrices of the first n texture projection frustums.

ACT_TEXTURE_WORLDVIEWPROJ_MATRIX 

The view/projection matrix of the assigned texture projection frustum, combined with the current world matrix.

ACT_TEXTURE_WORLDVIEWPROJ_MATRIX_ARRAY 

Array of world/view/projection matrices of the first n texture projection frustums.

ACT_SPOTLIGHT_VIEWPROJ_MATRIX 

The view/projection matrix of a given spotlight.

ACT_SPOTLIGHT_VIEWPROJ_MATRIX_ARRAY 

Array of view/projection matrix of a given spotlight.

ACT_SPOTLIGHT_WORLDVIEWPROJ_MATRIX 

The view/projection matrix of a given spotlight projection frustum, combined with the current world matrix.

ACT_SPOTLIGHT_WORLDVIEWPROJ_MATRIX_ARRAY 

An array of the view/projection matrix of a given spotlight projection frustum, combined with the current world matrix.

ACT_CUSTOM 

A custom parameter which will come from the renderable, using 'data' as the identifier.

This allows you to map a custom parameter on an individual Renderable (see Renderable::setCustomParameter) to a parameter on a GPU program. It requires that you complete the ’extra_params’ field with the index that was used in the Renderable::setCustomParameter call, and this will ensure that whenever this Renderable is used, it will have it’s custom parameter mapped in. It’s very important that this parameter has been defined on all Renderables that are assigned the material that contains this automatic mapping, otherwise the process will fail.

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 active pass.

ACT_ANIMATION_PARAMETRIC 

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

For morph animation, sets the parametric value (0..1) representing the distance between the first position keyframe (bound to positions) and the second position keyframe (bound to the first free texture coordinate) so that the vertex program can interpolate between them. For pose animation, indicates a group of up to 4 parametric weight values applying to a sequence of up to 4 poses (each one bound to x, y, z and w of the constant), one for each pose. The original positions are held in the usual position buffer, and the offsets to take those positions to the pose where weight == 1.0 are in the first ’n’ free texture coordinates; ’n’ being determined by the value passed to includes_pose_animation. If more than 4 simultaneous poses are required, then you’ll need more than 1 shader constant to hold the parametric values, in which case you should use this binding more than once, referencing a different constant entry; the second one will contain the parametrics for poses 5-8, the third for poses 9-12, and so on.

ACT_TEXEL_OFFSETS 

Provides the texel offsets required by this rendersystem to map texels to pixels.

Packed as float4(absoluteHorizontalOffset, absoluteVerticalOffset, horizontalOffset / viewportWidth, verticalOffset / viewportHeight)

ACT_SCENE_DEPTH_RANGE 

Provides information about the depth range of the scene as viewed from the current camera.

Passed as float4(minDepth, maxDepth, depthRange, 1 / depthRange)

ACT_SHADOW_SCENE_DEPTH_RANGE 

Provides information about the depth range of the scene as viewed from a given shadow camera.

Requires an index parameter which maps to a light index relative to the current light list. Passed as float4(minDepth, maxDepth, depthRange, 1 / depthRange)

ACT_SHADOW_SCENE_DEPTH_RANGE_ARRAY 

Provides an array of information about the depth range of the scene as viewed from a given shadow camera.

Requires an index parameter which maps to a light index relative to the current light list. Passed as float4(minDepth, maxDepth, depthRange, 1 / depthRange)

ACT_SHADOW_COLOUR 

Provides the fixed shadow colour as configured via SceneManager::setShadowColour; useful for integrated modulative shadows.

ACT_TEXTURE_SIZE 

Provides texture size of the texture unit (index determined by setAutoConstant call).

Packed as float4(width, height, depth, 1)

ACT_INVERSE_TEXTURE_SIZE 

Provides inverse texture size of the texture unit (index determined by setAutoConstant call).

Packed as float4(1 / width, 1 / height, 1 / depth, 1)

ACT_PACKED_TEXTURE_SIZE 

Provides packed texture size of the texture unit (index determined by setAutoConstant call).

Packed as float4(width, height, 1 / width, 1 / height)

ACT_TEXTURE_MATRIX 

Provides the current transform matrix of the texture unit (index determined by setAutoConstant call), as seen by the fixed-function pipeline.

This requires an index in the ’extra_params’ field, and relates to the ’nth’ texture unit of the pass in question. NB if the given index exceeds the number of texture units available for this pass, then the parameter will be set to Matrix4::IDENTITY.

ACT_LOD_CAMERA_POSITION 

Provides the position of the LOD camera in world space, allowing you to perform separate LOD calculations in shaders independent of the rendering camera.

If there is no separate LOD camera then this is the real camera position. See Camera::setLodCamera.

ACT_LOD_CAMERA_POSITION_OBJECT_SPACE 

Provides the position of the LOD camera in object space, allowing you to perform separate LOD calculations in shaders independent of the rendering camera.

If there is no separate LOD camera then this is the real camera position. See Camera::setLodCamera.

ACT_LIGHT_CUSTOM 

Binds custom per-light constants to the shaders.

ACT_POINT_PARAMS 

Point params: size; constant, linear, quadratic attenuation.

ACT_UNKNOWN 

◆ ACDataType

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

Enumerator
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 (float or double)

◆ ElementType

Defines the base element type of the auto constant.

Enumerator
ET_INT 
ET_REAL 

Constructor & Destructor Documentation

◆ GpuProgramParameters() [1/2]

Ogre::GpuProgramParameters::GpuProgramParameters ( )

◆ ~GpuProgramParameters()

Ogre::GpuProgramParameters::~GpuProgramParameters ( )
inline

◆ GpuProgramParameters() [2/2]

Ogre::GpuProgramParameters::GpuProgramParameters ( const GpuProgramParameters oth)

Copy constructor.

Member Function Documentation

◆ operator=()

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

Operator = overload.

◆ _setNamedConstants()

void Ogre::GpuProgramParameters::_setNamedConstants ( const GpuNamedConstantsPtr constantmap)

Internal method for providing a link to a name->definition map for parameters.

◆ _setLogicalIndexes()

void Ogre::GpuProgramParameters::_setLogicalIndexes ( const GpuLogicalBufferStructPtr floatIndexMap,
const GpuLogicalBufferStructPtr doubleIndexMap,
const GpuLogicalBufferStructPtr intIndexMap,
const GpuLogicalBufferStructPtr uintIndexMap,
const GpuLogicalBufferStructPtr boolIndexMap 
)

Internal method for providing a link to a logical index->physical index map for parameters.

◆ hasNamedParameters()

bool Ogre::GpuProgramParameters::hasNamedParameters ( ) const
inline

Does this parameter set include named parameters?

References Ogre::SharedPtr< T >::get().

◆ hasLogicalIndexedParameters()

bool Ogre::GpuProgramParameters::hasLogicalIndexedParameters ( ) const
inline

Does this parameter set include logically indexed parameters?

Note
Not mutually exclusive with hasNamedParameters since some high-level programs still use logical indexes to set the parameters on the rendersystem.

References Ogre::SharedPtr< T >::get().

◆ setConstant() [1/11]

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

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

Parameters
indexThe logical constant index at which to place the parameter (each constant is a 4D float)
vecThe value to set

◆ setConstant() [2/11]

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
indexThe logical constant index at which to place the parameter (each constant is a 4D float)
valThe value to set

◆ setConstant() [3/11]

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

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

Parameters
indexThe logical 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 homogeneous vector)
vecThe value to set

◆ setConstant() [4/11]

void Ogre::GpuProgramParameters::setConstant ( size_t  index,
const Vector2 vec 
)

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

Parameters
indexThe logical constant index at which to place the parameter (each constant is a 4D float). Note that since you're passing a Vector2, the last 2 elements of the 4-element value will be set to 1 (a homogeneous vector)
vecThe value to set

◆ setConstant() [5/11]

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

Sets a Matrix4 parameter to the program.

Parameters
indexThe logical 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.
mThe value to set

◆ setConstant() [6/11]

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

Sets a list of Matrix4 parameters to the program.

Parameters
indexThe logical 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.
mPointer to an array of matrices to set
numEntriesNumber of Matrix4 entries

◆ setConstant() [7/11]

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

Sets a ColourValue parameter to the program.

Parameters
indexThe logical constant index at which to place the parameter (each constant is a 4D float)
colourThe value to set

◆ setConstant() [8/11]

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
indexThe logical constant index at which to start placing parameters (each constant is a 4D float)
valPointer to the values to write, must contain 4*count floats
countThe number of groups of 4 floats to write

◆ setConstant() [9/11]

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
indexThe logical constant index at which to start placing parameters (each constant is a 4D float)
valPointer to the values to write, must contain 4*count floats
countThe number of groups of 4 floats to write

◆ setConstant() [10/11]

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
indexThe logical constant index at which to place the parameter (each constant is a 4D integer)
valPointer to the values to write, must contain 4*count ints
countThe number of groups of 4 ints to write

◆ setConstant() [11/11]

void Ogre::GpuProgramParameters::setConstant ( size_t  index,
const uint val,
size_t  count 
)

Sets a multiple value constant unsigned 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
indexThe logical constant index at which to place the parameter (each constant is a 4D integer)
valPointer to the values to write, must contain 4*count ints
countThe number of groups of 4 ints to write

◆ _writeRawConstants() [1/4]

void Ogre::GpuProgramParameters::_writeRawConstants ( size_t  physicalIndex,
const float *  val,
size_t  count 
)

Write a series of floating point values into the underlying float constant buffer at the given physical index.

Parameters
physicalIndexThe buffer position to start writing
valPointer to a list of values to write
countThe number of floats to write

◆ _writeRawConstants() [2/4]

void Ogre::GpuProgramParameters::_writeRawConstants ( size_t  physicalIndex,
const double *  val,
size_t  count 
)

Write a series of floating point values into the underlying float constant buffer at the given physical index.

Parameters
physicalIndexThe buffer position to start writing
valPointer to a list of values to write
countThe number of floats to write

◆ _writeRawConstants() [3/4]

void Ogre::GpuProgramParameters::_writeRawConstants ( size_t  physicalIndex,
const int *  val,
size_t  count 
)

Write a series of integer values into the underlying integer constant buffer at the given physical index.

Parameters
physicalIndexThe buffer position to start writing
valPointer to a list of values to write
countThe number of ints to write

◆ _writeRawConstants() [4/4]

void Ogre::GpuProgramParameters::_writeRawConstants ( size_t  physicalIndex,
const uint val,
size_t  count 
)

Write a series of unsigned integer values into the underlying integer constant buffer at the given physical index.

Parameters
physicalIndexThe buffer position to start writing
valPointer to a list of values to write
countThe number of ints to write

◆ _readRawConstants() [1/2]

void Ogre::GpuProgramParameters::_readRawConstants ( size_t  physicalIndex,
size_t  count,
float *  dest 
)

Read a series of floating point values from the underlying float constant buffer at the given physical index.

Parameters
physicalIndexThe buffer position to start reading
countThe number of floats to read
destPointer to a buffer to receive the values

◆ _readRawConstants() [2/2]

void Ogre::GpuProgramParameters::_readRawConstants ( size_t  physicalIndex,
size_t  count,
int *  dest 
)

Read a series of integer values from the underlying integer constant buffer at the given physical index.

Parameters
physicalIndexThe buffer position to start reading
countThe number of ints to read
destPointer to a buffer to receive the values

◆ _writeRawConstant() [1/10]

void Ogre::GpuProgramParameters::_writeRawConstant ( size_t  physicalIndex,
const Vector4 vec,
size_t  count = 4 
)

Write a 4-element floating-point parameter to the program directly to the underlying constants buffer.

Note
You can use these methods if you have already derived the physical constant buffer location, for a slight speed improvement over using the named / logical index versions.
Parameters
physicalIndexThe physical buffer index at which to place the parameter
vecThe value to set
countThe number of floats to write; if for example the uniform constant 'slot' is smaller than a Vector4

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

◆ _writeRawConstant() [2/10]

void Ogre::GpuProgramParameters::_writeRawConstant ( size_t  physicalIndex,
Real  val 
)

Write a single floating-point parameter to the program.

Note
You can use these methods if you have already derived the physical constant buffer location, for a slight speed improvement over using the named / logical index versions.
Parameters
physicalIndexThe physical buffer index at which to place the parameter
valThe value to set

◆ _writeRawConstant() [3/10]

void Ogre::GpuProgramParameters::_writeRawConstant ( size_t  physicalIndex,
Real  val,
size_t  count 
)

Write a variable number of floating-point parameters to the program.

Note
You can use these methods if you have already derived the physical constant buffer location, for a slight speed improvement over using the named / logical index versions.
Parameters
physicalIndexThe physical buffer index at which to place the parameter
valThe value to set

◆ _writeRawConstant() [4/10]

void Ogre::GpuProgramParameters::_writeRawConstant ( size_t  physicalIndex,
int  val 
)

Write a single integer parameter to the program.

Note
You can use these methods if you have already derived the physical constant buffer location, for a slight speed improvement over using the named / logical index versions.
Parameters
physicalIndexThe physical buffer index at which to place the parameter
valThe value to set

◆ _writeRawConstant() [5/10]

void Ogre::GpuProgramParameters::_writeRawConstant ( size_t  physicalIndex,
uint  val 
)

Write a single unsigned integer parameter to the program.

Note
You can use these methods if you have already derived the physical constant buffer location, for a slight speed improvement over using the named / logical index versions.
Parameters
physicalIndexThe physical buffer index at which to place the parameter
valThe value to set

◆ _writeRawConstant() [6/10]

void Ogre::GpuProgramParameters::_writeRawConstant ( size_t  physicalIndex,
const Vector3 vec 
)

Write a 3-element floating-point parameter to the program via Vector3.

Note
You can use these methods if you have already derived the physical constant buffer location, for a slight speed improvement over using the named / logical index versions.
Parameters
physicalIndexThe physical buffer index at which to place the parameter
vecThe value to set

◆ _writeRawConstant() [7/10]

void Ogre::GpuProgramParameters::_writeRawConstant ( size_t  physicalIndex,
const Vector2 vec 
)

Write a 2-element floating-point parameter to the program via Vector2.

Note
You can use these methods if you have already derived the physical constant buffer location, for a slight speed improvement over using the named / logical index versions.
Parameters
physicalIndexThe physical buffer index at which to place the parameter
vecThe value to set

◆ _writeRawConstant() [8/10]

void Ogre::GpuProgramParameters::_writeRawConstant ( size_t  physicalIndex,
const Matrix4 m,
size_t  elementCount 
)

Write a Matrix4 parameter to the program.

Note
You can use these methods if you have already derived the physical constant buffer location, for a slight speed improvement over using the named / logical index versions.
Parameters
physicalIndexThe physical buffer index at which to place the parameter
mThe value to set
elementCountactual element count used with shader

◆ _writeRawConstant() [9/10]

void Ogre::GpuProgramParameters::_writeRawConstant ( size_t  physicalIndex,
const Matrix4 m,
size_t  numEntries 
)

Write a list of Matrix4 parameters to the program.

Note
You can use these methods if you have already derived the physical constant buffer location, for a slight speed improvement over using the named / logical index versions.
Parameters
physicalIndexThe physical buffer index at which to place the parameter
mThe value to set
numEntriesNumber of Matrix4 entries

◆ _writeRawConstant() [10/10]

void Ogre::GpuProgramParameters::_writeRawConstant ( size_t  physicalIndex,
const ColourValue colour,
size_t  count = 4 
)

Write a ColourValue parameter to the program.

Note
You can use these methods if you have already derived the physical constant buffer location, for a slight speed improvement over using the named / logical index versions.
Parameters
physicalIndexThe physical buffer index at which to place the parameter
colourThe value to set
countThe number of floats to write; if for example the uniform constant 'slot' is smaller than a Vector4

◆ getConstantDefinitionIterator()

GpuConstantDefinitionIterator Ogre::GpuProgramParameters::getConstantDefinitionIterator ( void  ) const

Gets an iterator over the named GpuConstantDefinition instances as defined by the program for which these parameters exist.

Note
Only available if this parameters object has named parameters.

◆ getConstantDefinition()

const GpuConstantDefinition& Ogre::GpuProgramParameters::getConstantDefinition ( const String name) const

Get a specific GpuConstantDefinition for a named parameter.

Note
Only available if this parameters object has named parameters.

◆ getConstantDefinitions()

const GpuNamedConstants& Ogre::GpuProgramParameters::getConstantDefinitions ( ) const

Get the full list of GpuConstantDefinition instances.

Note
Only available if this parameters object has named parameters.

◆ getFloatLogicalBufferStruct()

const GpuLogicalBufferStructPtr& Ogre::GpuProgramParameters::getFloatLogicalBufferStruct ( ) const
inline

Get the current list of mappings from low-level logical param indexes to physical buffer locations in the float buffer.

Note
Only applicable to low-level programs.

◆ getDoubleLogicalBufferStruct()

const GpuLogicalBufferStructPtr& Ogre::GpuProgramParameters::getDoubleLogicalBufferStruct ( ) const
inline

Get the current list of mappings from low-level logical param indexes to physical buffer locations in the double buffer.

Note
Only applicable to low-level programs.

◆ getIntLogicalBufferStruct()

const GpuLogicalBufferStructPtr& Ogre::GpuProgramParameters::getIntLogicalBufferStruct ( ) const
inline

Get the current list of mappings from low-level logical param indexes to physical buffer locations in the integer buffer.

Note
Only applicable to low-level programs.

◆ getUnsignedIntLogicalBufferStruct()

const GpuLogicalBufferStructPtr& Ogre::GpuProgramParameters::getUnsignedIntLogicalBufferStruct ( ) const
inline

Get the current list of mappings from low-level logical param indexes to physical buffer locations in the integer buffer.

Note
Only applicable to low-level programs.

◆ getBoolLogicalBufferStruct()

const GpuLogicalBufferStructPtr& Ogre::GpuProgramParameters::getBoolLogicalBufferStruct ( ) const
inline

Get the current list of mappings from low-level logical param indexes to physical buffer locations in the integer buffer.

Note
Only applicable to low-level programs.

◆ getFloatLogicalIndexForPhysicalIndex()

size_t Ogre::GpuProgramParameters::getFloatLogicalIndexForPhysicalIndex ( size_t  physicalIndex)

Retrieves the logical index relating to a physical index in the float buffer, for programs which support that (low-level programs and high-level programs which use logical parameter indexes).

Returns
std::numeric_limits<size_t>::max() if not found

◆ getDoubleLogicalIndexForPhysicalIndex()

size_t Ogre::GpuProgramParameters::getDoubleLogicalIndexForPhysicalIndex ( size_t  physicalIndex)

Retrieves the logical index relating to a physical index in the double buffer, for programs which support that (low-level programs and high-level programs which use logical parameter indexes).

Returns
std::numeric_limits<size_t>::max() if not found

◆ getIntLogicalIndexForPhysicalIndex()

size_t Ogre::GpuProgramParameters::getIntLogicalIndexForPhysicalIndex ( size_t  physicalIndex)

Retrieves the logical index relating to a physical index in the int buffer, for programs which support that (low-level programs and high-level programs which use logical parameter indexes).

Returns
std::numeric_limits<size_t>::max() if not found

◆ getUnsignedIntLogicalIndexForPhysicalIndex()

size_t Ogre::GpuProgramParameters::getUnsignedIntLogicalIndexForPhysicalIndex ( size_t  physicalIndex)

Retrieves the logical index relating to a physical index in the uint buffer, for programs which support that (low-level programs and high-level programs which use logical parameter indexes).

Returns
std::numeric_limits<size_t>::max() if not found

◆ getBoolLogicalIndexForPhysicalIndex()

size_t Ogre::GpuProgramParameters::getBoolLogicalIndexForPhysicalIndex ( size_t  physicalIndex)

Retrieves the logical index relating to a physical index in the bool buffer, for programs which support that (low-level programs and high-level programs which use logical parameter indexes).

Returns
std::numeric_limits<size_t>::max() if not found

◆ getFloatConstantList()

const FloatConstantList& Ogre::GpuProgramParameters::getFloatConstantList ( ) const
inline

Get a reference to the list of float constants.

◆ getFloatPointer() [1/2]

float* Ogre::GpuProgramParameters::getFloatPointer ( size_t  pos)
inline

Get a pointer to the 'nth' item in the float buffer.

◆ getFloatPointer() [2/2]

const float* Ogre::GpuProgramParameters::getFloatPointer ( size_t  pos) const
inline

Get a pointer to the 'nth' item in the float buffer.

◆ getDoubleConstantList()

const DoubleConstantList& Ogre::GpuProgramParameters::getDoubleConstantList ( ) const
inline

Get a reference to the list of double constants.

◆ getDoublePointer() [1/2]

double* Ogre::GpuProgramParameters::getDoublePointer ( size_t  pos)
inline

Get a pointer to the 'nth' item in the double buffer.

◆ getDoublePointer() [2/2]

const double* Ogre::GpuProgramParameters::getDoublePointer ( size_t  pos) const
inline

Get a pointer to the 'nth' item in the double buffer.

◆ getIntConstantList()

const IntConstantList& Ogre::GpuProgramParameters::getIntConstantList ( ) const
inline

Get a reference to the list of int constants.

◆ getIntPointer() [1/2]

int* Ogre::GpuProgramParameters::getIntPointer ( size_t  pos)
inline

Get a pointer to the 'nth' item in the int buffer.

◆ getIntPointer() [2/2]

const int* Ogre::GpuProgramParameters::getIntPointer ( size_t  pos) const
inline

Get a pointer to the 'nth' item in the int buffer.

◆ getUnsignedIntConstantList()

const UnsignedIntConstantList& Ogre::GpuProgramParameters::getUnsignedIntConstantList ( ) const
inline

Get a reference to the list of uint constants.

◆ getUnsignedIntPointer() [1/2]

uint* Ogre::GpuProgramParameters::getUnsignedIntPointer ( size_t  pos)
inline

Get a pointer to the 'nth' item in the uint buffer.

◆ getUnsignedIntPointer() [2/2]

const uint* Ogre::GpuProgramParameters::getUnsignedIntPointer ( size_t  pos) const
inline

Get a pointer to the 'nth' item in the uint buffer.

◆ getAutoConstantList()

const AutoConstantList& Ogre::GpuProgramParameters::getAutoConstantList ( ) const
inline

Get a reference to the list of auto constant bindings.

◆ setAutoConstant() [1/2]

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
indexThe 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.
acTypeThe type of automatic constant to set
extraInfoIf the constant type needs more information (like a light index) put it here.

◆ setAutoConstantReal()

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

◆ setAutoConstant() [2/2]

void Ogre::GpuProgramParameters::setAutoConstant ( size_t  index,
AutoConstantType  acType,
uint16  extraInfo1,
uint16  extraInfo2 
)

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
indexThe 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.
acTypeThe type of automatic constant to set
extraInfo1The first extra parameter required by the auto constant type
extraInfo2The first extra parameter required by the auto constant type

◆ _setRawAutoConstant()

void Ogre::GpuProgramParameters::_setRawAutoConstant ( size_t  physicalIndex,
AutoConstantType  acType,
size_t  extraInfo,
uint16  variability,
size_t  elementSize = 4 
)

As setAutoConstant, but sets up the auto constant directly against a physical buffer index.

◆ _setRawAutoConstantReal()

void Ogre::GpuProgramParameters::_setRawAutoConstantReal ( size_t  physicalIndex,
AutoConstantType  acType,
Real  rData,
uint16  variability,
size_t  elementSize = 4 
)

As setAutoConstantReal, but sets up the auto constant directly against a physical buffer index.

◆ clearAutoConstant()

void Ogre::GpuProgramParameters::clearAutoConstant ( size_t  index)

Unbind an auto constant so that the constant is manually controlled again.

◆ setConstantFromTime()

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

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

Parameters
indexThe index of the parameter
factorThe amount by which to scale the time value

◆ clearAutoConstants()

void Ogre::GpuProgramParameters::clearAutoConstants ( void  )

Clears all the existing automatic constants.

◆ getAutoConstantIterator()

AutoConstantIterator Ogre::GpuProgramParameters::getAutoConstantIterator ( void  ) const

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

Deprecated:
use getAutoConstants()

◆ getAutoConstants()

const AutoConstantList& Ogre::GpuProgramParameters::getAutoConstants ( ) const
inline

Gets the automatic constant bindings currently in place.

◆ getAutoConstantCount()

size_t Ogre::GpuProgramParameters::getAutoConstantCount ( void  ) const
inline

Gets the number of int constants that have been set.

◆ getAutoConstantEntry()

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

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

Parameters
indexwhich entry is to be retrieved

◆ hasAutoConstants()

bool Ogre::GpuProgramParameters::hasAutoConstants ( void  ) const
inline

Returns true if this instance has any automatic constants.

◆ findFloatAutoConstantEntry()

const AutoConstantEntry* Ogre::GpuProgramParameters::findFloatAutoConstantEntry ( size_t  logicalIndex)

Finds an auto constant that's affecting a given logical parameter index for floating-point values.

Note
Only applicable for low-level programs.

◆ findDoubleAutoConstantEntry()

const AutoConstantEntry* Ogre::GpuProgramParameters::findDoubleAutoConstantEntry ( size_t  logicalIndex)

Finds an auto constant that's affecting a given logical parameter index for double-point values.

Note
Only applicable for low-level programs.

◆ findIntAutoConstantEntry()

const AutoConstantEntry* Ogre::GpuProgramParameters::findIntAutoConstantEntry ( size_t  logicalIndex)

Finds an auto constant that's affecting a given logical parameter index for integer values.

Note
Only applicable for low-level programs.

◆ findUnsignedIntAutoConstantEntry()

const AutoConstantEntry* Ogre::GpuProgramParameters::findUnsignedIntAutoConstantEntry ( size_t  logicalIndex)

Finds an auto constant that's affecting a given logical parameter index for unsigned integer values.

Note
Only applicable for low-level programs.

◆ findAutoConstantEntry()

const AutoConstantEntry* Ogre::GpuProgramParameters::findAutoConstantEntry ( const String paramName) const

Finds an auto constant that's affecting a given named parameter index.

Note
Only applicable to high-level programs.

◆ _findRawAutoConstantEntryFloat()

const AutoConstantEntry* Ogre::GpuProgramParameters::_findRawAutoConstantEntryFloat ( size_t  physicalIndex) const

Finds an auto constant that's affecting a given physical position in the floating-point buffer.

◆ _findRawAutoConstantEntryDouble()

const AutoConstantEntry* Ogre::GpuProgramParameters::_findRawAutoConstantEntryDouble ( size_t  physicalIndex) const

Finds an auto constant that's affecting a given physical position in the double-point buffer.

◆ _findRawAutoConstantEntryInt()

const AutoConstantEntry* Ogre::GpuProgramParameters::_findRawAutoConstantEntryInt ( size_t  physicalIndex) const

Finds an auto constant that's affecting a given physical position in the integer buffer.

◆ _findRawAutoConstantEntryUnsignedInt()

const AutoConstantEntry* Ogre::GpuProgramParameters::_findRawAutoConstantEntryUnsignedInt ( size_t  physicalIndex) const

Finds an auto constant that's affecting a given physical position in the unsigned integer buffer.

◆ _findRawAutoConstantEntryBool()

const AutoConstantEntry* Ogre::GpuProgramParameters::_findRawAutoConstantEntryBool ( size_t  physicalIndex) const

Finds an auto constant that's affecting a given physical position in the boolean buffer.

◆ _updateAutoParams()

void Ogre::GpuProgramParameters::_updateAutoParams ( const AutoParamDataSource source,
uint16  variabilityMask 
)

Update automatic parameters.

Parameters
sourceThe source of the parameters
variabilityMaskA mask of GpuParamVariability which identifies which autos will need updating

◆ setIgnoreMissingParams()

void Ogre::GpuProgramParameters::setIgnoreMissingParams ( bool  state)
inline

Tells the program whether to ignore missing parameters or not.

◆ setNamedConstant() [1/13]

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
nameThe name of the parameter
valThe value to set

◆ setNamedConstant() [2/13]

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
nameThe name of the parameter
valThe value to set

◆ setNamedConstant() [3/13]

void Ogre::GpuProgramParameters::setNamedConstant ( const String name,
uint  val 
)

Sets a single value constant unsigned 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
nameThe name of the parameter
valThe value to set

◆ setNamedConstant() [4/13]

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

Sets a Vector4 parameter to the program.

Parameters
nameThe name of the parameter
vecThe value to set

◆ setNamedConstant() [5/13]

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
nameThe name of the parameter
vecThe value to set

◆ setNamedConstant() [6/13]

void Ogre::GpuProgramParameters::setNamedConstant ( const String name,
const Vector2 vec 
)

Sets a Vector2 parameter to the program.

Parameters
nameThe name of the parameter
vecThe value to set

◆ setNamedConstant() [7/13]

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

Sets a Matrix4 parameter to the program.

Parameters
nameThe name of the parameter
mThe value to set

◆ setNamedConstant() [8/13]

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

Sets a list of Matrix4 parameters to the program.

Parameters
nameThe 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.
mPointer to an array of matrices to set
numEntriesNumber of Matrix4 entries

◆ setNamedConstant() [9/13]

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

Sets a ColourValue parameter to the program.

Parameters
nameThe name of the parameter
colourThe value to set

◆ setNamedConstant() [10/13]

void Ogre::GpuProgramParameters::setNamedConstant ( const String name,
const float *  val,
size_t  count,
size_t  multiple = 4 
)

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

Some systems only allow constants to be set on certain boundaries, e.g. in sets of 4 values for example. The 'multiple' parameter allows you to control that although you should only change it if you know your chosen language supports that (at the time of writing, only GLSL allows constants which are not a multiple of 4).
Note
This named option will only work if you are using a parameters object created from a high-level program (HighLevelGpuProgram).
Parameters
nameThe name of the parameter
valPointer to the values to write
countThe number of 'multiples' of floats to write
multipleThe number of raw entries in each element to write, the default is 4 so count = 1 would write 4 floats.

◆ setNamedConstant() [11/13]

void Ogre::GpuProgramParameters::setNamedConstant ( const String name,
const double *  val,
size_t  count,
size_t  multiple = 4 
)

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

Some systems only allow constants to be set on certain boundaries, e.g. in sets of 4 values for example. The 'multiple' parameter allows you to control that although you should only change it if you know your chosen language supports that (at the time of writing, only GLSL allows constants which are not a multiple of 4).
Note
This named option will only work if you are using a parameters object created from a high-level program (HighLevelGpuProgram).
Parameters
nameThe name of the parameter
valPointer to the values to write
countThe number of 'multiples' of floats to write
multipleThe number of raw entries in each element to write, the default is 4 so count = 1 would write 4 floats.

◆ setNamedConstant() [12/13]

void Ogre::GpuProgramParameters::setNamedConstant ( const String name,
const int *  val,
size_t  count,
size_t  multiple = 4 
)

Sets a multiple value constant integer parameter to the program.

Some systems only allow constants to be set on certain boundaries, e.g. in sets of 4 values for example. The 'multiple' parameter allows you to control that although you should only change it if you know your chosen language supports that (at the time of writing, only GLSL allows constants which are not a multiple of 4).
Note
This named option will only work if you are using a parameters object created from a high-level program (HighLevelGpuProgram).
Parameters
nameThe name of the parameter
valPointer to the values to write
countThe number of 'multiples' of floats to write
multipleThe number of raw entries in each element to write, the default is 4 so count = 1 would write 4 floats.

◆ setNamedConstant() [13/13]

void Ogre::GpuProgramParameters::setNamedConstant ( const String name,
const uint val,
size_t  count,
size_t  multiple = 4 
)

Sets a multiple value constant unsigned integer parameter to the program.

Some systems only allow constants to be set on certain boundaries, e.g. in sets of 4 values for example. The 'multiple' parameter allows you to control that although you should only change it if you know your chosen language supports that (at the time of writing, only GLSL allows constants which are not a multiple of 4).
Note
This named option will only work if you are using a parameters object created from a high-level program (HighLevelGpuProgram).
Parameters
nameThe name of the parameter
valPointer to the values to write
countThe number of 'multiples' of floats to write
multipleThe number of raw entries in each element to write, the default is 4 so count = 1 would write 4 floats.

◆ setNamedAutoConstant() [1/2]

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
nameThe name of the parameter
acTypeThe type of automatic constant to set
extraInfoIf the constant type needs more information (like a light index) put it here.

◆ setNamedAutoConstantReal()

void Ogre::GpuProgramParameters::setNamedAutoConstantReal ( const String name,
AutoConstantType  acType,
Real  rData 
)

◆ setNamedAutoConstant() [2/2]

void Ogre::GpuProgramParameters::setNamedAutoConstant ( const String name,
AutoConstantType  acType,
uint16  extraInfo1,
uint16  extraInfo2 
)

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
nameThe name of the parameter
acTypeThe type of automatic constant to set
extraInfo1The first extra info required by this auto constant type
extraInfo2The first extra info required by this auto constant type

◆ setNamedConstantFromTime()

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
nameThe name of the parameter
factorThe amount by which to scale the time value

◆ clearNamedAutoConstant()

void Ogre::GpuProgramParameters::clearNamedAutoConstant ( const String name)

Unbind an auto constant so that the constant is manually controlled again.

◆ _findNamedConstantDefinition()

const GpuConstantDefinition* Ogre::GpuProgramParameters::_findNamedConstantDefinition ( const String name,
bool  throwExceptionIfMissing = false 
) const

Find a constant definition for a named parameter.

Remarks
This method returns null if the named parameter did not exist, unlike getConstantDefinition which is more strict; unless you set the last parameter to true.
Parameters
nameThe name to look up
throwExceptionIfMissingIf set to true, failure to find an entry will throw an exception.

◆ _getFloatConstantPhysicalIndex()

size_t Ogre::GpuProgramParameters::_getFloatConstantPhysicalIndex ( size_t  logicalIndex,
size_t  requestedSize,
uint16  variability 
)

Gets the physical buffer index associated with a logical float constant index.

Note
Only applicable to low-level programs.
Parameters
logicalIndexThe logical parameter index
requestedSizeThe requested size - pass 0 to ignore missing entries
variabilityand return std::numeric_limits<size_t>::max()

◆ _getDoubleConstantPhysicalIndex()

size_t Ogre::GpuProgramParameters::_getDoubleConstantPhysicalIndex ( size_t  logicalIndex,
size_t  requestedSize,
uint16  variability 
)

Gets the physical buffer index associated with a logical double constant index.

Note
Only applicable to low-level programs.
Parameters
logicalIndexThe logical parameter index
requestedSizeThe requested size - pass 0 to ignore missing entries and return std::numeric_limits<size_t>::max()

◆ _getIntConstantPhysicalIndex()

size_t Ogre::GpuProgramParameters::_getIntConstantPhysicalIndex ( size_t  logicalIndex,
size_t  requestedSize,
uint16  variability 
)

Gets the physical buffer index associated with a logical int constant index.

Note
Only applicable to low-level programs.
Parameters
logicalIndexThe logical parameter index
requestedSizeThe requested size - pass 0 to ignore missing entries and return std::numeric_limits<size_t>::max()

◆ _getUnsignedIntConstantPhysicalIndex()

size_t Ogre::GpuProgramParameters::_getUnsignedIntConstantPhysicalIndex ( size_t  logicalIndex,
size_t  requestedSize,
uint16  variability 
)

Gets the physical buffer index associated with a logical unsigned int constant index.

Note
Only applicable to low-level programs.
Parameters
logicalIndexThe logical parameter index
requestedSizeThe requested size - pass 0 to ignore missing entries and return std::numeric_limits<size_t>::max()

◆ setTransposeMatrices()

void Ogre::GpuProgramParameters::setTransposeMatrices ( bool  val)
inline

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.

◆ getTransposeMatrices()

bool Ogre::GpuProgramParameters::getTransposeMatrices ( void  ) const
inline

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

◆ copyConstantsFrom()

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

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

Note
This copes the internal storage of the paarameters object and therefore can only be used for parameters objects created from the same GpuProgram. To merge parameters that match from different programs, use copyMatchingNamedConstantsFrom.

◆ copyMatchingNamedConstantsFrom()

void Ogre::GpuProgramParameters::copyMatchingNamedConstantsFrom ( const GpuProgramParameters source)

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

Remarks
This method iterates over the named constants in another parameters object and copies across the values where they match. This method is safe to use when the 2 parameters objects came from different programs, but only works for named parameters.

◆ getAutoConstantDefinition() [1/2]

static const AutoConstantDefinition* Ogre::GpuProgramParameters::getAutoConstantDefinition ( const String name)
static

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

Parameters
nameThe name of the auto constant

◆ getAutoConstantDefinition() [2/2]

static 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
idxThe auto constant index

◆ getNumAutoConstantDefinitions()

static size_t Ogre::GpuProgramParameters::getNumAutoConstantDefinitions ( void  )
static

Returns the number of auto constant definitions.

◆ incPassIterationNumber()

void Ogre::GpuProgramParameters::incPassIterationNumber ( void  )

increments the multipass number entry by 1 if it exists

◆ hasPassIterationNumber()

bool Ogre::GpuProgramParameters::hasPassIterationNumber ( ) const
inline

Does this parameters object have a pass iteration number constant?

◆ getPassIterationNumberIndex()

size_t Ogre::GpuProgramParameters::getPassIterationNumberIndex ( ) const
inline

Get the physical buffer index of the pass iteration number constant.

◆ addSharedParameters() [1/2]

void Ogre::GpuProgramParameters::addSharedParameters ( GpuSharedParametersPtr  sharedParams)

Use a set of shared parameters in this parameters object.

Remarks
Allows you to use a set of shared parameters to automatically update this parameter set.

◆ addSharedParameters() [2/2]

void Ogre::GpuProgramParameters::addSharedParameters ( const String sharedParamsName)

Use a set of shared parameters in this parameters object.

Remarks
Allows you to use a set of shared parameters to automatically update this parameter set.
Parameters
sharedParamsNameThe name of a shared parameter set as defined in GpuProgramManager

◆ isUsingSharedParameters()

bool Ogre::GpuProgramParameters::isUsingSharedParameters ( const String sharedParamsName) const

Returns whether this parameter set is using the named shared parameter set.

◆ removeSharedParameters()

void Ogre::GpuProgramParameters::removeSharedParameters ( const String sharedParamsName)

Stop using the named shared parameter set.

◆ removeAllSharedParameters()

void Ogre::GpuProgramParameters::removeAllSharedParameters ( )

Stop using all shared parameter sets.

◆ getSharedParameters()

const GpuSharedParamUsageList& Ogre::GpuProgramParameters::getSharedParameters ( ) const

Get the list of shared parameter sets.

◆ _setRenderSystemData()

void Ogre::GpuProgramParameters::_setRenderSystemData ( const Any data) const
inline

Internal method that the RenderSystem might use to store optional data.

◆ _getRenderSystemData()

const Any& Ogre::GpuProgramParameters::_getRenderSystemData ( ) const
inline

Internal method that the RenderSystem might use to store optional data.

◆ _copySharedParams()

void Ogre::GpuProgramParameters::_copySharedParams ( )

Update the parameters by copying the data from the shared parameters.

Note
This method may not actually be called if the RenderSystem supports using shared parameters directly in their own shared buffer; in which case the values should not be copied out of the shared area into the individual parameter set, but bound separately.

◆ calculateSize()

size_t Ogre::GpuProgramParameters::calculateSize ( void  ) const

◆ setNamedSubroutine()

void Ogre::GpuProgramParameters::setNamedSubroutine ( const String subroutineSlot,
const String subroutine 
)

Set subroutine name by slot name.

◆ setSubroutine()

void Ogre::GpuProgramParameters::setSubroutine ( size_t  index,
const String subroutine 
)

Set subroutine name by slot index.

◆ getSubroutineMap()

const SubroutineMap& Ogre::GpuProgramParameters::getSubroutineMap ( ) const
inline

Get map with.


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