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.
This fixes #53019, a regression from the changes to the GLTF module in #34193. This PR also fixes the attenuation calculation (it's different from 3.x by a factor of 2048) and adds documentation to the GLTFLight class. 3.x version: #53105
For the record, here's why these values are the way they are. GLTF lights with no range specified behave like physical lights which have infinite range, so we default to
INFINITY
for the range (but this is later clamped to 4096 if making a node). For the color, default to white, which is the most sensible option, otherwise we'd have black lights by default, which do not lighten things. For the intensity, default to 1.0, since 0.0 means no light. For the spotlight angle, default to an eighth turn (on both sides, so the cone's edges are a quarter turn apart), rather than 0.0, which would mean the spotlight is emitting light in an area of zero size.