Path Tracing 3D Fractals
path-tracingray-tracingrenderingfractalsglslmonte-carlo
Abstraction: GPU path tracing of 3D fractals using Monte Carlo integration in GLSL
Key points:
- Path tracing solves the rendering equation via Monte Carlo: shoot rays from camera, bounce at surfaces using random hemisphere samples, accumulate light until hitting a light source
- Cosine-weighted importance sampling (PDF = cos(theta)/pi) cancels the cosine factor in the diffuse term, yielding simpler code and faster convergence than uniform hemisphere sampling
- Direct lighting / Next Event Estimation required for small light sources: the sun covers ~1/100,000 of the hemisphere, requiring ~70,000 samples for 50% hit probability without it
- GLSL implementation in Fragmentarium uses pseudo-random seed from pixel coordinates; single-precision float precision errors can arise with sun-sized light sources
- Applied to 3D distance-estimated fractals (Mandelbulb): path tracing provides natural lighting and better 3D perception; one internal bounce adds 2.2x render time, two bounces 3.5x
- Fixed ray-depth termination makes the renderer biased/inconsistent; Russian roulette termination needed for true convergence
Connections: Fragmentarium · Path Tracing · Monte Carlo Sampling · Physically Based Rendering
Source: http://blog.hvidtfeldts.net/index.php/2015/01/path-tracing-3d-fractals/