1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-06 19:41:11 +00:00

Merge pull request #42915 from Yetizone/negative_lights_behavior

tonemap.glsl: Ensure color parameter of tonemap_reinhard() is positive
This commit is contained in:
Rémi Verschelde
2020-10-19 23:50:49 +02:00
committed by GitHub

View File

@@ -157,6 +157,10 @@ vec3 tonemap_aces(vec3 color, float white) {
}
vec3 tonemap_reinhard(vec3 color, float white) {
// Ensure color values are positive.
// They can be negative in the case of negative lights, which leads to undesired behavior.
color = max(vec3(0.0), color);
return (white * color + color) / (color * white + white);
}