Abstract
This paper presents a method for leveraging modern GPU raytracing pipelines (DXR) to render complex 3D fractals, such as the Mandelbulb and Julia sets, in real-time. By implementing distance estimation functions within custom intersection shaders, the authors transform abstract mathematical sets into interactive, high-fidelity procedural objects capable of realistic lighting and reflections.
Introduction
Visualizing complex 3D fractals presents a significant computational challenge. Unlike standard 3D meshes composed of triangles, fractals are defined by iterative mathematical functions. Rendering them requires identifying the "surface" of the set, a process traditionally too slow for real-time interaction. However, the demand for these "infinite" patterns in digital art and cinematography—seen in films like Big Hero 6 and Doctor Strange—has driven the need for more efficient techniques. This paper provides a blueprint for rendering these shapes at interactive frame rates by bridging complex fractal mathematics with high-performance computer graphics.
Methodology
The authors utilize the DirectX Raytracing (DXR) pipeline, focusing on several key technical implementations:
- Intersection Shaders and Distance Estimation (DE): Rather than checking every point in space, the authors employ Distance Estimation. Utilizing the Boettcher map—a mathematical tool describing space deformation under iteration—they derive a formula to estimate the distance from any point to the fractal's surface. This allows the ray tracer to "march" through empty space in large steps, decelerating only as it approaches the fractal boundary.
- Closest-Hit Shaders: Upon intersection, these shaders manage the visual output using a Phong lighting model and recursive reflections.
- Numerical Gradient Estimation: To calculate surface normals for lighting, the authors sample the distance function at the four vertices of a tetrahedron. This numerical approach provides high-quality normal vectors with only four function evaluations, avoiding complex analytical derivatives.
- 3D Julia Sets: Since Julia sets are naturally four-dimensional (quaternions), the authors render them by taking 3D "slices" of the 4D space, as illustrated in the intricate structures of Figure 1.
Key Insights
A core contribution of this work is treating fractals as procedural primitives. By containing the fractal logic within an Axis-Aligned Bounding Box (AABB), these sets can exist alongside traditional 3D models in a unified scene. Furthermore, the use of the Boettcher map provides a smooth distance function $G(z)$ that, while not a perfect metric, behaves predictably enough for efficient ray marching. By moving this logic into the DXR intersection shader, fractals can participate in the full raytracing ecosystem, including shadows and reflections from other objects.
Results
The authors successfully rendered the Mandelbulb (specifically the $n=8$ version) and various Julia sets at interactive speeds. The results demonstrate high visual fidelity, characterized by complex, self-similar structures with smooth shading and realistic reflections. Figure 4 showcases the detailed, bulbous geometry of the Mandelbulb achieved through this method.
Beyond individual sets, the authors demonstrated "hybrid" scenes where Julia sets, Mandelbulbs, and standard geometric shapes interact within the same raytraced environment.
Limitations and Future Work
While the results are compelling, the authors note that coloring these sets often requires empirical parameter tweaking. Additionally, the accuracy of the fractal surface is constrained by the number of iterations performed in the shader; extremely high counts can eventually impact real-time performance. The authors hope their visualization tools will motivate further mathematical study into 3D analogues of complex numbers, as the Mandelbulb still lacks a "canonical" 3D representation.
Summary updated