# Screen-space global illumination coloured light bleeding between surfaces. ```{raw} html ▶ Run in browser ``` **Tags:** `3d` `ssgi` `global-illumination` `colour-bleed` `pbr` Screen-space GI (design D8) casts a half-resolution hemisphere of rays from every lit surface, marches them through the depth buffer + thin G-buffer, and gathers the on-screen scene colour they hit: one bounce of indirect diffuse. The result feeds the pluggable indirect-diffuse ambient hook (design D8), so a brightly lit red wall throws a red tint across the white floor beside it and the green wall tints the other side, all on top of the flat ambient (a Cornell-box classic). The gather is Hi-Z traced (sharing the SSR trace utilities) and temporally accumulated to denoise, so the bounce converges over a few frames; fast camera motion trails a little (an accepted tradeoff). A direction that leaves the screen or finds no near surface gathers nothing, so open floor keeps the flat ambient and nothing is crushed. Usage: uv run python examples/features/3d/ssgi.py Controls: Space - Toggle SSGI on/off Escape - Quit ## Source ```{literalinclude} ../../examples/features/3d/ssgi.py :language: python :linenos: ```