A step-by-step breakdown of how each frame is computed, processed, and displayed.
Rendering a fractal in real time isn’t a single computation—it’s a pipeline.
Each frame passes through a sequence of stages that transform screen coordinates into a fully rendered image.
Viewport Mapping
Each pixel corresponds to a point in the complex plane:
- Screen → coordinate transform
- Center position + scale defines the view
This mapping must remain stable across frames to preserve continuity.
Iteration Kernel (GPU Compute)
At the core is the escape-time algorithm:
- Each pixel is processed independently
- Iterations continue until escape or the max iteration limit is reached
Executed massively in parallel on the GPU:
- Thousands of threads
- One thread per pixel
This is where the majority of compute time is spent.
Escape Detection
For each pixel:
- Determine if the sequence diverges
- Record iteration count
Enhancements:
- Smooth iteration counts
- Continuous escape metrics
These improve visual quality significantly.
Intermediate Buffer
Results are stored in a buffer:
- Typically, iteration counts or normalized values
- Used as input for coloring
This separation allows flexible rendering pipelines.
Palette Mapping (LUT)
Iteration values are mapped to color:
- Lookup table (LUT)
- Often high resolution. For example, 1024 steps as used in Mandelbrot Metal)
Options:
- Interpolated (smooth gradients)
- Exact (discrete bands)
This stage defines the render's visual identity.
Optional Effects (e.g., 3D Look)
Additional processing:
- Lighting simulations
- Gradient-based shading
- Surface illusion effects
These operate on iteration gradients or derived data.
Super-Sampling Anti-Aliasing (SSAA)
To improve image quality:
- Render at a higher resolution
- Downsample to final size
This reduces:
- Edge artifacts
- Shimmering during motion
Output to Display
The final image is:
- Converted to display color space
- Rendered to screen
At this point, latency matters:
- Must stay within the frame budget
- Avoid stalls between CPU and GPU
Deep Zoom Fallback (When Needed)
At extreme magnification:
- GPU precision becomes insufficient and breaks down
Fallback strategies:
- Higher precision math
- CPU-based rendering
- Tile-based updates
This ensures correctness beyond GPU limits.
Closing
A real-time fractal renderer is not a single algorithm—it’s a coordinated system.
Each stage:
- Has its own constraints
- Impacts performance and quality
- Must be carefully balanced
The result is a pipeline that transforms simple math into an interactive visual experience.
Until next time,
Michael
Get Version 2.2.3 