google / filament

Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
https://google.github.io/filament/
Apache License 2.0
17.44k stars 1.84k forks source link

Fix point/spot shadow rendering bug #7727

Closed pixelflinger closed 3 months ago

pixelflinger commented 3 months ago

We were calculating the shadow visibility of spot/point lights. The visibility was calculated during the "execute" phase of the FrameGraph but it was used/needed during the setup phase. The result was that the visibility was always delayed by one frame (really it was stale data from the previous calculation).

We are now computing the shadow visibility earlier, during the setup phase. This is also better because we can now skip culling of these shadow maps entirely if we know they're not visible.

Fixes #7715