#include <OgreGpuProgram.h>
Public Types | |
typedef VectorIterator< RealConstantList > | RealConstantIterator |
typedef VectorIterator< IntConstantList > | IntConstantIterator |
typedef VectorIterator< AutoConstantList > | AutoConstantIterator |
enum | AutoConstantType { ACT_WORLD_MATRIX, ACT_VIEW_MATRIX, ACT_PROJECTION_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_OBJECT_SPACE, ACT_LIGHT_DIRECTION_OBJECT_SPACE, ACT_CAMERA_POSITION_OBJECT_SPACE, ACT_AMBIENT_LIGHT_COLOUR } |
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 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) |
Gets an iterator over the Real constant parameters. | |
IntConstantIterator | getIntConstantIterator (void) |
Gets an iterator over the integer constant parameters. | |
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) |
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 | 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 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) const |
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. | |
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? |
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 243 of file OgreGpuProgram.h. Referenced by getAutoConstantIterator(). |
|
Definition at line 132 of file OgreGpuProgram.h. |
|
Definition at line 206 of file OgreGpuProgram.h. Referenced by getIntConstantIterator(). |
|
Definition at line 130 of file OgreGpuProgram.h. |
|
Mapping from parameter names to indexes - high-level programs are expected to populate this.
Definition at line 140 of file OgreGpuProgram.h. |
|
Definition at line 205 of file OgreGpuProgram.h. Referenced by getRealConstantIterator(). |
|
Definition at line 129 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 90 of file OgreGpuProgram.cpp. |
|
Definition at line 147 of file OgreGpuProgram.h. |
|
Internal method for associating a parameter name with an index.
Definition at line 264 of file OgreGpuProgram.cpp. References mParamNameMap. |
|
Updates the automatic parameters for lights based on the details provided.
Definition at line 222 of file OgreGpuProgram.cpp. References ACT_LIGHT_ATTENUATION, ACT_LIGHT_DIFFUSE_COLOUR, ACT_LIGHT_DIRECTION_OBJECT_SPACE, ACT_LIGHT_POSITION_OBJECT_SPACE, ACT_LIGHT_SPECULAR_COLOUR, Ogre::Light::getAttenuationConstant(), Ogre::Light::getAttenuationLinear(), Ogre::Light::getAttenuationQuadric(), Ogre::Light::getAttenuationRange(), Ogre::Light::getDerivedDirection(), Ogre::Light::getDerivedPosition(), Ogre::Light::getDiffuseColour(), Ogre::AutoParamDataSource::getInverseWorldMatrix(), Ogre::AutoParamDataSource::getLight(), Ogre::Light::getSpecularColour(), hasAutoConstants(), mAutoConstants, Ogre::Vector3::normalise(), setConstant(), Ogre::Vector4::w, Ogre::Vector4::x, Ogre::Vector3::x, Ogre::Vector4::y, Ogre::Vector3::y, Ogre::Vector4::z, and Ogre::Vector3::z. |
|
Updates the automatic parameters (except lights) based on the details provided.
Definition at line 178 of file OgreGpuProgram.cpp. References ACT_AMBIENT_LIGHT_COLOUR, ACT_CAMERA_POSITION_OBJECT_SPACE, ACT_INVERSE_WORLD_MATRIX, ACT_INVERSE_WORLDVIEW_MATRIX, ACT_PROJECTION_MATRIX, ACT_VIEW_MATRIX, ACT_WORLD_MATRIX, ACT_WORLDVIEW_MATRIX, ACT_WORLDVIEWPROJ_MATRIX, Ogre::AutoParamDataSource::getAmbientLightColour(), Ogre::AutoParamDataSource::getCameraPositionObjectSpace(), Ogre::AutoParamDataSource::getInverseWorldMatrix(), Ogre::AutoParamDataSource::getInverseWorldViewMatrix(), Ogre::AutoParamDataSource::getProjectionMatrix(), Ogre::AutoParamDataSource::getViewMatrix(), Ogre::AutoParamDataSource::getWorldMatrix(), Ogre::AutoParamDataSource::getWorldViewMatrix(), Ogre::AutoParamDataSource::getWorldViewProjMatrix(), hasAutoConstants(), mAutoConstants, and setConstant(). |
|
Clears all the existing automatic constants.
Definition at line 168 of file OgreGpuProgram.cpp. References mAutoConstants. |
|
Gets an iterator over the automatic constant bindings currently in place.
Definition at line 173 of file OgreGpuProgram.cpp. References AutoConstantIterator, and mAutoConstants. |
|
Gets the number of int constants that have been set.
Definition at line 215 of file OgreGpuProgram.h. |
|
Gets an iterator over the integer constant parameters.
Definition at line 343 of file OgreGpuProgram.cpp. References IntConstantIterator, and mIntConstants. |
|
Gets the constant index associated with a named parameter.
Definition at line 270 of file OgreGpuProgram.cpp. References Except, and mParamNameMap. Referenced by setNamedAutoConstant(), setNamedConstant(), and setNamedConstantFromTime(). |
|
Gets the number of Real constants that have been set.
Definition at line 213 of file OgreGpuProgram.h. |
|
Gets an iterator over the Real constant parameters.
Definition at line 338 of file OgreGpuProgram.cpp. References mRealConstants, and RealConstantIterator. |
|
Gets whether or not matrices are to be transposed when set.
Definition at line 404 of file OgreGpuProgram.h. |
|
Returns true if this instance has any automatic constants.
Definition at line 247 of file OgreGpuProgram.h. Referenced by _updateAutoParamsLightsOnly(), and _updateAutoParamsNoLights(). |
|
Returns true if there are any int constants contained here.
Definition at line 219 of file OgreGpuProgram.h. |
|
Returns true if there are any Real constants contained here.
Definition at line 217 of file OgreGpuProgram.h. |
|
Deletes the contents of the int constants registers.
Definition at line 203 of file OgreGpuProgram.h. |
|
Deletes the contents of the Real constants registers.
Definition at line 201 of file OgreGpuProgram.h. |
|
Sets up a constant which will automatically be updated by the system.
Definition at line 163 of file OgreGpuProgram.cpp. References mAutoConstants. Referenced by setNamedAutoConstant(). |
|
Sets a multiple value constant integer parameter to the program.
Definition at line 147 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 125 of file OgreGpuProgram.cpp. References setConstant(), and Ogre::ColourValue::val. |
|
Sets a multiple value constant floating-point parameter to the program.
Definition at line 130 of file OgreGpuProgram.cpp. References Ogre::GpuProgramParameters::RealConstantEntry::isSet, mRealConstants, Ogre::Real, and Ogre::GpuProgramParameters::RealConstantEntry::val. |
|
Sets a Matrix4 parameter to the program.
Definition at line 105 of file OgreGpuProgram.cpp. References Ogre::Matrix4::transpose(). |
|
Sets a 4-element floating-point parameter to the program via Vector3.
Definition at line 100 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 95 of file OgreGpuProgram.cpp. References Ogre::Vector4::val. Referenced by _updateAutoParamsLightsOnly(), _updateAutoParamsNoLights(), setConstant(), and setNamedConstant(). |
|
Sets a named parameter up to track a derivation of the current time.
Definition at line 326 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 321 of file OgreGpuProgram.cpp. References getParamIndex(), and setAutoConstant(). |
|
Sets a multiple value constant integer parameter to the program.
Definition at line 316 of file OgreGpuProgram.cpp. References getParamIndex(), and setConstant(). |
|
Sets a ColourValue parameter to the program.
Definition at line 311 of file OgreGpuProgram.cpp. References getParamIndex(), and setConstant(). |
|
Sets a multiple value constant floating-point parameter to the program.
Definition at line 306 of file OgreGpuProgram.cpp. References getParamIndex(), Ogre::Real, and setConstant(). |
|
Sets a Matrix4 parameter to the program.
Definition at line 301 of file OgreGpuProgram.cpp. References getParamIndex(), and setConstant(). |
|
Sets a Vector3 parameter to the program.
Definition at line 296 of file OgreGpuProgram.cpp. References getParamIndex(), and setConstant(). |
|
Sets a Vector4 parameter to the program.
Definition at line 291 of file OgreGpuProgram.cpp. References getParamIndex(), and setConstant(). |
|
Sets a single value constant integer parameter to the program.
Definition at line 286 of file OgreGpuProgram.cpp. References getParamIndex(), and setConstant(). |
|
Sets a single value constant floating-point parameter to the program.
Definition at line 281 of file OgreGpuProgram.cpp. References getParamIndex(), Ogre::Real, and setConstant(). |
|
Sets a named parameter up to track a derivation of the current time.
Definition at line 333 of file OgreGpuProgram.cpp. References getParamIndex(), Ogre::Real, and setConstantFromTime(). |
|
Sets whether or not we need to transpose the matrices passed in from the rest of OGRE.
Definition at line 402 of file OgreGpuProgram.h. |
|
List of automatically updated parameters.
Definition at line 138 of file OgreGpuProgram.h. Referenced by _updateAutoParamsLightsOnly(), _updateAutoParamsNoLights(), clearAutoConstants(), getAutoConstantIterator(), and setAutoConstant(). |
|
Packed list of integer constants.
Definition at line 136 of file OgreGpuProgram.h. Referenced by getIntConstantIterator(), and setConstant(). |
|
Definition at line 141 of file OgreGpuProgram.h. Referenced by _mapParameterNameToIndex(), and getParamIndex(). |
|
Packed list of floating-point constants.
Definition at line 134 of file OgreGpuProgram.h. Referenced by getRealConstantIterator(), and setConstant(). |
|
Do we need to transpose matrices?
Definition at line 143 of file OgreGpuProgram.h. |
Copyright © 2002-2003 by The OGRE Team
Last modified Wed Jan 21 00:17:26 2004