Model

Represents a 3D model for rendering using Vulkan graphics API.

Properties

SubMeshes

(IReadOnlyList) : The submeshes that make up this model. Each submesh covers a contiguous range of the shared index buffer and may carry its own material. Always contains at least one submesh.

Public Methods

Bind

public unsafe void Bind(CommandBuffer commandBuffer)

Binds the model's vertex and index buffers to a Vulkan command buffer for rendering.

Parameters:

  • commandBuffer (CommandBuffer): The Vulkan command buffer.

Draw

public void Draw(CommandBuffer commandBuffer)

Draws all submeshes of the model. Equivalent to calling DrawSubMesh for each entry in SubMeshes.

Parameters:

  • commandBuffer (CommandBuffer): The Vulkan command buffer.

DrawSubMesh

public void DrawSubMesh(CommandBuffer commandBuffer, int index)

Draws the submesh at index. Bind the model and the submesh's material descriptor sets first.

Parameters:

  • commandBuffer (CommandBuffer)
  • index (int)

Dispose

public void Dispose()

Releases the resources held by the model.