Class RenderableMesh
Namespace: ValveResourceFormat.Renderer
Assembly: Renderer.dll
GPU-ready mesh with draw calls, materials, and optional skeletal animation support.
public class RenderableMeshInheritance
Constructors
RenderableMesh(Mesh, int, Scene, Model?, Dictionary<string, string>?, Morph?, bool)
Constructs a renderable mesh from a resource mesh, uploading geometry and configuring draw calls.
public RenderableMesh(Mesh mesh, int meshIndex, Scene scene, Model? model = null, Dictionary<string, string>? initialMaterialTable = null, Morph? morph = null, bool isAggregate = false)Parameters
mesh Mesh
Source mesh resource.
meshIndex int
Index of this mesh within the parent model.
scene Scene
Scene providing render context and lighting info.
model Model?
Optional owning model, used for bone remapping.
initialMaterialTable Dictionary<string, string>?
Optional material name overrides.
morph Morph?
Optional morph data for facial animation.
isAggregate bool
When true, all draw calls go into the opaque bucket for aggregate rendering.
Properties
Alpha
Gets or sets the alpha component of .
public float Alpha { get; set; }Property Value
BoneMatricesGpu
Gets the GPU storage buffer holding the bone matrices for skeletal animation, or null if not animated.
public StorageBuffer? BoneMatricesGpu { get; }Property Value
BoneWeightCount
Gets the number of bone weights per vertex (4 or 8).
public int BoneWeightCount { get; }Property Value
BoundingBox
Gets the axis-aligned bounding box of the mesh in local space.
public AABB BoundingBox { get; }Property Value
DrawCalls
Gets all draw calls across all render buckets.
public IEnumerable<DrawCall> DrawCalls { get; }Property Value
DrawCallsBlended
Gets the translucent (blended) draw calls for this mesh.
public List<DrawCall> DrawCallsBlended { get; }Property Value
DrawCallsOpaque
Gets the opaque draw calls for this mesh.
public List<DrawCall> DrawCallsOpaque { get; }Property Value
DrawCallsOverlay
Gets the static overlay draw calls for this mesh.
public List<DrawCall> DrawCallsOverlay { get; }Property Value
FlexStateManager
Gets the flex state manager for morph target animation, or null if unsupported.
public FlexStateManager? FlexStateManager { get; }Property Value
MeshBoneCount
Gets the number of bones used by this mesh.
public int MeshBoneCount { get; }Property Value
MeshBoneOffset
Gets the starting bone index in the model-space bone array for this mesh.
public int MeshBoneOffset { get; }Property Value
MeshIndex
Gets the index of this mesh within its parent model.
public int MeshIndex { get; }Property Value
Meshlets
Gets the list of meshlets for GPU-driven indirect culling.
public List<Meshlet> Meshlets { get; }Property Value
Name
Gets the name of the source mesh resource.
public string Name { get; }Property Value
Tint
Gets or sets the tint color multiplier applied to the entire mesh.
public Vector4 Tint { get; set; }Property Value
Methods
CreateMesh(string, RenderMaterial, VBIB, AABB, RendererContext)
Creates a renderable mesh from raw vertex and index buffers with a single material.
public static RenderableMesh CreateMesh(string name, RenderMaterial material, VBIB vertexIndexBuffers, AABB bounds, RendererContext renderContext)Parameters
name string
Name for the mesh and GPU buffer labels.
material RenderMaterial
Material to assign to the single draw call.
vertexIndexBuffers VBIB
Vertex and index buffer data to upload.
bounds AABB
Bounding box of the mesh.
renderContext RendererContext
Renderer context for uploading buffers.
Returns
A new with one opaque draw call.
GetSupportedRenderModes()
Returns the union of all render mode names supported by the materials in this mesh.
public IEnumerable<string> GetSupportedRenderModes()Returns
ReplaceMaterials(Dictionary<string, string>)
Replaces materials on draw calls according to the provided name-to-name mapping.
public void ReplaceMaterials(Dictionary<string, string> materialTable)Parameters
materialTable Dictionary<string, string>
Dictionary mapping original material names to replacement material names.
SetBoneMatricesBuffer(StorageBuffer?)
Assigns the GPU bone matrices buffer and resets flex controllers.
public void SetBoneMatricesBuffer(StorageBuffer? buffer)Parameters
buffer StorageBuffer?
The storage buffer holding bone matrices, or null to disable skinning.
SetMaterialCombo((string ComboName, byte ComboValue))
Recompiles all draw call materials with a modified shader static combo value.
public void SetMaterialCombo((string ComboName, byte ComboValue) combo)Parameters
combo (string ComboName, byte ComboValue)
The combo name and new value to apply.
SetMaterialForMaterialViewer(Resource)
Replaces all draw call materials with a single material resource for use in the material viewer.
public void SetMaterialForMaterialViewer(Resource resourceMaterial)Parameters
resourceMaterial Resource
The material resource to apply to all draw calls.

