Skip to content

Add debanding option to improve gradient smoothness with truecolor #3089

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

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

Calinou
Copy link
Contributor

@Calinou Calinou commented Jan 19, 2024

This option only has an effect if true color is also enabled.

Most PS1 games don't exhibit that much banding with true color, but there are particular cases where flickering induced by a lack of color precision is visible, such as Driver in its nighttime levels. You may also notice more banding if you play with bilinear texture filtering enabled, in which case debanding will help.

Compared to the existing deband post-processing shader, this works with internal rendering which makes it both faster and more precise. No loss of detail occurs, and no tweaking of thresholds is required.

The option is disabled by default as its effect is subtle in most games, and it increases the file size of screenshots due to the subtle dithering pattern.

The debanding algorithm used is very fast (only a handful of instructions), and is also the one that happens to be used in Godot 🙂

Preview

Click to view at full size.

Before After
driver_without_debanding driver_debanding

This kind of flickering on the parking lot's floor and ceiling completely goes away once debanding is enabled:

driver_no_debanding.mp4

This option only has an effect if true color is also enabled.
@stenzek
Copy link
Owner

stenzek commented Jan 19, 2024

Sounds good, thanks for this!

Some minor UI changes, like having true colour disabled should disable banding, but I'll sort that out post-merge.

I also wonder if it would be better to apply after the texture modulation step, rather than to the two independently, since that would increase the visibility of the dithering pattern.

Linux CI fail is unrelated to these changes.

@stenzek stenzek merged commit 352114d into stenzek:master Jan 19, 2024
@Calinou Calinou deleted the add-debanding branch January 19, 2024 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants