Forward+ and Clustered Deferred Shading

October 2022

WebGL Demo GIF

Description: A WebGL implementation of the forward, forward+, and clustered deferred rendering methods for a scene with a large number of dynamic point lights. The forward+ and clustered deferred algorithms use light clustering to optimize the process of finding which lights affect the current fragment.

See Github for full technical and implementation details.

Features:

  • Optimized rendering of many dynamic lights by splitting the view frustum into clusters and assigning lights to each cluster
  • Lambertian and Blinn-Phong shading
  • G-Buffer optimizations
    • Oct-encoding normals
    • Reconstructing world space position using camera matrices and depth