This is a small physics based Air Hockey game. The project is part of the 2018 CG Course DAT205/DIT226 at Chalmers.
The following features are relevant for the course:
- Game
- Deferred Shading
- Variance Shadow Mapping
- Motion Blur
- FXAA
- Collision detection and basic physics
- Performance overlay
You, the player, control the blue striker with your mouse and try to push the puck into the opponent's goal. The "AI" opponent is a bit overpowered and will probably stop you from scoring most of the time.
The score board above the field indicates the current score, which is most likely a pretty remarkable lead for your opponent.
In the lower left corner you can find a performance overlay. This indicates the time required for the last 100 frames. The red line indicates a frame time of 1f/30fps, the green one 1f/60fps. As you can see my poor laptop manages 10fps quite easily!
I am using the following libraries:
- GLFW under a zlib license
- GLM under the Happy Bunny License
- GLEW under this license
- tinyobjloader under an MIT license
- lodepng under a voluntary attribution license
I adapted these shader:
- Space Background under CC BY-NC-SA 3.0
- FXAA under this license
This software contains source code provided by NVIDIA Corporation.
Key | Action |
---|---|
SPACE | Start the game. |
R | Change between deferred and forward rendering. |
S | Toggle animated background on and off. |
U/J | Increase/Decrease smoothness of shadows. |
I/K | Increase/Decrease number of motion blur samples. |
O/L | Increase/Decrease sample step size for motion blur. |
T/G | Increase/Decrease anti aliasing quality. |
P | Toggle performance overlay on and off. |
Y/H | Increase/Decrease performance overlay size. |
This game has two render modes: Forward and deferred.
When using forward rendering everything is very straight forward. The process for deferred rendering involves a few intermediate states. Let's look at the actual steps:
- The Shadow map is rendered from the light's perspective.
- All objects properties are collected in 4 textures. These are the stored channels:
- The information from all textures is composited into a single texture.
- Motion blur is applied to the rendered image.
- FXAA is applied to hide aliasing artifacts.
- The blurred image is combined with the sharp background.
- Finally the performance overlay is drawn ontop of the frame.
Don't you just love setting up C++ projects? Here we go.
- Setup your C++ compiler of choice.
- Install CMake (Tested with 3.10.3)
- Install Python for Conan (Tested with 3.6)
- Install Conan as admin:
pip install conan
- Clone the repository
- Navigate into directory:
cd SkyHockey/Engine
- Get dependencies:
conan install . --build missing --install-folder build
- Build with conan
conan build . --build-folder build