1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-01 16:38:31 +00:00

Fix inconsistent color clamping between Mobile and Forward+.

Also remove inconsistencies with glow blending code and comments between the two shader files to allow for easier comparison of the two tonemap files.
This commit is contained in:
Allen Pestaluky
2025-11-18 10:09:03 -05:00
parent 9c561027fc
commit 2c6749ab9a
2 changed files with 18 additions and 23 deletions

View File

@@ -862,17 +862,14 @@ void main() {
}
if (bool(params.flags & FLAG_USE_GLOW) && params.glow_mode != GLOW_MODE_SOFTLIGHT) {
vec3 glow = gather_glow(source_glow, uv_interp);
vec3 glow = gather_glow(source_glow, uv_interp) * params.glow_intensity;
if (params.glow_map_strength > 0.001) {
glow = mix(glow, texture(glow_map, uv_interp).rgb * glow, params.glow_map_strength);
}
if (params.glow_mode == GLOW_MODE_MIX) {
if (params.glow_map_strength > 0.001) {
glow = mix(glow, texture(glow_map, uv_interp).rgb * glow, params.glow_map_strength);
}
color.rgb = mix(color.rgb, glow, params.glow_intensity);
color.rgb = color.rgb * (1.0 - params.glow_intensity) + glow;
} else {
glow = glow * params.glow_intensity;
if (params.glow_map_strength > 0.001) {
glow = mix(glow, texture(glow_map, uv_interp).rgb * glow, params.glow_map_strength);
}
color.rgb = apply_glow(color.rgb, glow, params.white);
}
}
@@ -887,8 +884,7 @@ void main() {
// Apply soft light after tonemapping to mitigate the issue of discontinuity
// at 1.0 and higher. This makes the issue only appear with HDR output that
// can exceed a 1.0 output value.
vec3 glow = gather_glow(source_glow, uv_interp);
glow = glow * params.glow_intensity;
vec3 glow = gather_glow(source_glow, uv_interp) * params.glow_intensity;
if (params.glow_map_strength > 0.001) {
glow = mix(glow, texture(glow_map, uv_interp).rgb * glow, params.glow_map_strength);
}