Skip to content

Fix box light attenuation #3056

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

Merged
merged 3 commits into from
Jan 14, 2021
Merged

Conversation

adrien-de-tocqueville
Copy link
Contributor

@adrien-de-tocqueville adrien-de-tocqueville commented Jan 11, 2021

Purpose of this PR

Note: Still need to investigate why tests with shadows are failing

fix both issues raised in https://fogbugz.unity3d.com/f/cases/1299693/

The attenuation was divided by the the distance to the box light, which would make it drop very quickly and go above the light intensity when close to the light

Also removes two unused variables.

Note: this changes quite significantly the behaviour of box lights with range attenuation

Before After
before after

Testing status

Tested the repro project.
Tried various light ranges, with light close to objects and further than range, with range attenuation enabled and disabled and verified all works as expected.

@github-actions
Copy link

It appears that you made a non-draft PR!
Please convert your PR to draft (button on the right side of the page)
and cancel any jobs that started on Yamato.
See the PR template for more information.
Thank you!

Copy link
Contributor

@TomasKiniulis TomasKiniulis left a comment

Choose a reason for hiding this comment

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

Looks good to me. Tested multiple box lights overlapping each other while toggling range attenuation. No issues found.

2021-01-12.10-32-54.mp4

@RinaldoTjan
Copy link
Contributor

RinaldoTjan commented Jan 14, 2021

This looks good. It solved the over brightening issue.
While the fall off fade out a bit fast to my liking, but It does render quite a nice smooth fall off effect.
If no fall off is desired people will disable the attenuation anyway.
I'd say problem solved. Thank you for the fix.

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.

4 participants