Skip to content

Garfield1002/mandelbrot_explorer

Repository files navigation

Mandelbrot Fractal Viewer with OpenGL Shaders

A C++ implementation of a Mandelbrot explorer built using OpenGL Shaders.

🖼 Example results

Screenshot_0 Screenshot_1 Screenshot_2

🎮 Controls

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

💡 What I learned

C++

This was one of my first C++ and OpenGL projects, so quite a lot.

CMake

Their was an attempt at using CMake, maybe in a future project.

Mandelbrot

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);