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


public method Draw → (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​Indexed


public method DrawIndexed → (3)

firstIndex in : int32

First vertex index to draw.

indexCount in : int32

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

zeroVertex opt : int32 = 0

The value to add to resolved vertex indices. If CanUseZeroVertex 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​Indirect


public method DrawIndirect → (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 methods returns silently if Buffer is null or if CanDrawIndirect returns false.

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 CanDrawIndirect returns false.

The buffer to use for drawing primitives indirectly.

The element size and layout of the buffer is defined by the underlying graphics API and is usually populated by GPU programs. Please refer to the documentation of the respective subclass for details.

Can​Draw​Indirect


[Constant]
public attribute CanDrawIndirect → (get)

value : bool

true if DrawIndirect 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​Zero​Instance


[Constant]
public attribute CanUseZeroInstance → (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?

Can​Use​Zero​Vertex


[Constant]
public attribute CanUseZeroVertex → (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?

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.