class
SpriteMaterial
Interfaced implemented by materials used for rendering sprites.
This is expected to be used as a singleton.
Public
Constructors
SpriteMaterial
Methods
~SpriteMaterial
GetId
Returns the unique ID of the sprite material.
AllowBatching
Determines is this material allowed to be batched with other materials with the same merge hash.
GetMergeHash
Generates a hash value that describes the contents of the sprite material info structure.
Returned hash doesn't guarantee that the two objects with the same hash are identical, but rather that the objects are mergeable via Merge().
Merge
Merges two SpriteMaterialInfos into one structure.
User must guarantee that the two objects are mergeable by ensuring their merge hashes match (by calling GetMergeHash()).
- mergeInto
- Object that contains the first part of the data, and will contain the result of the merge.
- mergeFrom
- Object that contains the second part of the data to merge, which will be merged into the first object.
CreateParameterAdapter
Creates parameter adapter for use with this material
- supportClipping
- If true, parameter adapter will be created for use with the clip region buffer variant of the material.
Prepare
Prepares the provided parameters for use with the current material.
- parameterAdapter
- Pararmeter adapter to use for populating the parameters.
- mesh
- Mesh to render, containing vertices in screen space.
- texture
- Optional texture to render the mesh with.
- sampler
- Optional sampler to render the texture with.
- uniformBuffer
- Buffer containing data GPU parameters, created from GUISpriteUniformBufferDefinition.
- clipRegionBuffer
- Buffer containing regions against all rendered sprite quads will be culled/clipped against.
Render
Renders the provided mesh using the current material.
- commandBuffer
- Command buffer to encode the render commands on.
- parameters
- Parameters to use for rendering, prepared via the call to Prepare().
- mesh
- Mesh to render, containing vertices in screen space.
- subMesh
- Portion of to render.
- clipRegionBuffer
- Buffer containing regions against all rendered sprite quads will be culled/clipped against.
- clipRegionCount
- Number of regions in .
- additionalData
- Optional additional data that might be required by the renderer.
staticPopulateUniformBuffer
Writes the provided parameters into a uniform buffer created from GUISpriteUniformBufferDefinition.
Protected
Methods
Initialize
Perform initialization of render-thread specific objects.
staticDestroy
Destroys the render thread material.