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.Mesh→ PrimitiveMeshSystem.Numerics.Matrix4x4→ Matrix (converted at the Core↔backend boundary viaConversions).System.Numerics.Vector3→ Vector3 (same).
Mibo.Core.Layout3D (backend-agnostic) and is
reused unchanged; only the renderer glue is ported.
Constructors
| Constructor |
Description
|
Full Usage:
InstancedRenderContext(getKey, getMeshesAndMaterial, getTransform)
Parameters:
'T -> 'K
getMeshesAndMaterial : 'T -> (PrimitiveMesh * Material3D)[]
getTransform : Vector3 -> 'T -> Matrix
Returns: InstancedRenderContext<'T, 'K>
|
|
Instance members
| Instance member |
Description
|
Full Usage:
this.GetKey
Returns: 'T -> 'K
|
|
|
|
|
|
Full Usage:
this.ResetFrameBuffers
|
Returns pooled snapshot arrays to ArrayPool
and clears internal tracking state. Call once per frame before
invoking Skippable if GC pressure from instanced rendering is acceptable, but recommended for steady-state zero-alloc rendering. |
Mibo