Mandelbrot Viewer is a simple application which utilises the GPU via OpenGL to visualize the Mandelbrot Set in real time. The maximum possible zoom is 64-bit due to the limitations of OpenGL Doubles. v1.0 C++ port of this project
I wrote a tutorial series on how to create this project on my blog which can be found here.
A YouTube video demonstrating the project can be viewed here.
The application can be built with Maven:
mvn clean package
The jar file will be available in the ./target
directory.
W, A, S, D for panning.
Z, X or scroll wheel for zooming in and out.
K to take a screenshot. (Currently Disabled)
GUI
The UI allows you to configure the color and precision of the set via a pure
java binding of ImGUI. The variables it modifies are the uniform variables u_Color
and u_maxIter used in the fragment shader below.
More useful configuration variables:
src/main/java/Application.java
PIXEL_WIDTH & PIXEL_HEIGHT:
- The window's resolution.
WIDTH & HEIGHT:
- The scale of the complex axis (4 would be [-2, 2]).
TITLE:
- The window's title.
BACKGROUND_COLOUR:
- The window's background colour.
src/resources/shaders/frag.shader
This file contains the math for generating the Mandelbrot Set.
If you wish to change the colours of the set without the UI you should modify the
colorFunc function.
It takes in the uniform u_maxIter which is the number of iterations it took before
the modulus of a point on the set became >= 4.
- LWJGL 3 (minimal OpenGL configuration)
- JOML (math library)
- Dear ImGUI (pure java binding of the C++ UI library)