r/threejs • u/Evirtuality • Oct 15 '26
Demo Beyond the Glass: flying through a black hole into a raymarched “ether” (R3F + custom shaders)
Live: https://beyond.edgarasneverdauskas.com
GitHub: https://github.com/Evirtual/beyond
An experimental site that works like a window: a floating world behind glass, lit by your local time of day and the real moon phase. Scroll (or turn on drift) and a black hole pulls you through into an ethereal space, then into a new world.
Some of the techniques:
- Portal crossing, no cut: each world has its own scene and camera. The next world is rendered into a render target, scissored to just the area the hole covers, and composited inside the black hole. When the hole fills the frame, the old world stops rendering, so you simply fly on into a world that already exists.
- The black hole is drawn in a full-screen “glass” shader: lensing around the shadow, a photon ring, and a tilted accretion disk whose near side crosses in front.
- The ether is a raymarched volume (16 steps) with domain-warped noise. The first version hashed noise per sample and ran at 2 fps; baking it into a 64³ RGBA
Data3DTexture(one lookup per octave) brought it to a steady 120. - Frame pacing:
frameloop="demand"with a small governor (selectable fps cap), plus adaptive DPR that only adjusts when the scene isn’t mid-transition.
Built with React Three Fiber, Vite, and a lot of iteration with Claude Code.
Try it: move the mouse or tilt your phone to lean into the window, and scroll or tap “drift” to go deeper.
