AlpineMapsOrg / renderer

Rendering system for alpine maps.
GNU General Public License v3.0
4 stars 10 forks source link

Fix disappearing shadows #95

Closed pkomon-tgm closed 3 months ago

pkomon-tgm commented 4 months ago

The set of tiles used for calculating the shadow maps was culled with the camera's view frustum. Therefore, shadows cast by objects outside of the view frustum were not visible.

This PR fixes the issue by (per default) including all tiles when calculating the shadow maps. This adds a slight performance penalty, but improves the visual quality.

Culling of the tiles for shadow mapping can be toggled by pressing the V key, although, enabling it only culls the tiles by the camera view frustum and not be the light source view frustum, resulting in the same behaviour as before.

Additionally, you can toggle a debug camera view with F12 and view frustum culling for tiles to draw with C.

This PR serves as a basis for possibly further improving performance and quality by