class
MaterialParametersBase
Common functionality for MaterialParameters and render::MaterialParameters.
Public
Constructors
MaterialParametersBase
Creates a new material params object and initializes enough room for parameters from the provided parameter data.
MaterialParametersBase
Constructor for serialization use only.
Methods
~MaterialParametersBase
GetColorGradientParam
Returns the color gradient assigned to a shader color parameter with the specified name at the specified array index.
If the parameter name, index or type is not valid a warning will be logged and output value will not be retrieved. If no gradient has been assigned to this parameter then an empty gradient is returned.
- name
- Name of the shader parameter.
- arrayIdx
- If the parameter is an array, index of the entry to access.
Returns: Color gradient assigned to the parameter.
SetColorGradientParam
Sets a color gradient to a shader color parameter with the specified name at the specified array index.
If the parameter name, index or type is not valid a warning will be logged and output value will not be set.
- name
- Name of the shader parameter.
- arrayIdx
- If the parameter is an array, index of the entry to access.
- input
- New value of the parameter.
GetParamIndex
Returns an index of the parameter with the specified name.
Index can be used in a call to getParamData(u32) to get the actual parameter data.
- name
- Name of the shader parameter.
Returns: Index of the parameter, or -1 if not found.
GetParamIndex
Returns an index of the parameter with the specified name.
Index can be used in a call to getParamData(u32) to get the actual parameter data.
- name
- Name of the shader parameter.
- type
- Type of the parameter retrieve. Error will be logged if actual type of the parameter doesn't match.
- dataType
- Only relevant if the parameter is a data type. Determines exact data type of the parameter to retrieve.
- arrayIdx
- Array index of the entry to retrieve.
- output
- Index of the requested parameter, only valid if success is returned.
Returns: Success or error state of the request.
GetParamData
Returns data about a parameter and reports an error if there is a type or size mismatch, or if the parameter does exist.
- name
- Name of the shader parameter.
- type
- Type of the parameter retrieve. Error will be logged if actual type of the parameter doesn't match.
- dataType
- Only relevant if the parameter is a data type. Determines exact data type of the parameter to retrieve.
- arrayIdx
- Array index of the entry to retrieve.
- output
- Object describing the parameter with an index to its data. If the parameter was not found this value is undefined. This value will still be valid if parameter was found but some other error was reported.
Returns: Success or error state of the request.
GetParamData
Returns information about a parameter at the specified global index, as retrieved by getParamIndex().
GetParameterCount
Returns the total number of parameters managed by this object.
ReportGetParamError
Logs an error that was reported by getParamData().
- errorCode
- Information about the error.
- name
- Name of the shader parameter for which the error occurred.
- arrayIdx
- Array index for which the error occurred.
GetColorGradientParam
Equivalent to getColorGradientParam(const String & , u32) except it uses the internal parameter reference directly, avoiding the name lookup.
Caller must guarantee the parameter reference is valid and belongs to this object.
SetColorGradientParam
Equivalent to setColorGradientParam(const String & , u32, const ColorGradient & ) except it uses the internal parameter reference directly, avoiding the name lookup.
Caller must guarantee the parameter reference is valid and belongs to this object.
GetData
Returns pointer to the internal data buffer for a data parameter at the specified index.
GetParamVersion
Returns a counter that gets incremented whenever a parameter gets updated.