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

Change attribute for light distance for 2.80 #272

Merged
merged 1 commit into from
Dec 9, 2019

Conversation

SonnyBonds
Copy link
Contributor

Blender 2.80 seems to be using "cutoff_distance" as the attribute for light range instead of "distance".

@Jason0214
Copy link
Collaborator

Good catch! Looks like cutoff_distance is the correct attribute to be exported as Godot's range.
https://docs.blender.org/api/blender2.8/bpy.types.Light.html?highlight=cutoff_distance#bpy.types.Light.cutoff_distance

Also It is needed to update the reference_exports (we are keeping a exporting results of all the test scenes we have in the repo for regression testing purpose). If you are not sure about how to do it, I can simply send you a patch about this update.

@SonnyBonds
Copy link
Contributor Author

Ah sorry, I can update the references when I have time and resubmit.

Regarding the change itself, an alternate route to explore could be to instead approximate the inverse square falloff of Blender with a decently fitted range & attenuation curve in Godot. Not sure how close it'd be possible to get and if it'd be better or not.

@SonnyBonds
Copy link
Contributor Author

Yeah I went down that rabbit hole a bit back. There are some things that makes the two attenuation models not super compatible, but it's possible to make a decent approximation. I just haven't had time to finalize it really. I'll probably submit something in a new PR when I can.

@Jason0214
Copy link
Collaborator

Thanks for checking on this.
No worries about time, just do it when you really want to and available.

Copy link

@basdp basdp left a comment

Choose a reason for hiding this comment

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

This fixes the distance (which will otherwise always be 2.5). Note however, that Blender 'distance' is not really the same as Godot 'omni_range'. This is a short term fix/workaround. Long term fix should be to convert lights from Blender's interpretation to Godot.

Copy link

@basdp basdp left a comment

Choose a reason for hiding this comment

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

Although this fixes the problem described, it breaks the tests.

@Jason0214
Copy link
Collaborator

Will merge it and fix the test breaking afterwards

@Jason0214 Jason0214 merged commit 11bc86a into godotengine:master Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants