A Mandelbrot set generator built to explore parallel processing and CUDA concepts.
This project renders high-resolution images of the Mandelbrot set by mapping pixel coordinates to the complex plane and calculating the escape-time algorithm (
- GPU Acceleration: Replaces nested CPU loops with a fully parallelized CUDA kernel, allowing millions of pixels to be calculated simultaneously across GPU threads.
- 4K UHD Resolution: Capable of generating ultra-high-definition (3840 x 2160) fractals in a fraction of a second.
- Dynamic Camera System: Implements an aspect-ratio-locked, mathematical camera system (
centerX,centerY,zoom) to explore deep, specific fractal structures like Seahorse Valley. - Smooth Gradient Coloring: Bypasses basic modulo coloring by utilizing a GPU-side linear interpolation (lerp) engine to calculate ultra-smooth transitions across custom, multi-stop RGB palettes.
- Optimized Binary I/O: Utilizes the
P6binary PPM image format and direct memory block writing (reinterpret_cast) to eliminate the massive CPU bottlenecks caused by ASCII text conversions.
- C++ Compiler (MSVC, GCC, or Clang)
- NVIDIA CUDA Toolkit
- A CUDA-capable NVIDIA GPU
This project is compiled using the NVIDIA CUDA Compiler (nvcc).
- Clone the repository and navigate to the project directory:
git clone [https://github.com/yourusername/Mandelbrot-Set-Generator.git](https://github.com/yourusername/Mandelbrot-Set-Generator.git
cd Mandelbrot-Set-Generator- Compile and run the CUDA source file:
nvcc main.cu -o main.exe | .\main.exeThis command will output a mandelbrot.ppm file which will have the compiled mandelbrot set.
- Real-Time Interactive Viewer: Transition from a static batch-renderer to a live, navigable application. By leveraging GLFW and CUDA-OpenGL Interoperability, the CUDA kernel will write pixel data directly to an OpenGL texture on the VRAM, bypassing the CPU entirely to enable 60+ FPS panning and deep-zooming.
- Continuous Color Smoothing: Upgrade the discrete integer escape loop to a fractional escape algorithm (normalized iteration count). Utilizing the logarithm of the complex magnitude will eliminate stepped color banding and produce mathematically seamless gradient transitions.
- Supersampling Anti-Aliasing (SSAA): Implement a sub-pixel sampling architecture within the CUDA kernel. By calculating and averaging multiple offset coordinates per pixel, the renderer will eliminate jagged artifacts and deliver ultra-crisp, textbook-quality image fidelity.
- GitHub: @RamLanka05
- LinkedIn: Sathvik Ram Lanka
- Affiliation: Statistics & Computer Science, University of Illinois Urbana-Champaign