Class DrawCall
Namespace: ValveResourceFormat.Renderer
Assembly: Renderer.dll
Single GPU draw operation with geometry, material, and render state.
public class DrawCallInheritance
object ← DrawCall
Properties
BaseVertex
Gets or sets the base vertex offset applied to all indices.
public int BaseVertex { get; set; }Property Value
int
DrawBounds
Gets or sets the optional bounding box used for draw-level culling.
public AABB? DrawBounds { get; set; }Property Value
AABB?
FirstMeshlet
Gets or sets the index of the first meshlet for this draw call.
public int FirstMeshlet { get; set; }Property Value
int
Index
Gets the index of this draw call among the draw calls of its mesh.
public int Index { get; init; }Property Value
int
IndexBuffer
Gets or sets the index buffer binding for this draw call.
public IndexDrawBuffer IndexBuffer { get; set; }Property Value
IndexCount
Gets or sets the number of indices to draw.
public int IndexCount { get; set; }Property Value
int
IndexSizeInBytes
Gets the size in bytes of a single index element.
public int IndexSizeInBytes { get; }Property Value
int
IndexType
Gets or sets the data type of each element in the index buffer.
public DrawElementsType IndexType { get; set; }Property Value
DrawElementsType
Material
Gets or sets the render material applied to this draw call.
public required RenderMaterial Material { get; set; }Property Value
MeshBuffers
Gets the GPU mesh buffer cache that owns the buffers for this draw call.
public required GPUMeshBufferCache MeshBuffers { get; init; }Property Value
MeshId
Gets or sets the mesh identifier, which replacement shaders can tell draws apart by.
public int MeshId { get; set; }Property Value
int
MeshName
Gets or sets the name of the mesh this draw call belongs to.
public string MeshName { get; set; }Property Value
string
NumMeshlets
Gets or sets the number of meshlets in this draw call.
public int NumMeshlets { get; set; }Property Value
int
PrimitiveType
Gets or sets the OpenGL primitive type for this draw call.
public PrimitiveType PrimitiveType { get; set; }Property Value
PrimitiveType
StartIndex
Gets or sets the byte offset into the index buffer where drawing begins.
public nint StartIndex { get; set; }Property Value
TintColor
Gets or sets the per-draw-call tint color multiplier.
public Vector4 TintColor { get; set; }Property Value
UvDensity
Gets or sets the average world units, in the mesh's space, that one unit of the draw's texture coordinates spans. Zero when the mesh does not say.
public float UvDensity { get; set; }Property Value
float
VertexBuffers
Gets the vertex buffer bindings used by this draw call.
public required VertexDrawBuffer[] VertexBuffers { get; init; }Property Value
VertexCount
Gets or sets the number of vertices in the draw call.
public uint VertexCount { get; set; }Property Value
uint
VertexIdOffset
Gets or sets the vertex ID offset used for morph target lookup.
public int VertexIdOffset { get; set; }Property Value
int
Methods
AddVertexBuffer(VertexDrawBuffer)
Add a new vertex buffer. The attributes may override existing ones.
public void AddVertexBuffer(VertexDrawBuffer buffer)Parameters
buffer VertexDrawBuffer
GetVertexArrayObject()
Returns the VAO for this draw call, creating it if necessary. Locations are canonical, so it serves the material shader and every replacement shader.
public int GetVertexArrayObject()Returns
int
The OpenGL VAO handle.
SetNewMaterial(RenderMaterial)
Replaces the material and rebuilds the vertex array state.
public void SetNewMaterial(RenderMaterial newMaterial)Parameters
newMaterial RenderMaterial
The new material to assign.
UpdateVertexArrayObject()
Recreates the VAO, picking up the new material's input signature.
public void UpdateVertexArrayObject()
