From 849654517072b6d11cc26fa03c186a3bc357bd8a Mon Sep 17 00:00:00 2001 From: MooglyGuy Date: Sat, 10 Jun 2017 12:50:05 +0200 Subject: -bgfx: Fixed the following xBR shaders: xBR-lv2-fast, xBR-lv2-noblend, xBR-lv2, xBR-lv3-noblend, and xBR-lv3. [Ryan Holtz] --- bgfx/chains/xbr/xbr-lv2-3d.json | 2 +- bgfx/chains/xbr/xbr-lv2-fast.json | 15 -- bgfx/chains/xbr/xbr-lv2-noblend.json | 15 -- bgfx/chains/xbr/xbr-lv2.json | 15 -- bgfx/shaders/dx11/chains/xbr/fs_xbr-lv2-3d.bin | Bin 9531 -> 9300 bytes bgfx/shaders/dx11/chains/xbr/fs_xbr-lv2-fast.bin | Bin 4949 -> 4942 bytes .../shaders/dx11/chains/xbr/fs_xbr-lv2-noblend.bin | Bin 5120 -> 5395 bytes bgfx/shaders/dx11/chains/xbr/fs_xbr-lv2.bin | Bin 5885 -> 6518 bytes .../shaders/dx11/chains/xbr/fs_xbr-lv3-noblend.bin | Bin 6332 -> 7423 bytes bgfx/shaders/dx11/chains/xbr/fs_xbr-lv3.bin | Bin 8481 -> 7922 bytes bgfx/shaders/dx11/chains/xbr/vs_xbr-lv2-3d.bin | Bin 711 -> 1343 bytes bgfx/shaders/dx9/chains/xbr/fs_xbr-lv2-3d.bin | Bin 5140 -> 4693 bytes bgfx/shaders/dx9/chains/xbr/fs_xbr-lv2-fast.bin | Bin 2830 -> 2519 bytes bgfx/shaders/dx9/chains/xbr/fs_xbr-lv2-noblend.bin | Bin 2525 -> 2596 bytes bgfx/shaders/dx9/chains/xbr/fs_xbr-lv2.bin | Bin 3342 -> 3235 bytes bgfx/shaders/dx9/chains/xbr/fs_xbr-lv3-noblend.bin | Bin 3165 -> 3632 bytes bgfx/shaders/dx9/chains/xbr/fs_xbr-lv3.bin | Bin 4394 -> 4011 bytes bgfx/shaders/dx9/chains/xbr/vs_xbr-lv2-3d.bin | Bin 514 -> 726 bytes bgfx/shaders/essl/chains/xbr/fs_xbr-lv2-3d.bin | Bin 9638 -> 10107 bytes bgfx/shaders/essl/chains/xbr/fs_xbr-lv2-fast.bin | Bin 5304 -> 5484 bytes .../shaders/essl/chains/xbr/fs_xbr-lv2-noblend.bin | Bin 7137 -> 7171 bytes bgfx/shaders/essl/chains/xbr/fs_xbr-lv2.bin | Bin 6336 -> 7246 bytes .../shaders/essl/chains/xbr/fs_xbr-lv3-noblend.bin | Bin 8802 -> 9926 bytes bgfx/shaders/essl/chains/xbr/fs_xbr-lv3.bin | Bin 10312 -> 10691 bytes bgfx/shaders/essl/chains/xbr/vs_xbr-lv2-3d.bin | Bin 745 -> 2136 bytes bgfx/shaders/glsl/chains/xbr/fs_xbr-lv2-3d.bin | Bin 9322 -> 9773 bytes bgfx/shaders/glsl/chains/xbr/fs_xbr-lv2-fast.bin | Bin 5100 -> 5274 bytes .../shaders/glsl/chains/xbr/fs_xbr-lv2-noblend.bin | Bin 6880 -> 6913 bytes bgfx/shaders/glsl/chains/xbr/fs_xbr-lv2.bin | Bin 6083 -> 6982 bytes .../shaders/glsl/chains/xbr/fs_xbr-lv3-noblend.bin | Bin 8509 -> 9622 bytes bgfx/shaders/glsl/chains/xbr/fs_xbr-lv3.bin | Bin 9927 -> 10315 bytes bgfx/shaders/glsl/chains/xbr/vs_xbr-lv2-3d.bin | Bin 673 -> 1980 bytes bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-3d.bin | Bin 13025 -> 13854 bytes bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-fast.bin | Bin 7331 -> 7759 bytes .../metal/chains/xbr/fs_xbr-lv2-noblend.bin | Bin 8537 -> 8592 bytes bgfx/shaders/metal/chains/xbr/fs_xbr-lv2.bin | Bin 8581 -> 10337 bytes .../metal/chains/xbr/fs_xbr-lv3-noblend.bin | Bin 10602 -> 12246 bytes bgfx/shaders/metal/chains/xbr/fs_xbr-lv3.bin | Bin 13301 -> 14093 bytes bgfx/shaders/metal/chains/xbr/vs_xbr-lv2-3d.bin | Bin 1097 -> 2515 bytes .../bgfx/shaders/chains/xbr/fs_xbr-lv2-3d.sc | 175 ++++++++++----------- .../bgfx/shaders/chains/xbr/fs_xbr-lv2-fast.sc | 89 ++++------- .../bgfx/shaders/chains/xbr/fs_xbr-lv2-noblend.sc | 91 ++++------- .../render/bgfx/shaders/chains/xbr/fs_xbr-lv2.sc | 122 ++++++-------- .../bgfx/shaders/chains/xbr/fs_xbr-lv3-noblend.sc | 111 ++++++------- .../render/bgfx/shaders/chains/xbr/fs_xbr-lv3.sc | 121 ++++++-------- .../bgfx/shaders/chains/xbr/vs_xbr-lv2-3d.sc | 10 +- 46 files changed, 294 insertions(+), 472 deletions(-) diff --git a/bgfx/chains/xbr/xbr-lv2-3d.json b/bgfx/chains/xbr/xbr-lv2-3d.json index 7403b3e5b1a..accc199ee3d 100644 --- a/bgfx/chains/xbr/xbr-lv2-3d.json +++ b/bgfx/chains/xbr/xbr-lv2-3d.json @@ -27,7 +27,7 @@ */ { - "name": "xBR-lv2-3d", + "name": "xBR-lv2 3D", "author": "Hyllian", "passes": [ { diff --git a/bgfx/chains/xbr/xbr-lv2-fast.json b/bgfx/chains/xbr/xbr-lv2-fast.json index b3b3a1e5141..dee37b63f50 100644 --- a/bgfx/chains/xbr/xbr-lv2-fast.json +++ b/bgfx/chains/xbr/xbr-lv2-fast.json @@ -29,13 +29,6 @@ { "name": "xBR-lv2 Fast", "author": "Hyllian", - "targets": [ - { - "name": "internal", - "mode": "guest", - "doublebuffer": true - } - ], "passes": [ { "effect": "xbr/xbr-lv2-fast", @@ -43,14 +36,6 @@ "input": [ { "sampler": "decal", "texture": "screen" } ], - "output": "internal" - }, - { - "effect": "misc/blit", - "name": "Upscale", - "input": [ - { "sampler": "s_tex", "target": "internal" } - ], "output": "output" } ] diff --git a/bgfx/chains/xbr/xbr-lv2-noblend.json b/bgfx/chains/xbr/xbr-lv2-noblend.json index 6d8a70d9351..6469df993c5 100644 --- a/bgfx/chains/xbr/xbr-lv2-noblend.json +++ b/bgfx/chains/xbr/xbr-lv2-noblend.json @@ -29,13 +29,6 @@ { "name": "xBR-lv2 No Blend", "author": "Hyllian", - "targets": [ - { - "name": "internal", - "mode": "guest", - "doublebuffer": true - } - ], "passes": [ { "effect": "xbr/xbr-lv2-noblend", @@ -43,14 +36,6 @@ "input": [ { "sampler": "decal", "texture": "screen" } ], - "output": "internal" - }, - { - "effect": "misc/blit", - "name": "Upscale", - "input": [ - { "sampler": "s_tex", "target": "internal" } - ], "output": "output" } ] diff --git a/bgfx/chains/xbr/xbr-lv2.json b/bgfx/chains/xbr/xbr-lv2.json index 0b821dd82a3..fbcda45917d 100644 --- a/bgfx/chains/xbr/xbr-lv2.json +++ b/bgfx/chains/xbr/xbr-lv2.json @@ -29,13 +29,6 @@ { "name": "xBR-lv2", "author": "Hyllian", - "targets": [ - { - "name": "internal", - "mode": "guest", - "doublebuffer": true - } - ], "passes": [ { "effect": "xbr/xbr-lv2", @@ -43,14 +36,6 @@ "input": [ { "sampler": "decal", "texture": "screen" } ], - "output": "internal" - }, - { - "effect": "misc/blit", - "name": "Upscale", - "input": [ - { "sampler": "s_tex", "target": "internal" } - ], "output": "output" } ] diff --git a/bgfx/shaders/dx11/chains/xbr/fs_xbr-lv2-3d.bin b/bgfx/shaders/dx11/chains/xbr/fs_xbr-lv2-3d.bin index d8e18eed1ec..60cd601bb67 100644 Binary files a/bgfx/shaders/dx11/chains/xbr/fs_xbr-lv2-3d.bin and b/bgfx/shaders/dx11/chains/xbr/fs_xbr-lv2-3d.bin differ diff --git a/bgfx/shaders/dx11/chains/xbr/fs_xbr-lv2-fast.bin b/bgfx/shaders/dx11/chains/xbr/fs_xbr-lv2-fast.bin index c7ba1220aa5..81e60bd278b 100644 Binary files a/bgfx/shaders/dx11/chains/xbr/fs_xbr-lv2-fast.bin and b/bgfx/shaders/dx11/chains/xbr/fs_xbr-lv2-fast.bin differ diff --git a/bgfx/shaders/dx11/chains/xbr/fs_xbr-lv2-noblend.bin b/bgfx/shaders/dx11/chains/xbr/fs_xbr-lv2-noblend.bin index 3b72deb8782..aba34b863c8 100644 Binary files a/bgfx/shaders/dx11/chains/xbr/fs_xbr-lv2-noblend.bin and b/bgfx/shaders/dx11/chains/xbr/fs_xbr-lv2-noblend.bin differ diff --git a/bgfx/shaders/dx11/chains/xbr/fs_xbr-lv2.bin b/bgfx/shaders/dx11/chains/xbr/fs_xbr-lv2.bin index b288f8a7d84..eb0889524ef 100644 Binary files a/bgfx/shaders/dx11/chains/xbr/fs_xbr-lv2.bin and b/bgfx/shaders/dx11/chains/xbr/fs_xbr-lv2.bin differ diff --git a/bgfx/shaders/dx11/chains/xbr/fs_xbr-lv3-noblend.bin b/bgfx/shaders/dx11/chains/xbr/fs_xbr-lv3-noblend.bin index 3b4f0db46a3..d4bc94a4e7a 100644 Binary files a/bgfx/shaders/dx11/chains/xbr/fs_xbr-lv3-noblend.bin and b/bgfx/shaders/dx11/chains/xbr/fs_xbr-lv3-noblend.bin differ diff --git a/bgfx/shaders/dx11/chains/xbr/fs_xbr-lv3.bin b/bgfx/shaders/dx11/chains/xbr/fs_xbr-lv3.bin index e2cebba1f67..1d89ff9dc03 100644 Binary files a/bgfx/shaders/dx11/chains/xbr/fs_xbr-lv3.bin and b/bgfx/shaders/dx11/chains/xbr/fs_xbr-lv3.bin differ diff --git a/bgfx/shaders/dx11/chains/xbr/vs_xbr-lv2-3d.bin b/bgfx/shaders/dx11/chains/xbr/vs_xbr-lv2-3d.bin index 324107e89b1..fcd71edc655 100644 Binary files a/bgfx/shaders/dx11/chains/xbr/vs_xbr-lv2-3d.bin and b/bgfx/shaders/dx11/chains/xbr/vs_xbr-lv2-3d.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/fs_xbr-lv2-3d.bin b/bgfx/shaders/dx9/chains/xbr/fs_xbr-lv2-3d.bin index 28cf2738913..22aa4d95861 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/fs_xbr-lv2-3d.bin and b/bgfx/shaders/dx9/chains/xbr/fs_xbr-lv2-3d.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/fs_xbr-lv2-fast.bin b/bgfx/shaders/dx9/chains/xbr/fs_xbr-lv2-fast.bin index 3f04275f5ba..5eb4c7d62c1 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/fs_xbr-lv2-fast.bin and b/bgfx/shaders/dx9/chains/xbr/fs_xbr-lv2-fast.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/fs_xbr-lv2-noblend.bin b/bgfx/shaders/dx9/chains/xbr/fs_xbr-lv2-noblend.bin index 9cbbdd173c7..a66673f03f5 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/fs_xbr-lv2-noblend.bin and b/bgfx/shaders/dx9/chains/xbr/fs_xbr-lv2-noblend.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/fs_xbr-lv2.bin b/bgfx/shaders/dx9/chains/xbr/fs_xbr-lv2.bin index 8274e8aa4d8..f2dbf48200a 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/fs_xbr-lv2.bin and b/bgfx/shaders/dx9/chains/xbr/fs_xbr-lv2.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/fs_xbr-lv3-noblend.bin b/bgfx/shaders/dx9/chains/xbr/fs_xbr-lv3-noblend.bin index 6a3de661a08..259a40612a3 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/fs_xbr-lv3-noblend.bin and b/bgfx/shaders/dx9/chains/xbr/fs_xbr-lv3-noblend.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/fs_xbr-lv3.bin b/bgfx/shaders/dx9/chains/xbr/fs_xbr-lv3.bin index a6c9393e207..6bbad16b288 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/fs_xbr-lv3.bin and b/bgfx/shaders/dx9/chains/xbr/fs_xbr-lv3.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv2-3d.bin b/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv2-3d.bin index 2f3ac8db667..5bccc4d8c98 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv2-3d.bin and b/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv2-3d.bin differ diff --git a/bgfx/shaders/essl/chains/xbr/fs_xbr-lv2-3d.bin b/bgfx/shaders/essl/chains/xbr/fs_xbr-lv2-3d.bin index 9643a265714..d3e1b180b27 100644 Binary files a/bgfx/shaders/essl/chains/xbr/fs_xbr-lv2-3d.bin and b/bgfx/shaders/essl/chains/xbr/fs_xbr-lv2-3d.bin differ diff --git a/bgfx/shaders/essl/chains/xbr/fs_xbr-lv2-fast.bin b/bgfx/shaders/essl/chains/xbr/fs_xbr-lv2-fast.bin index fb0ee7104e3..840d103194b 100644 Binary files a/bgfx/shaders/essl/chains/xbr/fs_xbr-lv2-fast.bin and b/bgfx/shaders/essl/chains/xbr/fs_xbr-lv2-fast.bin differ diff --git a/bgfx/shaders/essl/chains/xbr/fs_xbr-lv2-noblend.bin b/bgfx/shaders/essl/chains/xbr/fs_xbr-lv2-noblend.bin index b4875edd7c6..457fe5a3dbf 100644 Binary files a/bgfx/shaders/essl/chains/xbr/fs_xbr-lv2-noblend.bin and b/bgfx/shaders/essl/chains/xbr/fs_xbr-lv2-noblend.bin differ diff --git a/bgfx/shaders/essl/chains/xbr/fs_xbr-lv2.bin b/bgfx/shaders/essl/chains/xbr/fs_xbr-lv2.bin index c5dcd103244..b5ab071e866 100644 Binary files a/bgfx/shaders/essl/chains/xbr/fs_xbr-lv2.bin and b/bgfx/shaders/essl/chains/xbr/fs_xbr-lv2.bin differ diff --git a/bgfx/shaders/essl/chains/xbr/fs_xbr-lv3-noblend.bin b/bgfx/shaders/essl/chains/xbr/fs_xbr-lv3-noblend.bin index 8ef2d000e2b..be749d0b162 100644 Binary files a/bgfx/shaders/essl/chains/xbr/fs_xbr-lv3-noblend.bin and b/bgfx/shaders/essl/chains/xbr/fs_xbr-lv3-noblend.bin differ diff --git a/bgfx/shaders/essl/chains/xbr/fs_xbr-lv3.bin b/bgfx/shaders/essl/chains/xbr/fs_xbr-lv3.bin index e2d807898a8..a9a218e5798 100644 Binary files a/bgfx/shaders/essl/chains/xbr/fs_xbr-lv3.bin and b/bgfx/shaders/essl/chains/xbr/fs_xbr-lv3.bin differ diff --git a/bgfx/shaders/essl/chains/xbr/vs_xbr-lv2-3d.bin b/bgfx/shaders/essl/chains/xbr/vs_xbr-lv2-3d.bin index 185547625c4..26b10137f15 100644 Binary files a/bgfx/shaders/essl/chains/xbr/vs_xbr-lv2-3d.bin and b/bgfx/shaders/essl/chains/xbr/vs_xbr-lv2-3d.bin differ diff --git a/bgfx/shaders/glsl/chains/xbr/fs_xbr-lv2-3d.bin b/bgfx/shaders/glsl/chains/xbr/fs_xbr-lv2-3d.bin index 5e23d658855..4eb973425fe 100644 Binary files a/bgfx/shaders/glsl/chains/xbr/fs_xbr-lv2-3d.bin and b/bgfx/shaders/glsl/chains/xbr/fs_xbr-lv2-3d.bin differ diff --git a/bgfx/shaders/glsl/chains/xbr/fs_xbr-lv2-fast.bin b/bgfx/shaders/glsl/chains/xbr/fs_xbr-lv2-fast.bin index a7b48e65fc8..c42afe7d9ce 100644 Binary files a/bgfx/shaders/glsl/chains/xbr/fs_xbr-lv2-fast.bin and b/bgfx/shaders/glsl/chains/xbr/fs_xbr-lv2-fast.bin differ diff --git a/bgfx/shaders/glsl/chains/xbr/fs_xbr-lv2-noblend.bin b/bgfx/shaders/glsl/chains/xbr/fs_xbr-lv2-noblend.bin index f404bb3847c..93e048d5f0e 100644 Binary files a/bgfx/shaders/glsl/chains/xbr/fs_xbr-lv2-noblend.bin and b/bgfx/shaders/glsl/chains/xbr/fs_xbr-lv2-noblend.bin differ diff --git a/bgfx/shaders/glsl/chains/xbr/fs_xbr-lv2.bin b/bgfx/shaders/glsl/chains/xbr/fs_xbr-lv2.bin index b1e84120d4d..57ad240a61f 100644 Binary files a/bgfx/shaders/glsl/chains/xbr/fs_xbr-lv2.bin and b/bgfx/shaders/glsl/chains/xbr/fs_xbr-lv2.bin differ diff --git a/bgfx/shaders/glsl/chains/xbr/fs_xbr-lv3-noblend.bin b/bgfx/shaders/glsl/chains/xbr/fs_xbr-lv3-noblend.bin index f8cbc73f326..0899e9faaa8 100644 Binary files a/bgfx/shaders/glsl/chains/xbr/fs_xbr-lv3-noblend.bin and b/bgfx/shaders/glsl/chains/xbr/fs_xbr-lv3-noblend.bin differ diff --git a/bgfx/shaders/glsl/chains/xbr/fs_xbr-lv3.bin b/bgfx/shaders/glsl/chains/xbr/fs_xbr-lv3.bin index 9eeb127cdf9..1b890059248 100644 Binary files a/bgfx/shaders/glsl/chains/xbr/fs_xbr-lv3.bin and b/bgfx/shaders/glsl/chains/xbr/fs_xbr-lv3.bin differ diff --git a/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv2-3d.bin b/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv2-3d.bin index d0293824b94..c771634e8be 100644 Binary files a/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv2-3d.bin and b/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv2-3d.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-3d.bin b/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-3d.bin index ce2f9f62d51..c7618a2d96f 100644 Binary files a/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-3d.bin and b/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-3d.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-fast.bin b/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-fast.bin index 12f2ae31da0..4883fe8edf4 100644 Binary files a/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-fast.bin and b/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-fast.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-noblend.bin b/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-noblend.bin index cf8f4857cc7..f3617dd9645 100644 Binary files a/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-noblend.bin and b/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-noblend.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2.bin b/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2.bin index 930b10120a9..c01d49c6c54 100644 Binary files a/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2.bin and b/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/fs_xbr-lv3-noblend.bin b/bgfx/shaders/metal/chains/xbr/fs_xbr-lv3-noblend.bin index 7df071c1379..cd0fde65e4e 100644 Binary files a/bgfx/shaders/metal/chains/xbr/fs_xbr-lv3-noblend.bin and b/bgfx/shaders/metal/chains/xbr/fs_xbr-lv3-noblend.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/fs_xbr-lv3.bin b/bgfx/shaders/metal/chains/xbr/fs_xbr-lv3.bin index 3be8a6e265a..53a3c4a0d2e 100644 Binary files a/bgfx/shaders/metal/chains/xbr/fs_xbr-lv3.bin and b/bgfx/shaders/metal/chains/xbr/fs_xbr-lv3.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/vs_xbr-lv2-3d.bin b/bgfx/shaders/metal/chains/xbr/vs_xbr-lv2-3d.bin index c4bc3b40c4d..ac2d2c9b499 100644 Binary files a/bgfx/shaders/metal/chains/xbr/vs_xbr-lv2-3d.bin and b/bgfx/shaders/metal/chains/xbr/vs_xbr-lv2-3d.bin differ diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2-3d.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2-3d.sc index 1febb8f5ee3..d9e44f0d4c7 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2-3d.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2-3d.sc @@ -1,4 +1,4 @@ -$input v_texcoord0, v_texcoord1, v_color0 +$input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texcoord5, v_texcoord6, v_texcoord7, v_color0 // license:MIT // copyright-holders:Hyllian @@ -51,19 +51,6 @@ SAMPLER2D(decal, 0); #define SMOOTH_TIPS #endif -const vec4 Ao = vec4( 1.0, -1.0, -1.0, 1.0 ); -const vec4 Bo = vec4( 1.0, 1.0, -1.0,-1.0 ); -const vec4 Co = vec4( 1.5, 0.5, -0.5, 0.5 ); -const vec4 Ax = vec4( 1.0, -1.0, -1.0, 1.0 ); -const vec4 Bx = vec4( 0.5, 2.0, -0.5,-2.0 ); -const vec4 Cx = vec4( 1.0, 1.0, -0.5, 0.0 ); -const vec4 Ay = vec4( 1.0, -1.0, -1.0, 1.0 ); -const vec4 By = vec4( 2.0, 0.5, -2.0,-0.5 ); -const vec4 Cy = vec4( 2.0, 0.0, -1.0, 0.5 ); -const vec4 Ci = vec4(0.25, 0.25, 0.25, 0.25); - -const vec4 Y = vec4(0.2126, 0.7152, 0.0722, 0.0); - vec4 df(vec4 A, vec4 B) { return abs(A - B); @@ -71,43 +58,17 @@ vec4 df(vec4 A, vec4 B) float c_df(vec3 c1, vec3 c2) { - vec3 df = abs(c1 - c2); - return df.r + df.g + df.b; -} - -vec4 ge(vec4 A, vec4 B) -{ - return vec4(greaterThanEqual(A, B)); -} - -vec4 le(vec4 A, vec4 B) -{ - return vec4(lessThanEqual(A, B)); -} - -vec4 lt(vec4 A, vec4 B) -{ - return vec4(lessThan(A, B)); + return dot(abs(c1 - c2), vec3(1.0, 1.0, 1.0)); } vec4 eq(vec4 A, vec4 B) { - return vec4(equal(A, B)); -} - -vec4 ne(vec4 A, vec4 B) -{ - return vec4(notEqual(A, B)); + return vec4(lessThan(df(A, B), XBR_EQ_THRESHOLD.xxxx)); } -vec4 abslt(vec4 A, vec4 B) +vec4 neq(vec4 A, vec4 B) { - return lt(df(A, B), XBR_EQ_THRESHOLD.xxxx); -} - -vec4 absge(vec4 A, vec4 B) -{ - return ge(df(A, B), XBR_EQ_THRESHOLD.xxxx); + return vec4(greaterThanEqual(df(A, B), XBR_EQ_THRESHOLD.xxxx)); } vec4 weighted_distance(vec4 a, vec4 b, vec4 c, vec4 d, vec4 e, vec4 f, vec4 g, vec4 h) @@ -117,39 +78,46 @@ vec4 weighted_distance(vec4 a, vec4 b, vec4 c, vec4 d, vec4 e, vec4 f, vec4 g, v void main() { + vec4 Y = vec4(0.2126, 0.7152, 0.0722, 0.0); + vec4 delta = 1.0 / XBR_SCALE.xxxx; vec4 deltaL = vec4(0.5, 1.0, 0.5, 1.0) / XBR_SCALE.xxxx; vec4 deltaU = deltaL.yxwz; vec2 fp = fract(v_texcoord0 * u_tex_size0.xy / XBR_RES.xx); - vec2 tex = (floor(v_texcoord0 * u_tex_size0.xy / XBR_RES.xx) + vec2(0.5, 0.5)) * XBR_RES.xx / u_tex_size0.xy; + vec4 A1 = texture2D(decal, v_texcoord1.xw); + vec4 B1 = texture2D(decal, v_texcoord1.yw); + vec4 C1 = texture2D(decal, v_texcoord1.zw); + + vec4 A = texture2D(decal, v_texcoord2.xw); + vec4 B = texture2D(decal, v_texcoord2.yw); + vec4 C = texture2D(decal, v_texcoord2.zw); + + vec4 D = texture2D(decal, v_texcoord3.xw); + vec4 E = texture2D(decal, v_texcoord3.yw); + vec4 F = texture2D(decal, v_texcoord3.zw); - vec2 dx = v_texcoord1.xy; - vec2 dy = v_texcoord1.zw; - - vec4 A = texture2D(decal, v_texcoord0 -dx -dy); - vec4 B = texture2D(decal, v_texcoord0 -dy); - vec4 C = texture2D(decal, v_texcoord0 +dx -dy); - vec4 D = texture2D(decal, v_texcoord0 -dx ); - vec4 E = texture2D(decal, v_texcoord0 ); - vec4 F = texture2D(decal, v_texcoord0 +dx ); - vec4 G = texture2D(decal, v_texcoord0 -dx +dy); - vec4 H = texture2D(decal, v_texcoord0 +dy); - vec4 I = texture2D(decal, v_texcoord0 +dx +dy); - - vec4 A1 = texture2D(decal, v_texcoord0 -dx -2.0*dy); - vec4 B1 = texture2D(decal, v_texcoord0 -2.0*dy); - vec4 C1 = texture2D(decal, v_texcoord0 +dx -2.0*dy); - vec4 G5 = texture2D(decal, v_texcoord0 -dx +2.0*dy); - vec4 H5 = texture2D(decal, v_texcoord0 +2.0*dy); - vec4 I5 = texture2D(decal, v_texcoord0 +dx +2.0*dy); - vec4 A0 = texture2D(decal, v_texcoord0 -2.0*dx -dy); - vec4 D0 = texture2D(decal, v_texcoord0 -2.0*dx ); - vec4 G0 = texture2D(decal, v_texcoord0 -2.0*dx +dy); - vec4 C4 = texture2D(decal, v_texcoord0 +2.0*dx -dy); - vec4 F4 = texture2D(decal, v_texcoord0 +2.0*dx ); - vec4 I4 = texture2D(decal, v_texcoord0 +2.0*dx +dy); + vec4 G = texture2D(decal, v_texcoord4.xw); + vec4 H = texture2D(decal, v_texcoord4.yw); + vec4 I = texture2D(decal, v_texcoord4.zw); + + vec4 G5 = texture2D(decal, v_texcoord5.xw); + vec4 H5 = texture2D(decal, v_texcoord5.yw); + vec4 I5 = texture2D(decal, v_texcoord5.zw); + + vec4 A0 = texture2D(decal, v_texcoord6.xy); + vec4 D0 = texture2D(decal, v_texcoord6.xz); + vec4 G0 = texture2D(decal, v_texcoord6.xw); + + vec4 C4 = texture2D(decal, v_texcoord7.xy); + vec4 F4 = texture2D(decal, v_texcoord7.xz); + vec4 I4 = texture2D(decal, v_texcoord7.xw); + + vec2 dx = vec2(XBR_RES.x / u_tex_size0.x, 0.0); + vec2 dy = vec2(0.0, XBR_RES.x / u_tex_size0.y); + + vec2 tex = (floor(v_texcoord0 * u_tex_size0.xy / XBR_RES.xx) + vec2(0.5, 0.5)) * XBR_RES.xx / u_tex_size0.xy; vec4 F6 = texture2D(decal, tex +dx+0.25*dx+0.25*dy); vec4 F7 = texture2D(decal, tex +dx+0.25*dx-0.25*dy); @@ -171,53 +139,66 @@ void main() vec4 H8 = texture2D(decal, tex -0.25*dx-0.25*dy+dy); vec4 H9 = texture2D(decal, tex -0.25*dx+0.25*dy+dy); - vec4 b = mul(mat4(B, D, H, F), XBR_Y_WEIGHT.xxxx * Y); - vec4 c = mul(mat4(C, A, G, I), XBR_Y_WEIGHT.xxxx * Y); - vec4 e = mul(mat4(E, E, E, E), XBR_Y_WEIGHT.xxxx * Y); + vec4 weightVec = XBR_Y_WEIGHT.xxxx * Y; + vec4 b = instMul(weightVec, mat4(B, D, H, F)); + vec4 c = instMul(weightVec, mat4(C, A, G, I)); + vec4 e = instMul(weightVec, mat4(E, E, E, E)); vec4 d = b.yzwx; vec4 f = b.wxyz; vec4 g = c.zwxy; vec4 h = b.zwxy; vec4 i = c.wxyz; - vec4 i4 = mul(mat4(I4, C1, A0, G5), XBR_Y_WEIGHT.xxxx * Y); - vec4 i5 = mul(mat4(I5, C4, A1, G0), XBR_Y_WEIGHT.xxxx * Y); - vec4 h5 = mul(mat4(H5, F4, B1, D0), XBR_Y_WEIGHT.xxxx * Y); + vec4 i4 = instMul(weightVec, mat4(I4, C1, A0, G5)); + vec4 i5 = instMul(weightVec, mat4(I5, C4, A1, G0)); + vec4 h5 = instMul(weightVec, mat4(H5, F4, B1, D0)); vec4 f4 = h5.yzwx; - vec4 f0 = mul(mat4(F6, B6, D6, H6), XBR_Y_WEIGHT.xxxx * Y); - vec4 f1 = mul(mat4(F7, B7, D7, H7), XBR_Y_WEIGHT.xxxx * Y); - vec4 f2 = mul(mat4(F8, B8, D8, H8), XBR_Y_WEIGHT.xxxx * Y); - vec4 f3 = mul(mat4(F9, B9, D9, H9), XBR_Y_WEIGHT.xxxx * Y); + vec4 f0 = instMul(weightVec, mat4(F6, B6, D6, H6)); + vec4 f1 = instMul(weightVec, mat4(F7, B7, D7, H7)); + vec4 f2 = instMul(weightVec, mat4(F8, B8, D8, H8)); + vec4 f3 = instMul(weightVec, mat4(F9, B9, D9, H9)); vec4 h0 = f0.wxyz; vec4 h1 = f1.wxyz; vec4 h2 = f2.wxyz; vec4 h3 = f3.wxyz; + vec4 Ao = vec4( 1.0, -1.0, -1.0, 1.0 ); + vec4 Bo = vec4( 1.0, 1.0, -1.0,-1.0 ); + vec4 Co = vec4( 1.5, 0.5, -0.5, 0.5 ); + vec4 Ax = vec4( 1.0, -1.0, -1.0, 1.0 ); + vec4 Bx = vec4( 0.5, 2.0, -0.5,-2.0 ); + vec4 Cx = vec4( 1.0, 1.0, -0.5, 0.0 ); + vec4 Ay = vec4( 1.0, -1.0, -1.0, 1.0 ); + vec4 By = vec4( 2.0, 0.5, -2.0,-0.5 ); + vec4 Cy = vec4( 2.0, 0.0, -1.0, 0.5 ); + vec4 Ci = vec4(0.25, 0.25, 0.25, 0.25); + // These inequations define the line below which interpolation occurs. vec4 fx = (Ao*fp.y+Bo*fp.x); vec4 fx_left = (Ax*fp.y+Bx*fp.x); vec4 fx_up = (Ay*fp.y+By*fp.x); - vec4 block_3d = (eq(f0,f1) * eq(f1,f2) * eq(f2,f3) * eq(h0,h1) * eq(h1,h2) * eq(h2,h3)); - vec4 interp_restriction_lv0 = (ne(e,f) * ne(e,h) * block_3d); + vec4 block_3d = vec4(equal(f0,f1)) * vec4(equal(f1,f2)) * vec4(equal(f2,f3)) * vec4(equal(h0,h1)) * vec4(equal(h1,h2)) * vec4(equal(h2,h3)); + vec4 interp_restriction_lv0 = vec4(notEqual(e,f)) * vec4(notEqual(e,h)) * block_3d; vec4 interp_restriction_lv1 = interp_restriction_lv0; #ifdef CORNER_B - interp_restriction_lv1 = (interp_restriction_lv0 * (ge(f,b) * ge(h,d) + eq(e,i) * ge(f,i4) * ge(h,i5) + eq(e,g) + eq(e,c))); + interp_restriction_lv1 = (interp_restriction_lv0 * ( neq(f,b) * neq(h,d) + eq(e,i) * neq(f,i4) * neq(h,i5) + eq(e,g) + eq(e,c) ) ); #endif #ifdef CORNER_D vec4 c1 = i4.yzwx; vec4 g0 = i5.wxyz; - interp_restriction_lv1 = (interp_restriction_lv0 * (ge(f,b) * ge(h,d) + eq(e,i) * ge(f,i4) * ge(h,i5) + eq(e,g) + eq(e,c) ) * (ne(f,f4) * ne(f,i) + ne(h,h5) * ne(h,i) + ne(h,g) + ne(f,c) + eq(b,c1) * eq(d,g0))); + interp_restriction_lv1 = (interp_restriction_lv0 * ( neq(f,b) * neq(h,d) + eq(e,i) * neq(f,i4) * neq(h,i5) + eq(e,g) + eq(e,c) ) * (vec4(notEqual(f,f4)) * vec4(notEqual(f,i)) + vec4(notEqual(h,h5)) * vec4(notEqual(h,i)) + vec4(notEqual(h,g)) + vec4(notEqual(f,c)) + eq(b,c1) * eq(d,g0))); #endif #ifdef CORNER_C - interp_restriction_lv1 = (interp_restriction_lv0 * (ge(f,b) * ge(f,c) + ge(h,d) * ge(h,g) + eq(e,i) * (ge(f,f4) * ge(f,i4) + ge(h,h5) * ge(h,i5)) + eq(e,g) + eq(e,c))); + interp_restriction_lv1 = (interp_restriction_lv0 * ( neq(f,b) * neq(f,c) + neq(h,d) * neq(h,g) + eq(e,i) * (neq(f,f4) * neq(f,i4) + neq(h,h5) * neq(h,i5)) + eq(e,g) + eq(e,c)) ); #endif + //interp_restriction_lv1 = clamp(interp_restriction_lv1, 0.0, 1.0); - vec4 interp_restriction_lv2_left = (ne(e,g) * ne(d,g)); - vec4 interp_restriction_lv2_up = (ne(e,c) * ne(b,c)); + vec4 interp_restriction_lv2_left = vec4(notEqual(e,g)) * vec4(notEqual(d,g)); + vec4 interp_restriction_lv2_up = vec4(notEqual(e,c)) * vec4(notEqual(b,c)); vec4 fx45i = saturate((fx + delta -Co - Ci) / (2.0 * delta )); vec4 fx45 = saturate((fx + delta -Co ) / (2.0 * delta )); @@ -227,17 +208,19 @@ void main() vec4 wd1 = weighted_distance( e, c, g, i, h5, f4, h, f); vec4 wd2 = weighted_distance( h, d, i5, f, i4, b, e, i); - vec4 edri = le(wd1,wd2) * interp_restriction_lv0; - vec4 edr = lt(wd1,wd2) * interp_restriction_lv1; - vec4 edr_left = le(XBR_LV2_COEFFICIENT.xxxx * df(f,g), df(h,c)) * interp_restriction_lv2_left * edr; - vec4 edr_up = ge(df(f,g), XBR_LV2_COEFFICIENT.xxxx * df(h,c)) * interp_restriction_lv2_up * edr; + vec4 edri = vec4(lessThanEqual(wd1,wd2)) * interp_restriction_lv0; + vec4 edr = vec4(lessThan(wd1,wd2)) * interp_restriction_lv1; + vec4 hcDiff = df(h,c); + vec4 fgDiff = df(f,g); + vec4 edr_left = vec4(lessThanEqual(XBR_LV2_COEFFICIENT.xxxx * fgDiff, hcDiff)) * interp_restriction_lv2_left * edr; + vec4 edr_up = vec4(greaterThanEqual(fgDiff, XBR_LV2_COEFFICIENT.xxxx * hcDiff)) * interp_restriction_lv2_up * edr; - fx45 = edr * fx45; - fx30 = edr_left * fx30; - fx60 = edr_up * fx60; - fx45i = edri * fx45i; + fx45 = clamp(edr, 0.0, 1.0) * fx45; + fx30 = clamp(edr_left, 0.0, 1.0) * fx30; + fx60 = clamp(edr_up, 0.0, 1.0) * fx60; + fx45i = clamp(edri, 0.0, 1.0) * fx45i; - vec4 px = le(df(e,f3), df(e,h1)); + vec4 px = vec4(lessThanEqual(df(e,f3), df(e,h1))); #ifdef SMOOTH_TIPS vec4 maximos = max(max(fx30, fx60), max(fx45, fx45i)); diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2-fast.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2-fast.sc index 0525a1bd297..1b47172209e 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2-fast.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2-fast.sc @@ -50,19 +50,6 @@ SAMPLER2D(decal, 0); #define SMOOTH_TIPS #endif -const vec4 Ao = vec4( 1.0, -1.0, -1.0, 1.0 ); -const vec4 Bo = vec4( 1.0, 1.0, -1.0,-1.0 ); -const vec4 Co = vec4( 1.5, 0.5, -0.5, 0.5 ); -const vec4 Ax = vec4( 1.0, -1.0, -1.0, 1.0 ); -const vec4 Bx = vec4( 0.5, 2.0, -0.5,-2.0 ); -const vec4 Cx = vec4( 1.0, 1.0, -0.5, 0.0 ); -const vec4 Ay = vec4( 1.0, -1.0, -1.0, 1.0 ); -const vec4 By = vec4( 2.0, 0.5, -2.0,-0.5 ); -const vec4 Cy = vec4( 2.0, 0.0, -1.0, 0.5 ); -const vec4 Ci = vec4(0.25, 0.25, 0.25, 0.25); - -const vec4 Y = vec4(0.2126, 0.7152, 0.0722, 0.0); - vec4 df(vec4 A, vec4 B) { return abs(A - B); @@ -70,43 +57,17 @@ vec4 df(vec4 A, vec4 B) float c_df(vec3 c1, vec3 c2) { - vec3 df = abs(c1 - c2); - return df.r + df.g + df.b; -} - -vec4 ge(vec4 A, vec4 B) -{ - return vec4(greaterThanEqual(A, B)); -} - -vec4 le(vec4 A, vec4 B) -{ - return vec4(lessThanEqual(A, B)); -} - -vec4 lt(vec4 A, vec4 B) -{ - return vec4(lessThan(A, B)); + return dot(abs(c1 - c2), vec3(1.0, 1.0, 1.0)); } vec4 eq(vec4 A, vec4 B) { - return vec4(equal(A, B)); + return vec4(lessThan(df(A, B), XBR_EQ_THRESHOLD.xxxx)); } -vec4 ne(vec4 A, vec4 B) +vec4 neq(vec4 A, vec4 B) { - return vec4(notEqual(A, B)); -} - -vec4 abslt(vec4 A, vec4 B) -{ - return lt(df(A, B), XBR_EQ_THRESHOLD.xxxx); -} - -vec4 absge(vec4 A, vec4 B) -{ - return ge(df(A, B), XBR_EQ_THRESHOLD.xxxx); + return vec4(greaterThanEqual(df(A, B), XBR_EQ_THRESHOLD.xxxx)); } vec4 weighted_distance(vec4 a, vec4 b, vec4 c, vec4 d, vec4 e, vec4 f, vec4 g, vec4 h) @@ -117,6 +78,8 @@ vec4 weighted_distance(vec4 a, vec4 b, vec4 c, vec4 d, vec4 e, vec4 f, vec4 g, v void main() { + vec4 Y = vec4(0.2126, 0.7152, 0.0722, 0.0); + vec4 delta = 1.0 / XBR_SCALE.xxxx; vec4 deltaL = vec4(0.5, 1.0, 0.5, 1.0) / XBR_SCALE.xxxx; vec4 deltaU = deltaL.yxwz; @@ -135,9 +98,10 @@ void main() vec4 H = texture2D(decal, v_texcoord3.yw); vec4 I = texture2D(decal, v_texcoord3.zw); - vec4 b = mul(mat4(B, D, H, F), XBR_Y_WEIGHT.xxxx * Y); - vec4 c = mul(mat4(C, A, G, I), XBR_Y_WEIGHT.xxxx * Y); - vec4 e = mul(mat4(E, E, E, E), XBR_Y_WEIGHT.xxxx * Y); + vec4 weightVec = XBR_Y_WEIGHT.xxxx * Y; + vec4 b = instMul(weightVec, mat4(B, D, H, F)); + vec4 c = instMul(weightVec, mat4(C, A, G, I)); + vec4 e = instMul(weightVec, mat4(E, E, E, E)); vec4 a = c.yzwx; vec4 d = b.yzwx; vec4 f = b.wxyz; @@ -145,20 +109,31 @@ void main() vec4 h = b.zwxy; vec4 i = c.wxyz; + vec4 Ao = vec4( 1.0, -1.0, -1.0, 1.0 ); + vec4 Bo = vec4( 1.0, 1.0, -1.0,-1.0 ); + vec4 Co = vec4( 1.5, 0.5, -0.5, 0.5 ); + vec4 Ax = vec4( 1.0, -1.0, -1.0, 1.0 ); + vec4 Bx = vec4( 0.5, 2.0, -0.5,-2.0 ); + vec4 Cx = vec4( 1.0, 1.0, -0.5, 0.0 ); + vec4 Ay = vec4( 1.0, -1.0, -1.0, 1.0 ); + vec4 By = vec4( 2.0, 0.5, -2.0,-0.5 ); + vec4 Cy = vec4( 2.0, 0.0, -1.0, 0.5 ); + vec4 Ci = vec4(0.25, 0.25, 0.25, 0.25); + // These inequations define the line below which interpolation occurs. vec4 fx = (Ao*fp.y+Bo*fp.x); vec4 fx_left = (Ax*fp.y+Bx*fp.x); vec4 fx_up = (Ay*fp.y+By*fp.x); - vec4 interp_restriction_lv0 = (ne(e,f) * ne(e,h)); - vec4 interp_restriction_lv1 = interp_restriction_lv0; + vec4 interp_restriction_lv0 = vec4(notEqual(e,f)) * vec4(notEqual(e,h)); + vec4 interp_restriction_lv1 = interp_restriction_lv0; #ifndef CORNER_A - interp_restriction_lv1 = clamp(interp_restriction_lv0 * (ge(f,b) * ge(f,c) + ge(h,d) * ge(h,g) + lt(e,g) + lt(e,c)), 0.0, 1.0); + interp_restriction_lv1 = clamp(interp_restriction_lv0 * (neq(f,b) * neq(f,c) + neq(h,d) * neq(h,g) + eq(e,g) + eq(e,c)), 0.0, 1.0); #endif - vec4 interp_restriction_lv2_left = (ne(e,g) * ne(d,g)); - vec4 interp_restriction_lv2_up = (ne(e,c) * ne(b,c)); + vec4 interp_restriction_lv2_left = vec4(notEqual(e,g)) * vec4(notEqual(d,g)); + vec4 interp_restriction_lv2_up = vec4(notEqual(e,c)) * vec4(notEqual(b,c)); vec4 fx45i = saturate((fx + delta -Co - Ci) / (2.0 * delta )); vec4 fx45 = saturate((fx + delta -Co ) / (2.0 * delta )); @@ -168,17 +143,19 @@ void main() vec4 wd1 = weighted_distance( d, b, g, e, e, c, h, f); vec4 wd2 = weighted_distance( a, e, b, f, d, h, e, i); - vec4 edri = le(wd1, wd2) * interp_restriction_lv0; - vec4 edr = lt(wd1, wd2) * interp_restriction_lv1; - vec4 edr_left = le(XBR_LV2_COEFFICIENT.xxxx * df(f,g), df(h,c)) * interp_restriction_lv2_left * edr; - vec4 edr_up = ge(df(f,g), XBR_LV2_COEFFICIENT.xxxx * df(h,c)) * interp_restriction_lv2_up * edr; + vec4 edri = vec4(lessThanEqual(wd1, wd2)) * interp_restriction_lv0; + vec4 edr = vec4(lessThan(wd1, wd2)) * interp_restriction_lv1; + vec4 hcDiff = df(h,c); + vec4 fgDiff = df(f,g); + vec4 edr_left = vec4(lessThanEqual(XBR_LV2_COEFFICIENT.xxxx * fgDiff, hcDiff)) * interp_restriction_lv2_left * edr; + vec4 edr_up = vec4(greaterThanEqual(fgDiff, XBR_LV2_COEFFICIENT.xxxx * hcDiff)) * interp_restriction_lv2_up * edr; fx45 = edr * fx45; fx30 = edr_left * fx30; fx60 = edr_up * fx60; fx45i = edri * fx45i; - vec4 px = le(df(e,f), df(e,h)); + vec4 px = vec4(lessThanEqual(df(e,f), df(e,h))); #ifdef SMOOTH_TIPS vec4 maximos = max(max(fx30, fx60), max(fx45, fx45i)); diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2-noblend.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2-noblend.sc index ee5ebb4398e..80d7269349e 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2-noblend.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2-noblend.sc @@ -44,8 +44,6 @@ SAMPLER2D(decal, 0); //#define CORNER_C //#define CORNER_D -const vec4 Y = vec4(0.2126, 0.7152, 0.0722, 0.0); - vec4 df(vec4 A, vec4 B) { return abs(A - B); @@ -53,48 +51,17 @@ vec4 df(vec4 A, vec4 B) float c_df(vec3 c1, vec3 c2) { - vec3 df = abs(c1 - c2); - return df.r + df.g + df.b; -} - -vec4 ge(vec4 A, vec4 B) -{ - return vec4(greaterThanEqual(A, B)); -} - -vec4 le(vec4 A, vec4 B) -{ - return vec4(lessThanEqual(A, B)); -} - -vec4 lt(vec4 A, vec4 B) -{ - return vec4(lessThan(A, B)); + return dot(abs(c1 - c2), vec3(1.0, 1.0, 1.0)); } vec4 eq(vec4 A, vec4 B) { - return vec4(equal(A, B)); + return vec4(lessThan(df(A, B), XBR_EQ_THRESHOLD.xxxx)); } -vec4 ne(vec4 A, vec4 B) +vec4 neq(vec4 A, vec4 B) { - return vec4(notEqual(A, B)); -} - -vec4 gt(vec4 A, vec4 B) -{ - return vec4(greaterThan(A, B)); -} - -vec4 abslt(vec4 A, vec4 B) -{ - return lt(df(A, B), XBR_EQ_THRESHOLD.xxxx); -} - -vec4 absge(vec4 A, vec4 B) -{ - return ge(df(A, B), XBR_EQ_THRESHOLD.xxxx); + return vec4(greaterThanEqual(df(A, B), XBR_EQ_THRESHOLD.xxxx)); } vec4 weighted_distance(vec4 a, vec4 b, vec4 c, vec4 d, vec4 e, vec4 f, vec4 g, vec4 h) @@ -104,6 +71,8 @@ vec4 weighted_distance(vec4 a, vec4 b, vec4 c, vec4 d, vec4 e, vec4 f, vec4 g, v void main() { + vec4 Y = vec4(0.2126, 0.7152, 0.0722, 0.0); + vec2 fp = fract(v_texcoord0 * u_tex_size0.xy); vec4 A1 = texture2D(decal, v_texcoord1.xw); @@ -134,18 +103,18 @@ void main() vec4 F4 = texture2D(decal, v_texcoord7.xz); vec4 I4 = texture2D(decal, v_texcoord7.xw); - vec4 b = mul(mat4(B, D, H, F), Y); - vec4 c = mul(mat4(C, A, G, I), Y); - vec4 e = mul(mat4(E, E, E, E), Y); + vec4 b = instMul(Y, mat4(B, D, H, F)); + vec4 c = instMul(Y, mat4(C, A, G, I)); + vec4 e = instMul(Y, mat4(E, E, E, E)); vec4 d = b.yzwx; vec4 f = b.wxyz; vec4 g = c.zwxy; vec4 h = b.zwxy; vec4 i = c.wxyz; - vec4 i4 = mul(mat4(I4, C1, A0, G5), Y); - vec4 i5 = mul(mat4(I5, C4, A1, G0), Y); - vec4 h5 = mul(mat4(H5, F4, B1, D0), Y); + vec4 i4 = instMul(Y, mat4(I4, C1, A0, G5)); + vec4 i5 = instMul(Y, mat4(I5, C4, A1, G0)); + vec4 h5 = instMul(Y, mat4(H5, F4, B1, D0)); vec4 f4 = h5.yzwx; vec4 Ao = vec4( 1.0, -1.0, -1.0, 1.0 ); @@ -159,49 +128,47 @@ void main() vec4 Cy = vec4( 2.0, 0.0, -1.0, 0.5 ); // These inequations define the line below which interpolation occurs. - vec4 fx = gt(Ao * fp.y + Bo * fp.x, Co); - vec4 fx_left = gt(Ax * fp.y + Bx * fp.x, Cx); - vec4 fx_up = gt(Ay * fp.y + By * fp.x, Cy); + vec4 fx = vec4(greaterThan(Ao * fp.y + Bo * fp.x, Co)); + vec4 fx_left = vec4(greaterThan(Ax * fp.y + Bx * fp.x, Cx)); + vec4 fx_up = vec4(greaterThan(Ay * fp.y + By * fp.x, Cy)); #ifdef CORNER_A - vec4 interp_restriction_lv1 = ne(e,f) * ne(e,h); + vec4 interp_restriction_lv1 = vec4(notEqual(e,f)) * vec4(notEqual(e,h)); #endif #ifdef CORNER_B - vec4 interp_restriction_lv1 = (ne(e,f) * ne(e,h) * (ge(f,b) * ge(h,d) + lt(e,i) * ge(f,i4) * ge(h,i5) + lt(e,g) + lt(e,c))); + vec4 interp_restriction_lv1 = (vec4(notEqual(e,f)) * vec4(notEqual(e,h)) * (neq(f,b) * neq(h,d) + eq(e,i) * neq(f,i4) * neq(h,i5) + eq(e,g) + eq(e,c))); #endif #ifdef CORNER_D vec4 c1 = i4.yzwx; vec4 g0 = i5.wxyz; - vec4 interp_restriction_lv1 = (ne(e,f) * ne(e,h) * (ge(f,b) * ge(h,d) + lt(e,i) * ge(f,i4) * ge(h,i5) + lt(e,g) + lt(e,c) ) * (ne(f,f4) * ne(f,i) + ne(h,h5) * ne(h,i) + ne(h,g) + ne(f,c) + lt(b,c1) * lt(d,g0))); + vec4 interp_restriction_lv1 = (vec4(notEqual(e,f)) * vec4(notEqual(e,h)) * (neq(f,b) * neq(h,d) + eq(e,i) * neq(f,i4) * neq(h,i5) + eq(e,g) + eq(e,c) ) * (vec4(notEqual(f,f4)) * vec4(notEqual(f,i)) + vec4(notEqual(h,h5)) * vec4(notEqual(h,i)) + vec4(notEqual(h,g)) + vec4(notEqual(f,c)) + eq(b,c1) * eq(d,g0))); #endif #ifdef CORNER_C - vec4 interp_restriction_lv1 = (ne(e,f) * ne(e,h) * (ge(f,b) * ge(f,c) + ge(h,d) * ge(h,g) + lt(e,i) * (ge(f,f4) * ge(f,i4) + ge(h,h5) * ge(h,i5)) + lt(e,g) + lt(e,c))); + vec4 interp_restriction_lv1 = (vec4(notEqual(e,f)) * vec4(notEqual(e,h)) * (neq(f,b) * neq(f,c) + neq(h,d) * neq(h,g) + eq(e,i) * (neq(f,f4) * neq(f,i4) + neq(h,h5) * neq(h,i5)) + eq(e,g) + eq(e,c))); #endif interp_restriction_lv1 = clamp(interp_restriction_lv1, 0.0, 1.0); - vec4 interp_restriction_lv2_left = (ne(e,g) * ne(d,g)); - vec4 interp_restriction_lv2_up = (ne(e,c) * ne(b,c)); + vec4 interp_restriction_lv2_left = vec4(notEqual(e,g)) * vec4(notEqual(d,g)); + vec4 interp_restriction_lv2_up = vec4(notEqual(e,c)) * vec4(notEqual(b,c)); vec4 wd1 = weighted_distance(e, c, g, i, h5, f4, h, f); vec4 wd2 = weighted_distance(h, d, i5, f, i4, b, e, i); - vec4 one = vec4(1.0, 1.0, 1.0, 1.0); - vec4 zero = vec4(0.0, 0.0, 0.0, 0.0); - vec4 edri = le(wd1,wd2) * interp_restriction_lv1; - vec4 edr = lt(wd1,wd2) * interp_restriction_lv1 * ((one - edri.yzwx) + (one - edri.wxyz)); - vec4 edr_left = le(XBR_LV2_COEFFICIENT.xxxx * df(f,g), df(h,c)) * interp_restriction_lv2_left * edr * ((one - edri.yzwx) * lt(e,c)); - vec4 edr_up = ge(df(f,g), XBR_LV2_COEFFICIENT.xxxx * df(h,c)) * interp_restriction_lv2_up * edr * ((one - edri.wxyz) * lt(e,g)); + vec4 edri = vec4(lessThanEqual(wd1,wd2)) * interp_restriction_lv1; + vec4 edr = vec4(lessThan(wd1,wd2)) * interp_restriction_lv1 * clamp((1.0 - edri.yzwx) + (1.0 - edri.wxyz), 0.0, 1.0); + vec4 edr_left = vec4(lessThanEqual(XBR_LV2_COEFFICIENT.xxxx * df(f,g), df(h,c))) * interp_restriction_lv2_left * edr * (1.0 - edri.yzwx) * eq(e,c); + vec4 edr_up = vec4(greaterThanEqual(df(f,g), XBR_LV2_COEFFICIENT.xxxx * df(h,c))) * interp_restriction_lv2_up * edr * (1.0 - edri.wxyz) * eq(e,g); vec4 nc = clamp(edr * (fx + edr_left * fx_left + edr_up * fx_up), 0.0, 1.0); - vec4 px = le(df(e,f), df(e,h)); + bvec4 px = lessThanEqual(df(e,f), df(e,h)); - vec3 res1 = nc.x > 0.0 ? px.x > 0.0 ? F.xyz : H.xyz : nc.y > 0.0 ? px.y > 0.0 ? B.xyz : F.xyz : nc.z > 0.0 ? px.z > 0.0 ? D.xyz : B.xyz : E.xyz; - vec3 res2 = nc.w > 0.0 ? px.w > 0.0 ? H.xyz : D.xyz : nc.z > 0.0 ? px.z > 0.0 ? D.xyz : B.xyz : nc.y > 0.0 ? px.y > 0.0 ? B.xyz : F.xyz : E.xyz; + vec3 res1 = nc.x > 0.0 ? px.x ? F.xyz : H.xyz : nc.y > 0.0 ? px.y ? B.xyz : F.xyz : nc.z > 0.0 ? px.z ? D.xyz : B.xyz : E.xyz; + vec3 res2 = nc.w > 0.0 ? px.w ? H.xyz : D.xyz : nc.z > 0.0 ? px.z ? D.xyz : B.xyz : nc.y > 0.0 ? px.y ? B.xyz : F.xyz : E.xyz; - vec2 df12 = abs(mul(mat3(res1, res2, vec3(0.0, 0.0, 0.0)), Y.xyz).xy - e.xy); + vec2 df12 = abs(instMul(Y.xyz, mat3(res1, res2, vec3(0.0, 0.0, 0.0))).xy - e.xy); vec3 res_mix = (df12.y >= df12.x) ? vec3(1.0, 1.0, 1.0) : vec3(0.0, 0.0, 0.0); vec3 res = mix(res1, res2, res_mix); diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2.sc index 421cf1efb9d..0294c56b84f 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv2.sc @@ -41,24 +41,11 @@ uniform vec4 u_tex_size0; SAMPLER2D(decal, 0); // Uncomment just one of the three params below to choose the corner detection -#define CORNER_A +//#define CORNER_A //#define CORNER_B -//#define CORNER_C +#define CORNER_C //#define CORNER_D -const vec4 Ao = vec4( 1.0, -1.0, -1.0, 1.0 ); -const vec4 Bo = vec4( 1.0, 1.0, -1.0,-1.0 ); -const vec4 Co = vec4( 1.5, 0.5, -0.5, 0.5 ); -const vec4 Ax = vec4( 1.0, -1.0, -1.0, 1.0 ); -const vec4 Bx = vec4( 0.5, 2.0, -0.5,-2.0 ); -const vec4 Cx = vec4( 1.0, 1.0, -0.5, 0.0 ); -const vec4 Ay = vec4( 1.0, -1.0, -1.0, 1.0 ); -const vec4 By = vec4( 2.0, 0.5, -2.0,-0.5 ); -const vec4 Cy = vec4( 2.0, 0.0, -1.0, 0.5 ); -const vec4 Ci = vec4(0.25, 0.25, 0.25, 0.25); - -const vec4 Y = vec4(0.2126, 0.7152, 0.0722, 0.0); - vec4 df(vec4 A, vec4 B) { return abs(A - B); @@ -66,43 +53,17 @@ vec4 df(vec4 A, vec4 B) float c_df(vec3 c1, vec3 c2) { - vec3 df = abs(c1 - c2); - return df.r + df.g + df.b; -} - -vec4 ge(vec4 A, vec4 B) -{ - return vec4(greaterThanEqual(A, B)); -} - -vec4 le(vec4 A, vec4 B) -{ - return vec4(lessThanEqual(A, B)); -} - -vec4 lt(vec4 A, vec4 B) -{ - return vec4(lessThan(A, B)); + return dot(abs(c1 - c2), vec3(1.0, 1.0, 1.0)); } vec4 eq(vec4 A, vec4 B) { - return vec4(equal(A, B)); -} - -vec4 ne(vec4 A, vec4 B) -{ - return vec4(notEqual(A, B)); -} - -vec4 abslt(vec4 A, vec4 B) -{ - return lt(df(A, B), XBR_EQ_THRESHOLD.xxxx); + return vec4(lessThan(df(A, B), XBR_EQ_THRESHOLD.xxxx)); } -vec4 absge(vec4 A, vec4 B) +vec4 neq(vec4 A, vec4 B) { - return ge(df(A, B), XBR_EQ_THRESHOLD.xxxx); + return vec4(greaterThanEqual(df(A, B), XBR_EQ_THRESHOLD.xxxx)); } vec4 weighted_distance(vec4 a, vec4 b, vec4 c, vec4 d, vec4 e, vec4 f, vec4 g, vec4 h) @@ -112,6 +73,8 @@ vec4 weighted_distance(vec4 a, vec4 b, vec4 c, vec4 d, vec4 e, vec4 f, vec4 g, v void main() { + vec4 Y = vec4(0.2126, 0.7152, 0.0722, 0.0); + vec4 delta = 1.0 / XBR_SCALE.xxxx; vec4 deltaL = vec4(0.5, 1.0, 0.5, 1.0) / XBR_SCALE.xxxx; vec4 deltaU = deltaL.yxwz; @@ -146,42 +109,54 @@ void main() vec4 F4 = texture2D(decal, v_texcoord7.xz); vec4 I4 = texture2D(decal, v_texcoord7.xw); - vec4 b = mul(mat4(B, D, H, F), XBR_Y_WEIGHT.xxxx * Y); - vec4 c = mul(mat4(C, A, G, I), XBR_Y_WEIGHT.xxxx * Y); - vec4 e = mul(mat4(E, E, E, E), XBR_Y_WEIGHT.xxxx * Y); + vec4 weightVec = XBR_Y_WEIGHT.xxxx * Y; + vec4 b = instMul(weightVec, mat4(B, D, H, F)); + vec4 c = instMul(weightVec, mat4(C, A, G, I)); + vec4 e = instMul(weightVec, mat4(E, E, E, E)); vec4 d = b.yzwx; vec4 f = b.wxyz; vec4 g = c.zwxy; vec4 h = b.zwxy; vec4 i = c.wxyz; - vec4 i4 = mul(mat4(I4, C1, A0, G5), XBR_Y_WEIGHT.xxxx * Y); - vec4 i5 = mul(mat4(I5, C4, A1, G0), XBR_Y_WEIGHT.xxxx * Y); - vec4 h5 = mul(mat4(H5, F4, B1, D0), XBR_Y_WEIGHT.xxxx * Y); + vec4 i4 = instMul(weightVec, mat4(I4, C1, A0, G5)); + vec4 i5 = instMul(weightVec, mat4(I5, C4, A1, G0)); + vec4 h5 = instMul(weightVec, mat4(H5, F4, B1, D0)); vec4 f4 = h5.yzwx; + vec4 Ao = vec4( 1.0, -1.0, -1.0, 1.0 ); + vec4 Bo = vec4( 1.0, 1.0, -1.0,-1.0 ); + vec4 Co = vec4( 1.5, 0.5, -0.5, 0.5 ); + vec4 Ax = vec4( 1.0, -1.0, -1.0, 1.0 ); + vec4 Bx = vec4( 0.5, 2.0, -0.5,-2.0 ); + vec4 Cx = vec4( 1.0, 1.0, -0.5, 0.0 ); + vec4 Ay = vec4( 1.0, -1.0, -1.0, 1.0 ); + vec4 By = vec4( 2.0, 0.5, -2.0,-0.5 ); + vec4 Cy = vec4( 2.0, 0.0, -1.0, 0.5 ); + vec4 Ci = vec4(0.25, 0.25, 0.25, 0.25); + // These inequations define the line below which interpolation occurs. vec4 fx = (Ao*fp.y+Bo*fp.x); vec4 fx_left = (Ax*fp.y+Bx*fp.x); vec4 fx_up = (Ay*fp.y+By*fp.x); - vec4 interp_restriction_lv0 = (ne(e,f) * ne(e,h)); + vec4 interp_restriction_lv0 = vec4(notEqual(e,f)) * vec4(notEqual(e,h)); vec4 interp_restriction_lv1 = interp_restriction_lv0; #ifdef CORNER_B - interp_restriction_lv1 = (interp_restriction_lv0 * ( ge(f,b) * ge(h,d) + lt(e,i) * ge(f,i4) * ge(h,i5) + lt(e,g) + lt(e,c) ) ); + interp_restriction_lv1 = (interp_restriction_lv0 * ( neq(f,b) * neq(h,d) + eq(e,i) * neq(f,i4) * neq(h,i5) + eq(e,g) + eq(e,c) ) ); #endif #ifdef CORNER_D vec4 c1 = i4.yzwx; vec4 g0 = i5.wxyz; - interp_restriction_lv1 = (interp_restriction_lv0 * ( ge(f,b) * ge(h,d) + lt(e,i) * ge(f,i4) * ge(h,i5) + lt(e,g) + lt(e,c) ) * (ne(f,f4) * ne(f,i) + ne(h,h5) * ne(h,i) + ne(h,g) + ne(f,c) + lt(b,c1) * lt(d,g0))); + interp_restriction_lv1 = (interp_restriction_lv0 * ( neq(f,b) * neq(h,d) + eq(e,i) * neq(f,i4) * neq(h,i5) + eq(e,g) + eq(e,c) ) * (vec4(notEqual(f,f4)) * vec4(notEqual(f,i)) + vec4(notEqual(h,h5)) * vec4(notEqual(h,i)) + vec4(notEqual(h,g)) + vec4(notEqual(f,c)) + eq(b,c1) * eq(d,g0))); #endif #ifdef CORNER_C - interp_restriction_lv1 = (interp_restriction_lv0 * ( ge(f,b) * ge(f,c) + ge(h,d) * ge(h,g) + lt(e,i) * (ge(f,f4) * ge(f,i4) + ge(h,h5) * ge(h,i5)) + lt(e,g) + lt(e,c)) ); + interp_restriction_lv1 = (interp_restriction_lv0 * ( neq(f,b) * neq(f,c) + neq(h,d) * neq(h,g) + eq(e,i) * (neq(f,f4) * neq(f,i4) + neq(h,h5) * neq(h,i5)) + eq(e,g) + eq(e,c)) ); #endif - vec4 interp_restriction_lv2_left = (ne(e,g) * ne(d,g)); - vec4 interp_restriction_lv2_up = (ne(e,c) * ne(b,c)); + vec4 interp_restriction_lv2_left = vec4(notEqual(e,g)) * vec4(notEqual(d,g)); + vec4 interp_restriction_lv2_up = vec4(notEqual(e,c)) * vec4(notEqual(b,c)); vec4 fx45i = saturate((fx + delta -Co - Ci) / (2.0 * delta )); vec4 fx45 = saturate((fx + delta -Co ) / (2.0 * delta )); @@ -191,26 +166,25 @@ void main() vec4 wd1 = weighted_distance( e, c, g, i, h5, f4, h, f); vec4 wd2 = weighted_distance( h, d, i5, f, i4, b, e, i); - vec4 one = vec4(1.0, 1.0, 1.0, 1.0); - vec4 zero = vec4(0.0, 0.0, 0.0, 0.0); - vec4 edri = le(wd1,wd2) * interp_restriction_lv0; - vec4 edr = lt(wd1,wd2) * interp_restriction_lv1; + vec4 edri = vec4(lessThanEqual(wd1,wd2)) * interp_restriction_lv0; + vec4 edr = vec4(lessThan(wd1,wd2)) * interp_restriction_lv1; + vec4 hcDiff = df(h,c); + vec4 fgDiff = df(f,g); #ifdef CORNER_A - edr = clamp(edr * ((one - edri.yzwx) + (one - edri.wxyz)), 0.0, 1.0); - vec4 edr_left = le(XBR_LV2_COEFFICIENT.xxxx * df(f,g), df(h,c)) * interp_restriction_lv2_left * edr * (one - edri.yzwx) * eq(e,c); - vec4 edr_up = ge(df(f,g), XBR_LV2_COEFFICIENT.xxxx * df(h,c)) * interp_restriction_lv2_up * edr * (one - edri.wxyz) * eq(e,g); -#endif -#ifndef CORNER_A - vec4 edr_left = le(XBR_LV2_COEFFICIENT.xxxx * df(f,g), df(h,c)) * interp_restriction_lv2_left * edr; - vec4 edr_up = ge(df(f,g), XBR_LV2_COEFFICIENT.xxxx * df(h,c)) * interp_restriction_lv2_up * edr; + edr = edr * clamp(((1.0 - edri.yzwx) + (1.0 - edri.wxyz)), 0.0, 1.0); + vec4 edr_left = vec4(lessThanEqual(XBR_LV2_COEFFICIENT.xxxx * df(f,g), df(h,c))) * interp_restriction_lv2_left * edr * (1.0 - edri.yzwx) * eq(e,c); + vec4 edr_up = vec4(greaterThanEqual(df(f,g), XBR_LV2_COEFFICIENT.xxxx * df(h,c))) * interp_restriction_lv2_up * edr * (1.0 - edri.wxyz) * eq(e,g); +#else + vec4 edr_left = vec4(lessThanEqual(XBR_LV2_COEFFICIENT.xxxx * fgDiff, hcDiff)) * interp_restriction_lv2_left * edr; + vec4 edr_up = vec4(greaterThanEqual(fgDiff, XBR_LV2_COEFFICIENT.xxxx * hcDiff)) * interp_restriction_lv2_up * edr; #endif - fx45 = edr * fx45; - fx30 = edr_left * fx30; - fx60 = edr_up * fx60; - fx45i = edri * fx45i; + fx45 = clamp(edr, 0.0, 1.0) * fx45; + fx30 = clamp(edr_left, 0.0, 1.0) * fx30; + fx60 = clamp(edr_up, 0.0, 1.0) * fx60; + fx45i = clamp(edri, 0.0, 1.0) * fx45i; - vec4 px = le(df(e,f), df(e,h)); + vec4 px = vec4(lessThanEqual(df(e,f), df(e,h))); vec4 maximos = max(max(fx30, fx60), max(fx45, fx45i)); @@ -222,7 +196,7 @@ void main() res2 = mix(res2, mix(F.xyz, B.xyz, px.y), maximos.y); res2 = mix(res2, mix(D.xyz, H.xyz, px.w), maximos.w); - vec3 E_mix = (c_df(E.xyz, res2) >= c_df(E.xyz, res1)) ? one.xyz : zero.xyz; + vec3 E_mix = (c_df(E.xyz, res2) >= c_df(E.xyz, res1)) ? vec3(1.0, 1.0, 1.0) : vec3(0.0, 0.0, 0.0); vec3 res = mix(res1, res2, E_mix); gl_FragColor = vec4(res, 1.0); diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv3-noblend.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv3-noblend.sc index 05cf1124896..8d65128f8fc 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv3-noblend.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv3-noblend.sc @@ -39,13 +39,11 @@ uniform vec4 u_tex_size0; SAMPLER2D(decal, 0); -// Uncomment just one of the three params below to choose the corner detection -#define CORNER_A +// Uncomment just one of the four params below to choose the corner detection +//#define CORNER_A //#define CORNER_B //#define CORNER_C -//#define CORNER_D - -const vec4 Y = vec4(0.2126, 0.7152, 0.0722, 0.0); +#define CORNER_D vec4 df(vec4 A, vec4 B) { @@ -54,53 +52,27 @@ vec4 df(vec4 A, vec4 B) float c_df(vec3 c1, vec3 c2) { - vec3 df = abs(c1 - c2); - return df.r + df.g + df.b; -} - -vec4 ge(vec4 A, vec4 B) -{ - return vec4(greaterThanEqual(A, B)); -} - -vec4 le(vec4 A, vec4 B) -{ - return vec4(lessThanEqual(A, B)); -} - -vec4 lt(vec4 A, vec4 B) -{ - return vec4(lessThan(A, B)); + return dot(abs(c1 - c2), vec3(1.0, 1.0, 1.0)); } vec4 eq(vec4 A, vec4 B) { - return vec4(equal(A, B)); + return vec4(lessThan(df(A, B), XBR_EQ_THRESHOLD.xxxx)); } -vec4 ne(vec4 A, vec4 B) +vec4 eq2(vec4 A, vec4 B) { - return vec4(notEqual(A, B)); + return vec4(lessThan(df(A, B), XBR_EQ_THRESHOLD2.xxxx)); } -vec4 gt(vec4 A, vec4 B) +vec4 neq(vec4 A, vec4 B) { - return vec4(greaterThan(A, B)); + return vec4(greaterThanEqual(df(A, B), XBR_EQ_THRESHOLD.xxxx)); } -vec4 abslt2(vec4 A, vec4 B) +vec4 neq2(vec4 A, vec4 B) { - return lt(df(A, B), XBR_EQ_THRESHOLD2.xxxx); -} - -vec4 absge(vec4 A, vec4 B) -{ - return ge(df(A, B), XBR_EQ_THRESHOLD.xxxx); -} - -vec4 absge2(vec4 A, vec4 B) -{ - return ge(df(A, B), XBR_EQ_THRESHOLD2.xxxx); + return vec4(greaterThanEqual(df(A, B), XBR_EQ_THRESHOLD2.xxxx)); } vec4 weighted_distance(vec4 a, vec4 b, vec4 c, vec4 d, vec4 e, vec4 f, vec4 g, vec4 h) @@ -110,6 +82,8 @@ vec4 weighted_distance(vec4 a, vec4 b, vec4 c, vec4 d, vec4 e, vec4 f, vec4 g, v void main() { + vec4 Y = vec4(0.2126, 0.7152, 0.0722, 0.0); + vec2 fp = fract(v_texcoord0 * u_tex_size0.xy); vec4 A1 = texture2D(decal, v_texcoord1.xw); @@ -140,18 +114,18 @@ void main() vec4 F4 = texture2D(decal, v_texcoord7.xz); vec4 I4 = texture2D(decal, v_texcoord7.xw); - vec4 b = mul(mat4(B, D, H, F), Y); - vec4 c = mul(mat4(C, A, G, I), Y); - vec4 e = mul(mat4(E, E, E, E), Y); + vec4 b = instMul(Y, mat4(B, D, H, F)); + vec4 c = instMul(Y, mat4(C, A, G, I)); + vec4 e = instMul(Y, mat4(E, E, E, E)); vec4 d = b.yzwx; vec4 f = b.wxyz; vec4 g = c.zwxy; vec4 h = b.zwxy; vec4 i = c.wxyz; - vec4 i4 = mul(mat4(I4, C1, A0, G5), Y); - vec4 i5 = mul(mat4(I5, C4, A1, G0), Y); - vec4 h5 = mul(mat4(H5, F4, B1, D0), Y); + vec4 i4 = instMul(Y, mat4(I4, C1, A0, G5)); + vec4 i5 = instMul(Y, mat4(I5, C4, A1, G0)); + vec4 h5 = instMul(Y, mat4(H5, F4, B1, D0)); vec4 f4 = h5.yzwx; vec4 c4 = i5.yzwx; @@ -181,50 +155,55 @@ void main() vec4 Cw = vec4( 5.0, -1.0, -3.0, 3.0 ); // These inequations define the line below which interpolation occurs. - vec4 fx = gt(Ao * fp.y + Bo * fp.x, Co); - vec4 fx_left = gt(Ax * fp.y + Bx * fp.x, Cx); - vec4 fx_up = gt(Ay * fp.y + By * fp.x, Cy); - vec4 fx3_left= gt(Az * fp.y + Bz * fp.x, Cz); - vec4 fx3_up = gt(Aw * fp.y + Bw * fp.x, Cw); + vec4 fx = vec4(greaterThan(Ao * fp.y + Bo * fp.x, Co)); + vec4 fx_left = vec4(greaterThan(Ax * fp.y + Bx * fp.x, Cx)); + vec4 fx_up = vec4(greaterThan(Ay * fp.y + By * fp.x, Cy)); + vec4 fx3_left= vec4(greaterThan(Az * fp.y + Bz * fp.x, Cz)); + vec4 fx3_up = vec4(greaterThan(Aw * fp.y + Bw * fp.x, Cw)); - vec4 interp_restriction_lv0 = (ne(e,f) * ne(e,h)); + vec4 interp_restriction_lv0 = (vec4(notEqual(e,f)) * vec4(notEqual(e,h))); // It uses CORNER_C if none of the others are defined. #ifdef CORNER_A vec4 interp_restriction_lv1 = interp_restriction_lv0; #elif CORNER_B - vec4 interp_restriction_lv1 = (interp_restriction_lv0 * (ge(f,b) * ge(h,d) + lt(e,i) * ge(f,i4) * ge(h,i5) + lt(e,g) + lt(e,c))); + vec4 interp_restriction_lv1 = (interp_restriction_lv0 * (neq(f,b) * neq(h,d) + eq(e,i) * neq(f,i4) * neq(h,i5) + eq(e,g) + eq(e,c))); #elif CORNER_D - vec4 interp_restriction_lv1 = (interp_restriction_lv0 * (ge(f,b) * ge(h,d) + lt(e,i) * ge(f,i4) * ge(h,i5) + lt(e,g) + lt(e,c)) * (ne(f,f4) * ne(f,i) + ne(h,h5) * ne(h,i) + ne(h,g) + ne(f,c) + lt(b,c1) * lt(d,g0))); + vec4 interp_restriction_lv1 = (interp_restriction_lv0 * (neq(f,b) * neq(h,d) + eq(e,i) * neq(f,i4) * neq(h,i5) + eq(e,g) + eq(e,c)) * (vec4(notEqual(f,f4)) * vec4(notEqual(f,i)) + vec4(notEqual(h,h5)) * vec4(notEqual(h,i)) + vec4(notEqual(h,g)) + vec4(notEqual(f,c)) + eq(b,c1) * eq(d,g0))); #elif CORNER_C - vec4 interp_restriction_lv1 = (interp_restriction_lv0 * (ge(f,b) * ge(f,c) + ge(h,d) * ge(h,g) + lt(e,i) * (ge(f,f4) * ge(f,i4) + ge(h,h5) * ge(h,i5)) + lt(e,g) + lt(e,c))); + vec4 interp_restriction_lv1 = (interp_restriction_lv0 * (neq(f,b) * neq(f,c) + neq(h,d) * neq(h,g) + eq(e,i) * (neq(f,f4) * neq(f,i4) + neq(h,h5) * neq(h,i5)) + eq(e,g) + eq(e,c))); #endif interp_restriction_lv1 = clamp(interp_restriction_lv1, 0.0, 1.0); - vec4 interp_restriction_lv2_left = ne(e,g) * ne(d,g); - vec4 interp_restriction_lv2_up = ne(e,c) * ne(b,c); - vec4 interp_restriction_lv3_left = abslt2(g,g0) * absge2(d0,g0); - vec4 interp_restriction_lv3_up = abslt2(c,c1) * absge2(b1,c1); + vec4 interp_restriction_lv2_left = vec4(notEqual(e,g)) * vec4(notEqual(d,g)); + vec4 interp_restriction_lv2_up = vec4(notEqual(e,c)) * vec4(notEqual(b,c)); + vec4 interp_restriction_lv3_left = eq2(g,g0) * vec4(notEqual(d0,g0)); + vec4 interp_restriction_lv3_up = eq2(c,c1) * vec4(notEqual(b1,c1)); vec4 wd1 = weighted_distance(e, c, g, i, h5, f4, h, f); vec4 wd2 = weighted_distance(h, d, i5, f, i4, b, e, i); vec4 one = vec4(1.0, 1.0, 1.0, 1.0); vec4 zero = vec4(0.0, 0.0, 0.0, 0.0); - vec4 edri = le(wd1,wd2) * interp_restriction_lv1; - vec4 edr = clamp(lt(wd1,wd2) * interp_restriction_lv1 * ((one - edri.yzwx) + (one - edri.wxyz)), 0.0, 1.0); - vec4 edr_left = le(XBR_LV2_COEFFICIENT.xxxx * df(f,g), df(h,c)) * interp_restriction_lv2_left * edr * (one - edri.yzwx) * lt(e,c); - vec4 edr_up = ge(df(f,g), XBR_LV2_COEFFICIENT.xxxx * df(h,c)) * interp_restriction_lv2_up * edr * (one - edri.wxyz) * lt(e,g); + + vec4 edri = vec4(lessThanEqual(wd1,wd2)) * interp_restriction_lv1; + vec4 edr = vec4(lessThan(wd1,wd2)) * interp_restriction_lv1 * ((1.0 - edri.yzwx) + (1.0 - edri.wxyz)); + edr = clamp(edr, 0.0, 1.0); + + vec4 hcDiff = df(h,c); + vec4 fgDiff = df(f,g); + vec4 edr_left = vec4(lessThanEqual(XBR_LV2_COEFFICIENT.xxxx * fgDiff, hcDiff)) * interp_restriction_lv2_left * edr * (1.0 - edri.yzwx) * eq(e,c); + vec4 edr_up = vec4(greaterThanEqual(fgDiff, XBR_LV2_COEFFICIENT.xxxx * hcDiff)) * interp_restriction_lv2_up * edr * (1.0 - edri.wxyz) * eq(e,g); vec4 edr3_left = interp_restriction_lv3_left; vec4 edr3_up = interp_restriction_lv3_up; - vec4 nc = clamp((edr * fx + edr_left * (fx_left + edr3_left * fx3_left * lt(e,c4)) + edr_up * (fx_up + edr3_up * fx3_up * lt(e,g5))), 0.0, 1.0); + vec4 nc = edr * (fx + edr_left * (fx_left + edr3_left * fx3_left * eq(e,c4)) + edr_up * (fx_up + edr3_up * fx3_up * eq(e,g5))); - vec4 px = le(df(e,f), df(e,h)); + bvec4 px = lessThanEqual(df(e,f), df(e,h)); - vec3 res1 = nc.x > 0.0 ? px.x > 0.0 ? F.xyz : H.xyz : nc.y > 0.0 ? px.y > 0.0 ? B.xyz : F.xyz : nc.z > 0.0 ? px.z > 0.0 ? D.xyz : B.xyz : nc.w > 0.0 ? px.w > 0.0 ? H.xyz : D.xyz : E.xyz; - vec3 res2 = nc.w > 0.0 ? px.w > 0.0 ? H.xyz : D.xyz : nc.z > 0.0 ? px.z > 0.0 ? D.xyz : B.xyz : nc.y > 0.0 ? px.y > 0.0 ? B.xyz : F.xyz : nc.x > 0.0 ? px.x > 0.0 ? F.xyz : H.xyz : E.xyz; + vec3 res1 = nc.x > 0.0 ? px.x ? F.xyz : H.xyz : nc.y > 0.0 ? px.y ? B.xyz : F.xyz : nc.z > 0.0 ? px.z ? D.xyz : B.xyz : nc.w > 0.0 ? px.w ? H.xyz : D.xyz : E.xyz; + vec3 res2 = nc.w > 0.0 ? px.w ? H.xyz : D.xyz : nc.z > 0.0 ? px.z ? D.xyz : B.xyz : nc.y > 0.0 ? px.y ? B.xyz : F.xyz : nc.x > 0.0 ? px.x ? F.xyz : H.xyz : E.xyz; vec2 df12 = abs(mul(mat3(res1, res2, zero.xyz), Y.xyz).xy - e.xy); diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv3.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv3.sc index b2fd0d94714..162461d145b 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv3.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/fs_xbr-lv3.sc @@ -38,10 +38,13 @@ uniform vec4 XBR_LV2_COEFFICIENT; uniform vec4 u_tex_size0; -SAMPLER2D(decal, 0); +// Uncomment just one of the four params below to choose the corner detection +//#define CORNER_A +//#define CORNER_B +#define CORNER_C +//#define CORNER_D -const vec4 yuv = vec4(0.299, 0.587, 0.114, 0.0); -const vec4 delta = vec4(0.4, 0.4, 0.4, 0.4); +SAMPLER2D(decal, 0); vec4 df(vec4 A, vec4 B) { @@ -50,53 +53,27 @@ vec4 df(vec4 A, vec4 B) float c_df(vec3 c1, vec3 c2) { - vec3 df = abs(c1 - c2); - return df.r + df.g + df.b; -} - -vec4 ge(vec4 A, vec4 B) -{ - return vec4(greaterThanEqual(A, B)); -} - -vec4 le(vec4 A, vec4 B) -{ - return vec4(lessThanEqual(A, B)); -} - -vec4 lt(vec4 A, vec4 B) -{ - return vec4(lessThan(A, B)); + return dot(abs(c1 - c2), vec3(1.0, 1.0, 1.0)); } vec4 eq(vec4 A, vec4 B) { - return vec4(equal(A, B)); -} - -vec4 ne(vec4 A, vec4 B) -{ - return vec4(notEqual(A, B)); -} - -vec4 abslt(vec4 A, vec4 B) -{ - return lt(df(A, B), XBR_EQ_THRESHOLD.xxxx); + return vec4(lessThan(df(A, B), XBR_EQ_THRESHOLD.xxxx)); } -vec4 abslt2(vec4 A, vec4 B) +vec4 eq2(vec4 A, vec4 B) { - return lt(df(A, B), XBR_EQ_THRESHOLD2.xxxx); + return vec4(lessThan(df(A, B), XBR_EQ_THRESHOLD2.xxxx)); } -vec4 absge(vec4 A, vec4 B) +vec4 neq(vec4 A, vec4 B) { - return ge(df(A, B), XBR_EQ_THRESHOLD.xxxx); + return vec4(greaterThanEqual(df(A, B), XBR_EQ_THRESHOLD.xxxx)); } -vec4 absge2(vec4 A, vec4 B) +vec4 neq2(vec4 A, vec4 B) { - return ge(df(A, B), XBR_EQ_THRESHOLD2.xxxx); + return vec4(greaterThanEqual(df(A, B), XBR_EQ_THRESHOLD2.xxxx)); } vec4 weighted_distance(vec4 a, vec4 b, vec4 c, vec4 d, vec4 e, vec4 f, vec4 g, vec4 h) @@ -106,6 +83,9 @@ vec4 weighted_distance(vec4 a, vec4 b, vec4 c, vec4 d, vec4 e, vec4 f, vec4 g, v void main() { + vec4 yuv = vec4(0.299, 0.587, 0.114, 0.0); + vec4 delta = vec4(0.4, 0.4, 0.4, 0.4); + vec2 fp = fract(v_texcoord0 * u_tex_size0.xy); vec4 A1 = texture2D(decal, v_texcoord1.xw); @@ -136,18 +116,19 @@ void main() vec4 F4 = texture2D(decal, v_texcoord7.xz); vec4 I4 = texture2D(decal, v_texcoord7.xw); - vec4 b = mul(mat4(B, D, H, F), XBR_Y_WEIGHT.xxxx * yuv); - vec4 c = mul(mat4(C, A, G, I), XBR_Y_WEIGHT.xxxx * yuv); - vec4 e = mul(mat4(E, E, E, E), XBR_Y_WEIGHT.xxxx * yuv); + vec4 weightVec = XBR_Y_WEIGHT.xxxx * yuv; + vec4 b = instMul(weightVec, mat4(B, D, H, F)); + vec4 c = instMul(weightVec, mat4(C, A, G, I)); + vec4 e = instMul(weightVec, mat4(E, E, E, E)); vec4 d = b.yzwx; vec4 f = b.wxyz; vec4 g = c.zwxy; vec4 h = b.zwxy; vec4 i = c.wxyz; - vec4 i4 = mul(mat4(I4, C1, A0, G5), XBR_Y_WEIGHT.xxxx * yuv); - vec4 i5 = mul(mat4(I5, C4, A1, G0), XBR_Y_WEIGHT.xxxx * yuv); - vec4 h5 = mul(mat4(H5, F4, B1, D0), XBR_Y_WEIGHT.xxxx * yuv); + vec4 i4 = instMul(weightVec, mat4(I4, C1, A0, G5)); + vec4 i5 = instMul(weightVec, mat4(I5, C4, A1, G0)); + vec4 h5 = instMul(weightVec, mat4(H5, F4, B1, D0)); vec4 f4 = h5.yzwx; vec4 c1 = i4.yzwx; @@ -179,25 +160,25 @@ void main() vec4 fx3_left= (Az * fp.y + Bz * fp.x); vec4 fx3_up = (Aw * fp.y + Bw * fp.x); - vec4 interp_restriction_lv0 = (ne(e,f) * ne(e,h)); + vec4 interp_restriction_lv0 = (vec4(notEqual(e,f)) * vec4(notEqual(e,h))); // It uses CORNER_C if none of the others are defined. #ifdef CORNER_A vec4 interp_restriction_lv1 = interp_restriction_lv0; #elif CORNER_B - vec4 interp_restriction_lv1 = (interp_restriction_lv0 * ( ge(f,b) * ge(h,d) + lt(e,i) * ge(f,i4) * ge(h,i5) + lt(e,g) + lt(e,c) ) ); + vec4 interp_restriction_lv1 = (interp_restriction_lv0 * ( neq(f,b) * neq(h,d) + eq(e,i) * neq(f,i4) * neq(h,i5) + eq(e,g) + eq(e,c) ) ); #elif CORNER_D - vec4 interp_restriction_lv1 = (interp_restriction_lv0 * ( ge(f,b) * ge(h,d) + lt(e,i) * ge(f,i4) * ge(h,i5) + lt(e,g) + lt(e,c) ) * (f!=f4 * f!=i + h!=h5 * h!=i + h!=g + f!=c + lt(b,c1) * lt(d,g0))); + vec4 interp_restriction_lv1 = (interp_restriction_lv0 * ( neq(f,b) * neq(h,d) + eq(e,i) * neq(f,i4) * neq(h,i5) + eq(e,g) + eq(e,c) ) * (vec4(notEqual(f,f4)) * vec4(notEqual(f,i)) + vec4(notEqual(h,h5)) * vec4(notEqual(h,i)) + vec4(notEqual(h,g)) + vec4(notEqual(f,c)) + eq(b,c1) * eq(d,g0))); #else - vec4 interp_restriction_lv1 = (interp_restriction_lv0 * ( ge(f,b) * ge(f,c) + ge(h,d) * ge(h,g) + lt(e,i) * (ge(f,f4) * ge(f,i4) + ge(h,h5) * ge(h,i5)) + lt(e,g) + lt(e,c)) ); + vec4 interp_restriction_lv1 = (interp_restriction_lv0 * ( neq(f,b) * neq(f,c) + neq(h,d) * neq(h,g) + eq(e,i) * (neq(f,f4) * neq(f,i4) + neq(h,h5) * neq(h,i5)) + eq(e,g) + eq(e,c)) ); #endif interp_restriction_lv1 = clamp(interp_restriction_lv1, 0.0, 1.0); - - vec4 interp_restriction_lv2_left = ne(e,g) * ne(d,g); - vec4 interp_restriction_lv2_up = ne(e,c) * ne(b,c); - vec4 interp_restriction_lv3_left = abslt2(g,g0) * absge2(d0,g0); - vec4 interp_restriction_lv3_up = abslt2(c,c1) * absge2(b1,c1); + + vec4 interp_restriction_lv2_left = vec4(notEqual(e,g)) * vec4(notEqual(d,g)); + vec4 interp_restriction_lv2_up = vec4(notEqual(e,c)) * vec4(notEqual(b,c)); + vec4 interp_restriction_lv3_left = eq2(g,g0) * neq2(d0,g0); + vec4 interp_restriction_lv3_up = eq2(c,c1) * neq2(b1,c1); vec4 fx45 = smoothstep(Co - delta, Co + delta, fx); vec4 fx30 = smoothstep(Cx - delta, Cx + delta, fx_left); @@ -205,22 +186,22 @@ void main() vec4 fx15 = smoothstep(Cz - delta, Cz + delta, fx3_left); vec4 fx75 = smoothstep(Cw - delta, Cw + delta, fx3_up); - vec4 edr = lt(weighted_distance(e, c, g, i, h5, f4, h, f), weighted_distance( h, d, i5, f, i4, b, e, i)) * interp_restriction_lv1; - vec4 edr_left = le(XBR_LV2_COEFFICIENT.xxxx * df(f,g), df(h,c)) * interp_restriction_lv2_left; - vec4 edr_up = ge(df(f,g), XBR_LV2_COEFFICIENT.xxxx * df(h,c)) * interp_restriction_lv2_up; + vec4 edr = vec4(lessThan(weighted_distance(e, c, g, i, h5, f4, h, f), weighted_distance( h, d, i5, f, i4, b, e, i))) * interp_restriction_lv1; + vec4 edr_left = vec4(lessThanEqual(XBR_LV2_COEFFICIENT.xxxx * df(f,g), df(h,c))) * interp_restriction_lv2_left; + vec4 edr_up = vec4(greaterThanEqual(df(f,g), XBR_LV2_COEFFICIENT.xxxx * df(h,c))) * interp_restriction_lv2_up; vec4 edr3_left = interp_restriction_lv3_left; vec4 edr3_up = interp_restriction_lv3_up; - vec4 nc45 = edr * fx45; - vec4 nc30 = edr * edr_left * fx30; - vec4 nc60 = edr * edr_up * fx60; - vec4 nc15 = edr * edr_left * edr3_left * fx15; - vec4 nc75 = edr * edr_up * edr3_up * fx75; + vec4 nc45 = (edr * fx45); + vec4 nc30 = (edr * edr_left * fx30); + vec4 nc60 = (edr * edr_up * fx60); + vec4 nc15 = (edr * edr_left * edr3_left * fx15); + vec4 nc75 = (edr * edr_up * edr3_up * fx75); - vec4 px = le(df(e,f), df(e,h)); + bvec4 px = lessThanEqual(df(e,f), df(e,h)); - vec4 nc = nc75 + nc15 + nc30 + nc60 + nc45; + vec4 nc = clamp(nc75 + nc15 + nc30 + nc60 + nc45, 0.0, 1.0); vec4 final45 = nc45 * fx45; vec4 final30 = nc30 * fx30; @@ -232,17 +213,17 @@ void main() float blend1; vec3 pix1; - if (nc.x > 0.0) {pix1 = px.x > 0.0 ? F.xyz : H.xyz; blend1 = maximo.x;} - else if (nc.y > 0.0) {pix1 = px.y > 0.0 ? B.xyz : F.xyz; blend1 = maximo.y;} - else if (nc.z > 0.0) {pix1 = px.z > 0.0 ? D.xyz : B.xyz; blend1 = maximo.z;} - else if (nc.w > 0.0) {pix1 = px.w > 0.0 ? H.xyz : D.xyz; blend1 = maximo.w;} + if (nc.x > 0.0) {pix1 = px.x ? F.xyz : H.xyz; blend1 = maximo.x;} + else if (nc.y > 0.0) {pix1 = px.y ? B.xyz : F.xyz; blend1 = maximo.y;} + else if (nc.z > 0.0) {pix1 = px.z ? D.xyz : B.xyz; blend1 = maximo.z;} + else if (nc.w > 0.0) {pix1 = px.w ? H.xyz : D.xyz; blend1 = maximo.w;} float blend2; vec3 pix2; - if (nc.w > 0.0) {pix2 = px.w > 0.0 ? H.xyz : D.xyz; blend2 = maximo.w;} - else if (nc.z > 0.0) {pix2 = px.z > 0.0 ? D.xyz : B.xyz; blend2 = maximo.z;} - else if (nc.y > 0.0) {pix2 = px.y > 0.0 ? B.xyz : F.xyz; blend2 = maximo.y;} - else if (nc.x > 0.0) {pix2 = px.x > 0.0 ? F.xyz : H.xyz; blend2 = maximo.x;} + if (nc.w > 0.0) {pix2 = px.w ? H.xyz : D.xyz; blend2 = maximo.w;} + else if (nc.z > 0.0) {pix2 = px.z ? D.xyz : B.xyz; blend2 = maximo.z;} + else if (nc.y > 0.0) {pix2 = px.y ? B.xyz : F.xyz; blend2 = maximo.y;} + else if (nc.x > 0.0) {pix2 = px.x ? F.xyz : H.xyz; blend2 = maximo.x;} vec3 res1 = mix(E.xyz, pix1, blend1); vec3 res2 = mix(E.xyz, pix2, blend2); diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-3d.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-3d.sc index 476e11da6ea..a3bb4330f45 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-3d.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-3d.sc @@ -1,5 +1,5 @@ $input a_position, a_texcoord0, a_color0 -$output v_texcoord0, v_texcoord1, v_color0 +$output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texcoord5, v_texcoord6, v_texcoord7, v_color0 // license:BSD-3-Clause // copyright-holders:Dario Manesku @@ -18,6 +18,12 @@ void main() vec2 ps = XBR_RES.xx / u_tex_size0.xy; float dx = ps.x; float dy = ps.y; - v_texcoord1 = vec4(dx, 0, 0, dy); // F H + v_texcoord1 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx, -2.0*dy); // A1 B1 C1 + v_texcoord2 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx, -dy); // A B C + v_texcoord3 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx, 0.0); // D E F + v_texcoord4 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx, dy); // G H I + v_texcoord5 = v_texcoord0.xxxy + vec4( -dx, 0.0, dx, 2.0*dy); // G5 H5 I5 + v_texcoord6 = v_texcoord0.xyyy + vec4(-2.0*dx, -dy, 0.0, dy); // A0 D0 G0 + v_texcoord7 = v_texcoord0.xyyy + vec4( 2.0*dx, -dy, 0.0, dy); // C4 F4 I4 v_color0 = a_color0; } -- cgit v1.2.3