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

Fix regression with shadows when light range is 0 or close #100862

Merged
merged 1 commit into from
Dec 30, 2024

Conversation

Flarkk
Copy link
Contributor

@Flarkk Flarkk commented Dec 27, 2024

This PR fixes #100850.
A regression were introduced in #100319 when Omni and Spot lights have a range of 0 or close to 0.
Far distance could become smaller than near distance (0.005) which makes the shadow projection matrix non inversible.

@matheusmdx
Copy link
Contributor

I cherry-picked this pr but seems the same error persists.

@Flarkk Flarkk changed the title Fix regression with shadows rendering Fix regression with 0-range lights shadows Dec 28, 2024
@Flarkk Flarkk changed the title Fix regression with 0-range lights shadows Fix regression with shadows when light range is 0 or close Dec 28, 2024
@Flarkk Flarkk marked this pull request as ready for review December 28, 2024 10:44
@Flarkk
Copy link
Contributor Author

Flarkk commented Dec 28, 2024

Should be okay now.
The fix ensures the shadow near distance never goes above far.
This guarantees the projection matrix stays inversible.

Copy link
Contributor

@stuartcarnie stuartcarnie left a comment

Choose a reason for hiding this comment

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

LGTM – tested with TPS-Demo and can no longer reproduce the log spam 👏🏻

@Repiteo Repiteo merged commit 888883d into godotengine:master Dec 30, 2024
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Dec 30, 2024

Thanks!

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

Successfully merging this pull request may close these issues.

Projection::invert fails with Condition "0.0 == r3[3]" is true
5 participants