PointLight/SpotLight: distance does not influence shadows anymore.
#27722
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #27290.
Closes #27345.
Description
The
distanceproperty is currently coupled to thefarvalue of shadow cameras in context of spot and point lights. That's because the engine provides an automatism that configures a properfarvalues based on the light's distance. However, the current implementation is inconsistent and produces a buggy behavior like reported in #27290 or #27523.Since there is no clean way to fix this I suggest to completely remove the coupling. That means
distancedoes not affect shadows anymore.Devs who rely on a physically correct workflow won't notice this change since they do not change the default distance value
0. Devs with a custom distance value might have to update theirlight.shadow.camera.farto an appropriate value after this change. So this change needs to be noted in the migration guide.With this PR devs always have to configure the shadow camera's frustum like with directional lights or when
distanceis zero which should produce a more predictable engine behavior.