Raymarching & SDF

Version 4 of 4

Mandelbulb.

GPU · fractal · 2009

This version

A 3D fractal with a distance estimate, raymarched like any other SDF. Its power slowly breathes; colour comes from an orbit trap.

How this version works

At a render scale of 0.5, an orbiting camera traces a fractal whose power slowly varies between 6.5 and 9.5. Each distance estimate performs up to six spherical-coordinate power iterations, tracking a derivative and stopping early when the orbit radius exceeds two. Primary rays take up to 90 steps, and the minimum orbit radius selects colours between coral and pale gold. Finite-difference normals provide diffuse and specular lighting, while a higher ray-step count darkens the diffuse result as a simple occlusion approximation.

The trick in this version

This shader marches an iterative distance estimate rather than an exact primitive distance function. Every normal calculation requires six more fractal evaluations, so the reduced render scale and bounded iteration counts constrain the GPU workload.

Historical context · GPU

  1. 2009 · Still, Loonies and others

    The year of raymarching

    In his ‘Behind Elevated’ talk, Quilez calls 2009 a year of ‘AO*Reflection Raymarching’, adoption across the intro scene, documented.

  2. 2008 · Iñigo Quilez · NVScene 2008

    Rendering worlds with two triangles

    The talk that tied full-screen shaders, 4K intros and distance-field acceleration together, with modelling operators, ambient occlusion and soft shadows.

  3. 2013 · Iñigo Quilez & Pol Jeremias

    Shadertoy

    Public shader code with live output: the place where procedural techniques, distance fields above all, are studied, forked and shared.

Platform
GPU · fractal
Era
GPU
Rendered on
GPU
Tags
fractal · distance estimator
Sources
The year of raymarching (2009)Rendering worlds with two triangles (2008)Shadertoy (2013)