A C++ implementation of a Mandelbrot explorer built using OpenGL Shaders.
Key | Action |
---|---|
⬆ |
Move the camera up |
➡ |
Move the camera right |
⬇ |
Move the camera down |
⬅ |
Move the camera left |
W |
Zoom in |
S |
Zoom out |
ESC |
Exit the application |
This was one of my first C++ and OpenGL projects, so quite a lot.
Their was an attempt at using CMake, maybe in a future project.
I had to read through a couple wikipedia articles to learn about implementing the mandelbrot fractal. I used their "smoothing function":
float log_zn = log(Z.x*Z.x + Z.y*Z.y) / 2.0;
float nu = log(log_zn / log(2.0)) / log(2.0);
iteration += 1.0 - nu;
color = vec4(mix(colormap[int(floor(iteration)) % 17], colormap[(int(floor(iteration)) + 1) % 17], fract(iteration)), 1.0);