Binary Formats & glTF Import
Xodó's runtime reads only its own binary formats. Every format begins with a 4-byte signature, a version, and little-endian fields, with bulk arrays aligned to 16-byte boundaries for direct GPU upload or range reads. Hosts bring external content in through a converter or xodo-import.
Engine Formats
| Format | Signature | Contents |
|---|---|---|
| Texture | KTX2 | BC1/2/3/7 or RGBA8 mip chains, with an optional palette |
| Mesh, skin, animation, vertex mesh | XMSH, XSKN, XANM, XVRT | Static and skinned geometry in GPU stream layout; joint animation with smallest-three rotation keys |
| Emitter | XEMT | Particle emitter descriptors |
| Catalog | XCAT | Package object index mapping logical names to converted asset paths |
| Material records | XMAT | Material objects resolved to typed records |
| Engine settings | XSET | Camera, physics, and lighting defaults |
| Level | XGEO, XENT, XLVW, XCAM | Geometry, entities, world records, and camera paths described by schemas (Level dump) |
| Pack | XPAK | Seekable Zstandard archive of files read by byte range |
Assets live in an asset store (engine_assets::store) under lowercase /-separated paths of the form <kind>/<package>/<path>.<extension>.
Importing glTF 2.0 (xodo-import)
engine-import (import/) is a build-time tool crate (never linked into a runtime) that converts .gltf + .bin or .glb files into Xodó asset formats:
sh
cargo run --release -p engine-import -- model.glb out/ --name modelOutputs
model.xmesh— Unskinned mesh nodes baked into one vertex stream (one section per primitive)model.xskin&model.xanim— Skinned mesh and skeletal animationsmodel.<image>.ktx2— Base colour PNG textures stored as BGRA8 with full mip chains- Prints the texture binding used by each section
engine_import::stage::mesh_data converts an .xmesh directly into engine_stage::MeshData.
Feature Support & Constraints
- Supported — Triangle lists with positions, normals (generated if absent), up to 2 UV sets, 1 vertex colour set, and indices; skins with up to 4 influences per vertex, inverse bind matrices, and 1 root joint; linear translation/rotation joint animations resampled at 30 fps; PNG images via URI, data URI, or buffer view.
- Refused explicitly — Required extensions (Draco, quantization, etc.), sparse accessors, morph targets, non-triangle primitive modes, >2 UV sets or >1 colour set, >4 influences, multiple skins/root joints, scaled joints, step/cubic-spline interpolation, animated scale or morph weights, non-PNG images, and meshes exceeding 65,535 vertices.
- Coordinate space — glTF is right-handed, Y-up, metres, +Z forward (matching the stage). Engine files are left-handed, Z-up, X-forward, in 1/50th-metre units.
import/src/space.rsmaps(x, y, z)→(-y, z, x) / 50, preserving winding and UVs while conjugating rotations. - Quantization — Animation rotations use 6-byte smallest-three keys (~`4e-5` error per component); all other values remain 32-bit floats.
Build & Verification Scripts (build/)
bun build/slang.ts— Downloads and pins the Slang shader compiler.bun build/build.ts shaders [--web] [--ios]— Compiles engine Slang shaders into Rust modules, Metal libraries, and WGSL.bun build/stage-materials.ts— Compiles host custom stage materials and post steps (Custom materials).bun build/compare-images.ts <a> <b>— Compares PNG captures or directories with masks, regions, tolerances, and diff image output (Comparing captures).bun build/budget.ts— Verifies the small-host binary size, symbol isolation, and frame-time budget for thespritesexample.