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);
432 bool isFloat()
const;
435 bool isSampler()
const;
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)
592 const valueType&
getValue()
const {
return mValue; }
602 virtual String toString()
const = 0;
616 static ParameterPtr createInPosition(
int index);
617 static ParameterPtr createOutPosition(
int index);
619 static ParameterPtr createInNormal(
int index);
620 static ParameterPtr createInWeights(
int index);
621 static ParameterPtr createInIndices(
int index);
622 static ParameterPtr createOutNormal(
int index);
623 static ParameterPtr createInBiNormal(
int index);
624 static ParameterPtr createOutBiNormal(
int index);
625 static ParameterPtr createInTangent(
int index);
626 static ParameterPtr createOutTangent(
int index);
627 static ParameterPtr createInColor(
int index);
628 static ParameterPtr createOutColor(
int index);
641 static ParameterPtr createConstParamVector2(
Vector2 val);
642 static ParameterPtr createConstParamVector3(
Vector3 val);
643 static ParameterPtr createConstParamVector4(
Vector4 val);
644 static ParameterPtr createConstParamFloat(
float val);
646 static UniformParameterPtr createSampler(
GpuConstantType type,
int index);
647 static UniformParameterPtr createSampler1D(
int index);
648 static UniformParameterPtr createSampler2D(
int index);
649 static UniformParameterPtr createSampler2DArray(
int index);
650 static UniformParameterPtr createSampler3D(
int index);
651 static UniformParameterPtr createSamplerCUBE(
int index);
653 static UniformParameterPtr createUniform(
GpuConstantType type,
int index,
uint16 variability,
const String& suggestedName,
size_t size);
SharedPtr< UniformParameter > UniformParameterPtr
size_t getSize() const
Returns the number of elements in the parameter (for arrays).
AutoConstantType
Defines the types of automatically updated values that may be bound to GpuProgram parameters...
Light direction in tangent space index 0-7.
UniformParameterList::const_iterator UniformParameterConstIterator
Light vector in view space index 0-7.
bool isArray() const
Returns Whether this parameter is an array.
Helper template which is the base for our ConstParameters.
Light position in tangent space index 0-7.
Light vector in world space index 0-7.
Light position in view space index 0-7.
Content getContent() const
Return the content of this parameter.
A class that represents a shader based program parameter.
Light direction in view space index 0-7.
Position in light space index 0-7.
4-dimensional homogeneous vector.
Standard 2-dimensional vector.
Class representing colour.
float Real
Software floating point type.
GpuConstantType getType() const
Get the type of this parameter.
const String & getName() const
Get the name of this parameter.
virtual String toString() const
Returns the string representation of this parameter.
vector< UniformParameterPtr >::type UniformParameterList
ConstParameter(valueType val, GpuConstantType type, const Semantic &semantic, const Content &content)
ShaderParameterList::const_iterator ShaderParameterConstIterator
View vector in world space.
virtual bool isConstParameter() const
Returns true if this instance is a ConstParameter otherwise false.
SharedPtr< Parameter > ParameterPtr
vector< ParameterPtr >::type ShaderParameterList
Class encapsulating a standard 4x4 homogeneous matrix.
Standard 3-dimensional vector.
Binormal in object space.
Depth in projective space.
virtual ~ConstParameter()
const Semantic & getSemantic() const
Get the semantic of this parameter.
Texture coordinate set index 0-7.
UniformParameterList::iterator UniformParameterIterator
View vector in tangent space.
virtual bool isConstParameter() const
Real * ptr()
Pointer accessor for direct copying.
Light vector in object space index 0-7.
Position in object space.
const valueType & getValue() const
Returns the native value of this parameter.
Position in projective space.
Helper utility class that creates common parameters.
Binormal in tangent space.
Light position in object space index 0-7.
Tangent in tangent space.
View vector in object space.
View vector in view space.
GpuConstantType
Enumeration of the types of constant we may encounter in programs.
int getIndex() const
Get the index of this parameter.
ShaderParameterList::iterator ShaderParameterIterator
Light vector in tangent space index 0-7.
Light direction in world space index 0-7.
Light direction in object space index 0-7.
virtual ~Parameter()
Class destructor.
Light position in world space index 0-7.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Collects together the program parameters used for a GpuProgram.
void setSize(size_t size)
Sets the number of elements in the parameter (for arrays).