Rendering Modes

Polygon · SDF · Lithos Emitted · Server-Streamed · Lithos Native

The Five Rendering Paths

Polygon Mesh

Traditional Three.js scene graph. Object3D tree, BufferGeometry, MeshStandardMaterial. Each object is a mesh with vertices, faces, and materials. The GPU rasterizes triangles.
~456 objects ~26 modules ~12ms frame GC pauses

SDF Raymarcher

/sign/sdf or /sign (default for Virgo)
Single fullscreen quad. Fragment shader marches rays through signed distance fields. All geometry is mathematical — no vertices, no triangles. One shader, one draw call.
1 draw call ~96 march steps ~8ms frame sceneSDF kernel

Lithos Emitted SDF

Server-side shader specialization. The Lithos emitter frustum-culls objects, bakes terrain heights as constants, adapts march step count. Browser compiles the specialized GLSL. Same visual, fewer GPU ops.
frustum culled constants baked 43-96 adaptive steps 0.879 Lipschitz

Server-Streamed

Zero WebGL on client. Server renders via Dawn WebGPU on M4 GPU, streams JPEG frames over WebSocket. Browser just draws images to a 2D canvas. No shader compilation, no GPU required on client.
0 client GPU JPEG over WS 30fps @ 1280x720 M4 server GPU

Lithos Native (Future)

/sign/native
Lithos compiles sceneSDF directly to AGX bytecode. Single megakernel dispatch per frame. No GLSL, no WebGPU, no Dawn. The math IS the bytes on the GPU. Streamed to browser or run locally via WASM.
406µs dispatch ~69KB binary 0 GC L2 cache resident

Head-to-Head Comparison

Aspect Polygon SDF Lithos Emitted Server-Streamed Lithos Native
Draw calls 456+ 1 1 0 (client) 1 dispatch
Frame time ~12ms ~8ms ~6ms ~0ms (client) ~2ms
GC pauses 2-5ms / 500ms 2-5ms / 500ms 1-3ms (less JS) 0 (server) 0
Client GPU Required (WebGL) Required (WebGL) Required (WebGL) Not required WASM or stream
Geometry Triangles Distance fields Distance fields Distance fields Distance fields
March steps N/A (rasterize) 96 (fixed) 43-96 (adaptive) 43-96 (adaptive) Lipschitz-optimal
Object culling Three.js frustum None (all in shader) Server frustum cull Server frustum cull Compile-time cull
Terrain heights Mesh vertices FBM per step Baked constants Baked constants Baked constants
Shader size Multiple materials ~15KB GLSL ~36KB specialized ~36KB (server) ~69KB native
Network ~200KB modules ~15KB module ~36KB JSON 30fps JPEG stream 69KB binary (once)
Latency 0ms (local) 0ms (local) ~5ms (emit fetch) ~33ms (frame lag) 0ms (local)
Memory ~120MB ~40MB ~35MB ~5MB (client) ~30MB
Scene graph Three.js Object3D None None None None

Rendering Pipelines

Polygon

JS modules Three.js scene Object3D tree frustum cull WebGL draw calls GPU rasterize pixels

SDF Raymarcher

GLSL shader fullscreen quad per-pixel ray march loop (96) sceneSDF(p) shade + tonemap pixels

Lithos Emitted

lithos-emit.mjs frustum cull bake heights adaptive steps GLSL template WebGL compile sceneSDF(p) pixels

Server-Streamed

lithos-emit.mjs GLSL → WGSL Dawn WebGPU M4 GPU render JPEG encode WebSocket canvas.drawImage

Lithos Native (Future)

scene.ls byte dispatch AGX megakernel M4 GPU (40k threads) pixels → stream or WASM

SDF vs Fractal vs Procedural

TechniqueWhat it isCost per stepLithos compatibilityUsed in
Primitive SDF Exact distance: sphere, capsule, box. Lipschitz-1. t += d safe. 1-3 ops Direct .ls mapping All homes, drawbook
Smooth union (smin) Polynomial blend: min(a,b) - h²·k/4. Preserves L-1. ~8 ops Direct .ls mapping Tree canopies, organic forms
Height-field terrain p.y - terrainH(p.xz). L > 1 (needs relaxation). ~40 ops (FBM) noise.ls library Virgo meadow, Taurus hills
IFS fractal tree Iterated fold-rotate-scale. 8 iterations of domain warping. ~80 ops (8 iter) Needs loop primitive glsl/stdlib.mjs ifsBranch
Volumetric aura Accumulate glow from near-misses: glow += exp(-d²*k) ~12 ops/step Standard ops Gemini twins, stars
Field-valued SDF vec4(distance, gravity, temperature, density). Physical rendering. 4x scalar SDF .ls vec4 ops sdf_solar, sdf_fields
Spectral-break FBM Multi-regime noise: convective→granular, tectonic→erosion. Phase transitions at physical scales. ~60 ops (6 oct) noise.ls 1:1 port Stars, terrain, galaxies, nebulae
Animated creature Many primitives composed with time-dependent transforms. Bull: ~35 primitives. ~200 ops Static pos bakeable, animation not Taurus bull, drawbook octopus
Domain repetition Infinite copies via mod(p, period). Vineyard rows, star fields. ~5 ops + 1 SDF mod is a primitive Taurus vineyard
Mandelbrot/Julia Escape-time iteration. Not SDF — no distance estimate. ~500 ops (256 iter) Loop + complex ops mandelbrot.html

Try It

Virgo — English Meadow
Taurus — Mediterranean Vineyard