University of Pennsylvania, CIS 565: GPU Programming and Architecture, Project 5
- Yalun Hu
- Tested on: Firefox 56.0.1 on Windows 10, i7-6700HQ CPU @ 2.60GHz 32GB, GTX 1070 8192MB (Personal computer)
- Build a data structure to keep track of how many lights are in each cluster and what their indices are.
- Render the scene using only the lights that overlap a given cluster.
- Parameters:
- Maxinmum number of lights per cluster: 1000;
- The number of lights in the whole scene: 500;
- Light radius: 3.0;
- Reuse clustering logic from Clustered Forward+.
- Store vertex attributes in g-buffer.
- Read g-buffer in a shader to produce final output
- Parameters:
- Maxinmum number of lights per cluster: 1000;
- The number of lights in the whole scene: 500;
- Light radius: 3.0;
- Implement deferred Blinn-Phong shading (diffuse + specular) for point lights
- Optimized g-buffer format - reduce the number and size of g-buffers:
- Encode normals from vec3 to vec2, and decode in deferred fragment shader.
- Use only 2 G-buffers instead of four.
- But encoding the normal leads to some information loss.
- Parameters:
- Maxinmum number of lights per cluster: 1000;
- The number of lights in the whole scene: 500;
- Light radius: 3.0;
It shows that Forward+ and Deferred really improve the performance. And Deferred works a little bit better than Forward+.
- Parameters:
- Maxinmum number of lights per cluster: 1000;
- The number of lights in the whole scene: 1500;
- Light radius: 3.0;
Theoratically, packing normals uses less resources and improve the overall performance obviously. Considering the hardware and the range of the input data, the influence of this optimization is limited.
- Three.js by @mrdoob and contributors
- stats.js by @mrdoob and contributors
- webgl-debug by Khronos Group Inc.
- glMatrix by @toji and contributors
- minimal-gltf-loader by @shrekshao
- Encode normals by Aras Pranckevičius


