class
MaterialParameters
Contains all parameter values set in a Material.
This is similar to GpuParameterSet which also stores parameter values, however GpuParameterSet objects are built for use on the GPU-side and don't store parameters that don't exist in a compiled GPU program. This object on the other hand stores all parameters defined in a shader, regardless or not if they actually exist in the GPU program.
Public
Constructors
MaterialParameters
MaterialParameters
*********************************************************************
Methods
CreateSyncPacket
Creates sync packet that can be used for bringing the render proxy up to date.
- allocator
- Allocator with which to allocate the sync packet.
- forceAll
- By default only dirty parameter will be synced. If you wish to sync all parameters set this to true.
Returns: Sync packet if there are any dirty parameters, null otherwise.
GetResourceDependencies
Appends any resources stored by this object to the provided vector.
GetCoreObjectDependencies
Appends any core objects stored by this object to the provided vector.
staticGetRttiStatic
~TMaterialParameters<IsRenderProxy>
GetStructData
Returns the value of a shader structure 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.
- name
- Name of the shader parameter.
- value
- Pre-allocated buffer of bytes where the value will be retrieved.
- size
- Size of the buffer into which to write the value. Must match parameter struct's size.
- arrayIdx
- If the parameter is an array, index of the entry to access.
SetStructData
Sets the value of a shader structure 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.
- name
- Name of the shader parameter.
- value
- Buffer of bytes containing the new value of the structure.
- size
- Size of the buffer from which to retrieve the value. Must match parameter struct's size.
- arrayIdx
- If the parameter is an array, index of the entry to access.
GetTexture
Returns the value of a shader texture parameter with the specified name.
If the parameter name or type is not valid a warning will be logged and output value will not be retrieved.
- name
- Name of the shader parameter.
- value
- Output value of the parameter.
- surface
- Surface describing which part of the texture is being accessed.
SetTexture
Sets the value of a shader texture parameter with the specified name.
If the parameter name or type is not valid a warning will be logged and output value will not be set.
- name
- Name of the shader parameter.
- value
- New value of the parameter.
- surface
- Surface describing which part of the texture is being accessed.
GetSpriteImage
Returns the value of a shader texture parameter with the specified name as a sprite image.
If the parameter name or type is not valid a warning will be logged and output value will not be retrieved. If the assigned texture is not a sprite texture then this returns null and you should use one of the GetTexture() overloads instead.
- name
- Name of the shader parameter.
- value
- Output value of the parameter.
SetSpriteImage
Assigns a sprite image to a shader texture parameter with the specified name.
If the parameter name or type is not valid a warning will be logged and output value will not be set.
- name
- Name of the shader parameter.
- value
- New value of the parameter.
GetStorageTexture
Returns the value of a shader load/store texture parameter with the specified name.
If the parameter name or type is not valid a warning will be logged and output value will not be retrieved.
- name
- Name of the shader parameter.
- value
- Output value of the parameter.
- surface
- Surface describing which part of the texture is being accessed.
SetStorageTexture
Sets the value of a shader load/store texture parameter with the specified name.
If the parameter name or type is not valid a warning will be logged and the value will not be set.
- name
- Name of the shader parameter.
- value
- New value of the parameter.
- surface
- Surface describing which part of the texture is being accessed.
GetBuffer
Returns the value of a shader buffer parameter with the specified name.
If the parameter name or type is not valid a warning will be logged and output value will not be retrieved.
- name
- Name of the shader parameter.
- value
- Output value of the parameter.
SetBuffer
Sets the value of a shader buffer parameter with the specified name.
If the parameter name or type is not valid a warning will be logged and output value will not be set.
- name
- Name of the shader parameter.
- value
- New value of the parameter.
GetSamplerState
Sets the value of a shader sampler state parameter with the specified name.
If the parameter name or type is not valid a warning will be logged and output value will not be set.
- name
- Name of the shader parameter.
- value
- Output value of the parameter.
SetSamplerState
Sets the value of a shader sampler state parameter with the specified name.
If the parameter name or type is not valid a warning will be logged and output value will not be set.
- name
- Name of the shader parameter.
- value
- New value of the parameter.
IsAnimated
Checks does the data parameter with the specified name currently contains animated data.
This could be an animation curve or a color gradient.
GetStructSize
Returns a size of a struct parameter in bytes, using the internal parameter reference.
Caller must guarantee the parameter reference is valid and belongs to this object.
GetTextureType
Returns the type of texture that is currently assigned to the provided parameter.
This can only be called on on texture parameters. Caller must guarantee the parameter reference is valid, is of a texture type and belongs to this object.
GetOwningSpriteImage
Returns a sprite texture that is used for populating the specified data parameter.
This is only relevant for data parameters marked with the ShaderParamAttributeType::SpriteUV attribute.
GetDefaultTexture
Returns the default texture (one assigned when no other is provided), if available for the specified parameter.
Parameter is represented using the internal parameter reference and the caller must guarantee the parameter eference is valid and belongs to this object.
GetDefaultSamplerState
Returns the default sampler state (one assigned when no other is provided), if available for the specified parameter.
Parameter is represented using the internal parameter reference and the caller must guarantee the parameter reference is valid and belongs to this object.