/mandelbrot-set-explorer

Colorful Mandelbrot set renderer in C# + OpenGL + ARM NEON

Primary LanguageC#MIT LicenseMIT

Mandelbrot Set Explorer

License - MIT

OpenTK–based C# program that generates images of the Mandelbrot set.

Uses two rendering techniques:

  • OpenGL fragment shader (GPU) - very fast, but limited by 32-bit floating point precision.
  • Monte Carlo (CPU) - uses all available threads to parallelize the work. Works on double precision numbers. Will use 128-bit NEON SIMD operations on supported 64-bit ARM processors.

Installation

Build and run the project by invoking the dotnet run command.

Usage

  • Left-click and hold to pan around, scroll wheel to zoom.
  • Hold 1 and scroll to change the escape radius
  • Hold 2 and scroll to change the color modifier
  • Hold 3 and scroll to change the number of iterations
  • Press R to switch between GPU/float and CPU/double rendering.
  • Press 0 to change resolution (for CPU rendering)
  • Press S to save the image to a file.
  • Press Escape to terminate the program.

Parameters

Setting the escape radius to a value higher than 2 gives the background a wavy pattern. These are images of the same region, rendered with R = 2 and R = 8192 respectively.

The escape radius is set to R = 2 by default, as it creates smoother looking images. Viewing structures "from afar" can create some nicely blended color patterns:

The number of iterations per pixel determines how detailed the image is. Lower values cause pixels to prematurely be assigned the black color. Here are two images of the same region with N = 1375 and N = 4000:

Gallery