Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/garfield1002/mandelbrot_explorer
- Owner: Garfield1002
- License: unlicense
- Created: 2021-08-19T22:04:14.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-02-09T07:59:26.000Z (almost 3 years ago)
- Last Synced: 2023-03-08T19:16:32.059Z (almost 2 years ago)
- Topics: cpp, glsl, mandelbrot, opengl, shader
- Language: C++
- Homepage:
- Size: 5.92 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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);
```