Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


DrawData

Mutable view over one generated mesh belonging to the current element.
Read time 1 minuteLast updated 6 days ago

Definition

public readonly ref struct DrawData

Remarks

Slices alias the underlying CPU storage — writes propagate to the GPU at the next upload. Conceptually a mesh, not a draw call: the renderer is free to batch multiple meshes (even from different elements) into a single GPU draw later in the pipeline.

Properties

Property

Description

indicesThe mesh's indices (triangles, 3 per tri).
phaseThe visual phase this draw belongs to.
renderTypeWhat kind of geometry this draw holds.
textureThe texture sampled by this draw, or
null
for RenderType.Solid.
userDataUser-provided identifier set at draw time via the
userData
parameter of APIs such as
DrawMesh
.
verticesThe mesh's vertices.

Methods

Method

Description

GetNormalReturns the Normal extras slice.
Vector3
per vertex.
GetTangentReturns the Tangent extras slice.
GetUv1Returns the UV1 (TEXCOORD1) extras slice.
GetUv2Returns the UV2 (TEXCOORD2) extras slice.
GetUv3Returns the UV3 (TEXCOORD3) extras slice.
SetIndicesReplace this draw's indices.
SetMeshReplace this draw's entire geometry in a single call: vertices, indices, and all extras channels.
SetNormalReplace the Normal extras slice.
Vector3
per vertex.
SetTangentReplace the Tangent extras slice.
SetUv1Replace the UV1 (TEXCOORD1) extras slice.
SetVerticesReplace this draw's vertices.