WebGLRenderer: Deprecate useLegacyLights
, change default to false
.
#26392
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.
Related issue: #24975 and #25479
Description
This PR deprecates
WebGLRenderer.useLegacyLights
. It also changes the default value tofalse
.The motivation behind this change is to have a single lighting mode in the engine which allows for physically correct workflows. It will also make the switch to
WebGPURenderer
easier since this renderer does not support a legacy lighting mode.Changing the default of
useLegacyLights
will affect all applications that still use the legacy workflow. For the upcoming months, users can set the property back totrue
to restore the previous behavior. Since the property is deprecated, a migration to the new mode is required at some point. I think it's best if we provide a forum topic that explains the changes and how the migration tasks look like. The URL to this topic will be placed into the deprecation warnings.All light intensities are affected by this PR since the artist-friendly light intensity scaling factor is not used anymore. That means light intensities are decreased by factor
Math.PI
. The behavior of spot and point lights (how they decay) also noticeably changes which has to be explained in the new guide.