Workshop 4 - Deferred Shading

The base code for this lab can be found on GitHub here

Base Code

When you run the base code, you should see some diffuse shaded spheres moving around slowly.

The base code is rendering a scene into a G-Buffer, then doing a light pass. However, there is no light code, so the lights are rendered as spheres (in the usual way).

All of the debug modes are implemented in debug_frag.glsl.

For this workshop, we need to implement all of the deferred shading in light_frag.glsl. We’ll also need to do some setup in main.cpp pertaining to the lighting pass.

Light Volumes

light volumes

G-Buffer Colors

g-buffer colors

G-Buffer Normals

g-buffer normals

G-Buffer Depth

g-buffer depth

G-Buffer Positions

g-buffer positions