struct
render::ShaderCreateInformation
Descriptor structure used for initialization of a Shader.
Public
Constructors
ShaderCreateInformation
ShaderCreateInformation
Methods
staticGetRttiStatic
AddParameter
Registers a new data (int, Vector2, etc.) parameter you that you may then use via Material by providing the parameter name.
All parameters internally map to variables defined in GPU programs.
- parameterInformation
- Structure describing the parameter to add.
- defaultValue
- (optional) Pointer to the buffer containing the default value for this parameter (initial value that will be set when a material is initialized with this shader). The provided buffer must be of the correct size (depending on the element type and array size).
SetParameterAttribute
Applies an attribute to the parameter with the specified name.
- name
- Name of an object or data parameter to apply the attribute to.
- attribute
- Structure describing the attribute to apply.
SetUniformBufferAttributes
Changes parameters of a uniform buffer with the specified name.
- name
- Name of the uniform buffer. This should correspond with the name specified in the GPU program code.
- shared
- If uniform buffer is marked as shared it will not be automatically created by the Material. You will need to create it elsewhere and then assign it manually.
- flags
- Flags that control the behaviour of the uniform buffer.
- rendererSemantic
- (optional) Semantic that allows you to specify the use of this uniform buffer in the renderer. The actual value of the semantic depends on the current Renderer and its supported list of semantics. Elements with a renderer semantic will not have their uniform buffer automatically created (similar to "shared" argument), but instead a Renderer will create an assign it instead. Be aware that renderers have strict policies on what and how are parameters stored in the buffer and you will need to respect them. If you don't respect them your shader will be deemed incompatible and won't be used. Value of 0 signifies the uniform buffer is not used by the renderer.
Fields
QueueSortType
Sorting type to use when performing sort in the render queue.
Default value is sort front to back which causes least overdraw and is preferable. Transparent objects need to be sorted back to front. You may also specify no sorting and the elements will be rendered in the order they were added to the render queue.
QueuePriority
Priority that allows you to control in what order are your shaders rendered.
See QueuePriority for a list of initial values. Shaders with higher priority will be rendered before shaders with lower priority, and additionally render queue will only sort elements within the same priority group.
SeparablePasses
Enables or disables separable passes.
When separable passes are disabled all shader passes will be executed in a sequence one after another. If it is disabled the renderer is free to mix and match passes from different objects to achieve best performance. (They will still be executed in sequence, but some other object may be rendered in-between passes)
VariationParameters
Information about all variation parameters and their possible values.
Each permutation of variation parameters represents a separate shader variation.
CompilerMetaData
Meta-data required by the shader compiler when compiling shader variations on demand.
Can be null if the shader is being initialized with precompiled variations.