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

tonemap.glsl: Ensure color parameter of tonemap_reinhard() is positive #42056

Merged
merged 1 commit into from
Oct 19, 2020

Conversation

Yetizone
Copy link
Contributor

PR opened in response to #41901

The problem here is that there are indeed negative values in the color parameter of tonemap_reinhard()
The division in the forumla causes the negative signs to cancel out so the clamp() in the return statement doesn't fix this.
The changes here add checks that ensure the color values are positive before applying the formula.

The test scene now looks like this:
correct

This issue also happens in master. I'll make a separate PR there after this one reaches approval and is merged.

Color values can become negative in the case of negative lights which
leads to undesired behaviour.
@akien-mga akien-mga merged commit f442dc0 into godotengine:3.2 Oct 19, 2020
@akien-mga
Copy link
Member

Thanks!

@Yetizone
Copy link
Contributor Author

Thanks for getting this merged ! :)

@Yetizone Yetizone deleted the negative_lights_behavior branch October 19, 2020 21:04
@akien-mga akien-mga modified the milestones: 3.2, 3.3 Apr 21, 2021
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.

6 participants