PrimitiveBatch

Description

struct Tinman.Engine.Rendering.Util.PrimitiveBatch

A rendering primitive batch.

The natural sort order of primitive batches establishes an ordering that may be used to join subsequent primitive batches, in order to reduce the number of required draw calls:

  1. Indexed: indexed primitives first, non-indexed second

  2. Zero: sorted ascending by base vertex

  3. Type: sorted ascending by primitive type ordinal

  4. First: sorted ascending by index of first vertex

  5. Count: sorted ascending by vertex count

Public / Constants

None


public static readonly attribute None → (PrimitiveBatch)

The empty primitive batch.

Public / Constructors

Line​List


[Pure]
public static method LineList → (2)

first in : int32

[>=0]
See First.

count in : int32

[>=0]
See Count.

returns → PrimitiveBatch

The primitive batch.

Creates a Primitive.LineList primitive batch.

Line​List​Indexed


[Pure]
public static method LineListIndexed → (3)

first in : int32

[>=0]
See First.

count in : int32

[>=0]
See Count.

zero opt : int32 = 0

[>=0]
See Zero.

returns → PrimitiveBatch

The primitive batch.

Creates an indexed Primitive.LineList primitive batch.

Line​Strip


[Pure]
public static method LineStrip → (2)

first in : int32

[>=0]
See First.

count in : int32

[>=0]
See Count.

returns → PrimitiveBatch

The primitive batch.

Creates a Primitive.LineStrip primitive batch.

Line​Strip​Indexed


[Pure]
public static method LineStripIndexed → (3)

first in : int32

[>=0]
See First.

count in : int32

[>=0]
See Count.

zero opt : int32 = 0

[>=0]
See Zero.

returns → PrimitiveBatch

The primitive batch.

Creates an indexed Primitive.LineStrip primitive batch.

Point​List


[Pure]
public static method PointList → (2)

first in : int32

[>=0]
See First.

count in : int32

[>=0]
See Count.

returns → PrimitiveBatch

The primitive batch.

Creates a Primitive.PointList primitive batch.

Point​List​Indexed


[Pure]
public static method PointListIndexed → (3)

first in : int32

[>=0]
See First.

count in : int32

[>=0]
See Count.

zero opt : int32 = 0

[>=0]
See Zero.

returns → PrimitiveBatch

The primitive batch.

Creates an indexed Primitive.PointList primitive batch.

Primitive​Batch


public constructor PrimitiveBatch → (5)

type in : Primitive

See Type.

first in : int32

[>=0]
See First.

count in : int32

[>=0]
See Count.

indexed in : bool

See Indexed.

zero opt : int32 = 0

[>=0]
See Zero.

Creates a new instance of PrimitiveBatch.

Triangle​List


[Pure]
public static method TriangleList → (2)

first in : int32

[>=0]
See First.

count in : int32

[>=0]
See Count.

returns → PrimitiveBatch

The primitive batch.

Creates a Primitive.TriangleList primitive batch.

Triangle​List​Indexed


[Pure]
public static method TriangleListIndexed → (3)

first in : int32

[>=0]
See First.

count in : int32

[>=0]
See Count.

zero opt : int32 = 0

[>=0]
See Zero.

returns → PrimitiveBatch

The primitive batch.

Creates an indexed Primitive.TriangleList primitive batch.

Triangle​Strip


[Pure]
public static method TriangleStrip → (2)

first in : int32

[>=0]
See First.

count in : int32

[>=0]
See Count.

returns → PrimitiveBatch

The primitive batch.

Creates a Primitive.TriangleStrip primitive batch.

Triangle​Strip​Indexed


[Pure]
public static method TriangleStripIndexed → (3)

first in : int32

[>=0]
See First.

count in : int32

[>=0]
See Count.

zero opt : int32 = 0

[>=0]
See Zero.

returns → PrimitiveBatch

The primitive batch.

Creates an indexed Primitive.TriangleStrip primitive batch.

Public / Methods

Collect​Lines


public method CollectLines → (1)

indices in : int32 [ ]

The vertex indices for indexed geometry or null for non-indexed geometry.

returns → Vec2I [ ]

The collected line primitives or null if none primitives have been collected.

Collects all line primitives.

Collect​Points


public method CollectPoints → (1)

indices in : int32 [ ]

The vertex indices for indexed geometry or null for non-indexed geometry.

returns → int32 [ ]

The collected point primitives or null if none primitives have been collected.

Collects all point primitives.

Collect​Triangles


public method CollectTriangles → (1)

indices in : int32 [ ]

The vertex indices for indexed geometry or null for non-indexed geometry.

returns → Vec3I [ ]

The collected triangle primitives or null if none primitives have been collected.

Collects all triangle primitives.

Merge


[Pure]
public method Merge → (1)

batch in : PrimitiveBatch

The primitive batch to merge with.

returns → PrimitiveBatch

The merged primitive batch or None if the batches cannot be merged.

Merges this primitive batch with the given one, if possible.

Two primitive batches may be merged if all of the following is true:

Offset​First


[Pure]
public method OffsetFirst → (1)

offset in : int32

The offset to apply.

returns → PrimitiveBatch

The resulting primitive batch.

Applies the given offset in to First.

Offset​Zero


[Pure]
public method OffsetZero → (1)

offset in : int32

The offset to apply.

returns → PrimitiveBatch

The resulting primitive batch.

Applies the given offset in to Zero.

Render


public method Render → (1)

renderer in : IPrimitiveRenderer

The primitive renderer to use.

Renders this primitive batch using the given renderer in.

To​String


[Pure]
public static method ToString → (1)

primitive in : Primitive

The primitive.

returns → string

The primitive name.

Returns the name of the given Primitive, as used by PrimitiveBatch.ToString.

Public / Attributes

Count


public readonly attribute Count → (int32)

The number of vertices (Indexed = false) or indices ( Indexed = true) to draw.

First


public readonly attribute First → (int32)

The index of first vertex in vertex buffer (Indexed = false) or the index of the first index in the index buffer (Indexed = true).

Indexed


public readonly attribute Indexed → (bool)

Is this an indexed primitive?

Is​Lines


public attribute IsLines → (get)

value : bool

true if this is a line primitive batch, false if not.

Is this a line primitive batch?

Is​Points


public attribute IsPoints → (get)

value : bool

true if this is a point primitive batch, false if not.

Is this a point primitive batch?

Is​Triangles


public attribute IsTriangles → (get)

value : bool

true if this is a triangle primitive batch, false if not.

Is this a triangle primitive batch?

Type


public readonly attribute Type → (Primitive)

The primitive type.

Zero


public readonly attribute Zero → (int32)

The value to add to resolved vertex indices for indexed primitives.

Will always be 0 if Indexed is false.