Header menu logo Mibo

PipelineBufferExtensions Type

Provides a fluent, discoverable API for submitting 3D rendering commands to a RenderBuffer.

Most methods return the buffer instance to allow for method chaining. These extensions are optimized for the 3D pipeline and handle the transition between opaque and transparent rendering passes automatically.

Static members

Static member Description

PipelineBufferExtensions.AddLight(this, light)

Full Usage: PipelineBufferExtensions.AddLight(this, light)

Parameters:
Returns: PipelineBuffer<RenderCommand>
Modifiers: inline

Adds a single dynamic light to the current lighting environment.

Unlike 'Lighting', this does not replace existing lights. It appends the new light to the collection for the current frame. Useful for lights attached to dynamic objects.

this : PipelineBuffer<RenderCommand>
light : Light
Returns: PipelineBuffer<RenderCommand>

PipelineBufferExtensions.Billboard(this, texture, billboard)

Full Usage: PipelineBufferExtensions.Billboard(this, texture, billboard)

Parameters:
Returns: PipelineBuffer<RenderCommand>
Modifiers: inline

Submits a camera-facing billboard to the Transparent pass.

Useful for particles, lens flares, and foliage. The pipeline handles the orientation math based on the active camera at render time.

this : PipelineBuffer<RenderCommand>
texture : Texture2D
billboard : Billboard3D
Returns: PipelineBuffer<RenderCommand>

PipelineBufferExtensions.BillboardOpaque(this, texture, billboard)

Full Usage: PipelineBufferExtensions.BillboardOpaque(this, texture, billboard)

Parameters:
Returns: PipelineBuffer<RenderCommand>
Modifiers: inline

Submits a camera-facing billboard to the Opaque pass.

Rarely used, but effective for high-performance impostors that do not require alpha blending.

this : PipelineBuffer<RenderCommand>
texture : Texture2D
billboard : Billboard3D
Returns: PipelineBuffer<RenderCommand>

PipelineBufferExtensions.Camera(this, camera)

Full Usage: PipelineBufferExtensions.Camera(this, camera)

Parameters:
Returns: PipelineBuffer<RenderCommand>
Modifiers: inline

Configures the view and projection matrices for all subsequent draw calls in the current buffer.

This command triggers an internal state change. If multiple cameras are needed (e.g., for a split-screen or a minimap), you should submit a new Camera command between the respective draw calls.

this : PipelineBuffer<RenderCommand>
camera : Camera
Returns: PipelineBuffer<RenderCommand>
Example

 buffer.Camera(myCamera).Draw(player)

PipelineBufferExtensions.Clear(this, color)

Full Usage: PipelineBufferExtensions.Clear(this, color)

Parameters:
Returns: PipelineBuffer<RenderCommand>
Modifiers: inline

Clears the color and depth buffers of the current render target.

this : PipelineBuffer<RenderCommand>

The render buffer.

color : Color

The background color to fill the target with.

Returns: PipelineBuffer<RenderCommand>

PipelineBufferExtensions.ClearDepth(this)

Full Usage: PipelineBufferExtensions.ClearDepth(this)

Parameters:
Returns: PipelineBuffer<RenderCommand>
Modifiers: inline

Resets the depth buffer without affecting the color data.

Essential when drawing transparent overlays or "always-on-top" objects (like silhouettes) that should not be occluded by world geometry.

this : PipelineBuffer<RenderCommand>
Returns: PipelineBuffer<RenderCommand>

PipelineBufferExtensions.ClearTarget(this, color, clearDepth)

Full Usage: PipelineBufferExtensions.ClearTarget(this, color, clearDepth)

Parameters:
    this : PipelineBuffer<RenderCommand> - The render buffer.
    color : Color - The background color. If black is desired, pass Color.Black.
    clearDepth : bool - If true, the Z-buffer is reset to 1.0, allowing new depth tests to pass.

Returns: PipelineBuffer<RenderCommand>
Modifiers: inline

Performs a targeted clear operation on the current render target.

this : PipelineBuffer<RenderCommand>

The render buffer.

color : Color

The background color. If black is desired, pass Color.Black.

clearDepth : bool

If true, the Z-buffer is reset to 1.0, allowing new depth tests to pass.

Returns: PipelineBuffer<RenderCommand>

PipelineBufferExtensions.Custom(this, drawFn)

Full Usage: PipelineBufferExtensions.Custom(this, drawFn)

Parameters:
Returns: PipelineBuffer<RenderCommand>
Modifiers: inline

Injects a custom rendering callback for low-level GraphicsDevice access.

This is an "escape hatch" for operations not supported by the DSL, such as dispatching compute shaders or drawing custom vertex buffers.

this : PipelineBuffer<RenderCommand>
drawFn : GraphicsDevice -> Camera -> unit
Returns: PipelineBuffer<RenderCommand>

PipelineBufferExtensions.Draw(this, drawable)

Full Usage: PipelineBufferExtensions.Draw(this, drawable)

Parameters:
Returns: PipelineBuffer<RenderCommand>
Modifiers: inline

Adds a pre-configured drawable to the pipeline.

