2D Global Illumination in COPs

After learning more about real-time lighting techniques, I wanted to tackle 2D Screen-Space Global Illumination (GI).



This setup calculates dynamic 2d lighting, multi-bounce reflections, and soft shadows in screen-space. It is ported from a 2D GI article originally written by Yaazarai in GLSL and adapted into OpenCL to run natively inside Houdini’s COP network.



Grab the free setup on Gumroad here.

Technical Details

The solver relies on distance fields to evaluate light visibility and scattering:

  • SDF Collider Layer: Represents geometry obstacles.
  • SDF Light Layer: Represents the emissive light source bounds.
  • RGB Light Layer: Stores source colors and intensities.
  • Blue Noise Sampling: Distributes ray angles to turn hard aliasing/banding into high-frequency dithered noise, easily smoothed via temporal accumulation or blur.

Parameters allow tweaking steps per ray, bounce counts, albedo absorption, and bounce decay.

2D GI bouncing off geometric obstacles with soft shadows

Light scattering and color bleeding in a dynamic setup

Multi-colored light emitters casting rays through complex collision geometry

Real-time response to moving obstacles and light sources