From f37ed772babb6c68fe2b9b2190d1d420dff79279 Mon Sep 17 00:00:00 2001 From: Hyllian Date: Mon, 25 Jul 2022 17:39:13 -0300 Subject: [PATCH] Update xbr-lv2-small-details. - Improve dithering treatment. --- xbr/shaders/xbr-lv2-multipass/xbr-lv2-pass0.slang | 4 ++-- xbr/xbr-lv2-small-details.slangp | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/xbr/shaders/xbr-lv2-multipass/xbr-lv2-pass0.slang b/xbr/shaders/xbr-lv2-multipass/xbr-lv2-pass0.slang index 9b48cf0..3ec75f4 100644 --- a/xbr/shaders/xbr-lv2-multipass/xbr-lv2-pass0.slang +++ b/xbr/shaders/xbr-lv2-multipass/xbr-lv2-pass0.slang @@ -184,7 +184,7 @@ vec4 weighted_distance(mat4x3 a, mat4x3 b, mat4x3 c, mat4x3 d, mat4x3 e, mat4x3 } else { - return (dist4(a,b) + dist4(a,c) + dist4(d,e) + dist4(d,f) + 4.0*dist4(g,h) - dist4(b,c) - dist4(e,f)); + return ( (dist4(a,b) + dist4(a,c)) * (dist4(d,e) + dist4(d,f)) + 2.0 * dist4(g,h) * (dist4(c,e)+dist4(b,f)) * (dist4(c,b)+dist4(e,f)) ); } } @@ -269,7 +269,7 @@ void main() vec4 d_fg = dist4(f, g); vec4 d_hc = dist4(h, c); - float K = (SMALL_DETAILS < 0.5 ? 1.0 : 3.0); + float K = (SMALL_DETAILS < 0.5 ? 1.0 : 1.9); edri = LTE(wd1, wd2) * irlv0; edr = LT( K*wd1, wd2) * irlv1 * NOT(edri.yzwx * edri.wxyz); diff --git a/xbr/xbr-lv2-small-details.slangp b/xbr/xbr-lv2-small-details.slangp index e214a6d..508d2db 100644 --- a/xbr/xbr-lv2-small-details.slangp +++ b/xbr/xbr-lv2-small-details.slangp @@ -13,7 +13,9 @@ filter_linear2 = false filter_linear0 = "false" filter_linear1 = "false" -parameters = "SMALL_DETAILS" +parameters = "XBR_LV2_COEFFICIENT;XBR_EQ_THRESHOLD;SMALL_DETAILS" +XBR_LV2_COEFFICIENT = "0.0 +XBR_EQ_THRESHOLD = "0.22" SMALL_DETAILS = "1.0"