Represents the definition of a ShaderParameter object.
Shader parameter definitions are stored on the ShaderDef object in a special ShaderParamDefContainer object, which allows you to access existing parameter definitions or add new ones. To access the ShaderParamDefContainer object, call ShaderDef::GetInputParamDefs or ShaderDef::GetOutputParamDefs. From the ShaderParamDefContainer you can add new parameter definitions by calling ShaderParamDefContainer::AddParamDef or ShaderParamDefContainer::AddArrayParamDef with a set of ShaderParamDefOptions.
To access a specific shader parameter definition from an instantiated shader definition, use the ShaderParamDefContainer::GetParamDefByName function. To iterate over the entire list of input or output parameter definitions for an instantiated shader definition, use ShaderParamDefContainer::GetDefinitions.
To access existing shader parameter definitions from a ShaderParameter instance, use ShaderParameter::GetDefinition.
To add an array parameter (ShaderArrayParamDef), use ShaderParamDefContainer::AddArrayParamDef. For all other parameter types, use ShaderParamDefContainer::AddParamDef.
#include <xsi_shaderparamdef.h>
ShaderParamDef | ( | ) |
Default constructor.
~ShaderParamDef | ( | ) |
Default destructor.
ShaderParamDef | ( | const CRef & | in_ref | ) |
Constructor.
in_ref | constant reference object. |
ShaderParamDef | ( | const ShaderParamDef & | in_obj | ) |
Copy constructor.
in_obj | constant class object. |
bool IsA | ( | siClassID | in_ClassID | ) | const [virtual] |
Returns true if a given class type is compatible with this API class.
in_ClassID | class type. |
Reimplemented from SIObject.
Reimplemented in ShaderArrayParamDef, and ShaderStructParamDef.
siClassID GetClassID | ( | ) | const [virtual] |
Returns the type of the API class.
Reimplemented from SIObject.
Reimplemented in ShaderArrayParamDef, and ShaderStructParamDef.
ShaderParamDef& operator= | ( | const ShaderParamDef & | in_obj | ) |
Creates an object from another object. The newly created object is set to empty if the input object is not compatible.
in_obj | constant class object. |
ShaderParamDef& operator= | ( | const CRef & | in_ref | ) |
Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.
in_ref | constant class object. |
Reimplemented from SIObject.
Reimplemented in ShaderArrayParamDef, and ShaderStructParamDef.
ValueMap GetAttributes | ( | ) | const |
Returns the list of attributes available on this parameter.
LONG GetCapabilities | ( | ) | const |
Returns a number (see siCapabilities) which is a bitfield of all the parameter's capabilities. For convenience, the texturable capability is exposed directly as ShaderParamDef::GetTexturable.
To set the texturable, inspectable, and animatable capabilities on the shader parameter definition, you need to set them on the ShaderParamDefOptions object before calling the ShaderParamDefContainer::AddParamDef or ShaderParamDefContainer::AddArrayParamDef methods. For the texturable capability, the convenience method ShaderParamDef::SetTexturable is also available.
CValue GetDefaultValue | ( | ) | const |
Returns the default value for this parameter.
Sets the default value for this parameter.
CString GetDisplayName | ( | ) | const |
Returns the short name for this parameter definition. This is
the name that appears in the Scene Explorer (with the View
> Use Script Names
option turned OFF
). It is
also the same value that the SIObject::GetName
property returns on the instance (ShaderParameter).
bool HasDefaultValue | ( | ) | const |
Indicates whether or not the parameter has a default value.
bool IsArray | ( | ) | const |
Indicates whether or not the parameter is an array parameter (defined as ShaderArrayParamDef, or ShaderArrayParameter when instantiated). This is a convenience method for testing the following:
bool IsInput | ( | ) | const |
Indicates whether or not the parameter is an input parameter.
bool IsOutput | ( | ) | const |
Indicates whether or not the parameter is an output parameter.
bool IsStructure | ( | ) | const |
Indicates whether or not the parameter is a structure parameter (true if it is). This is a convenience method for testing the following:
bool GetMainPort | ( | ) | const |
Indicates whether or not the port is the main port.
CStatus PutMainPort | ( | bool | in_main | ) |
Sets this port as the main port.
in_main | true if the port is the main port; false otherwise |
CValue GetMaxValue | ( | ) | const |
Returns the maximum allowable value for this parameter.
Sets the maximum allowable value for this parameter.
in_value | the maximum value |
CValue GetMinValue | ( | ) | const |
Returns the minimum allowable value for this parameter.
Sets the minimum allowable value for this parameter.
in_value | the minimum value |
siShaderParameterDataType GetDataType | ( | ) | const |
Returns one of the siShaderParameterDataType enum values corresponding to this shader parameter's type.
CValue GetSuggestedMaxValue | ( | ) | const |
Returns the suggested maximum value for this parameter.
Sets the suggested maximum value for this parameter.
in_value | the suggested maximum value |
CValue GetSuggestedMinValue | ( | ) | const |
Returns the suggested minimum value for this parameter.
Sets the suggested minimum value for this parameter.
in_value | the suggested minimum value |
bool GetTexturable | ( | ) | const |
Indicates whether or not the texturable capability (see siCapabilities) is set. This is a convenience for accessing it using ShaderParamDef::GetCapabilities.
CStatus SetTexturable | ( | bool | in_value | ) |
Sets whether or not the texturable capability (see siCapabilities) is set. This is a convenience for accessing it using ShaderParamDef::GetCapabilities.
Sets the short name for this parameter definition. This is the
name that appears in the Scene Explorer (with the View >
Use Script Names
option turned OFF
).