This is the standard way to submit meshes. The pipeline will automatically assign the drawable to the Opaque or Transparent pass based on its material flags.

this : PipelineBuffer<RenderCommand>

The render buffer.

drawable : Drawable voption

The object to render. Passing ValueNone is a safe no-op.

Returns: PipelineBuffer<RenderCommand>

PipelineBufferExtensions.DrawMany(this, drawables)

Full Usage: PipelineBufferExtensions.DrawMany(this, drawables)

Parameters:
Returns: PipelineBuffer<RenderCommand>
Modifiers: inline
Type parameters: 'a

Efficiently submits a collection of drawables.

Ideal for rendering lists of entities or particles. Skips all ValueNone entries.

this : PipelineBuffer<RenderCommand>
drawables : 'a
Returns: PipelineBuffer<RenderCommand>

PipelineBufferExtensions.Lighting(this, lighting)

Full Usage: PipelineBufferExtensions.Lighting(this, lighting)

Parameters:
Returns: PipelineBuffer<RenderCommand>
Modifiers: inline

Sets the global lighting environment, including ambient light and the dynamic light collection.

The 3D pipeline uses this state to pack light data into textures for the PBR shader. Only one lighting state can be active at a time; submitting a new one replaces the previous.

this : PipelineBuffer<RenderCommand>
lighting : LightingState
Returns: PipelineBuffer<RenderCommand>

PipelineBufferExtensions.Line(this, p1, p2, color)

Full Usage: PipelineBufferExtensions.Line(this, p1, p2, color)

Parameters:
Returns: PipelineBuffer<RenderCommand>
Modifiers: inline

Submits a single unlit line segment.

this : PipelineBuffer<RenderCommand>

The render buffer.

p1 : Vector3

Starting point in world space.

p2 : Vector3

Ending point in world space.

color : Color

The color of the line.

Returns: PipelineBuffer<RenderCommand>

PipelineBufferExtensions.Lines(this, verts, lineCount)

Full Usage: PipelineBufferExtensions.Lines(this, verts, lineCount)

Parameters:
Returns: PipelineBuffer<RenderCommand>
Modifiers: inline

Submits a batch of line segments for efficient rendering.

this : PipelineBuffer<RenderCommand>

The render buffer.

verts : VertexPositionColor[]

Interleaved start/end vertices.

lineCount : int

Number of segments (verts.Length / 2).

Returns: PipelineBuffer<RenderCommand>

PipelineBufferExtensions.LinesEffect(this, pass, effect, setup, verts, lineCount)

Full Usage: PipelineBufferExtensions.LinesEffect(this, pass, effect, setup, verts, lineCount)

Parameters:
Returns: PipelineBuffer<RenderCommand>
Modifiers: inline

Submits a batch of lines to be rendered with a custom shader effect.

Used for advanced effects like distance-faded grids or glowing neon paths.

this : PipelineBuffer<RenderCommand>
pass : RenderPass
effect : Effect
setup : (Effect -> EffectContext -> unit) voption
verts : VertexPositionColor[]
lineCount : int
Returns: PipelineBuffer<RenderCommand>

PipelineBufferExtensions.Quad(this, texture, quad)

Full Usage: PipelineBufferExtensions.Quad(this, texture, quad)

Parameters:
Returns: PipelineBuffer<RenderCommand>
Modifiers: inline

Submits a textured quad to the Opaque rendering pass.

Opaque quads are rendered with depth-write enabled and do not support semi-transparency. Ideal for floors, walls, and solid world geometry.

this : PipelineBuffer<RenderCommand>
texture : Texture2D
quad : Quad3D
Returns: PipelineBuffer<RenderCommand>

PipelineBufferExtensions.QuadTransparent(this, texture, quad)

Full Usage: PipelineBufferExtensions.QuadTransparent(this, texture, quad)

Parameters:
Returns: PipelineBuffer<RenderCommand>
Modifiers: inline

Submits a textured quad to the Transparent rendering pass.

Transparent quads are automatically sorted back-to-front by the pipeline to ensure correct alpha blending. Use this for decals, markers, and UI elements.

this : PipelineBuffer<RenderCommand>
texture : Texture2D
quad : Quad3D
Returns: PipelineBuffer<RenderCommand>

PipelineBufferExtensions.Submit(this)

Full Usage: PipelineBufferExtensions.Submit(this)

Parameters:
Modifiers: inline

Terminates the fluent command chain.

While this method is currently a no-op, using it is recommended for visual clarity and to signal the completion of a frame's command submission.

this : PipelineBuffer<RenderCommand>

PipelineBufferExtensions.Viewport(this, viewport)

Full Usage: PipelineBufferExtensions.Viewport(this, viewport)

Parameters:
Returns: PipelineBuffer<RenderCommand>
Modifiers: inline

Restricts rendering to a specific sub-region of the screen.

Use this for UI overlays, minimaps, or local viewport effects. The viewport stays active until another Viewport command is submitted.

this : PipelineBuffer<RenderCommand>
viewport : Viewport
Returns: PipelineBuffer<RenderCommand>

Type something to start searching.