Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/garfield1002/mandelbrot_explorer

A Mandelbrot fractal viewer, built using OpenGL shaders
https://github.com/garfield1002/mandelbrot_explorer

cpp glsl mandelbrot opengl shader

Last synced: about 1 month ago
JSON representation

A Mandelbrot fractal viewer, built using OpenGL shaders

Awesome Lists containing this project

README

        

# Mandelbrot Fractal Viewer with OpenGL Shaders

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

## 🖼 Example results

![Screenshot_0](https://raw.githubusercontent.com/Garfield1002/Fractal/master/res/screenshot_0.png)
![Screenshot_1](https://raw.githubusercontent.com/Garfield1002/Fractal/master/res/screenshot_1.png)
![Screenshot_2](https://raw.githubusercontent.com/Garfield1002/Fractal/master/res/screenshot_2.png)

## 🎮 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"_:

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