This is an OpenGL project inspired by: https://tympanus.net/codrops/2016/04/26/the-aviator-animating-basic-3d-scene-threejs/ The main purpose of this project is to practice OpenGL rendering techniques and applying 3D maths.
- Use cmake for all platforms
- Change shadow map projection to orthographic
- Fix motion blur bug on windows
- Replace GLFW3 with SDL2
- Build on IOS and WebAssembly
- Refactor code
I implement motion blur using per-object motion blur technique. By uploading the previous transformation matrix to shader, I can calculate the velocity and save the velocity of each object to a velocity map.
Velocity Map
Then roughly calculate the position of each fragment over 10 different time steps, and average the fragment color, this is the final color of the fragment.
Motion Blur Demo
Render the scene from the perspective of the light source, save the depth information.
Depth Map
In the main render pass, calculate the depth of each pixel, if the calculated depth is smaller than the depth from depth map, then this fragment is shadowed.
Shadow Demo
I implement lens flare by calculating the screen position of the light source, linearly render some textures along a line from screen position of the sun to center of the screen.
- Particle system
- Physics engine
- Collision detection and collision response
- Linear animation
- Primitives including tetrahedron, box, sphere, cylinder
- Linear Fog calculation in shader
mkdir build
cd build
cmake ..
make
./TheAviator




