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 GLTF light import #53109

Merged
merged 1 commit into from
Sep 27, 2021
Merged

Conversation

aaronfranke
Copy link
Member

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.

Copy link
Member

@fire fire left a comment

Choose a reason for hiding this comment

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

image

Lights look ok. The lights having power is easier to see when the preview env is off.

image

@akien-mga akien-mga merged commit 281d0bd into godotengine:master Sep 27, 2021
@akien-mga
Copy link
Member

Thanks!

@aaronfranke aaronfranke deleted the fix-gltf-light branch September 27, 2021 15:29
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.

Punctual Lights from gltf / glb files import with 0 range and attenuation values
3 participants