Header menu logo Mibo

SpriteQuadBatch Module

A simple batcher for drawing textured, vertex-colored quads in 3D.

This batcher is intended for Sprite3D-style draws (unlit, texture + vertex color), but it can also be used with custom effects that consume VertexPositionColorTexture. The caller is responsible for configuring the effect (View/Projection/Texture/etc) and device states.

Types

Type Description

State

Functions and values

Function or value Description

begin' state

Full Usage: begin' state

Parameters:
Modifiers: inline

Begin a batch.

state : State

create graphicsDevice

Full Usage: create graphicsDevice

Parameters:
Returns: State

Creates a new quad batcher.

graphicsDevice : GraphicsDevice
Returns: State

dispose state

Full Usage: dispose state

Parameters:

Return pooled arrays. Call when the batch is no longer needed.

state : State

draw center right up color uv state

Full Usage: draw center right up color uv state

Parameters:
    center : Vector3 - Center of the quad in world space.
    right : Vector3 - Half-extent vector pointing to the quad's +X direction in world space.
    up : Vector3 - Half-extent vector pointing to the quad's +Y direction in world space.
    color : Color
    uv : UvRect
    state : State

Adds a quad to the batch.

center : Vector3

Center of the quad in world space.

right : Vector3

Half-extent vector pointing to the quad's +X direction in world space.

up : Vector3

Half-extent vector pointing to the quad's +Y direction in world space.

color : Color
uv : UvRect
state : State

end' effect state

Full Usage: end' effect state

Parameters:
Modifiers: inline

Ends the batch and flushes all draw commands to the GPU.

effect : Effect
state : State

flush effect state

Full Usage: flush effect state

Parameters:

Flushes the current batch to the GPU.

Effect passes are applied by the caller; this only issues the draw call.

effect : Effect
state : State

Type something to start searching.