The Storm Drive — Volumetric Fog, Headlight Cones, Lightning at Distance
You're driving down a country road at midnight. Rain hammers the windshield. Your headlights cut into ray-marched volumetric fog. Distant lightning silhouettes the world. Wipers struggle.
What this is
A first-person night driving simulator. The endless procedural country road curves through rolling hills. Volumetric fog ray-marched through 22 steps in a fragment shader gives you headlight cones that you can SEE — bright shafts cutting through mist, not just spotlights on the asphalt. 10,000 GPU-instanced rain streaks fall diagonally; when they hit the windshield, they leave drift-down trails that wipers periodically clear. Lightning every 8-15 seconds illuminates the whole scene; thunder follows after a real speed-of-sound delay with lowpass-filtered rumble for distance.
Why this is mind-blowing
Volumetric lighting is what AAA games shipped in 2016 and we're still catching our breath about. Here it runs in your browser tab from one paragraph. The headlights aren't a Three.js spotlight — they're a real ray-marched cone of scattered light, and you can drive through them.
Build a first-person night driving simulator in Three.js. Endless
procedural country road with hills and curves. Real volumetric fog via
a ray-marched fragment shader; headlight cones cut through it as bright
light volumes. 10,000 GPU-instanced rain streaks falling diagonally,
hitting the windshield and running down it. Wipers swipe on a 3-second
cycle, clearing tracks through the rain. Distant lightning flashes
occasionally illuminate the entire landscape; thunder follows after a
delay proportional to flash distance.
Paste this into Claude, Cursor, or Copilot. Change one thing that matters to you.
What I learned shipping it
- Headlights inside ray-marched fog become ACTUAL light volumes — 22 march steps with fbm-perturbed density and per-step cone scattering. They float in the air, not just illuminate the road.
- ACES tone mapping with low exposure makes headlights the dominant readable light. Without it, night scenes look gray. Tone mapping is the difference between 'dark' and 'cinematic.'
- Speed-of-sound delayed thunder (lowpass cutoff scaling with distance) sells the scale. The model knows the formula — you just say 'thunder follows the flash by distance over 340 m/s.'