Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clamp shadow distance to camera far plane #5183

Merged
merged 1 commit into from
Mar 22, 2023

Conversation

slimbuck
Copy link
Member

Shadow cascades weren't taking the camera's far clipping plane into consideration when generating cascades.

This PR clamps shadow distance so cascades are more optimally placed.

With optimal near and far camera clipping planes, shadow resolution is improved:

Before:
Screenshot 2023-03-22 at 13 10 44

After:
Screenshot 2023-03-22 at 13 11 21

@slimbuck slimbuck added bug area: graphics Graphics related issue labels Mar 22, 2023
@slimbuck slimbuck requested a review from a team March 22, 2023 13:12
@slimbuck slimbuck self-assigned this Mar 22, 2023
Copy link
Contributor

@mvaligursky mvaligursky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, this works around the case where the user would not set up shadowDistance correctly.

@slimbuck slimbuck merged commit c582dc8 into playcanvas:main Mar 22, 2023
@slimbuck slimbuck deleted the shadow-bound-fix branch March 22, 2023 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants