Chaos as density fields, flows, and raymarches. Math formulas by Yohei Nishitsuji. Ambient music in the header.
Yohei Nishitsuji · 3D · three.js · raymarch
KIFS Glow
Origin: Yohei Nishitsuji · x.com/YoheiNishitsuji0f · 1.00×
manual
Parameters
KIFS Glow
How many rotate→fold iterations (the original used 6).
Raymarch budget (the original used 100).
Strength of the exp surface contribution.
Fold size in abs(2p)−scale (original: 1).
How fast t drives the rotations.
Palette shift of the monochrome glow.
Morphs the rot3 axis middle component around the golf default.
Camera push: g − cam + sin(t/2) (original cam ≈ 3).
Compact golfed kaleidoscopic IFS raymarch by Yohei Nishitsuji (@YoheiNishitsuji): rotate → absolute fold ×6, accumulate exp glow. Origin: https://x.com/YoheiNishitsuji
Explanation
A dynamical system is a rule that takes a point and moves it to a new point — over and over. An attractor is the set of places those points eventually live. “Strange” means the set is fractal: sensitive to starting conditions, never settling into a simple loop, yet never flying off to infinity either. This app does not draw the formula as a curve. It runs the rule millions of times and paints a tiny mark wherever the orbit visits. Bright regions are places the system returns to often — the geometry of chaos made visible as density. The maps, flows, and compact shader math curated in this lab follow work shared by Yohei Nishitsuji (@YoheiNishitsuji on X).
1. State
Start with a point (x, y) — or (x, y, z) for 3D flows like Lorenz.
2. Map
Apply a fixed rule: discrete maps jump; flows take a tiny time step dt; Gargantua and KIFS sample GPU raymarches.
3. Plot
Draw a dim pixel at that location. Repeat ~12,000 times per frame.
4. Density
Where the orbit returns often, marks stack — bright corridors of the attractor.
- Drag. Pan the view; Shift-drag rotates.
- Scroll. Zoom into dense arms.
- Morph. Gently animates parameters so the geometry breathes.
- Presets. Jump to known-good parameter islands.
Math formulas by
Yohei Nishitsujix.com/YoheiNishitsujiMath formulas and dynamical-system sketches that inspired this lab
A golfed raymarcher originated by Yohei Nishitsuji (@YoheiNishitsuji): each ray steps forward, and at every depth the point is spun and folded by absolute-value reflections (a kaleidoscopic IFS). Where the distance estimate kisses zero, an exponential spike paints surface glow — the bright filigree you see.
What you are seeing
Rotating crystalline lattices, tunnels, and glowing edges that reconfigure as time turns the fold axes.
One iteration step
p starts on the camera ray at depth g. Six (or more) iterations of rotate3D + abs(2p)−scale fold space. The estimate e = (‖p.yzx‖·5−6)/900 advances the ray; o accumulates exp(−e·10⁶). That is Nishitsuji’s original compact shader, expanded.
Why it is “strange”
Not a strange attractor orbit — a 3D IFS distance field sampled along rays. Sibling energy to the maps: iteration + fold → structure from chaos.
The map
// origin: Yohei Nishitsuji https://x.com/YoheiNishitsuji
for i < steps:
p = ray(uv, g); p.zy *= rot2(t/2)
for j < folds:
p *= rot3(t+½, axis)
p = abs(2p) − scale
e = (‖p.yzx‖·5 − 6)/900
g += e; o += exp(−e·10⁶)/70Try this
Classic KIFS preset, raise folds to 8, then ease fold size between 0.85–1.15 while it spins.