IPrimitiveRenderer

Description

interface Tinman.Terrain.Rendering.IPrimitiveRenderer

Extended by

PrimitiveRenderer abstract

Base interface for classes that provide methods for drawing graphic primitives (both indexed and non-indexed) and for dispatching general-purpose computational work.

Public / Methods

Draw​Buffer


public method DrawBuffer → (2)

first in : int32

Index of first element in Buffer to draw.

count in : int32

Number of elements in Buffer to draw.

Draws indexed primitives indirectly from the current draw buffer (see Buffer).

This method returns silently if Buffer is null or if CanDrawBuffer returns false.

Draw​Indices


public method DrawIndices → (3)

firstIndex in : int32

First vertex index to draw.

indexCount in : int32

The number of vertex indices to draw (not ! primitive count).

baseVertex opt : int32 = 0

The value to add to resolved vertex indices. If CanUseBaseVertex is false, this value must be zero, otherwise no primitives will be drawn.

Draws indexed primitives.

The vertex indices of the primitive are stored in an IIndexBuffer object, the vertices are stored in a IVertexBuffer object. The application is responsible for setting the proper render states.

Exactly indexCount in indices will read from the index buffer, starting at the buffer index firstIndex in (not ! byte offset).

Draw​Indices​Instanced


public method DrawIndicesInstanced → (5)

firstIndex in : int32

First vertex index to draw.

indexCount in : int32

The number of vertex indices to draw (not ! primitive count).

firstInstance in : int32

First instance to draw. If CanUseFirstInstance is false, this value must be zero, otherwise no primitives will be drawn.

instanceCount in : int32

The number of instances to draw.

baseVertex opt : int32 = 0

The value to add to resolved vertex indices. If CanUseBaseVertex is false, this value must be zero, otherwise no primitives will be drawn.

Draws indexed primitives.

The vertex indices of the primitive are stored in an IIndexBuffer object, the vertices and instances are stored in a IVertexBuffer object. The application is responsible for setting the proper render states.

Exactly indexCount in indices will read from the index buffer, starting at the buffer index firstIndex in (not ! byte offset).

Draw​Vertices


public method DrawVertices → (2)

firstVertex in : int32

First vertex to draw.

vertexCount in : int32

The number of vertices to draw (not ! primitive count).

Draws primitives.

The vertices are stored in a IVertexBuffer object. The application is responsible for setting the proper render states.

Draw​Vertices​Instanced


public method DrawVerticesInstanced → (4)

firstVertex in : int32

First vertex to draw.

vertexCount in : int32

The number of vertices to draw (not ! primitive count).

firstInstance in : int32

First instance to draw. If CanUseFirstInstance is false, this value must be zero, otherwise no primitives will be drawn.

instanceCount in : int32

The number of instances to draw.

Draws primitives with instancing.

The vertices and instances are stored in a IVertexBuffer object. The application is responsible for setting the proper render states.

Reset


public method Reset → ()

Resets this primitive renderer object to its default state.

Public / Attributes

Buffer


public attribute Buffer → (get,set)

value : IGpuBuffer

The buffer or null if CanDrawBuffer returns false.

The buffer to use for drawing primitives indirectly.

The buffer is a packed array of the following structure, where each element represents an indexed and instanced draw call:

struct DrawBuffer       // Byte size 20
{
  uint32 indexCount;    // Byte offset 0
  uint32 instanceCount; // Byte offset 4
  uint32 firstIndex;    // Byte offset 8
  int32  zeroVertex;    // Byte offset 12
  uint32 firstInstance; // Byte offset 16
}

Can​Draw​Buffer


[Constant]
public attribute CanDrawBuffer → (get)

value : bool

true if DrawBuffer may be used,
false if not.

Can primitives be rendered indirectly from the current draw buffer (see Buffer)?

Can​Draw​Patches


[Constant]
public attribute CanDrawPatches → (get)

value : bool

true if tessellated patches can be drawn,
false if not.

Can patches for hardware tessellation on the GPU be drawn?

Can​Restart​Primitive


[Constant]
public attribute CanRestartPrimitive → (get)

value : bool

true if primitives can be restarted,
false if not.

Can primitives be restarted by inserting a special index (~0) into the stream?

Can​Use​Base​Vertex


[Constant]
public attribute CanUseBaseVertex → (get)

value : bool

true if a base vertex may be used for indexed geometry,
false if a base vertex cannot be used.

Can a base vertex be specified when rendering indexed geometry?

Can​Use​First​Instance


[Constant]
public attribute CanUseFirstInstance → (get)

value : bool

true if a base instance may be used for instanced geometry,
false if a base instance cannot be used.

Can a base instance be specified when rendering instanced geometry?

Patches


public attribute Patches → (get,set)

value : int32

The number of vertices per patch or 0 to render regular primitives, according to Type. Will be clamped to [0..32]. If CanDrawPatches returns false, the patch size will always be 0.

Specifies the patch size to use for subsequent draw calls (hardware tessellation).

Defaults to 0.

Type


public attribute Type → (get,set)

value : Primitive

The graphics primitive.

Specifies the primitive type to use for subsequent draw calls (regular primitives).

If Patches is greater than zero, the primitive type is ignored. Defaults to Primitive.PointList.