[FIX] Fix glTF spot light default cone angle#8305
Merged
willeastcott merged 1 commit intomainfrom Dec 22, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an incorrect default value for the outerConeAngle property when loading spot lights from glTF/GLB files. The glTF specification uses radians with a default of π/4, but PlayCanvas expects degrees, so the default should be 45° instead of the unconverted π/4 (≈0.785°).
Key Changes:
- Fixed default
outerConeAnglefromMath.PI / 4(radians) to45(degrees) - Added safe fallbacks using nullish coalescing for cone angles in luminance calculation
- Fixed typo in comment ("clapms" → "clamps") and improved comment clarity
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mvaligursky
approved these changes
Dec 22, 2025
Contributor
|
please see the comment by copilot above, seems it might be right @willeastcott |
Contributor
Author
Yep, creating a follow up PR now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 incorrect default
outerConeAnglewhen loading spot lights from glTF/GLB files.Changes
outerConeAngledefault value from radians to degreesTechnical Details
The glTF KHR_lights_punctual extension specifies cone angles in radians with a default
outerConeAngleof π/4. When converting to degrees, this default was incorrectly left in radians.Before:
After:
The previous code resulted in spot lights without explicit
outerConeAnglehaving a cone of ~0.785° instead of 45°, making them nearly invisible.Checklist