Deband
- empleat
-
Please Log in or Create an account to join the conversation.
- Duran.te
-
About the values for the very high preset, based on my tests, I think we could work with these ones as starting point: Average and Middle threshold something around 6 and the Maximum threshold around 10.
Here there's the difference between "high" (left) and my custom preset (right), which takes away some details in normal games, but should offer better debanding on gradient based ones.
Please Log in or Create an account to join the conversation.
- empleat
-
BUMP
Please Log in or Create an account to join the conversation.
- spiro
-
Most users probably use this for debanding skies but don't want to lose detail in the foreground. A depth mask, based on Reshade's depth buffer, would be a good way to solve the problem.
I am currently playing Risen 2. The sky has a lot of banding. However, if I crank this shader's settings high enough to eliminate all banding from the sky, I lose some foreground detail (cobblestone ground at nighttime is a series of dark blue horizontal streaks, and on high settings the Deband shader smooths it all out).
I tried googling for a Reshade depth mask. I found this post, where someone had succeeded in editing the default UIMask into a depth mask:
reshade.me/forum/shader-discussion/4185-...modify-ui-mask#27402
I have zero knowledge of shader programming, but I tried to do the same. I didn't just copy the shader code from the depth mask linked above - in case the UIMask had changed between versions, I took the current UIMask as my source, did a text comparison with the modified UIMask linked above, and edited in the lines related to the depth buffer. Then I saved the new file as DepthMask.fx and renamed the techniques at the bottom of the file to DepthMask_Top and DepthMask_Bottom.
Although I had no idea what I was doing, to my surprise and delight, this solution worked perfectly ingame. Putting Deband between DepthMask_Top and DepthMask_Bottom gave me a scene where the Deband only debanded the sky and not the foreground. I could crank up the debanding in the sky as high as I wanted with no effect on the foreground.
In practice, I found that raising the number of iterations debanded the sky very efficiently, but they also had an fps cost. So I stuck to one iteration, but as I was now free to crank up the settings, I used custom settings similar to what Duran.te suggests as a "very high" preset a couple of posts above.
So, the solution with the custom depth mask works. However, I could still suggest / request a modification to the Deband shader itself to include a depth mask option. It would probably be more fps-friendly to use one shader for this rather than three (DepthMask_Top, Deband, DepthMask_Bottom).
Please Log in or Create an account to join the conversation.
- spiro
-
I abandoned the depth mask idea from my previous post, because it was an unnecessarily complicated solution that added processing overhead and thus strained the fps. Instead I decided to add a simple depth cutoff into the Deband shader code. Not only does this solve the problem of loss of detail in the foreground, it probably also makes the shader more lightweight on fps, because it doesn't need to compute anything for foreground pixels.
I experimented with a depth cutoff slider in the UI and discovered that at least in this game, Risen 2, the depth of the skybox is where "float depth = ReShade::GetLinearizedDepth(texcoord)" equals exactly 1. Anything less than 1 is the world in front of the skybox.
Here's the code for my modification of this shader, in case anyone cares. It has a "Sky only" option checkbox added in the UI, on by default. If you want to use it to deband only the sky in some game where the depth of the skybox is at something other than 1.0, you can try changing the value on the line "if (depth < 1.0) {".
/**
* Deband shader by haasn
* https://github.com/haasn/gentoo-conf/blob/xor/home/nand/.mpv/shaders/deband-pre.glsl
*
* Copyright (c) 2015 Niklas Haas
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Modified and optimized for ReShade by JPulowski
* https://reshade.me/forum/shader-presentation/768-deband
*
* Do not distribute without giving credit to the original author(s).
*
* 1.0 - Initial release
* 1.1 - Replaced the algorithm with the one from MPV
* 1.1a - Minor optimizations
* Removed unnecessary lines and replaced them with ReShadeFX intrinsic counterparts
* 2.0 - Replaced "grain" with CeeJay.dk's ordered dithering algorithm and enabled it by default
* The configuration is now more simpler and straightforward
* Some minor code changes and optimizations
* Improved the algorithm and made it more robust by adding some of the madshi's
* improvements to flash3kyuu_deband which should cause an increase in quality. Higher
* iterations/ranges should now yield higher quality debanding without too much decrease
* in quality.
* Changed licensing text and original source code URL
*/
#include "ReShadeUI.fxh"
uniform int threshold_preset < __UNIFORM_COMBO_INT1
ui_label = "Debanding strength";
ui_items = "Low\0Medium\0High\0Custom\0";
ui_tooltip = "Debanding presets. Use Custom to be able to use custom thresholds in the advanced section.";
> = 0;
uniform float range < __UNIFORM_SLIDER_FLOAT1
ui_min = 1.0;
ui_max = 32.0;
ui_step = 1.0;
ui_label = "Initial radius";
ui_tooltip = "The radius increases linearly for each iteration. A higher radius will find more gradients, but a lower radius will smooth more aggressively.";
> = 24.0;
uniform int iterations < __UNIFORM_SLIDER_INT1
ui_min = 1;
ui_max = 4;
ui_label = "Iterations";
ui_tooltip = "The number of debanding steps to perform per sample. Each step reduces a bit more banding, but takes time to compute.";
> = 1;
uniform bool sky_only < __UNIFORM_RADIO_BOOL1
ui_label = "Sky only";
ui_tooltip = "Deband sky and horizon only. Preserve all foreground detail.";
> = true;
uniform float custom_avgdiff < __UNIFORM_SLIDER_FLOAT1
ui_min = 0.0;
ui_max = 255.0;
ui_step = 0.1;
ui_label = "Average threshold";
ui_tooltip = "Threshold for the difference between the average of reference pixel values and the original pixel value. Higher numbers increase the debanding strength but progressively diminish image details. In pixel shaders a 8-bit color step equals to 1.0/255.0";
ui_category = "Advanced";
> = 1.8;
uniform float custom_maxdiff < __UNIFORM_SLIDER_FLOAT1
ui_min = 0.0;
ui_max = 255.0;
ui_step = 0.1;
ui_label = "Maximum threshold";
ui_tooltip = "Threshold for the difference between the maximum difference of one of the reference pixel values and the original pixel value. Higher numbers increase the debanding strength but progressively diminish image details. In pixel shaders a 8-bit color step equals to 1.0/255.0";
ui_category = "Advanced";
> = 4.0;
uniform float custom_middiff < __UNIFORM_SLIDER_FLOAT1
ui_min = 0.0;
ui_max = 255.0;
ui_step = 0.1;
ui_label = "Middle threshold";
ui_tooltip = "Threshold for the difference between the average of diagonal reference pixel values and the original pixel value. Higher numbers increase the debanding strength but progressively diminish image details. In pixel shaders a 8-bit color step equals to 1.0/255.0";
ui_category = "Advanced";
> = 2.0;
uniform bool debug_output < __UNIFORM_RADIO_BOOL1
ui_label = "Debug view";
ui_tooltip = "Shows the low-pass filtered (blurred) output. Could be useful when making sure that range and iterations capture all of the banding in the picture.";
ui_category = "Advanced";
> = false;
#include "ReShade.fxh"
// Reshade uses C rand for random, max cannot be larger than 2^15-1
uniform int drandom < source = "random"; min = 0; max = 32767; >;
float rand(float x)
{
return frac(x / 41.0);
}
float permute(float x)
{
return ((34.0 * x + 1.0) * x) % 289.0;
}
void analyze_pixels(float3 ori, sampler2D tex, float2 texcoord, float2 _range, float2 dir, out float3 ref_avg, out float3 ref_avg_diff, out float3 ref_max_diff, out float3 ref_mid_diff1, out float3 ref_mid_diff2)
{
// Sample at quarter-turn intervals around the source pixel
// South-east
float3 ref = tex2Dlod(tex, float4(texcoord + _range * dir, 0.0, 0.0)).rgb;
float3 diff = abs(ori - ref);
ref_max_diff = diff;
ref_avg = ref;
ref_mid_diff1 = ref;
// North-west
ref = tex2Dlod(tex, float4(texcoord + _range * -dir, 0.0, 0.0)).rgb;
diff = abs(ori - ref);
ref_max_diff = max(ref_max_diff, diff);
ref_avg += ref;
ref_mid_diff1 = abs(((ref_mid_diff1 + ref) * 0.5) - ori);
// North-east
ref = tex2Dlod(tex, float4(texcoord + _range * float2(-dir.y, dir.x), 0.0, 0.0)).rgb;
diff = abs(ori - ref);
ref_max_diff = max(ref_max_diff, diff);
ref_avg += ref;
ref_mid_diff2 = ref;
// South-west
ref = tex2Dlod(tex, float4(texcoord + _range * float2( dir.y, -dir.x), 0.0, 0.0)).rgb;
diff = abs(ori - ref);
ref_max_diff = max(ref_max_diff, diff);
ref_avg += ref;
ref_mid_diff2 = abs(((ref_mid_diff2 + ref) * 0.5) - ori);
ref_avg *= 0.25; // Normalize avg
ref_avg_diff = abs(ori - ref_avg);
}
float3 PS_Deband(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target
{
float3 ori = tex2Dlod(ReShade::BackBuffer, float4(texcoord, 0.0, 0.0)).rgb; // Original pixel
if (sky_only) {
float depth = ReShade::GetLinearizedDepth(texcoord);
if (depth < 1.0) {
return ori;
}
}
float3 res; // Final pixel
// Settings
float avgdiff;
float maxdiff;
float middiff;
if (threshold_preset == 0) {
avgdiff = 0.6;
maxdiff = 1.9;
middiff = 1.2;
}
else if (threshold_preset == 1) {
avgdiff = 1.8;
maxdiff = 4.0;
middiff = 2.0;
}
else if (threshold_preset == 2) {
avgdiff = 3.4;
maxdiff = 6.8;
middiff = 3.3;
}
else if (threshold_preset == 3) {
avgdiff = custom_avgdiff;
maxdiff = custom_maxdiff;
middiff = custom_middiff;
}
// Normalize
avgdiff /= 255.0;
maxdiff /= 255.0;
middiff /= 255.0;
// Initialize the PRNG by hashing the position + a random uniform
float h = permute(permute(permute(texcoord.x) + texcoord.y) + drandom / 32767.0);
float3 ref_avg; // Average of 4 reference pixels
float3 ref_avg_diff; // The difference between the average of 4 reference pixels and the original pixel
float3 ref_max_diff; // The maximum difference between one of the 4 reference pixels and the original pixel
float3 ref_mid_diff1; // The difference between the average of SE and NW reference pixels and the original pixel
float3 ref_mid_diff2; // The difference between the average of NE and SW reference pixels and the original pixel
// Compute a random angle
float dir = rand(permute(h)) * 6.2831853;
float2 o = float2(cos(dir), sin(dir));
for (int i = 1; i <= iterations; ++i) {
// Compute a random distance
float dist = rand(h) * range * i;
float2 pt = dist * BUFFER_PIXEL_SIZE;
analyze_pixels(ori, ReShade::BackBuffer, texcoord, pt, o,
ref_avg,
ref_avg_diff,
ref_max_diff,
ref_mid_diff1,
ref_mid_diff2);
float3 ref_avg_diff_threshold = avgdiff * i;
float3 ref_max_diff_threshold = maxdiff * i;
float3 ref_mid_diff_threshold = middiff * i;
// Fuzzy logic based pixel selection
float3 factor = pow(saturate(3.0 * (1.0 - ref_avg_diff / ref_avg_diff_threshold)) *
saturate(3.0 * (1.0 - ref_max_diff / ref_max_diff_threshold)) *
saturate(3.0 * (1.0 - ref_mid_diff1 / ref_mid_diff_threshold)) *
saturate(3.0 * (1.0 - ref_mid_diff2 / ref_mid_diff_threshold)), 0.1);
if (debug_output)
res = ref_avg;
else
res = lerp(ori, ref_avg, factor);
h = permute(h);
}
const float dither_bit = 8.0; //Number of bits per channel. Should be 8 for most monitors.
/*------------------------.
| :: Ordered Dithering :: |
'------------------------*/
//Calculate grid position
float grid_position = frac(dot(texcoord, (BUFFER_SCREEN_SIZE * float2(1.0 / 16.0, 10.0 / 36.0)) + 0.25));
//Calculate how big the shift should be
float dither_shift = 0.25 * (1.0 / (pow(2, dither_bit) - 1.0));
//Shift the individual colors differently, thus making it even harder to see the dithering pattern
float3 dither_shift_RGB = float3(dither_shift, -dither_shift, dither_shift); //subpixel dithering
//modify shift acording to grid position.
dither_shift_RGB = lerp(2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position); //shift acording to grid position.
//shift the color by dither_shift
res += dither_shift_RGB;
return res;
}
technique Deband <
ui_tooltip = "Alleviates color banding by trying to approximate original color values.";
>
{
pass
{
VertexShader = PostProcessVS;
PixelShader = PS_Deband;
}
}
Please Log in or Create an account to join the conversation.
- JPulowski
-
Topic Author
I am happy to announce the version 3.0 of Deband shader. In this version I have completely changed the banding analysis algorithm, replacing it with Weber ratio and modified standard deviation analyses which according to my testing give more accurate results compared to old versions. I have also added and modified some other stuff as well which you can read in the changelog. As usual I am going to post the release candidate here and if there are no bugs or more improvement suggestions I will push it to the upstream. Enjoy!
/**
* Deband shader by haasn
* https://github.com/haasn/gentoo-conf/blob/xor/home/nand/.mpv/shaders/deband-pre.glsl
*
* Copyright (c) 2015 Niklas Haas
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Modified and optimized for ReShade by JPulowski
* https://reshade.me/forum/shader-presentation/768-deband
*
* Do not distribute without giving credit to the original author(s).
*
* 1.0 - Initial release
* 1.1 - Replaced the algorithm with the one from MPV
* 1.1a - Minor optimizations
* - Removed unnecessary lines and replaced them with ReShadeFX intrinsic counterparts
* 2.0 - Replaced "grain" with CeeJay.dk's ordered dithering algorithm and enabled it by default
* - The configuration is now more simpler and straightforward
* - Some minor code changes and optimizations
* - Improved the algorithm and made it more robust by adding some of the madshi's
* improvements to flash3kyuu_deband which should cause an increase in quality. Higher
* iterations/ranges should now yield higher quality debanding without too much decrease
* in quality.
* - Changed licensing text and original source code URL
* 3.0 - Replaced the entire banding detection algorithm with modified standard deviation and
* Weber ratio analyses which give more accurate and error-free results compared to the
* previous algorithm
* - Added banding map debug view
* - Added and redefined UI categories
* - Added depth detection (credits to spiro) which should be useful when banding only
* occurs in the sky texture for example
* - Fixed a bug in random number generation which was causing artifacts on the upper left
* side of the screen
* - Dithering is now applied only when debanding a pixel as it should be which should
* reduce the overall noise in the final texture
* - Minor code optimizations
* 3.1 - Switched to chroma-based analysis from luma-based analysis which was causing artifacts
* under some scenarios
* - Changed parts of the code which was causing compatibility issues on some renderers
*/
#include "ReShadeUI.fxh"
#include "ReShade.fxh"
uniform bool enable_weber <
ui_category = "Banding analysis";
ui_label = "Weber ratio";
ui_tooltip = "Weber ratio analysis that calculates the ratio of the each local pixel's intensity to average background intensity of all the local pixels.";
ui_type = "radio";
> = true;
uniform bool enable_sdeviation <
ui_category = "Banding analysis";
ui_label = "Standard deviation";
ui_tooltip = "Modified standard deviation analysis that calculates nearby pixels' intensity deviation from the current pixel instead of the mean.";
ui_type = "radio";
> = true;
uniform bool enable_depthbuffer <
ui_category = "Banding analysis";
ui_label = "Depth detection";
ui_tooltip = "Allows depth information to be used when analysing banding, pixels will only be analysed if they are in a certain depth. (e.g. debanding only the sky)";
ui_type = "radio";
> = false;
uniform float t1 <
ui_category = "Banding analysis";
ui_label = "Standard deviation threshold";
ui_max = 0.5;
ui_min = 0.0;
ui_step = 0.001;
ui_tooltip = "Standard deviations lower than this threshold will be flagged as flat regions with potential banding.";
ui_type = "slider";
> = 0.007;
uniform float t2 <
ui_category = "Banding analysis";
ui_label = "Weber ratio threshold";
ui_max = 2.0;
ui_min = 0.0;
ui_step = 0.01;
ui_tooltip = "Weber ratios lower than this threshold will be flagged as flat regions with potential banding.";
ui_type = "slider";
> = 0.04;
uniform float banding_depth <
ui_category = "Banding analysis";
ui_label = "Banding depth";
ui_max = 1.0;
ui_min = 0.0;
ui_step = 0.001;
ui_tooltip = "Pixels under this depth threshold will not be processed and returned as they are.";
ui_type = "slider";
> = 1.0;
uniform float range <
ui_category = "Banding detection & removal";
ui_label = "Radius";
ui_max = 32.0;
ui_min = 1.0;
ui_step = 1.0;
ui_tooltip = "The radius increases linearly for each iteration. A higher radius will find more gradients, but a lower radius will smooth more aggressively.";
ui_type = "slider";
> = 24.0;
uniform int iterations <
ui_category = "Banding detection & removal";
ui_label = "Iterations";
ui_max = 4;
ui_min = 1;
ui_tooltip = "The number of debanding steps to perform per sample. Each step reduces a bit more banding, but takes time to compute.";
ui_type = "slider";
> = 1;
uniform int debug_output <
ui_category = "Debug";
ui_items = "None\0Blurred (LPF) image\0Banding map\0";
ui_label = "Debug view";
ui_tooltip = "Blurred (LPF) image: Useful when tweaking radius and iterations to make sure all banding regions are blurred enough.\nBanding map: Useful when tweaking analysis parameters, continuous green regions indicate flat (i.e. banding) regions.";
ui_type = "combo";
> = 0;
// Reshade uses C rand for random, max cannot be larger than 2^15-1
uniform int drandom < source = "random"; min = 0; max = 32767; >;
float rand(float x)
{
return frac(x / 41.0);
}
float permute(float x)
{
return ((34.0 * x + 1.0) * x) % 289.0;
}
float3 PS_Deband(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target
{
float3 ori = tex2Dlod(ReShade::BackBuffer, float4(texcoord, 0.0, 0.0)).rgb;
if (enable_depthbuffer && (ReShade::GetLinearizedDepth(texcoord) < banding_depth))
return ori;
// Initialize the PRNG by hashing the position + a random uniform
float3 m = float3(texcoord + 1.0, (drandom / 32767.0) + 1.0);
float h = permute(permute(permute(m.x) + m.y) + m.z);
// Compute a random angle
float dir = rand(permute(h)) * 6.2831853;
float2 o = float2(cos(dir), sin(dir));
// Distance calculations
float2 pt;
float dist;
for (int i = 1; i <= iterations; ++i) {
dist = rand(h) * range * i;
pt = dist * BUFFER_PIXEL_SIZE;
h = permute(h);
}
// Sample at quarter-turn intervals around the source pixel
float3 ref[4] = {
tex2Dlod(ReShade::BackBuffer, float4(texcoord + pt * o, 0.0, 0.0)).rgb, // SE
tex2Dlod(ReShade::BackBuffer, float4(texcoord + pt * -o, 0.0, 0.0)).rgb, // NW
tex2Dlod(ReShade::BackBuffer, float4(texcoord + pt * float2(-o.y, o.x), 0.0, 0.0)).rgb, // NE
tex2Dlod(ReShade::BackBuffer, float4(texcoord + pt * float2( o.y, -o.x), 0.0, 0.0)).rgb // SW
};
// Calculate weber ratio
float3 mean = (ori + ref[0] + ref[1] + ref[2] + ref[3]) * 0.2;
float3 k = abs(ori - mean);
for (int j = 0; j < 4; ++j) {
k += abs(ref[j] - mean);
}
k = k * 0.2 / mean;
// Calculate std. deviation
float3 sd = 0.0;
for (int j = 0; j < 4; ++j) {
sd += pow(ref[j] - ori, 2);
}
sd = sqrt(sd * 0.25);
// Generate final output
float3 output;
if (debug_output == 2)
output = float3(0.0, 1.0, 0.0);
else
output = (ref[0] + ref[1] + ref[2] + ref[3]) * 0.25;
// Generate a binary banding map
bool3 banding_map = true;
if (debug_output != 1) {
if (enable_weber)
banding_map = banding_map && k <= t2 * iterations;
if (enable_sdeviation)
banding_map = banding_map && sd <= t1 * iterations;
}
/*------------------------.
| :: Ordered Dithering :: |
'------------------------*/
//Calculate grid position
float grid_position = frac(dot(texcoord, (BUFFER_SCREEN_SIZE * float2(1.0 / 16.0, 10.0 / 36.0)) + 0.25));
//Calculate how big the shift should be
float dither_shift = 0.25 * (1.0 / (pow(2, BUFFER_COLOR_BIT_DEPTH) - 1.0));
//Shift the individual colors differently, thus making it even harder to see the dithering pattern
float3 dither_shift_RGB = float3(dither_shift, -dither_shift, dither_shift); //subpixel dithering
//modify shift acording to grid position.
dither_shift_RGB = lerp(2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position); //shift acording to grid position.
return banding_map ? output + dither_shift_RGB : ori;
}
technique Deband <
ui_tooltip = "Alleviates color banding by trying to approximate original color values.";
>
{
pass
{
VertexShader = PostProcessVS;
PixelShader = PS_Deband;
}
}
Please Log in or Create an account to join the conversation.
- s0ulty
-
C:\Reshade\Shaders\deband.fx(226,16-41): error X3535: Bitwise operations not supported on target ps_3_0.
4.9 Black Mesa.
Please Log in or Create an account to join the conversation.
- JPulowski
-
Topic Author
Please Log in or Create an account to join the conversation.
- s0ulty
-
Please Log in or Create an account to join the conversation.
- Forgiven12
-
It used to be a matter of leaving Debanding strength on 'high', Iterations maxed at 4, and the gradually decreasing Initial radius from 32 until you get a nice gradient. A little bit of grain in darker areas such as shadows is pleasing to the eye I'd say. Thanks for your work.
streamable.com/qf6gps
Please Log in or Create an account to join the conversation.
- JPulowski
-
Topic Author
Interesting. Can you please post some non-processed screenshots for testing where shimmering occurs?Forgiven12 wrote: Hi. I updated the Deband shader in my pcsx2 emulator folder from 2.0->3.0. After testing and comparing the two in a 2D sprite heavy game, I'm sticking with the older one. The new version introduces too much unwanted shimmering on anything above 1 iterations, and requires fine adjusting from game to game. I just can't get good results anymore.
It used to be a matter of leaving Debanding strength on 'high', Iterations maxed at 4, and the gradually decreasing Initial radius from 32 until you get a nice gradient. A little bit of grain in darker areas such as shadows is pleasing to the eye I'd say. Thanks for your work.
streamable.com/qf6gps
Please Log in or Create an account to join the conversation.
- Forgiven12
-
streamable.com/wna9je
PS. Will update once Depth Detection becomes handy but 2D retro games will suffice for now.
Please Log in or Create an account to join the conversation.
- JPulowski
-
Topic Author
Please Log in or Create an account to join the conversation.
- JPulowski
-
Topic Author
Please Log in or Create an account to join the conversation.
- anontsuki
-

Please Log in or Create an account to join the conversation.
- JPulowski
-
Topic Author
Please Log in or Create an account to join the conversation.
- anontsuki
-
It works fine, but the weber ratio seems weird. At 0.01 everything is fine, because 0.0 breaks everything, but increasing the ratio doesn't seem to affect anything on the banding map. Not sure what it's exactly affecting. The Standard deviation is really obvious in comparison.
I think it'd be worthwhile to have the tip that the colour green in the banding map symbolizes debanding is working. Do you know what the other colours symbolize though? I saw yellow, in clouds.
It's great though, FFXIV has very subtle banding most of the time and this cleared it up really well. I was able to leave the clouds and other whispy elements unaffected by the smoothing. Depth access also is a really nice little touch.
0.5ms or so with the settings I'm using, basically imperceptible performance penalty.
Please Log in or Create an account to join the conversation.