Skip to content

[Lightning] Use a single z-buffer texture for shadow maps on spot lights #16

Description

@pedropaulosuzuki

Description

The current implementation uses an omnidirectional shadow map (6 faces) for point lights and spot lights. When we're using a spot light, it will only generate a shadow for the region inside the cone, which means any texels outside that region are wasted. If we bake the projection matrix with the correct angle, we will have the best quality possible for a given resolution.

Here is a video I made earlier on the difference in resolution density between a tetrahedron mapping and a single optimized z-buffer. Even though we use a cube mapping currently, the logic is still similar.

0001-0030.mp4

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions