A Mandelbrot Fractal Explorer written in C++ and SFML, and Thread Pools.
It can view up to a zoom (pixel width) of 10^-16
before encountering floating point errors (although this could be increased using long double
at the cost of speed and inconsistency across compilers).
a 1080x1080 render at a zoom of 10^-4.66 and a max iteration of 576, rendered in 0.330s
- Customizable size, max iteration count, iteration increment on zoom, scale factor when zooming, and period checking frequency. These can be set with command-line arguments. For more details, run
main.exe --help
. - Zoom in/out with the mouse scroll wheel. It will place the region the mouse was over when scrolling at the center of the window after the zoom.
- Increase/decrease maxiter with any of the
arrow
keys or with the numpad+
and-
keys.
Here are the list of optimizations and improvements implemented, taken mostly from this Wikepedia article:
- Normalized iteration count
- Continuous coloring
- Cardoid checking
- Periodicity checking
- Multithreading
- Clone the repository
- Install g++
- Download SFML-2.6.0 (GCC MinGW) from https://www.sfml-dev.org/download/sfml/2.6.0/ and add it to the root directory
- Compile and run
main.exe
with the following commandsg++ -c main.cpp -ISFML-2.6.0/include -DSFML_STATIC g++ -o main main.o -LSFML-2.6.0/lib -lsfml-graphics-s -lsfml-window-s -lsfml-system-s -lopengl32 -lwinmm -lgdi32 del main.o main.exe