27#ifndef _ShaderParameter_
28#define _ShaderParameter_
60 SPS_BLEND_WEIGHTS = 2,
62 SPS_BLEND_INDICES = 3,
68 SPS_TEXTURE_COORDINATES = 7,
299 SPC_CUSTOM_CONTENT_BEGIN = 1000,
300 SPC_CUSTOM_CONTENT_END = 2000
316 const Semantic& semantic,
int index,
390 const Semantic& semantic,
int index,
392 uint16 variability,
size_t size);
460 if (mParamsPtr !=
NULL)
462 mParamsPtr->_writeRawConstant(mPhysicalIndex, val);
469 if (mParamsPtr !=
NULL)
471 mParamsPtr->_writeRawConstant(mPhysicalIndex, val);
478 if (mParamsPtr !=
NULL)
480 mParamsPtr->_writeRawConstant(mPhysicalIndex, val);
487 if (mParamsPtr !=
NULL)
489 mParamsPtr->_writeRawConstants(mPhysicalIndex, val.
ptr(), 2);
496 if (mParamsPtr !=
NULL)
498 mParamsPtr->_writeRawConstant(mPhysicalIndex, val);
505 if (mParamsPtr !=
NULL)
507 mParamsPtr->_writeRawConstant(mPhysicalIndex, val);
514 if (mParamsPtr !=
NULL)
516 mParamsPtr->_writeRawConstant(mPhysicalIndex, val, 16);
523 if (mParamsPtr !=
NULL)
525 mParamsPtr->_writeRawConstants(mPhysicalIndex, val,
count *
multiple);
532 if (mParamsPtr !=
NULL)
534 mParamsPtr->_writeRawConstants(mPhysicalIndex, val,
count *
multiple);
541 if (mParamsPtr !=
NULL)
543 mParamsPtr->_writeRawConstants(mPhysicalIndex, val,
count *
multiple);
575template <
class valueType>
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Class representing colour.
Collects together the program parameters used for a GpuProgram.
AutoConstantType
Defines the types of automatically updated values that may be bound to GpuProgram parameters,...
Class encapsulating a standard 4x4 homogeneous matrix.
Helper template which is the base for our ConstParameters.
virtual String toString() const =0
ConstParameter(valueType val, GpuConstantType type, const Semantic &semantic, const Content &content)
const valueType & getValue() const
Returns the native value of this parameter.
virtual ~ConstParameter()
virtual bool isConstParameter() const
Helper utility class that creates common parameters.
static UniformParameterPtr createSampler(GpuConstantType type, int index)
static ParameterPtr createInColor(int index)
static ParameterPtr createConstParamVector2(Vector2 val)
static ParameterPtr createOutNormal(int index)
static UniformParameterPtr createSampler2DArray(int index)
static ParameterPtr createInWeights(int index)
static ParameterPtr createOutTexcoord2(int index, Parameter::Content content)
static UniformParameterPtr createUniform(GpuConstantType type, int index, uint16 variability, const String &suggestedName, size_t size)
static ParameterPtr createInTangent(int index)
static UniformParameterPtr createSampler2D(int index)
static ParameterPtr createInNormal(int index)
static UniformParameterPtr createSampler1D(int index)
static ParameterPtr createInTexcoord1(int index, Parameter::Content content)
static ParameterPtr createInTexcoord3(int index, Parameter::Content content)
static UniformParameterPtr createSampler3D(int index)
static ParameterPtr createInBiNormal(int index)
static ParameterPtr createInTexcoord4(int index, Parameter::Content content)
static ParameterPtr createConstParamVector4(Vector4 val)
static ParameterPtr createOutTexcoord3(int index, Parameter::Content content)
static ParameterPtr createInIndices(int index)
static ParameterPtr createInTexcoord2(int index, Parameter::Content content)
static ParameterPtr createOutTexcoord4(int index, Parameter::Content content)
static ParameterPtr createOutPosition(int index)
static ParameterPtr createInPosition(int index)
static UniformParameterPtr createSamplerCUBE(int index)
static ParameterPtr createOutTangent(int index)
static ParameterPtr createOutTexcoord(GpuConstantType type, int index, Parameter::Content content)
static ParameterPtr createOutBiNormal(int index)
static ParameterPtr createConstParamVector3(Vector3 val)
static ParameterPtr createOutColor(int index)
static ParameterPtr createInTexcoord(GpuConstantType type, int index, Parameter::Content content)
static ParameterPtr createOutTexcoord1(int index, Parameter::Content content)
static ParameterPtr createConstParamFloat(float val)
A class that represents a shader based program parameter.
virtual ~Parameter()
Class destructor.
void setSize(size_t size)
Sets the number of elements in the parameter (for arrays).
virtual String toString() const
Returns the string representation of this parameter.
bool isArray() const
Returns Whether this parameter is an array.
const Semantic & getSemantic() const
Get the semantic of this parameter.
@ SPC_LIGHTPOSITION_OBJECT_SPACE6
@ SPC_LIGHTDIRECTION_OBJECT_SPACE3
@ SPC_TEXTURE_COORDINATE3
@ SPC_POSTOLIGHT_VIEW_SPACE5
@ SPC_DEPTH_WORLD_SPACE
Depth in world space.
@ SPC_NORMAL_VIEW_SPACE
Normal in view space.
@ SPC_POSTOLIGHT_TANGENT_SPACE3
@ SPC_LIGHTPOSITION_WORLD_SPACE4
@ SPC_TEXTURE_COORDINATE7
@ SPC_POSTOLIGHT_TANGENT_SPACE6
@ SPC_POSTOLIGHT_TANGENT_SPACE0
Light vector in tangent space index 0-7.
@ SPC_POSTOLIGHT_WORLD_SPACE7
@ SPC_POSTOLIGHT_VIEW_SPACE0
Light vector in view space index 0-7.
@ SPC_LIGHTPOSITION_OBJECT_SPACE7
@ SPC_LIGHTDIRECTION_TANGENT_SPACE6
@ SPC_LIGHTPOSITION_WORLD_SPACE5
@ SPC_LIGHTDIRECTION_VIEW_SPACE5
@ SPC_TEXTURE_COORDINATE4
@ SPC_LIGHTPOSITION_WORLD_SPACE6
@ SPC_LIGHTPOSITION_OBJECT_SPACE3
@ SPC_TEXTURE_COORDINATE6
@ SPC_BLEND_INDICES
Blending indices.
@ SPC_LIGHTPOSITION_WORLD_SPACE2
@ SPC_POSTOCAMERA_VIEW_SPACE
View vector in view space.
@ SPC_LIGHTDIRECTION_VIEW_SPACE3
@ SPC_LIGHTPOSITION_OBJECT_SPACE4
@ SPC_POSITION_LIGHT_SPACE4
@ SPC_POSITION_LIGHT_SPACE2
@ SPC_LIGHTDIRECTION_WORLD_SPACE6
@ SPC_POSTOLIGHT_WORLD_SPACE6
@ SPC_BINORMAL_WORLD_SPACE
Binormal in world space.
@ SPC_POSTOLIGHT_OBJECT_SPACE6
@ SPC_POSTOLIGHT_WORLD_SPACE5
@ SPC_POSTOLIGHT_OBJECT_SPACE0
Light vector in object space index 0-7.
@ SPC_POSTOLIGHT_VIEW_SPACE7
@ SPC_POSITION_LIGHT_SPACE1
@ SPC_POSTOCAMERA_WORLD_SPACE
View vector in world space.
@ SPC_POSITION_LIGHT_SPACE6
@ SPC_POSTOLIGHT_OBJECT_SPACE1
@ SPC_POSITION_LIGHT_SPACE3
@ SPC_POSTOLIGHT_TANGENT_SPACE5
@ SPC_POSTOLIGHT_TANGENT_SPACE1
@ SPC_POSITION_WORLD_SPACE
Position in world space.
@ SPC_POSTOLIGHT_OBJECT_SPACE5
@ SPC_LIGHTPOSITIONVIEW_SPACE7
@ SPC_NORMAL_OBJECT_SPACE
Normal in object space.
@ SPC_LIGHTDIRECTION_WORLD_SPACE2
@ SPC_POSTOLIGHT_OBJECT_SPACE4
@ SPC_LIGHTDIRECTION_VIEW_SPACE6
@ SPC_LIGHTDIRECTION_TANGENT_SPACE4
@ SPC_LIGHTPOSITION_OBJECT_SPACE5
@ SPC_LIGHTDIRECTION_TANGENT_SPACE1
@ SPC_TANGENT_WORLD_SPACE
Tangent in world space.
@ SPC_POSTOLIGHT_WORLD_SPACE3
@ SPC_LIGHTPOSITION_OBJECT_SPACE1
@ SPC_LIGHTDIRECTION_OBJECT_SPACE1
@ SPC_LIGHTDIRECTION_OBJECT_SPACE7
@ SPC_POSITION_LIGHT_SPACE7
@ SPC_LIGHTPOSITION_WORLD_SPACE7
@ SPC_BINORMAL_OBJECT_SPACE
Binormal in object space.
@ SPC_LIGHTDIRECTION_VIEW_SPACE4
@ SPC_LIGHTDIRECTION_TANGENT_SPACE3
@ SPC_LIGHTPOSITIONVIEW_SPACE1
@ SPC_POSTOLIGHT_VIEW_SPACE1
@ SPC_POSTOLIGHT_OBJECT_SPACE7
@ SPC_POSTOLIGHT_WORLD_SPACE0
Light vector in world space index 0-7.
@ SPC_POSITION_VIEW_SPACE
Position in view space.
@ SPC_TEXTURE_COORDINATE1
@ SPC_LIGHTDIRECTION_WORLD_SPACE4
@ SPC_POSTOLIGHT_TANGENT_SPACE7
@ SPC_LIGHTPOSITIONVIEW_SPACE2
@ SPC_LIGHTPOSITIONVIEW_SPACE6
@ SPC_NORMAL_TANGENT_SPACE
Normal in tangent space.
@ SPC_LIGHTPOSITIONVIEW_SPACE0
Light position in view space index 0-7.
@ SPC_LIGHTDIRECTION_TANGENT_SPACE5
@ SPC_LIGHTPOSITIONVIEW_SPACE3
@ SPC_BLEND_WEIGHTS
Blending weights.
@ SPC_UNKNOWN
Unknown content.
@ SPC_POSTOLIGHT_OBJECT_SPACE3
@ SPC_POSTOLIGHT_VIEW_SPACE3
@ SPC_DEPTH_PROJECTIVE_SPACE
Depth in projective space.
@ SPC_LIGHTPOSITION_OBJECT_SPACE0
Light position in object space index 0-7.
@ SPC_DEPTH_VIEW_SPACE
Depth in view space.
@ SPC_LIGHTDIRECTION_OBJECT_SPACE6
@ SPC_LIGHTDIRECTION_VIEW_SPACE7
@ SPC_POSTOLIGHT_VIEW_SPACE4
@ SPC_POSTOCAMERA_OBJECT_SPACE
View vector in object space.
@ SPC_LIGHTDIRECTION_OBJECT_SPACE5
@ SPC_POSTOLIGHT_WORLD_SPACE1
@ SPC_LIGHTDIRECTION_OBJECT_SPACE2
@ SPC_LIGHTPOSITION_WORLD_SPACE0
Light position in world space index 0-7.
@ SPC_LIGHTDIRECTION_WORLD_SPACE7
@ SPC_POSTOCAMERA_TANGENT_SPACE
View vector in tangent space.
@ SPC_LIGHTDIRECTION_TANGENT_SPACE7
@ SPC_TANGENT_TANGENT_SPACE
Tangent in tangent space.
@ SPC_LIGHTPOSITION_OBJECT_SPACE2
@ SPC_LIGHTDIRECTION_VIEW_SPACE1
@ SPC_POSITION_PROJECTIVE_SPACE
Position in projective space.
@ SPC_LIGHTDIRECTION_VIEW_SPACE2
@ SPC_POSTOLIGHT_TANGENT_SPACE2
@ SPC_LIGHTPOSITION_TANGENT_SPACE
Light position in tangent space index 0-7.
@ SPC_TEXTURE_COORDINATE0
Texture coordinate set index 0-7.
@ SPC_LIGHTPOSITION_WORLD_SPACE3
@ SPC_LIGHTDIRECTION_TANGENT_SPACE0
Light direction in tangent space index 0-7.
@ SPC_POSITION_OBJECT_SPACE
Position in object space.
@ SPC_TANGENT_OBJECT_SPACE
Tangent in object space.
@ SPC_LIGHTDIRECTION_WORLD_SPACE0
Light direction in world space index 0-7.
@ SPC_LIGHTPOSITIONVIEW_SPACE4
@ SPC_TANGENT_VIEW_SPACE
Tangent in view space.
@ SPC_LIGHTPOSITIONVIEW_SPACE5
@ SPC_POSTOLIGHT_WORLD_SPACE4
@ SPC_POSTOLIGHT_WORLD_SPACE2
@ SPC_NORMAL_WORLD_SPACE
Normal in world space.
@ SPC_LIGHTDIRECTION_WORLD_SPACE1
@ SPC_LIGHTDIRECTION_OBJECT_SPACE0
Light direction in object space index 0-7.
@ SPC_TEXTURE_COORDINATE5
@ SPC_LIGHTDIRECTION_WORLD_SPACE3
@ SPC_COLOR_SPECULAR
Specular color.
@ SPC_LIGHTPOSITION_WORLD_SPACE1
@ SPC_LIGHTDIRECTION_VIEW_SPACE0
Light direction in view space index 0-7.
@ SPC_COLOR_DIFFUSE
Diffuse color.
@ SPC_LIGHTDIRECTION_WORLD_SPACE5
@ SPC_BINORMAL_TANGENT_SPACE
Binormal in tangent space.
@ SPC_DEPTH_OBJECT_SPACE
Depth in object space.
@ SPC_POSTOLIGHT_TANGENT_SPACE4
@ SPC_POSTOLIGHT_VIEW_SPACE6
@ SPC_POSITION_LIGHT_SPACE5
@ SPC_LIGHTDIRECTION_TANGENT_SPACE2
@ SPC_BINORMAL_VIEW_SPACE
Binormal in view space.
@ SPC_POSTOLIGHT_VIEW_SPACE2
@ SPC_TEXTURE_COORDINATE2
@ SPC_POSITION_LIGHT_SPACE0
Position in light space index 0-7.
@ SPC_LIGHTDIRECTION_OBJECT_SPACE4
@ SPC_POSTOLIGHT_OBJECT_SPACE2
const String & getName() const
Get the name of this parameter.
int getIndex() const
Get the index of this parameter.
virtual bool isConstParameter() const
Returns true if this instance is a ConstParameter otherwise false.
GpuConstantType getType() const
Get the type of this parameter.
Parameter(GpuConstantType type, const String &name, const Semantic &semantic, int index, const Content &content, size_t size=0)
Class constructor.
Content getContent() const
Return the content of this parameter.
size_t getSize() const
Returns the number of elements in the parameter (for arrays).
Reference-counted shared pointer, used for objects where implicit destruction is required.
Standard 2-dimensional vector.
Real * ptr()
Pointer accessor for direct copying.
Standard 3-dimensional vector.
4-dimensional homogeneous vector.
GpuConstantType
Enumeration of the types of constant we may encounter in programs.
ShaderParameterList::iterator ShaderParameterIterator
UniformParameterList::const_iterator UniformParameterConstIterator
UniformParameterList::iterator UniformParameterIterator
vector< ParameterPtr >::type ShaderParameterList
vector< UniformParameterPtr >::type UniformParameterList
SharedPtr< Parameter > ParameterPtr
ShaderParameterList::const_iterator ShaderParameterConstIterator
SharedPtr< UniformParameter > UniformParameterPtr