Soft Shadows from Environment Map Light Probes

by Jay Freeman

The goal of this project was to implement an algorithm for doing light detection, capable of rendering real-time soft shadows, based on light probes generated from environment maps.

To this end, I first implemented an algorithm specified by Paul Debevec for doing light detection, involving median cuts of luminance.

This algorithm splits an environment map into a number of individual light sources. In his poster abstract, he indicated that 64 such lights was enough to perform decent soft shadows. This became my challenge. In order to obtain 64 shadow maps, I looked at the various bottlenecks in the shadow mapping process. In order to minimize the number of copies back from the graphics card I perform, I pack multiple shadow maps into a single texture, and then manually perform the perspective math calculations in my shader so as to avoid using the now incorrect TXP instruction. This, however, causes issues with the resolution of shadow maps, to wit I've targetted the viewing frustums of the shadow maps to better target the objects.

Project Code

Ennis

Pisa

Uffizi