Xodó
Xodó is Bizu's open-source Cargo workspace for desktop UI, 2D/2.5D/3D games, and streamed 3D worlds: a shared GPU device graph with Metal (macOS, iOS) and WebGPU (browser via Emscripten) backends, a retained 2D/2.5D/3D stage, a world runtime, and a hardware-accelerated UI toolkit. Shaders are written once in Slang, and SDL3 handles windows, input, and audio.
Game rules, networking, and session state belong to the hosts built on Xodó.
Highlights
- Shared GPU device graph — Typed handles, ordered render passes, automatic hazard tracking, and transient resource pooling across Metal and WebGPU, driven by one set of Slang shaders.
- 2D / 2.5D / 3D stage — A retained scene model and renderer with orthographic, tilted, and perspective cameras, batched sprites, instanced meshes, classic and PBR lighting, shadows, MSAA, HDR post-processing, temporal anti-aliasing and upscaling, tilemaps, particles, world-space text, and custom Slang materials.
- Streamed 3D world capabilities — Optional capability crates for static regions, cell-and-portal visibility, heightfield terrain with layers and decorations, CPU/GPU skeletal skinning, planar water reflections, atmospheric fog and physical sky, and background level streaming.
- UI toolkit — Retained flexbox tree and immediate 2D canvas, HarfRust text shaping, FreeType-matched hinting and rasterization, SVG icons, linear-light blending, and HUD compositing over stage passes.
- Pay for what you use — Acyclic Cargo crate boundaries ensure a host links only what it uses. Toolkit, stage, and world capability costs stay out of hosts that do not opt in.
Crate Map
Every module is a workspace crate in Cargo.toml. The top-level engine facade crate re-exports the core runtime and UI crates (engine::assets, engine::render::device, etc.). Stage crates are opted into directly so unused stage code is never linked.
Core & Platform
| Crate | Path | Responsibility |
|---|---|---|
engine-core | core/ | Value types, math, load profile and frame trace counters, FixedClock, dynamic resolution controller, RSA public power, and SHA-256 |
engine-platform | platform/ | SDL3 initialization, windows, cursors, BackgroundLoad, web file mounting, PNG helpers, and iOS app lifecycle |
engine-render-device | render/device/ | Device layer: typed resource handles, ordered render graph, and Metal / WebGPU backends (Device layer) |
engine-audio-output | audio/output/ | SDL3 playback device, Ogg Vorbis decoder, generic clip and streaming playback with fades, groups, ducking, and distance gain |
Stage (2D / 2.5D / 3D Scene)
| Crate | Path | Responsibility |
|---|---|---|
engine-stage | stage/ | Headless CPU scene model: transforms, cameras, virtual resolutions, sprites, meshes, classic and PBR lights, shadows, MSAA, culling, picking, HDR post plans, tilemaps, particles, world-space text layout, and debug lines |
engine-stage-render | stage/render/ | Draws stage draw lists through the device layer using Slang shaders, host custom materials, and engine-gfx glyph rasterization |
engine-stage-assets | stage/assets/ | Reads converted .xmesh, .xskin, .ktx2, emitter, and material files into stage data |
engine-stage-cells | stage/cells/ | Cell-and-portal visibility masks and point-to-cell queries for stage cameras and regions |
engine-stage-levels | stage/levels/ | Loads converted levels, BSP geometry, terrain chunks and layers, decorations, sky, fog, simulated effects, and background streaming into the stage |
engine-stage-materials | stage/materials/ | Built-in stage custom materials and post steps: compiled stage programs, terrain layers, water, physical sky, cube reflections, contact shadows, seabed caustics, and light shafts |
engine-stage-skinning | stage/skinning/ | CPU and GPU compute skeletal mesh skinning and animation blending for the stage |
World Runtime & Data
| Crate | Path | Responsibility |
|---|---|---|
engine-assets | assets/ | Binary asset formats (KTX2, meshes, skins, animations, emitters, catalogs, materials, levels), asset store, seekable packs, host profile, and async byte source |
engine-scene-materials | scene/materials/ | Material graphs, stage compilation, texture animation, and procedural texture interfaces |
engine-scene | scene/ | Level data and loaders, lighting, particles, visibility, and material resolution |
engine-scene-world | scene/world/ | Seamless world scene, collision, water, time of day, and cameras |
engine-scene-pawns | scene/pawns/ | Skeletal animation, skinning, and pawn shadows |
engine-render | render/ | Metal ray tracing, light masks, CPU reference rasterizer, and video output |
engine-audio | audio/ | Sound voices, sound library, and music / ambient players |
UI Toolkit & Tools
| Crate | Path | Responsibility |
|---|---|---|
engine-gfx | gfx/ | 2D UI renderer, interface font, FreeType-matched autofit hinter, and smooth glyph rasterizer |
engine-ui | ui/ | Retained flexbox UI tree, immediate canvas, text shaping, SVG icons, input, and HUD compositing (UI toolkit) |
engine-ui-view | ui/view/ | Elm-style components on the retained tree: element builders, keyed reconciliation, story tests and headless behaviours (components) |
engine-cli | cli/ | The xodo CLI for lossless JSON dumps of binary level files and back (Level dump) |
engine-import | import/ | Build-time glTF 2.0 importer (xodo-import); never linked into a runtime (Formats & Import) |
engine-image-diff | image_diff/ | Dev-dependency for RGBA8 capture comparison in tests |
Guide Index
- Getting Started — Building, testing, examples, and host integration
- Architecture — Workspace & Rust rules, Device layer & render graph, Asset source & loading, Resource lifetimes
- The Stage — Model, cameras & renderer, Lighting, shadows & HDR post, Tilemaps, particles, text & helpers, World capabilities
- UI Toolkit — Retained flexbox tree, canvas & text
- Platforms — iOS setup, SDL3 & simulator samples
- Tools & Formats — Binary formats, glTF import & capture diff, Level dump CLI
- Reference — Material device capabilities, Vertex data preparation
- Rendering Contracts — Index, Colour, Baked lighting, Materials, Precision, Streaming