Screen Space Global Illumination

Project information

  • Introduction
  • A real-time implementation of Screen Space Global Illumination (SSGI) using C++ and DirectX 11, developed as part of my final dissertation at Sheffield Hallam University.

    The effect is designed to enhance realism by simulating indirect lighting based on screen-space data in a deferred rendering pipeline.

  • Programmer
  • Joel Vinaroz Giménez.

  • Skills developed
  • C++ and DirectX11.

  • Development duration
  • 3 months (October 2024 - December 2024).


My role in the project

In this project, I implemented a complete Screen Space Global Illumination (SSGI) pipeline using DirectX 11, integrated on top of my basic custom deferred rendering engine. The aim was to simulate real-time diffuse light bounces using only screen-space data, improving the realism of indoor scenes without resorting to baked lighting or global illumination techniques that require offline computation.

Core Features & Techniques

🌀 Screen-Space Position Reconstruction
The first step was reconstructing the world-space position of each pixel from the depth buffer. This was done using the inverse of the projection matrix, enabling accurate ray tracing in screen space from the camera’s point of view.



🔀 Stochastic Sampling
I implemented stochastic sampling to randomly explore directions within the hemisphere defined by the surface normal. These samples were jittered per frame to introduce variation, and used to simulate the diffuse scattering of indirect light. Sampling was done in tangent space to maintain a consistent hemispherical distribution.



📡 Ray Marching
Rays were traced in screen space using a step-based ray marching algorithm. For each direction, I marched until a depth intersection was detected—indicating a bounce point—and then sampled the indirect light contribution from that location. The results of all ray samples were accumulated per pixel.



🧼 Spatial and Temporal Denoising
Due to the stochastic nature of the sampling, raw results were noisy. To resolve this, I implemented a two-stage denoising process:

  • Spatial filtering using a bilateral blur to preserve edges and reduce spatial noise.
  • Temporal accumulation using a history buffer with reprojection to blend results across frames and achieve stable indirect lighting.

Normals Indirect

Debugging Tools

To aid in the development and tuning of the effect, I integrated an ImGui-based debug menu which allows real-time visualization of key rendering stages:

  • Direct lighting pass – The scene rendered with only direct illumination.
  • Stochastic normals – The randomly jittered normals used for sampling.
  • Filtered indirect lighting – The final result of the SSGI pipeline after denoising.
  • Final combined scene – The fully lit scene combining both direct and indirect lighting.
These views were critical for verifying the correctness of each stage and fine-tuning the denoising parameters and ray marching behavior.

Research & Inspiration

The implementation was based on the GameHacker SSGI blog post, which provided a conceptual baseline.

Results

The final result is a real-time SSGI system that adds subtle and realistic indirect lighting to scenes, enhancing depth and material perception. While limited to information available in screen space, the system provides a performant alternative to more expensive GI techniques and runs smoothly in real-time applications.

© Copyright Joel Vinaroz Giménez