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

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.