OpenGL Projects
A downloadable game
Over the second year of university I created multiple small projects, experimenting with various taught techniques and learning new ones. I mainly did two projects: final project where I applied new techniques I learnt and a project where I showcased the many skills I got taught.
Final Project GitHub
This project consists of a randomly generated cave stored as voxel data and represented using marching cubes. The player is able to break the terrain to form tunnels and explore the whole cave.
Additionally, to have a small game loop, a portal is spawned somewhere in the cave which the player can find. To open the portal they have to collect 5 rocks, giving the ability to the player to explore a newly generated world.
I have uploaded a demonstration of this project:

In this project my primary goal was to learn how compute shaders work. I implemented the Marching Cubes algorithm that is run utilising compute shaders. Using this, the program renders the whole world. To make this world breakable it is split into small chunks, as when the player breaks any part of the mesh only the chunks where the values were changed are updated. This uses the speed of compute shaders, as it updates it in real time.
Another aspect of this project is the use of an intricate post processing effect. This consists of a cell shaded, cartoony shader, with outlines on normals and solid colours throughout. It is done by rendering the scene three times: render normals, render shading, render colour.
As solid colours are used, the details from models are mainly shown using normal maps. In addition, for the specular spots, the colour channel is changed by adding white parts to it, and the normals are changed, to ensure that an outline is present.
On top of these effects, a noise is applied throughout the screen, which removes straight lines and makes them wavier, to give the scene a hand-drawn look.
Additionally rocks are placed all around the cave this is done using instancing.
Water Rendering Project GitHub
In this other project I applied many of the skills that I learnt during the course. The scene consists of a bumpy landscape combined with water rendering, a day to night cycle - which during the night the lamp posts turn on - and randomly placed rocks on the terrain.
In addition, the water has been implemented using reflections and waves, shadows have also been added; having directional shadow throughout the day and only shadows coming from lamp posts during the night
The main two features are the water rendering and shadows.
The water uses its own shader and works by rendering the whole scene again in a Frame Buffer Object and sending this to the shader. When this is rendered the matrix view is reflected, so the scene is rendered from the point of view of the water.
Additionally to the reflection, an underwater fog and a blue colour is blended together.
Furthermore the water moves in small waves, to give it motion; this is done in the vertex shader by simply moving vertices up and down.
Shadows are also created in a similar way, so using FBOs from the point of view of each light source. The main difference is that only the depth buffer is stored and sent to shader. Moreover, for directional light shadows, an orthographic camera is used instead of perspective.
Both of these projects can be found on my GitHub!
Updated | 28 days ago |
Status | Released |
Author | Matteo Marelli |
Leave a comment
Log in with itch.io to leave a comment.