Realtime graphics on GPU - labs summer semester 2018/2019

In order to pass the lab exercises, you need to pick 2 assignments from the pool below, implement them and submit them by e-mail by the end of the summer semester tuition period 2018/2019, i.e., 26. 5. 2019. Use separate messages for each project and use a meaningful subject like "NPGR019 - {name of the project}". I will send you e-mail confirming delivery followed by further questions (if any) and the result.

Please, use the following e-mail address: {name}.{surname}.88{at}gmail{dot}com

Lab excercises overview


25. 2. & 4. 3. 2019

Camera, textures, buffers

11. 3. & 18. 3. 2019

Instancing, textures, shading

25. 3. & 1. 4. 2019

Advanced shading, HDR, shadows

8. 4. & 15. 4. 2019

Compute shaders - flocking simulation

29. 4. & 6. 5. 2019

CUDA - flocking simulation

13. 5. & 20. 5. 2019

Useful resources

  • GLFW - multi-platform library abstracting the window creation and more.
  • A trip through the graphics pipeline - series of articles talking about how the pipeline is actually realized in the sillicon.

  • GLFW - multi-platform library abstracting the window creation and more.
  • SDL - multi-platform library allowing window creation, sound handling etc.
  • GLAD - GL loader generator for .dll.
  • GLM - OpenGL Mathematics library. C++ header only mimicing GLSL.
  • Assimp - Open Source Asset Import Library.

Semestral project assignments

You should implement 2 of the following assignments or one of the first two with all the bonuses as combined they create another assignment on top of the basic one. OpenGL and C/C++ are preferred and strongly recommended for the implementation but I can handle also Python, C#, WebGL, or D3D11. You can use whatever resources you'd like (textures, models, model loading libraries) but I suggest you keep the assignment as simple as possible and focus only on the task at hand. All of the required geometry and textures for the assignments can be hardcoded in the program, use simple planes, cubes, cylinders, spheres. Please provide interactive camera in all submissions.

The source code must be well commented so I can decypher what you are trying to achieve and can see that you understand your code. The handed-in assignments should ideally compile and run on Windows machine under MSVS 2017, I'll be using that as a primary testing machine. Linux is also possible but in all cases I expect that your solution will compile and run without any unreasonable effort. Don't forget to bundle all needed external resources and .dll files needed to run. If the filesize exceeds 10 MB, please upload the solution somewhere and send a link instead.

Cascaded shadow maps

Implement a simple scene that uses directional light to cast shadows. A common extension to basic shadow map used to fight perspective aliasing is called Cascaded Shadow Maps, where we render the scene into several shadow maps based on the distance from camera. The scene you create should be sufficiently large, e.g., long alley of poles, and should provide varied geometry to assess how you fought with common shadow map artifacts, i.e., have there at least some spheres and cylinders or some curved surfaces.


  • Render at least 2 shadow cascades
  • Sample them based on Z (you can use PSSM, for example)
  • Solve common artifacts, i.e., shadow acne, Peter panning, and shimmering
  • Filter using either Percentage Closer Filtering, or, Poisson Disk Sampling


Deferred rendering

Implement a deferred rendering pipeline for a simple scene containing several lights.


  • Use non-naive approach to lighting (tiling, rendering light geometry) with a greater amount of lights
  • Solve anti-aliasing using MSAA
  • Implement some fullscreen post-process, e.g., Screen Space Ambient Oclussion

Volumetric water effect

Create a simple scene with a pool of water and implement a water surface shader with the properties summarized below. The normal map can be either calculated from the displacement or can be supplied as a texture the fragment shader and optionally animated. For inspiration look at how GTA V handled this - scroll down to reflections, there's an explanation what is needed for really nice water effect.


  • Apply water waves (sin/cos will suffice), i.e., displacement
  • Use a normal map and Fresnel coefficients to reflect/refract light
  • Calculate the "fogged" refraction color based on the depth

GPU particles

In a simple scene simulate a particle effect completely on the GPU. It can be sparkles flowing out of a fountain, fire and smoke, ground fog, whatever you can think about.


  • Use either compute shader/CUDA/OpenCL to simulate particle positions
  • Expand particle positions into quad sprites (always oriented towards camera), you can use geometry shader for this
  • Fade particles based on depth, i.e., implement soft particles

GPU terrain tesselation

Employ tessellation shaders to implement variable terrain Level Of Detail. You can either use some heightmap texture or generate it in the program using procedural noise.


  • Render the terrain using regular grid
  • Use tessellation shader to create LOD, i.e., more triangles close to the camera, less triangles from the camera
  • Make sure the generated mesh is water-tight, i.e., no T-cracks

Copyright (C) 2015-2019 Martin Kahoun