Header menu logo Mibo.Raylib

Rendering Overview

Mibo.Raylib uses a deferred, layer-sorted rendering pipeline. Instead of calling raylib draw functions directly, you build a list of commands each frame, and the renderer sorts and executes them in one pass.

The Pipeline

  1. Your view function builds IRenderCommand2D commands and adds them to a RenderBuffer2D
  2. The renderer sorts commands by Layer (ascending)
  3. The renderer executes commands in order
  4. raylib auto-batches GPU draw calls; optional post-processing passes run after

Why Deferred Rendering?

2D Rendering

The 2D pipeline is built on Renderer2D<'Model> in the Mibo.Elmish.Graphics2D namespace. See:

3D Rendering

The 3D pipeline is built on Renderer3D<'Model> in the Mibo.Elmish.Graphics3D namespace. It uses a pluggable IRenderPipeline3D that interprets Command3D values — draw meshes, billboards, lights, shadows, and post-processing passes.

Multi-Renderer Compositing

You can combine 2D and 3D renderers in the same program. The 3D scene renders first, then the 2D renderer composites on top (HUD, menus, debug overlays).

Program.mkProgram init update
|> Program.withRenderer (fun () ->
    Renderer3D.create pipeline view3D)
|> Program.withRenderer (fun () ->
    Renderer2D.create view2D)

The 2D renderer uses Renderer2DConfig.noClear to skip clearing the background, preserving the 3D scene underneath. Per-camera clear control is also available via Camera3DConfig and Camera2DConfig.

See also: Camera for multi-camera patterns.

Type something to start searching.