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
|
Full Usage:
InstancedRenderContext(getKey, getMeshesMaterialAndShader, getTransform)
Parameters:
'T -> 'K
getMeshesMaterialAndShader : 'T -> (Mesh * Material3D * Shader voption)[]
getTransform : Vector3 -> 'T -> Matrix4x4
Returns: InstancedRenderContext<'T, 'K>
|
Overload constructor for per-sub-mesh shaders: each triple may carry a
|
Full Usage:
InstancedRenderContext(getKey, getMeshesAndMaterial, getTransform)
Parameters:
'T -> 'K
getMeshesAndMaterial : 'T -> (Mesh * Material3D)[]
getTransform : Vector3 -> 'T -> Matrix4x4
Returns: InstancedRenderContext<'T, 'K>
|
|
Instance members
| Instance member |
Description
|
Full Usage:
this.GetKey
Returns: 'T -> 'K
|
|
|
|
|
|
Full Usage:
this.RenderInstanced
Parameters:
RenderBuffer3D
grid : CellGrid2D<'T>
occupancy : Occupancy
|
|
|
Fills the context from every populated cell of a 2D footprint grid — square or hex — and emits the instanced draws, one per key. This is the heightmap replacement for the retired whole-volume renderers. Each cell is its own instance, so a cell that covers several cells draws at one cell; use the occupancy member for those.
|
Full Usage:
this.RenderInstancedWithEffect
Parameters:
RenderBuffer3D
grid : CellGrid2D<'T>
occupancy : Occupancy
shaderForKey : 'K -> Shader voption
|
|
Full Usage:
this.RenderInstancedWithEffect
Parameters:
RenderBuffer3D
grid : CellGrid2D<'T>
shaderForKey : 'K -> Shader voption
|
|
Full Usage:
this.RenderWindowInstanced
Parameters:
RenderBuffer3D
left : int
top : int
right : int
bottom : int
grid : CellGrid2D<'T>
occupancy : Occupancy
|
|
Full Usage:
this.RenderWindowInstanced
Parameters:
RenderBuffer3D
left : int
top : int
right : int
bottom : int
grid : CellGrid2D<'T>
|
Like
|
Full Usage:
this.RenderWindowInstancedWithEffect
Parameters:
RenderBuffer3D
left : int
top : int
right : int
bottom : int
grid : CellGrid2D<'T>
occupancy : Occupancy
shaderForKey : 'K -> Shader voption
|
|
Full Usage:
this.RenderWindowInstancedWithEffect
Parameters:
RenderBuffer3D
left : int
top : int
right : int
bottom : int
grid : CellGrid2D<'T>
shaderForKey : 'K -> Shader voption
|
|
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. |
Static members
| Static member |
Description
|
Full Usage:
InstancedRenderContext.Rect(getKey, getMeshesAndMaterial, getTransform)
Parameters:
'T -> 'K
getMeshesAndMaterial : 'T -> (Mesh * Material3D)[]
getTransform : CellRect -> Vector3 -> 'T -> Matrix4x4
Returns: InstancedRenderContext<'T, 'K>
|
Builds a context whose transform receives the rectangle each instance
covers — the anchor's own cell on the cell-walk members, the anchor's
rectangle on the occupancy members — so one model scales to the cells it
stands for:
|
Mibo