Back to projects

2022

GPU Accelerated Mandelbrot Set Explorer

I built a real-time Mandelbrot set explorer with Unity, C#, and HLSL shader code for GPU-accelerated fractal rendering.

GPU Acceleration C# Unity HLSL
Mandelbrot set visualization

Overview

I built this project from an interest in fractals and mathematics. It was my first hands-on experience programming for the GPU and helped me learn Unity, C#, and shader-based rendering.

Rendering approach

I ran the Mandelbrot calculation in parallel for each pixel, using HLSL to keep the explorer smooth at real-time frame rates. I optimized the core iteration loop and represented complex numbers with two floating-point values.

Limits discovered

When zooming deeply, the visualization became pixelated because my GPU did not support the precision needed for 64-bit floating point calculations. Fixing that would require arbitrary precision arithmetic, which would significantly reduce performance.

Project images

Mandelbrot set rendered in Unity
Pixelation caused by floating point precision limits