mirror of
https://github.com/stenzek/duckstation.git
synced 2026-02-04 05:04:33 +00:00
[PR #3089] [MERGED] Add debanding option to improve gradient smoothness with truecolor #1588
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/stenzek/duckstation/pull/3089
Author: @Calinou
Created: 1/19/2024
Status: ✅ Merged
Merged: 1/19/2024
Merged by: @stenzek
Base:
master← Head:add-debanding📝 Commits (1)
cc94b76Add debanding option to improve gradient smoothness with truecolor📊 Changes
11 files changed (+71 additions, -18 deletions)
View changed files
📝
src/core/fullscreen_ui.cpp(+4 -0)📝
src/core/gpu_hw.cpp(+10 -3)📝
src/core/gpu_hw.h(+1 -0)📝
src/core/gpu_hw_shadergen.cpp(+29 -11)📝
src/core/gpu_hw_shadergen.h(+2 -1)📝
src/core/imgui_overlays.cpp(+7 -2)📝
src/core/settings.cpp(+3 -0)📝
src/core/settings.h(+1 -0)📝
src/core/system.cpp(+1 -0)📝
src/duckstation-qt/enhancementsettingswidget.cpp(+5 -0)📝
src/duckstation-qt/enhancementsettingswidget.ui(+8 -1)📄 Description
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.
This kind of flickering on the parking lot's floor and ceiling completely goes away once debanding is enabled:
https://github.com/stenzek/duckstation/assets/180032/ee325ce0-ddbc-41a3-8452-7472e8de7ff9
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.