You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-07 19:53:17 +00:00
Move deband to end of tonemapping.
This avoids artifacts when using adjustments and color correction
This commit is contained in:
@@ -462,12 +462,6 @@ void main() {
|
||||
}
|
||||
#endif
|
||||
|
||||
if (params.use_debanding) {
|
||||
// For best results, debanding should be done before tonemapping.
|
||||
// Otherwise, we're adding noise to an already-quantized image.
|
||||
color.rgb += screen_space_dither(gl_FragCoord.xy);
|
||||
}
|
||||
|
||||
color.rgb = apply_tonemapping(color.rgb, params.white);
|
||||
|
||||
color.rgb = linear_to_srgb(color.rgb); // regular linear -> SRGB conversion
|
||||
@@ -498,5 +492,11 @@ void main() {
|
||||
color.rgb = apply_color_correction(color.rgb);
|
||||
}
|
||||
|
||||
if (params.use_debanding) {
|
||||
// Debanding should be done at the end of tonemapping, but before writing to the LDR buffer.
|
||||
// Otherwise, we're adding noise to an already-quantized image.
|
||||
color.rgb += screen_space_dither(gl_FragCoord.xy);
|
||||
}
|
||||
|
||||
frag_color = color;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user