Logo Mibo

InstancedRenderContext<'T, 'K> Type

Contextual object for instanced cell grid rendering. Bundles the key/material/transform functions and manages internal reusable storage and snapshot pooling to avoid per-frame allocations.

Constructors

Constructor Description

InstancedRenderContext(getKey, getMeshesMaterialAndShader, getTransform)

Full Usage: InstancedRenderContext(getKey, getMeshesMaterialAndShader, getTransform)

Parameters:
Returns: InstancedRenderContext<'T, 'K>

Overload constructor for per-sub-mesh shaders: each triple may carry a Shader voption. A ValueSome shader wraps that sub-mesh's instanced draw in its own BeginEffect/EndEffect scope; ValueNone uses the default PBR instanced path. Existing two-element contexts are unaffected.

getKey : 'T -> 'K
getMeshesMaterialAndShader : 'T -> (Mesh * Material3D * Shader voption)[]
getTransform : Vector3 -> 'T -> Matrix4x4
Returns: InstancedRenderContext<'T, 'K>

InstancedRenderContext(getKey, getMeshesAndMaterial, getTransform)

Full Usage: InstancedRenderContext(getKey, getMeshesAndMaterial, getTransform)

Parameters:
Returns: InstancedRenderContext<'T, 'K>
getKey : 'T -> 'K
getMeshesAndMaterial : 'T -> (Mesh * Material3D)[]
getTransform : Vector3 -> 'T -> Matrix4x4
Returns: InstancedRenderContext<'T, 'K>

Instance members

Instance member Description

this.GetKey

Full Usage: this.GetKey

Returns: 'T -> 'K
Returns: 'T -> 'K

this.GetMeshesAndMaterial

Full Usage: this.GetMeshesAndMaterial

Returns: 'T -> (Mesh * Material3D)[]
Returns: 'T -> (Mesh * Material3D)[]

this.GetTransform

Full Usage: this.GetTransform

Returns: Vector3 -> 'T -> Matrix4x4
Returns: Vector3 -> 'T -> Matrix4x4

this.RenderCellGridInstanced

Full Usage: this.RenderCellGridInstanced

Parameters:

Emit instanced draw commands for every occupied cell of grid, grouping cells by shaderForKey: cells whose key maps to a shader are shaded by it (when it opts into instancing), keys mapped to ValueNone keep the default PBR instanced path. See docs/graphics3d/instancing.md.

buffer : RenderBuffer3D
grid : CellGrid3D<'T>
shaderForKey : 'K -> Shader voption

this.RenderCellGridInstanced

Full Usage: this.RenderCellGridInstanced

Parameters:

Emit instanced draw commands for every occupied cell of grid, shaded by the default PBR instanced path.

buffer : RenderBuffer3D
grid : CellGrid3D<'T>

this.RenderCellGridVolumeInstanced

Full Usage: this.RenderCellGridVolumeInstanced

Parameters:

Emit instanced draw commands for the occupied cells of grid inside bounds, grouping cells by shaderForKey: cells whose key maps to a shader are shaded by it (when it opts into instancing), keys mapped to ValueNone keep the default PBR instanced path. See docs/graphics3d/instancing.md.

buffer : RenderBuffer3D
bounds : BoundingBox
grid : CellGrid3D<'T>
shaderForKey : 'K -> Shader voption

this.RenderCellGridVolumeInstanced

Full Usage: this.RenderCellGridVolumeInstanced

Parameters:

Emit instanced draw commands for the occupied cells of grid inside bounds, shaded by the default PBR instanced path.

buffer : RenderBuffer3D
bounds : BoundingBox
grid : CellGrid3D<'T>

this.RenderHexGridInstanced

Full Usage: this.RenderHexGridInstanced

Parameters:

Emit instanced draw commands for every occupied cell of the hex grid, grouping cells by shaderForKey: cells whose key maps to a shader are shaded by it (when it opts into instancing), keys mapped to ValueNone keep the default PBR instanced path. See docs/graphics3d/instancing.md.

buffer : RenderBuffer3D
grid : HexGrid3D<'T>
shaderForKey : 'K -> Shader voption

this.RenderHexGridInstanced

Full Usage: this.RenderHexGridInstanced

Parameters:

Emit instanced draw commands for every occupied cell of the hex grid, shaded by the default PBR instanced path.

buffer : RenderBuffer3D
grid : HexGrid3D<'T>

this.RenderHexGridVolumeInstanced

Full Usage: this.RenderHexGridVolumeInstanced

Parameters:

Emit instanced draw commands for the occupied cells of the hex grid inside bounds, grouping cells by shaderForKey: cells whose key maps to a shader are shaded by it (when it opts into instancing), keys mapped to ValueNone keep the default PBR instanced path. See docs/graphics3d/instancing.md.

buffer : RenderBuffer3D
bounds : BoundingBox
grid : HexGrid3D<'T>
shaderForKey : 'K -> Shader voption

this.RenderHexGridVolumeInstanced

Full Usage: this.RenderHexGridVolumeInstanced

Parameters:

Emit instanced draw commands for the occupied cells of the hex grid inside bounds, shaded by the default PBR instanced path.

buffer : RenderBuffer3D
bounds : BoundingBox
grid : HexGrid3D<'T>

this.ResetFrameBuffers

Full Usage: this.ResetFrameBuffers

Returns pooled snapshot arrays to ArrayPool and clears internal tracking state. Call once per frame before invoking renderInstanced or renderVolumeInstanced.

Skippable if GC pressure from instanced rendering is acceptable, but recommended for steady-state zero-alloc rendering.

Type something to start searching.