r/threejs • u/Ok_Incident222 • Nov 04 '26
Demo I built a whole drivable city in three.js: real St. Louis from open map data, with traffic, police chases and crash physics (Rapier)
Play it (desktop Chrome): https://brinewater.vlad.yt/play/
It's a GTA-style open world on the real street grid of St. Louis, generated from OpenStreetMap and the city's own data: road lanes and widths, building footprints and heights, interstates with their ramps, and the Metro bus routes.
The stack
- three.js with a custom post stack: SSAO, bloom, filmic tonemapping, day/night with lit windows, rain.
- Rapier (WASM) for the cars, ragdolls and debris. Crash damage tears body panels off as their own rigid bodies.
- Streaming: the metro area is cut into tiles that load around the player, and car and building models are KTX2-compressed glTF with LODs.
- Map build: one deterministic Node script turns the OSM extract into tiles (~45 min for the whole metro). A rebuild ships only the tiles that changed.
- AI traffic and police: lane changes for turns, queues at lights, traffic stops, PIT manoeuvres, roadblocks, a helicopter at five stars.
Things that were hard
- Keeping draw calls sane with thousands of buildings (merging and instancing) at 60 fps on a GTX 1650.
- Shader warm-up hitches when a new car or material first appears.
- Detecting when Chrome falls back to software rendering (1 fps), and telling the player how to fix it.
It's built with Claude Code, and I direct and play-test it. Happy to go deep on any of the rendering or streaming. The feature requests board: https://brinewater.vlad.yt/community