Class Gorgon2DShaderState<T>
A shader state for use with a Gorgon2DBatchState.
Inherited Members
Namespace: Gorgon.Renderers
Assembly: Gorgon.Renderers.Gorgon2D.dll
Syntax
public sealed class Gorgon2DShaderState<T> where T : GorgonShader
Type Parameters
Name | Description |
---|---|
T | The type of shader. Must inherit from GorgonShader. |
Remarks
This provides state information wrapped around shaders based on GorgonShader. These states are used for passing shader programs and related states to the Gorgon2DBatchState when setting up a batch render via Begin(Gorgon2DBatchState, GorgonCameraCommon).
If a custom pixel or vertex shader is assigned to the state, then developers should note which resource slots, and constant buffer slots are used by the 2D renderer itself. Gorgon will allow overriding of these slots, but in those cases, some information may no longer available and things may not work as expected. The following slots are use by the 2D renderer:
Shader Type | Resource type | Slot # | Purpose |
---|---|---|---|
Pixel | Texture/Sampler | 0 | Primary sprite texture/sampler. |
Pixel | Texture | 1 | Additional texture for effects. |
Pixel | Constants | 0 | Data for alpha testing. |
Pixel and Vertex | Constants | 12 | Timing data. |
Pixel and Vertex | Constants | 13 | Miscellaneous data (e.g. target width and height) |
Vertex | Constants | 0 | View/Projection matrix for the CurrentCamera (or the default camera if null). |
Vertex | Constants | 1 | Data for a polygon sprite. |
Properties
| Edit this page View SourceConstantBuffers
Property to return the constant buffers for the shader.
Declaration
public IGorgonReadOnlyArray<GorgonConstantBufferView> ConstantBuffers { get; }
Property Value
Type | Description |
---|---|
IGorgonReadOnlyArray<GorgonConstantBufferView> |
See Also
| Edit this page View SourceSamplers
Property to return the samplers for the shader.
Declaration
public IGorgonReadOnlyArray<GorgonSamplerState> Samplers { get; }
Property Value
Type | Description |
---|---|
IGorgonReadOnlyArray<GorgonSamplerState> |
See Also
| Edit this page View SourceShader
Property to return the shader.
Declaration
public T Shader { get; }
Property Value
Type | Description |
---|---|
T |
See Also
| Edit this page View SourceShaderResources
Property to return the list of shader resources for the shader.
Declaration
public IGorgonReadOnlyArray<GorgonShaderResourceView> ShaderResources { get; }
Property Value
Type | Description |
---|---|
IGorgonReadOnlyArray<GorgonShaderResourceView> |