Header menu logo Mibo

InstancedRenderContext<'T, 'K> Type

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

Ported from Mibo.Raylib/Layout3D/Renderer3D.fs with type swaps per §5/§6.2:

  • Raylib_cs.MeshPrimitiveMesh
  • System.Numerics.Matrix4x4Matrix (converted at the Core↔backend boundary via Conversions).
  • System.Numerics.Vector3Vector3 (same).
The layout logic itself lives in Mibo.Core.Layout3D (backend-agnostic) and is reused unchanged; only the renderer glue is ported.

Constructors

Constructor Description

InstancedRenderContext(getKey, getMeshesAndMaterial, getTransform)

Full Usage: InstancedRenderContext(getKey, getMeshesAndMaterial, getTransform)

Parameters:
Returns: InstancedRenderContext<'T, 'K>
getKey : 'T -> 'K
getMeshesAndMaterial : 'T -> (PrimitiveMesh * Material3D)[]
getTransform : Vector3 -> 'T -> Matrix
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 -> (PrimitiveMesh * Material3D)[]
Returns: 'T -> (PrimitiveMesh * Material3D)[]

this.GetTransform

Full Usage: this.GetTransform

Returns: Vector3 -> 'T -> Matrix
Returns: Vector3 -> 'T -> Matrix

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.