Basic real-time area lights.
This example is a basic implementation of Real-Time Polygonal-Light Shading with Linearly Transformed Cosines. Three lights are displayed, each with different orientation and parameters.
- W / A / S / D — move camera
- Mouse drag — look around
- R / Shift R — increase / decrease roughness of the plane
- M / Shift M — increase / decrease metalness of the plane
- F / Shift F — increase / decrease (specular reflection coefficient) of the plane
- F5 — reload shaders
Roughness, metallness and can be also configured through the UI.
This example was originally contributed by Jonathan Hale. The implementation is based on the paper "Real-Time Polygonal-Light Shading with Linearly Transformed Cosines" by Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt. The
*.dds files are republished with a permission from Eric Heitz.
There's also a Guest Post introducing this example on the Magnum Blog.
Full source code is linked below and together with assets also available in the magnum-examples GitHub repository.