-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Move deband to end of tonemapping. #66317
Conversation
This avoids artifacts when using adjustments and color correction
@@ -498,5 +492,11 @@ void main() { | |||
color.rgb = apply_color_correction(color.rgb); | |||
} | |||
|
|||
if (params.use_debanding) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing this means debanding is applied after tonemapping – can this be a problem with certain tonemappers?
Edit: In the 3.x
version of this PR, this seems to work out just fine (tested with Filmic and ACES Fitted tonemappers).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it shouldn't be a problem. Debanding should not be done before tonemapping anyway regardless of the tonemapper used. Debanding needs to be done right before quantizing.
Are you using a monitor on a VGA connection, or a monitor with a 6-bit + FRC panel (which can't display 8-bit color without dithering on its own)? Both can result in visible noise appearing on static images. Many low-end monitors (typically those with TN panels) are 6-bit + FRC, not 8-bit or more. |
using DVI on a ViewSonic VX2433wm, which is 1080p 60Hz LCD (which is a cheap, nearly 15 years old TN panel) |
This is indeed a monitor with 6-bit + FRC color:
|
Thanks! |
Fixes #66316
This avoids artifacts when using adjustments and color correction
Dither was incorrectly added before the tonemapping step (and thus before the adjustments and color correction). Dither should be applied right before quantization (i.e. before writing to the LDR framebuffer). Otherwise the debanding effect becomes stronger or weaker depending on the scene brightness and the adjustments/color correction steps.
As a bonus this also increases the quality of the debanding (but only very slightly).
Before:
After:
Without the extreme adjustments:
Before:
After (if you zoom in you will notice a very small increase in quality here):
This change is not relevant for GLES3 in 4.0, but is relevant for 3.x. It won't be able to be cherrypicked but it is a simple fix