#include <OgreGpuProgram.h>
Public Types | |
typedef ConstVectorIterator< RealConstantList > | RealConstantIterator |
typedef ConstVectorIterator< IntConstantList > | IntConstantIterator |
typedef ConstVectorIterator< AutoConstantList > | AutoConstantIterator |
enum | AutoConstantType { ACT_WORLD_MATRIX, ACT_WORLD_MATRIX_ARRAY_3x4, ACT_WORLD_MATRIX_ARRAY, ACT_VIEW_MATRIX, ACT_PROJECTION_MATRIX, ACT_VIEWPROJ_MATRIX, ACT_WORLDVIEW_MATRIX, ACT_WORLDVIEWPROJ_MATRIX, ACT_INVERSE_WORLD_MATRIX, ACT_INVERSE_WORLDVIEW_MATRIX, ACT_LIGHT_DIFFUSE_COLOUR, ACT_LIGHT_SPECULAR_COLOUR, ACT_LIGHT_ATTENUATION, ACT_LIGHT_POSITION, ACT_LIGHT_DIRECTION, ACT_LIGHT_POSITION_OBJECT_SPACE, ACT_LIGHT_DIRECTION_OBJECT_SPACE, ACT_LIGHT_DISTANCE_OBJECT_SPACE, ACT_SHADOW_EXTRUSION_DISTANCE, ACT_CAMERA_POSITION_OBJECT_SPACE, ACT_AMBIENT_LIGHT_COLOUR, ACT_TEXTURE_VIEWPROJ_MATRIX, ACT_CUSTOM } |
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... | |
Public Methods | |
GpuProgramParameters () | |
~GpuProgramParameters () | |
void | setConstant (size_t index, const Vector4 &vec) |
Sets a 4-element floating-point parameter to the program. | |
void | setConstant (size_t index, const Vector3 &vec) |
Sets a 4-element floating-point parameter to the program via Vector3. | |
void | setConstant (size_t index, const Matrix4 &m) |
Sets a Matrix4 parameter to the program. | |
void | setConstant (size_t index, const Matrix4 *m, size_t numEntries) |
Sets a list of Matrix4 parameters to the program. | |
void | setConstant (size_t index, const Real *val, size_t count) |
Sets a multiple value constant floating-point parameter to the program. | |
void | setConstant (size_t index, const ColourValue &colour) |
Sets a ColourValue parameter to the program. | |
void | setConstant (size_t index, const int *val, size_t count) |
Sets a multiple value constant integer parameter to the program. | |
void | resetRealConstants (void) |
Deletes the contents of the Real constants registers. | |
void | resetIntConstants (void) |
Deletes the contents of the int constants registers. | |
RealConstantIterator | getRealConstantIterator (void) const |
Gets an iterator over the Real constant parameters. | |
IntConstantIterator | getIntConstantIterator (void) const |
Gets an iterator over the integer constant parameters. | |
RealConstantEntry * | getRealConstantEntry (const size_t index) |
Gets a specific Real Constant entry if index is in valid range otherwise returns a NULL. | |
IntConstantEntry * | getIntConstantEntry (const size_t index) |
Gets a specific Int Constant entry if index is in valid range otherwise returns a NULL. | |
RealConstantEntry * | getNamedRealConstantEntry (const String &name) |
Gets a Named Real Constant entry if the name is found otherwise returns a NULL. | |
IntConstantEntry * | getNamedIntConstantEntry (const String &name) |
Gets a named Int Constant entry if name is found otherwise returns a NULL. | |
size_t | getRealConstantCount (void) const |
Gets the number of Real constants that have been set. | |
size_t | getIntConstantCount (void) const |
Gets the number of int constants that have been set. | |
bool | hasRealConstantParams (void) const |
Returns true if there are any Real constants contained here. | |
bool | hasIntConstantParams (void) const |
Returns true if there are any int constants contained here. | |
void | setAutoConstant (size_t index, AutoConstantType acType, size_t extraInfo=0) |
Sets up a constant which will automatically be updated by the system. | |
void | setConstantFromTime (size_t index, Real factor) |
Sets a named parameter up to track a derivation of the current time. | |
void | clearAutoConstants (void) |
Clears all the existing automatic constants. | |
AutoConstantIterator | getAutoConstantIterator (void) const |
Gets an iterator over the automatic constant bindings currently in place. | |
bool | hasAutoConstants (void) const |
Returns true if this instance has any automatic constants. | |
void | _updateAutoParamsNoLights (const AutoParamDataSource &source) |
Updates the automatic parameters (except lights) based on the details provided. | |
void | _updateAutoParamsLightsOnly (const AutoParamDataSource &source) |
Updates the automatic parameters for lights based on the details provided. | |
void | setAutoAddParamName (bool state) |
Sets the auto add parameter name flag. | |
void | setNamedConstant (const String &name, Real val) |
Sets a single value constant floating-point parameter to the program. | |
void | setNamedConstant (const String &name, int val) |
Sets a single value constant integer parameter to the program. | |
void | setNamedConstant (const String &name, const Vector4 &vec) |
Sets a Vector4 parameter to the program. | |
void | setNamedConstant (const String &name, const Vector3 &vec) |
Sets a Vector3 parameter to the program. | |
void | setNamedConstant (const String &name, const Matrix4 &m) |
Sets a Matrix4 parameter to the program. | |
void | setNamedConstant (const String &name, const Matrix4 *m, size_t numEntries) |
Sets a list of Matrix4 parameters to the program. | |
void | setNamedConstant (const String &name, const Real *val, size_t count) |
Sets a multiple value constant floating-point parameter to the program. | |
void | setNamedConstant (const String &name, const ColourValue &colour) |
Sets a ColourValue parameter to the program. | |
void | setNamedConstant (const String &name, const int *val, size_t count) |
Sets a multiple value constant integer parameter to the program. | |
void | setNamedAutoConstant (const String &name, AutoConstantType acType, size_t extraInfo=0) |
Sets up a constant which will automatically be updated by the system. | |
void | setNamedConstantFromTime (const String &name, Real factor) |
Sets a named parameter up to track a derivation of the current time. | |
void | _mapParameterNameToIndex (const String &name, size_t index) |
Internal method for associating a parameter name with an index. | |
size_t | getParamIndex (const String &name) |
Gets the constant index associated with a named parameter. | |
void | setTransposeMatrices (bool val) |
Sets whether or not we need to transpose the matrices passed in from the rest of OGRE. | |
bool | getTransposeMatrices (void) const |
Gets whether or not matrices are to be transposed when set. | |
void | copyConstantsFrom (const GpuProgramParameters &source) |
Copies the values of all constants (including auto constants) from another GpuProgramParameters object. | |
Protected Types | |
typedef std::vector< RealConstantEntry > | RealConstantList |
typedef std::vector< IntConstantEntry > | IntConstantList |
typedef std::vector< AutoConstantEntry > | AutoConstantList |
typedef std::map< String, size_t > | ParamNameMap |
Mapping from parameter names to indexes - high-level programs are expected to populate this. | |
Protected Attributes | |
RealConstantList | mRealConstants |
Packed list of floating-point constants. | |
IntConstantList | mIntConstants |
Packed list of integer constants. | |
AutoConstantList | mAutoConstants |
List of automatically updated parameters. | |
ParamNameMap | mParamNameMap |
bool | mTransposeMatrices |
Do we need to transpose matrices? | |
bool | mAutoAddParamName |
flag to indicate if names not found will be automatically added |
GpuProgramParameters objects should be created through the GpuProgramManager and may be shared between multiple GpuProgram instances. For this reason they are managed using a shared pointer, which will ensure they are automatically deleted when no program is using them anymore.
Definition at line 55 of file OgreGpuProgram.h.
|
Definition at line 295 of file OgreGpuProgram.h. Referenced by copyConstantsFrom(), and getAutoConstantIterator(). |
|
Definition at line 155 of file OgreGpuProgram.h. |
|
Definition at line 239 of file OgreGpuProgram.h. Referenced by copyConstantsFrom(), and getIntConstantIterator(). |
|
Definition at line 153 of file OgreGpuProgram.h. |
|
Mapping from parameter names to indexes - high-level programs are expected to populate this.
Definition at line 163 of file OgreGpuProgram.h. |
|
Definition at line 238 of file OgreGpuProgram.h. Referenced by copyConstantsFrom(), and getRealConstantIterator(). |
|
Definition at line 152 of file OgreGpuProgram.h. |
|
Defines the types of automatically updated values that may be bound to GpuProgram parameters, or used to modify parameters on a per-object basis.
Definition at line 61 of file OgreGpuProgram.h. |
|
Definition at line 116 of file OgreGpuProgram.cpp. |
|
Definition at line 172 of file OgreGpuProgram.h. |
|
Internal method for associating a parameter name with an index.
Definition at line 365 of file OgreGpuProgram.cpp. References mParamNameMap, and Ogre::String. Referenced by getParamIndex(). |
|
|
|
Clears all the existing automatic constants.
Definition at line 219 of file OgreGpuProgram.cpp. References mAutoConstants. Referenced by copyConstantsFrom(). |
|
Copies the values of all constants (including auto constants) from another GpuProgramParameters object.
Definition at line 537 of file OgreGpuProgram.cpp. References AutoConstantIterator, clearAutoConstants(), Ogre::GpuProgramParameters::AutoConstantEntry::data, getAutoConstantIterator(), getIntConstantIterator(), getRealConstantIterator(), Ogre::GpuProgramParameters::AutoConstantEntry::index, IntConstantIterator, Ogre::GpuProgramParameters::IntConstantEntry::isSet, Ogre::GpuProgramParameters::RealConstantEntry::isSet, mParamNameMap, Ogre::GpuProgramParameters::AutoConstantEntry::paramType, RealConstantIterator, setAutoConstant(), setConstant(), Ogre::ushort, Ogre::GpuProgramParameters::IntConstantEntry::val, and Ogre::GpuProgramParameters::RealConstantEntry::val. |
|
Gets an iterator over the automatic constant bindings currently in place.
Definition at line 224 of file OgreGpuProgram.cpp. References AutoConstantIterator, and mAutoConstants. Referenced by copyConstantsFrom(). |
|
Gets the number of int constants that have been set.
Definition at line 267 of file OgreGpuProgram.h. |
|
Gets a specific Int Constant entry if index is in valid range otherwise returns a NULL.
Definition at line 486 of file OgreGpuProgram.cpp. References mIntConstants. Referenced by getNamedIntConstantEntry(). |
|
Gets an iterator over the integer constant parameters.
Definition at line 467 of file OgreGpuProgram.cpp. References IntConstantIterator, and mIntConstants. Referenced by copyConstantsFrom(). |
|
Gets a named Int Constant entry if name is found otherwise returns a NULL.
Definition at line 518 of file OgreGpuProgram.cpp. References getIntConstantEntry(), mParamNameMap, and Ogre::String. |
|
Gets a Named Real Constant entry if the name is found otherwise returns a NULL.
Definition at line 499 of file OgreGpuProgram.cpp. References getRealConstantEntry(), mParamNameMap, and Ogre::String. |
|
Gets the constant index associated with a named parameter.
Definition at line 371 of file OgreGpuProgram.cpp. References _mapParameterNameToIndex(), Except, mIntConstants, mParamNameMap, mRealConstants, and Ogre::String. Referenced by setNamedAutoConstant(), setNamedConstant(), and setNamedConstantFromTime(). |
|
Gets the number of Real constants that have been set.
Definition at line 265 of file OgreGpuProgram.h. |
|
Gets a specific Real Constant entry if index is in valid range otherwise returns a NULL.
Definition at line 473 of file OgreGpuProgram.cpp. References mRealConstants. Referenced by getNamedRealConstantEntry(). |
|
Gets an iterator over the Real constant parameters.
Definition at line 462 of file OgreGpuProgram.cpp. References mRealConstants, and RealConstantIterator. Referenced by copyConstantsFrom(). |
|
Gets whether or not matrices are to be transposed when set.
Definition at line 478 of file OgreGpuProgram.h. |
|
Returns true if this instance has any automatic constants.
Definition at line 299 of file OgreGpuProgram.h. Referenced by _updateAutoParamsLightsOnly(), and _updateAutoParamsNoLights(). |
|
Returns true if there are any int constants contained here.
Definition at line 271 of file OgreGpuProgram.h. |
|
Returns true if there are any Real constants contained here.
Definition at line 269 of file OgreGpuProgram.h. |
|
Deletes the contents of the int constants registers.
Definition at line 236 of file OgreGpuProgram.h. |
|
Deletes the contents of the Real constants registers.
Definition at line 234 of file OgreGpuProgram.h. |
|
Sets the auto add parameter name flag.
Definition at line 316 of file OgreGpuProgram.h. |
|
Sets up a constant which will automatically be updated by the system.
Definition at line 214 of file OgreGpuProgram.cpp. References mAutoConstants. Referenced by copyConstantsFrom(), and setNamedAutoConstant(). |
|
Sets a multiple value constant integer parameter to the program.
Definition at line 198 of file OgreGpuProgram.cpp. References Ogre::GpuProgramParameters::IntConstantEntry::isSet, mIntConstants, and Ogre::GpuProgramParameters::IntConstantEntry::val. |
|
Sets a ColourValue parameter to the program.
Definition at line 176 of file OgreGpuProgram.cpp. References setConstant(), and Ogre::ColourValue::val. |
|
Sets a multiple value constant floating-point parameter to the program.
Definition at line 181 of file OgreGpuProgram.cpp. References Ogre::GpuProgramParameters::RealConstantEntry::isSet, mRealConstants, Ogre::Real, and Ogre::GpuProgramParameters::RealConstantEntry::val. |
|
Sets a list of Matrix4 parameters to the program.
Definition at line 151 of file OgreGpuProgram.cpp. References Ogre::Matrix4::transpose(). |
|
Sets a Matrix4 parameter to the program.
Definition at line 131 of file OgreGpuProgram.cpp. References Ogre::Matrix4::transpose(). |
|
Sets a 4-element floating-point parameter to the program via Vector3.
Definition at line 126 of file OgreGpuProgram.cpp. References setConstant(), Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z. |
|
Sets a 4-element floating-point parameter to the program.
Definition at line 121 of file OgreGpuProgram.cpp. References Ogre::Vector4::val. Referenced by _updateAutoParamsLightsOnly(), _updateAutoParamsNoLights(), Ogre::TerrainRenderable::_updateCustomGpuParameter(), Ogre::Renderable::_updateCustomGpuParameter(), copyConstantsFrom(), setConstant(), setNamedConstant(), and Ogre::FloatGpuParameterControllerValue::setValue(). |
|
Sets a named parameter up to track a derivation of the current time.
Definition at line 450 of file OgreGpuProgram.cpp. References Ogre::Real. Referenced by setNamedConstantFromTime(). |
|
Sets up a constant which will automatically be updated by the system.
Definition at line 445 of file OgreGpuProgram.cpp. References getParamIndex(), setAutoConstant(), and Ogre::String. |
|
Sets a multiple value constant integer parameter to the program.
Definition at line 440 of file OgreGpuProgram.cpp. References getParamIndex(), setConstant(), and Ogre::String. |
|
Sets a ColourValue parameter to the program.
Definition at line 435 of file OgreGpuProgram.cpp. References getParamIndex(), setConstant(), and Ogre::String. |
|
Sets a multiple value constant floating-point parameter to the program.
Definition at line 430 of file OgreGpuProgram.cpp. References getParamIndex(), Ogre::Real, setConstant(), and Ogre::String. |
|
Sets a list of Matrix4 parameters to the program.
Definition at line 424 of file OgreGpuProgram.cpp. References getParamIndex(), setConstant(), and Ogre::String. |
|
Sets a Matrix4 parameter to the program.
Definition at line 419 of file OgreGpuProgram.cpp. References getParamIndex(), setConstant(), and Ogre::String. |
|
Sets a Vector3 parameter to the program.
Definition at line 414 of file OgreGpuProgram.cpp. References getParamIndex(), setConstant(), and Ogre::String. |
|
Sets a Vector4 parameter to the program.
Definition at line 409 of file OgreGpuProgram.cpp. References getParamIndex(), setConstant(), and Ogre::String. |
|
Sets a single value constant integer parameter to the program.
Definition at line 404 of file OgreGpuProgram.cpp. References getParamIndex(), setConstant(), and Ogre::String. |
|
Sets a single value constant floating-point parameter to the program.
Definition at line 399 of file OgreGpuProgram.cpp. References getParamIndex(), Ogre::Real, setConstant(), and Ogre::String. |
|
Sets a named parameter up to track a derivation of the current time.
Definition at line 457 of file OgreGpuProgram.cpp. References getParamIndex(), Ogre::Real, setConstantFromTime(), and Ogre::String. |
|
Sets whether or not we need to transpose the matrices passed in from the rest of OGRE.
Definition at line 476 of file OgreGpuProgram.h. |
|
flag to indicate if names not found will be automatically added
Definition at line 168 of file OgreGpuProgram.h. |
|
List of automatically updated parameters.
Definition at line 161 of file OgreGpuProgram.h. Referenced by _updateAutoParamsLightsOnly(), _updateAutoParamsNoLights(), clearAutoConstants(), getAutoConstantIterator(), and setAutoConstant(). |
|
Packed list of integer constants.
Definition at line 159 of file OgreGpuProgram.h. Referenced by getIntConstantEntry(), getIntConstantIterator(), getParamIndex(), and setConstant(). |
|
Definition at line 164 of file OgreGpuProgram.h. Referenced by _mapParameterNameToIndex(), copyConstantsFrom(), getNamedIntConstantEntry(), getNamedRealConstantEntry(), and getParamIndex(). |
|
Packed list of floating-point constants.
Definition at line 157 of file OgreGpuProgram.h. Referenced by getParamIndex(), getRealConstantEntry(), getRealConstantIterator(), and setConstant(). |
|
Do we need to transpose matrices?
Definition at line 166 of file OgreGpuProgram.h. |
Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:50:59 2004