the fractal
The shape on the homepage is a Mandelbox — a class of fractal discovered by Tom Lowe in 2010. It's rendered in real-time in your browser using a technique called raymarching.
Unlike a typical 3D model made of triangles, the Mandelbox doesn't exist as a mesh. Instead, every pixel on screen casts a ray into a mathematical field. The ray steps forward, checking at each point: "How close am I to the surface?" When it gets close enough, it stops. That's raymarching — and it's all happening on your GPU, roughly 120 times per pixel, 60 times per second.
how it works
The Mandelbox is built from two simple operations applied over and over:
- Box fold — if a coordinate goes past -1 or 1, reflect it back. This creates the angular, architectural geometry.
- Sphere fold — if a point is inside a small sphere, scale it outward. If it's inside a larger sphere, invert it. This creates the recursive depth and infinite detail.
Apply these two folds 12 times in sequence, then measure the distance. That single number — repeated for every pixel — gives you the entire shape. Change the scale parameter slightly and the geometry transforms completely: from crystalline lattices to organic caves to impossible architecture.
The color comes from tracking how the point moves during iteration (an orbit trap), then mapping that trajectory through a cosine color palette. Lighting is physically-inspired: diffuse shading, specular highlights, ambient occlusion, rim lighting, and depth fog — all computed mathematically, with no pre-baked textures.
interact with it
- Drag to rotate the fractal in 3D space
- Scroll to zoom in and out
- Wait and it slowly rotates on its own
The shape subtly breathes — the scale parameter oscillates over time, morphing the geometry between states. Zoom in and you'll find detail at every level. That's the nature of fractals: infinite complexity from finite rules.
why a fractal?
Simple rules producing complex, emergent behavior. That's what I find interesting about both fractals and AI. A language model is just matrix multiplication and attention — repeated billions of times. A Mandelbox is just box folds and sphere folds — repeated 12 times. Both produce something that feels like it shouldn't be possible from such basic ingredients.
The fractal is built with Three.js and a custom GLSL fragment shader. The full source is in the site's repo.