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
- Smooth coloring
- Normal mapping for shadows
- Super-sampling anti aliasing (SSAA)
- Customizable color palette with up to 16 colors
- Hold right-click to see the orbit and the corresponding Julia set for any point
- Zoom video rendering
2024_Jan_13_22_31_47_19.mp4
2024-05-22.00-45-10.mp4
Users can define 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
Burning ship fractal
Nova fractal
Magnet 1 fractal
- Git
- CMake version >= 3.21
- C++ build system (Make, Ninja, MSBuild, etc.)
- C++ compiler (GCC, Clang, MSVC, etc.)
Clone the repository with --recurse-submodules
, then go into the directory
git clone --recurse-submodules https://github.com/Yilmaz4/MV2.git
cd MV2
Generate the build files with CMake and build
cmake -S . -B build
cmake --build build
You can then find the binary in the bin
directory
This project has been tested on Windows and Linux.
- Any custom equation utilizing
dvec2 cpow(dvec2, float)
where the second argument$\not\in [1,4] \cap \mathbb{N}$ will be limited to single-precision floating point, therefore limiting amount of zoom to$10^4$ . - Most of the double-precision transcendental functions are software emulated, which means performance will be severely impacted.
- Maximum zoom is
$10^{14}$ due to finite precision.
- Shader linkage takes too long on Intel iGPUs with Mesa drivers on Linux, causing the program to open only after several minutes, I have no idea why
- Taking a screenshot results in a blurry image regardless of how high SSAA is set
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!