3D Game Project
C++, OpenGL
The course 3D Computer Graphics and Animation, required to build a game in C++ and OpenGL.
A basic framework was provided, but all the shading, shadows and extra things were done by me.
The aim of this course was not to create something beautiful, but to learn to use OpenGL,
so the main focus was on developing shaders.
The 3D models have been done in Maya.βββββββ The following parts of the game were developed by me:
Blinn-Phong Shading
Implemented and applied to the floor, tree heads, trunks, houses and the robot.
Toon Shading with Blinn reflections
Implemented and applied to the robot. The robot .obj was downloaded from Turbosquid.
Shadow Map & PCF
Shadows were calculated using the shadow map technique, with a fixed,
slightly yellow light. The bias value was tailored in order to find a good visual
balance between peter panning and shadow acne. Every model casts shadows apart from the main character.
In order to soften shadow edges, Percentage closer filtering(PCF) was implemented. Even in this case,
the number of sampled texels was tailored with trial and error to obtain a more realistic visual appearance.
X-Ray
The X-ray view was implemented with Blinn reflections, and it samples colors from a texture,
based on distance. The X-ray view can be called pressing βxβ.
The shader will shade a βholeβ through the first occluding layer as seen from the camera.
By pressing βcβ and βvβ, the size of this hole can be increased/decreased.
All the remaining parts of the models, outside the hole, are shaded just with diffuse light,
while the floor is shaded with its initial shader. The X-ray shader
samples a texture based on distance from camera and the Blinn specularity.
Third person view
An attempt of creating a third person view was made. By pressing the key β1β, the user could switch to third person view.
Minimap
Finally, a minimap was implemented.The minimap was created by rendering the scene from above,
storing it as a texture and rendering it on a quad. The minimap can be activated / deactivated pressing β2β.
The main character is visible in the map as a red dot moving in the scene.