I'll start by inspecting the project scaffold.
Single-file build is already configured (vite-plugin-singlefile). Now I'll build the engine. Starting with math utilities and a 5×7 bitmap font for neon signage.
Now the core framebuffer: RGB light buffers, depth, braille sub-pixel bitplane, glyph overrides, bloom, and the glyph-ramp resolver that emits colored spans.
Now the camera: perspective projection with a curving/undulating road spline, roll shear, and a cached row→distance table for ground rasterization.
Now the sky pass — gradient, scrolling cloud deck, twinkling braille stars, moon, parallax skyline with lit windows.
Now the city pass: procedural building blocks, perspective-correct wall slicing with windows, neon signage rasterized from the bitmap font, streetlights, cables and traffic signals.
The road pass — wet asphalt with mirrored reflections, puddle masks, ripples, lane markings and per-light ground pools.
Now traffic: oncoming headlights, tail lights ahead, wet-road light smears, and umbrella-carrying pedestrians on the sidewalk.
Now weather: 3D rain with motion-blurred streaks, impact ripples, splash sparks, steam vents, embers, dust motes, plus windshield droplets and a wiper as a post pass.
Now the renderer that drives the passes, camera dynamics, dashboard HUD and post-effects.
Now updating the camera to accept a measured cell aspect ratio, then building the React shell.
Build passes. Now some correctness and performance refinements — precomputing sky azimuths, cheaper noise in the road pass, and a black default text colour so zero-colour runs stay invisible.
A robustness pass: fonts that lack braille/block glyphs would break the monospace grid, so I'll runtime-measure glyph widths and fall back to pure ASCII ramps when needed.
A few final touches: tuning the edge threshold and adding distant lightning that briefly lights the cloud deck and lifts exposure.
Built successfully — and because vite-plugin-singlefile is configured, dist/index.html is one self-contained HTML file with everything inlined (no external JS/CSS/assets).
What I built
A genuine real-time text rasterizer (~3,500 lines across 12 modules) — no canvas, no images, no sprites, no pre-baked frames. Every frame the scene is rasterized into float RGB light buffers at cell resolution plus a 2×4 braille sub-cell bitplane, then resolved into one RLE-compressed string of colored <span>s written to a single <pre>.
The rasterizer (framebuffer.ts)
- Depth-buffered plot/blend/additive-glow/bilinear-splat primitives, plus Bresenham line drawing in sub-cell braille space (⠁…⣿) for detail finer than a character.
- Three depth-selected brightness ramps: sparse thin glyphs for distant material, the classic 70-step ASCII ramp mid-field, and a chunky block ramp (
░▒▓█ %&@$) up close — exactly the "far fades to sparse, near goes bold" behaviour.
- Sobel edge pass that swaps mid-tones for direction-matched strokes
│ ╱ ─ ╲, 4×4 Bayer dithering, separable half-res bloom, filmic tonemap, and chroma re-normalization so neon stays vivid.
- Runtime font probing: if the user's monospace font renders braille/blocks at a different advance width, it silently falls back to pure-ASCII ramps so rows never shear.
The scene — camera rides an analytic road spline (curveX/curveY bend everything ahead of you), with suspension bob, curvature-driven roll shear, look-into-the-bend yaw and pointer drag-look.
- Sky: light-pollution dome, scrolling fBm cloud deck lit from below, 460 twinkling braille stars, crescent moon with halo, blinking aircraft, two parallax skyline layers with braille windows, and distant lightning that stutters and lifts exposure.
- City: infinite deterministic blocks sliced in z with perspective-correct 1/z interpolation — windows (lit/TV-flicker/curtained), floor lines, grime streaks, storefronts with silhouettes inside, rooftop antennae with beacons, and neon signs rasterized from a hand-authored 5×7 bitmap font as true world geometry (they bend with the road, chase, flicker, and reflect).
- Road: every cell inverse-projected to world space — asphalt grain, cracks, lane paint, crosswalks, manholes, kerbs and paving; puddle masks; mirror reflections that re-sample the frame's own upper half, distorted by flow noise and expanding raindrop impact rings; per-light ground pools with wet streak stretching.
- Traffic & life: oncoming headlights, brake-modulated tail lights, wheel spray, ripple-jittered light smears down the wet road, umbrella-carrying rim-lit pedestrians.
- Weather: ~1,000 3D raindrops projected twice per frame for motion-blurred streaks (braille far, slash glyphs near), splash sparks, steam vents, embers, dust motes, and a windshield of lens droplets that invert/magnify the image behind them, a residual smear film, and a wiper that sweeps them away.
- Dashboard with in-grid instrument text (speed, RPM bars, wetness, heading, FPS).
Keys: space pause · R rain · B bloom · E edges · M phosphor mono · W wipe · G glass · X exposure · F speed · Q particles · +/- glyph density · drag to look.
Files built: src/engine/math.ts, src/engine/font5x7.ts, src/engine/framebuffer.ts, src/engine/camera.ts, src/engine/scene/sky.ts, src/engine/types.ts, src/engine/scene/city.ts, src/engine/scene/road.ts, src/engine/scene/traffic.ts, src/engine/scene/weather.ts, src/engine/renderer.ts, src/App.tsx, index.html