APEX

Browser · WebGPU · Rust/WASM · no install

An open world that streams
out of a single seed.

APEX is an open-world superpower simulation built against a 16.67 ms frame budget. Terrain generates in Rust, physics runs in a worker, shaders are written once in TSL and compile to both WGSL and GLSL.

draw calls 32–34 budget 100
main-thread CPU 2.8 ms budget 8 ms
terrain ↔ physics 0.11 m must agree
Rust tests 17 passing in CI

What is actually running

One shader source

Every material is authored in TSL. The same code compiles to WGSL on WebGPU and GLSL on the WebGL2 fallback — one codebase, two backends.

Dual simulation core

A deterministic Rust core compiled to WASM, mirrored in TypeScript so a clean clone runs without a toolchain, and kept honest by a differential parity test.

Physics owns collision, not time

Rapier runs in a worker. The page owns the clock and sends one step per 1/60 s; the worker never reads a timer of its own.

A populated world

630 conifers and rocks placed by rejection sampling on the same height function the physics collides against — nothing floats, nothing grows in the sea or on a cliff. Two draw calls.

Streamed terrain

A quadtree of chunks around the player, doubling in size with distance, built nearest-first against a per-frame budget with pooled buffers.

Floating origin

At four kilometres the world rebases under the player, in the renderer and in every physics body, so f32 never has to hold a kilometre-scale position.

A character, not a capsule

A figure built from primitives at boot with a procedural gait, a flight pose and a lean into speed. Five draw calls, zero downloaded assets, palette sampled from a photograph.

A mix that follows the world

Every sound is synthesised — no samples. The ambient bed follows the weather and rises with altitude, and anything behind terrain arrives duller through a raycast occlusion test.

Weather that changes the light

Cloud is a diffuser, not a filter: the key drops and greys, the sky fill comes up to carry the scene, and the dome and fog take the weather's own colour. A storm is not a grey fog under a blue sky.

A graded day

Eleven keyframes carry sun colour, key intensity, sky colour and exposure from midnight to midnight. Golden hour is a moment you can point at in the table, not an accident of two colours mixing.

A marker in the world

The active objective has a beacon — a column of light with a turning ring, visible through foliage, fading as you arrive. The HUD carries the distance; the world carries the place.

Powers are earned

One ability at boot, one per mission after that. The HUD carries the distance to the marker and a locked power cannot be cast — progression is the objective flow, not a menu.

100K particles, no CPU

A stateless pool integrated in the vertex shader from origin, velocity and birth. Five powers cast through one path, each landing a real impulse on the physics bodies and the people it touches.

The HUD is the arbiter

Frame time, CPU, worker round-trip, draw calls against budget, chunk build cost. A feature that does not fit the budget does not ship.

Where it is

#BatchMetric that closes itStatus
1Rendering spine, dual core, physics workerCPU < 8 ms, draws < 100done
2Streamed terrain, LOD, scatter, floating origin60 FPS across biomes, no chunk > 20 msdone
3Character feel: slopes, flight, CCDno step/render jitterdone
4Superpower VFX framework100K particles at 60 FPSdone
5Atmosphere, ocean, post-processingno single effect > 1 msdone
6Hardening and mobile preset60 FPS desktop, 30 FPS mobiledone
7Content, NPC AI, missionsthe world feels authoreddone
8Networking and persistenceoptionaldone

Frame-rate gates are unverified: the build environment has no GPU, so Chromium runs a software rasteriser. Everything that can be measured without one is in METRICS.md.

Documents

Support the work

APEX is free, offline-capable and has no account, no telemetry and no server. If it is useful to you, you can put something in the pot — it buys GPU time and coffee, in that order.

GitHub Sponsors UPI · drsohilboi@ybl github.com/drsamonline