This goal of this project is to render the Mandelbrot and Julia sets. I made two versions : on GPU and on CPU.
This simulation uses Python3 and C++. The python library are tqdm, PIL. You can download them with pip3 install tqdm pillow.
Compile the C++ library with g++ -c -fPIC CPU/library.cpp -o CPU/library.o && g++ -shared -o CPU/library.so CPU/library.o.
Run the python with python3 CPU/Julia.py.
Altenatively, you can compile and run python in the same time with : g++ -c -fPIC CPU/library.cpp -o CPU/library.o && g++ -shared -o CPU/library.so CPU/library.o && python3 CPU/Julia.py
You can use three differents modes of rendering : Python, C or C_COLOR. C color do more calcul in C than the C mode.
This simulation uses Processing. You can download the Processing application here. GPU.pde is the layout and manage UI. shader.glsl calculate the color of each pixel.
Keyboard actions :
- Arrows : move view
:and=: zoom or dezoomlandm: progressive zoomoandp: increase or decrease number of itterations;: change display mode (Mandelbrot, Julia or JuliaSDF)alt: reset scene
To compute the fractales, I use C++ and GLSL. Those two programs do basicly the same thing, but GLSL run the calculation in parallel for each pixel, witch is faster than C++. The calculation are detailes in the next parts.
We define
The Julia set is similar to the Mandelbrot set, but now
This is only available on for GPU.
An SDF is a signed distance function. This algorithm tries to calculate the distance to the Julia set.
To compute this distance, we compute the







