Viewer
Not a game — a tool. The same apps/viewer that opens a
.glb from your disk, running here on the document it ships
with.
controls
A mouse and four keys.
- Orbit the document drag, or one finger
- Zoom scroll, or pinch
- What the document holds, and what the conversion skipped I
- Wireframe W
- World-space normals N
- Exposure - =, or the panel's slider
- Pause and resume Esc
- Fullscreen F11
- Debug overlay F3
- Debug console `
- Pause, fullscreen and the debug overlay keys — unless a control for them is listed above
- Debug console, and its on-screen keyboard the CONSOLE button, once you have touched the canvas
what is actually running
The native tool, with one difference that is not a porting detail.
The native viewer is pointed at a file: you give it a path, it reads the document through the asset seam, converts it, frames the camera on its bounds and draws it. Point it at something re-exported from Blender and the frame becomes the new document while you watch.
A browser tab has no path and no filesystem to resolve one against, so this
build opens with a document generated in Rust and compiled into the module —
and then takes whatever you drag onto the canvas. A dropped
.glb or .gltf goes through a staging buffer into
exactly the loader a path reaches natively, and the next frame that draws is
the new document. Everything past the loading is the same code — the orbit
camera, the frame-on-load, the grid scaled to the document's own size, the
listing, the debug views, the exposure.
The other differences are the ones every demo here has. Start-up is polled
across several frames, because requestDevice is a promise and
the main thread cannot block on it — and for this sample that had to reach
further than the others, because its renderer is built out of the document
it is showing, so the document has to be carried through the device request
rather than loaded after it.
console.log, so log lines are queued
inside wasm and drained by the page each frame. crcbl.audio(),
crcbl.saves() and crcbl.logLevel(4) are there too.