Header menu logo Mibo

RenderBuffer3D Type

An allocation-friendly buffer for 3D render commands.

Commands are accumulated each frame via RenderBuffer3D.Add, then executed in insertion order by the active pipeline. The pipeline may re-sort internally if needed for state efficiency (e.g., front-to-back, material batching), but the buffer itself does not impose an order. Uses ArrayPool for the backing store to avoid per-frame heap allocations. The buffer is designed to be cleared and repopulated each frame. RenderBuffer3D.Clear resets the count without deallocating the internal array.

Constructors

Constructor Description

RenderBuffer3D(?capacity)

Full Usage: RenderBuffer3D(?capacity)

Parameters:
    ?capacity : int

Returns: RenderBuffer3D
?capacity : int
Returns: RenderBuffer3D

Instance members

Instance member Description

this.Add

Full Usage: this.Add

Parameters:

Adds a render command to the buffer.

cmd : Command3D

this.AddAnimatedModel

Full Usage: this.AddAnimatedModel

Parameters:
Modifiers: inline

MonoGame animated draw: derives the bone palette from the state.

am : AnimatedModel
transform : Matrix

this.AddAnimatedModelWith

Full Usage: this.AddAnimatedModelWith

Parameters:
Modifiers: inline
am : AnimatedModel
transform : Matrix
material : Material3D

this.AddAnimatedModelWithPerMesh

Full Usage: this.AddAnimatedModelWithPerMesh

Parameters:
Modifiers: inline
am : AnimatedModel
transform : Matrix
resolver : int -> Material3D

this.AddBeginCamera

Full Usage: this.AddBeginCamera

Parameters:
Modifiers: inline

this.AddBeginCameraConfig

Full Usage: this.AddBeginCameraConfig

Parameters:
Modifiers: inline

this.AddBeginEffect

Full Usage: this.AddBeginEffect

Parameters:
Modifiers: inline
effect : Effect

this.AddBillboard

Full Usage: this.AddBillboard

Parameters:
Modifiers: inline
texture : Texture2D
position : Vector3
size : Vector2
color : Color

this.AddBillboardBatch

Full Usage: this.AddBillboardBatch

Parameters:
Modifiers: inline
textures : Texture2D[]
positions : Vector3[]
sizes : Vector2[]
colors : Color[]
count : int

this.AddDirectionalLight

Full Usage: this.AddDirectionalLight

Parameters:
Modifiers: inline

this.AddDisableShadows3D

Full Usage: this.AddDisableShadows3D

Modifiers: inline

this.AddDrawImmediate

Full Usage: this.AddDrawImmediate

Parameters:
Modifiers: inline
action : SceneContext -> unit
_layer : int<MeasureProduct<RenderLayer, MeasureOne>>

this.AddDrawInstanced

Full Usage: this.AddDrawInstanced

Parameters:
Modifiers: inline
mesh : PrimitiveMesh
transforms : Matrix[]
material : Material3D
instanceCount : int

this.AddDrawMesh

Full Usage: this.AddDrawMesh

Parameters:
Modifiers: inline

MonoGame's mesh-level draw is the effectless PrimitiveMesh.

mesh : PrimitiveMesh
transform : Matrix
material : Material3D

this.AddDrawModel

Full Usage: this.AddDrawModel

Parameters:
Modifiers: inline
model : Model
transform : Matrix

this.AddDrawModelWith

Full Usage: this.AddDrawModelWith

Parameters:
Modifiers: inline
model : Model
transform : Matrix
material : Material3D

this.AddDrawModelWithPerMesh

Full Usage: this.AddDrawModelWithPerMesh

Parameters:
Modifiers: inline
model : Model
transform : Matrix
resolver : int -> Material3D

this.AddEnableShadows3D

Full Usage: this.AddEnableShadows3D

Modifiers: inline

this.AddEndCamera

Full Usage: this.AddEndCamera

Parameters:
Modifiers: inline

this.AddEndEffect

Full Usage: this.AddEndEffect

Modifiers: inline

this.AddLine3D

Full Usage: this.AddLine3D

Parameters:
Modifiers: inline
start : Vector3
finish : Vector3
color : Color

this.AddPointLight

Full Usage: this.AddPointLight

Parameters:
Modifiers: inline
light : PointLight3D

this.AddPostProcess

Full Usage: this.AddPostProcess

Parameters:
Modifiers: inline
action : PostProcessContext3D -> unit

this.AddPostProcessWithDepth

Full Usage: this.AddPostProcessWithDepth

Parameters:
Modifiers: inline
action : PostProcessContext3D -> unit

this.AddSetAmbientLight

Full Usage: this.AddSetAmbientLight

Parameters:
Modifiers: inline

this.AddSetShadowOrigin

Full Usage: this.AddSetShadowOrigin

Parameters:
Modifiers: inline
origin : Vector3

this.AddSpotLight

Full Usage: this.AddSpotLight

Parameters:
Modifiers: inline
light : SpotLight3D

this.Clear

Full Usage: this.Clear

Clears all commands from the buffer without deallocating the backing array. Call this at the start of each frame before populating with new commands.

Resets the count every frame (clearing thousands of struct-DU slots per frame is a hot-path cost we avoid), but periodically zeroes the backing array (~every 300 frames) so stale managed refs (Model/Texture2D/Effect) in slots above count can't keep unloaded assets alive indefinitely after a scene shrinks. Dispose also clears. This matches RenderBuffer2D.Clear and the raylib buffers.

this.Count

Full Usage: this.Count

Returns: int

The number of commands currently in the buffer.

Returns: int

this.DepthPostProcessCount

Full Usage: this.DepthPostProcessCount

Returns: int

Number of PostProcessWithDepth commands added since the last Clear. When > 0, the pipeline produces a camera-POV depth target this frame so depth-needing effects (fog, depth-of-field, SSAO) can sample PostProcessContext3D.Depth. Zero on frames with only color-only PostProcess actions, so the depth pass is skipped entirely.

Returns: int

this[i]

Full Usage: this[i]

Parameters:
    i : int

Returns: Command3D

Gets the command at the specified index.

i : int
Returns: Command3D

this.PostProcessCount

Full Usage: this.PostProcessCount

Returns: int

Number of PostProcess/PostProcessWithDepth commands added since the last Clear. Lets a pipeline skip the post-process drain (and its per-frame allocation) when the view emits none.

Returns: int

this.Sort

Full Usage: this.Sort

Parameters:

Sorts commands using the provided comparer. Pipelines may call this internally to optimize draw order.

comparer : IComparer<Command3D>

Type something to start searching.