A fully interactive GPU-accelerated customizable fractal zoom program aimed at creating artistic and high quality images & videos.
Mandelbrot set is a set defined in the complex plane, and consists of all complex numbers which satisfy
Points inside the set are colored black, while points outside the set are colored based on
- Fully customizable equation in GLSL syntax
- Perturbation theory for zooming further than you'll have the patience for
- 11 built-in unique fractals
- Smooth coloring
- Normal mapping for shadows
- TAA (temporal anti-aliasing) and SSAA (super sampling anti-aliasing)
- Customizable color palette with up to 16 colors
- Hold right-click to see the orbit, the corresponding Julia set, and hear the sound waves of the orbit for any point
- Zoom video creation to uncompressed AVI
output.mp4
Zoom video demonstrating perturbation theory using one central reference orbit, 70K iterations, taking 3 minutes to render
2024-05-22.00-45-10.mp4
Users can write custom equations to draw fractals in the complex plane. The following functions are available in addition to the standard functions in GLSL:
Custom functions reference
Double-precision transcendental functions
Function | Definition |
---|---|
double atan2(double, double) |
|
double dsin(double) |
|
double dcos(double) |
|
double dlog(double) |
|
double dexp(double) |
|
double dpow(double, double) |
Complex-defined double-precision functions
Function | Definition |
---|---|
dvec2 cexp(dvec2) |
|
dvec2 cconj(dvec2) |
|
double carg(dvec2) |
|
dvec2 cmultiply(dvec2, dvec2) |
|
dvec2 cdivide(dvec2, dvec2) |
|
dvec2 clog(dvec2) |
|
dvec2 cpow(dvec2, float) |
|
dvec2 csin(dvec2) |
|
dvec2 ccos(dvec2) |
Furthermore, the following variables are also exposed to the user:
Local variables
Name | Description |
---|---|
dvec2 c |
Corresponding point in the complex plane of the current pixel |
dvec2 z |
|
dvec2 prevz |
|
int i |
Number of iterations so far |
dvec2 xsq |
|
dvec2 ysq |
|
float power |
Uniform variable of type float, adjustable from the UI |
int max_iters |
Maximum number of iterations before point is considered inside the set |
double zoom |
Length of a single pixel in screen space in the complex plane |
dvec2 center |
Center point of the window in the complex plane |
dvec2 mouseCoord |
Point in the complex plane that the mouse cursor is on |
dvec2 initialz |
Initial value of |
The first input (the main equation, must evaluate to a dvec2
) is the new value of bool
) is the condition which, when true, the current pixel will be considered inside the set. The third input (initial Z, must evaluate to a dvec2
) is
User-controlled variables can also be defined, which can then be used in the equation and adjusted in real time using the sliders below. "Power" is a default slider that cannot be deleted and corresponds to the power
variable above.
Note
Due to limitations in GLSL, zoom is limited to
- Git
- CMake version >= 3.21
Clone the repository with --recurse-submodules
, then go into the directory
git clone --recurse-submodules https://github.com/Yilmaz4/MV2.git
cd MV2
Windows
Install MSYS2 to C:\msys64
, and from a MSYS2 UCRT64 terminal, run
pacman -Syu mingw-w64-ucrt-x86_64-gcc mingw-w64-x86_64-ninja
Then add C:\msys64\mingw64\bin
to PATH.
On Linux
Arch Linux
sudo pacman -S base-devel cmake ninja
Debian/Ubuntu
sudo apt install build-essential cmake ninja-build
Fedora
sudo dnf install gcc-c++ cmake ninja-build pkg-config
openSUSE
sudo zypper in -t pattern devel-basis
sudo zypper install cmake ninja
Finally, generate the build files with CMake and build
cmake -S . -B build -G Ninja
cmake --build build
You can then find the binary in the bin
directory
- Any custom equation utilizing
dvec2 cpow(dvec2, float)
where the second argument$\not\in {2, 3, 4}$ will be limited to single-precision floating point, therefore limiting amount of zoom to$10^4$ . - Maximum zoom for all fractals other than the Mandelbrot set is
$10^{14}$ due to finite precision. Perturbation can be enabled for the Mandelbrot set to zoom further.
- Shader linkage takes very long on Intel iGPUs with Mesa drivers on Linux, causing the program to open only after several minutes, I have no idea why
- Enabling perturbation causes "glitches" to appear such as same-color blobs or noise. This can be minimized with glitch detection algorithms and more reference orbits as described here.
- The zoom videos do not play in VLC or Windows Media Player, however they do in MPV.
Contributions are highly welcome, it could be anything from a typo correction to a completely new feature, feel free to create a pull request or raise an issue!