A project for AP CS, where we render 3D fractals using distance estimators and ray marching.
Number (key) | Fractal |
---|---|
1 | Mandelbulb |
2 | Mandelbox |
3 | Menger Sponge |
4 | Koch Snowflake |
Key | Function |
---|---|
W | Move Camera Forward |
S | Move Camera Backwards |
A | Move Camera Left |
D | Move Camera Right |
Space | Move Camera Up |
Left Shift | Move Camera Down |
Control + | Increase Movement Speed |
Control - | Decrease Movement Speed |
E | Export Render |
R | Export HD Render |
T (hold) | Export GIF Frames |
Q | Quit Program |
P | Pause/Play Animation |
+ | Increase Max Fractal Iterations |
- | Decrease Max Fractal Iterations |
Alt + | Increase Antialias Level |
Alt - | Decrease Antialias Level |
Right Shift + | Increase Ray Iterations |
Right Shift - | Decrease Ray Iterations |
Escape | Release Mouse |
Click on Window | Recapture Mouse |
C | Print Camera Location to Console |
. (period) | Toggle Double Precision |
1 | Display Mandelbulb Fractal |
2 | Display Mandelbox Fractal |
3 | Display Menger Sponge Fractal |
4 | Display Koch Snowflake Fractal |
- Download the lwjgl-release-custom-zip file that corresponds to your os
- Go here: https://www.lwjgl.org/customize and click load config
- Upload the lwjgl-release-custom-zip file
- Download the zip
- Create a new project
- Follow these instructions for installing the library into the project: https://github.com/LWJGL/lwjgl3-wiki/wiki/1.2.-Install
- In the src folder, clone this repo.
- GUI/rendering somewhat working
- Some GUI features including: changing the color of a single pixel, creating a colored rectangle on the screen
- Keyboard and mouse controls implemented, but need to be connected to the computing classes
- Vector3D, UnitVector3D, and Camera classes done
- Vector classes have a variety of common vector math methods
- Camera class has methods to translate keyboard and mouse input to movement relative to direction vector
- Mouse and Keyboard input implemented, but still have issues
- Basic kernel written to render a sphere using raymarching (still has bugs)
- Compute and GUI handlers consolidated into one file
- Full kernel integration: frames are now rendered using openCL and displayed properly, and input is translated into position/direction changes in the camera class, which is then sent back to the kernel for the next frame
- Some OpenGL implementation drawing simple 2d shapes, but still has bugs and doesn't work
- The kernel now properly shades the rendered images based on the number of iterations required per pixel. Here is a sample image of a torus and a sphere:
- Mouse input issue fixed - the screen no longer shakes incessantly
- Not much work was done this week because of preparation for AP tests
- Folding space was tested and worked successfully. Here is a sample image of a world filled with infinite toruses:
- Minor optimisations such as the vertex and fragment shader sources being moved to separate files
- Window can be resized, and automatically recompiles the kernel with the new resolution (only works on windows for some reason)
- The mouse can be released by pressing ESC and recaptured by clicking anywhere in the window
- Lots of distortion is present along the Z axis (when rendering objects above and below the camera) but none along the X and Y axes for some reason
- All distortion eliminated
- First Fractals! Here is a Mandelbulb rendering that we are quite proud of:
- Work is being done on coloring fractals, making them more detailed and some preliminary GUI stuff
- Added a time variable that increments frame by frame, allowing fractals to be animated:
- Added mandelbox fractal:
- Fractals are colored based on distance from the origin, more sophisticated coloring that emphasizes the structure of the fractal to be added later.
- More control over the renderer: +/- adjusts the number of iterations for the fractal and shift +/- adjusts the number of iterations per ray. p also plays/pauses the animation.
- Added antialiasing
- Added 3d Koch Snowflake Fractal
- Added the ability to export a frame
- Ctrl +/- to increase/decrease movement speed
- Added arbitrarily high resolution image export
- Added fractal hotkeys to quickly change between fractals
- Added support for multiple GPU systems