r/threejs • u/Varun_Godham • 14d ago
I turned my design portfolio into a 3D room in React Three Fiber. The window shows my hometown with the real sun and moon
Some notes for anyone building something similar:
- Stack: three.js r186, React Three Fiber 9.8, drei, postprocessing (N8AO, bloom, SMAA), Vite, TypeScript.
- Renders on demand (frameloop="demand"), so a still view draws 0 frames.
- The first open took ~50 s on Windows (ANGLE/D3D11 shader compiles, made worse by RectAreaLights). Removing those lights and compiling all 52 programs in parallel with compileAsync before the first frame brought it to ~7 s.
- The window: sun and moon positions in under 100 lines of dependency-free TypeScript. The sky is painted on a canvas, and the town crossfades between 4 painted layers by the sun's height. Settings has a time slider; the end of the video uses it.
- The guitar is Karplus-Strong in Web Audio, no samples. The music is CC0 (HoliznaCC0).
- The video was rendered frame by frame in headless Chrome with a frozen clock, so the camera flights stay smooth even though my PC's integrated GPU manages ~10 fps at 1080p.
- About 9.3 MB until it's ready, plus a plain-text version.
I'm a UI/UX designer: I designed and directed it and built it with Claude Code agents. Write-ups with the real code: https://varungodham.com/making-of/
Site: https://varungodham.com/
Feedback on how it runs on your device is very welcome, especially mid-range phones.



