From 2f06a08ec466b21223abe6de277889f269c45890 Mon Sep 17 00:00:00 2001 From: ImJezze Date: Sun, 19 Jun 2016 22:23:02 +0200 Subject: [PATCH] Small shader corrections (nw) --- .../dx11/chains/hlsl/fs_distortion.bin | Bin 3782 -> 3782 bytes bgfx/shaders/dx11/chains/hlsl/fs_post.bin | Bin 3550 -> 3550 bytes .../shaders/dx9/chains/hlsl/fs_distortion.bin | Bin 2823 -> 2823 bytes bgfx/shaders/dx9/chains/hlsl/fs_post.bin | Bin 3135 -> 3135 bytes .../gles/chains/hlsl/fs_distortion.bin | Bin 5285 -> 5285 bytes bgfx/shaders/gles/chains/hlsl/fs_post.bin | Bin 5017 -> 5017 bytes .../glsl/chains/hlsl/fs_distortion.bin | Bin 5035 -> 5035 bytes bgfx/shaders/glsl/chains/hlsl/fs_post.bin | Bin 4769 -> 4769 bytes .../metal/chains/hlsl/fs_distortion.bin | Bin 5581 -> 5581 bytes bgfx/shaders/metal/chains/hlsl/fs_post.bin | Bin 5468 -> 5468 bytes hlsl/distortion.fx | 4 ++-- hlsl/post.fx | 4 ++-- hlsl/vector.fx | 4 ++-- .../bgfx/shaders/chains/hlsl/fs_distortion.sc | 2 +- .../bgfx/shaders/chains/hlsl/fs_post.sc | 2 +- 15 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bgfx/shaders/dx11/chains/hlsl/fs_distortion.bin b/bgfx/shaders/dx11/chains/hlsl/fs_distortion.bin index b86b2f303f971fb1f0605bd65d5c220ff4f9bd76..41f4aef5d24dfcee318ceb398e46d49d3e6f8a2c 100644 GIT binary patch delta 61 zcmX>mdrWr1Gl3aO9R?TU8}8iD>0wf^xIS&;Hx6zY1_lQ9CI$fpCLqHKjovK9vxW%( DdTb9e delta 61 zcmX>mdrWr1GXbj{K0T?Eua!D=E__w{(rCHy8wa0NMZE8{QkR9s&@YPvJHUpPh};Hs4JqC0Dz%E&`MY1KJPCv&9M-12hQ_4FCWD delta 38 wcmV+>0NMZE8{QkR9s&?E<+5WKt05;eLRR910 delta 16 Ycmdllv0q|?9UJpr>GPW%+5WKt05)g_N&o-= diff --git a/bgfx/shaders/gles/chains/hlsl/fs_distortion.bin b/bgfx/shaders/gles/chains/hlsl/fs_distortion.bin index b40b16a3052470aee0abbbccf56bec81a2effdee..fa2f788eecc74e7355890f142f28e56b7833eccd 100644 GIT binary patch delta 14 VcmZ3gxm0sQh7hCC=1d_QCIBYJ1ZDsL delta 14 VcmZ3gxm0sQh7hCi=1d_QCIBYP1ZMyM diff --git a/bgfx/shaders/gles/chains/hlsl/fs_post.bin b/bgfx/shaders/gles/chains/hlsl/fs_post.bin index 185b92fa882605273f9fc67b67bf5ab64595b7f3..f7039993aaca88f8628c493f3cd0235e7481d3b7 100644 GIT binary patch delta 27 jcmbQKK2v?ec>yj{a|3frGfhoR>&b~iI-6Mqr!WBkb@B(J delta 27 jcmbQKK2v?ec>yjnLkk0A6HQG`>&b~iI-6Mqr!WBkbvp-_ diff --git a/bgfx/shaders/glsl/chains/hlsl/fs_distortion.bin b/bgfx/shaders/glsl/chains/hlsl/fs_distortion.bin index 1840874ea5a78736ed349e567d37c66342173c21..15f466dbc5350c4bde1ab01b26c8c30ee3dc5886 100644 GIT binary patch delta 14 VcmZ3jzFK`ll^~=4wF$CIBb@1cd+q diff --git a/bgfx/shaders/glsl/chains/hlsl/fs_post.bin b/bgfx/shaders/glsl/chains/hlsl/fs_post.bin index eda1c602e9f464a89e769d716abfb078f1e01104..49f23896de73cf424887ab35a325b9a5177b184c 100644 GIT binary patch delta 31 ncmZ3ex=?k)9eyrTa|3frGfhoR>&bb7I+IJdr8esblrjMToJR=y delta 31 ncmZ3ex=?k)9eyq|Lkk0A6HQG`>&bb7I+IJdr8esblrjMTn_vj; diff --git a/bgfx/shaders/metal/chains/hlsl/fs_distortion.bin b/bgfx/shaders/metal/chains/hlsl/fs_distortion.bin index fe7f7a4c49579fd9332bbc860b0d0605d03bbe82..2ea407b3195eef9da7dc67a81ee4e5d5f8a4510c 100644 GIT binary patch delta 26 gcmX@BeO7yeqcEqDo`EKp0uW68!!NNpNjRGc0Btb`i~s-t delta 26 gcmX@BeO7yeqcEqjo`EKp0uW68!!NNpNjRGc0Bu7DjQ{`u diff --git a/bgfx/shaders/metal/chains/hlsl/fs_post.bin b/bgfx/shaders/metal/chains/hlsl/fs_post.bin index e261b0e64316685f0729ab0b0f6bb5bb111ece33..ad8382250a90fea8fd6045f307658949879ef60b 100644 GIT binary patch delta 19 acmcbkbw_K1wji6Sxq-Q**=9pQZ59AQ-UVd< delta 19 acmcbkbw_K1wji6Cp@o65$!0@AZ59AQhXq*x diff --git a/hlsl/distortion.fx b/hlsl/distortion.fx index 1ee1641e646..3b7a9d592e3 100644 --- a/hlsl/distortion.fx +++ b/hlsl/distortion.fx @@ -176,9 +176,9 @@ float GetRoundCornerFactor(float2 coord, float2 bounds, float radiusAmount, floa smoothAmount = min(smoothAmount, radiusAmount); float range = min(bounds.x, bounds.y); - float amountMinimum = range > 0.0f ? 1.0f / range : 0.0f; + float amountMinimum = 1.0f / range; float radius = range * max(radiusAmount, amountMinimum); - float smooth = 1.0f / (range * max(smoothAmount, amountMinimum * 3.0f)); + float smooth = 1.0f / (range * max(smoothAmount, amountMinimum * 2.0f)); // compute box float box = roundBox(bounds * (coord * 2.0f), bounds, radius); diff --git a/hlsl/post.fx b/hlsl/post.fx index 93a871a629a..6d8077e2037 100644 --- a/hlsl/post.fx +++ b/hlsl/post.fx @@ -67,7 +67,7 @@ struct PS_INPUT //----------------------------------------------------------------------------- static const float PI = 3.1415927f; -static const float PHI = 1.618034f; +static const float HalfPI = PI * 0.5f; //----------------------------------------------------------------------------- // Scanline & Shadowmask Vertex Shader @@ -259,7 +259,7 @@ float4 ps_main(PS_INPUT Input) : COLOR ScanlineCoord *= SourceDims.y * ScanlineScale * PI; - float ScanlineCoordJitter = ScanlineOffset * PHI; + float ScanlineCoordJitter = ScanlineOffset * HalfPI; float ScanlineSine = sin(ScanlineCoord + ScanlineCoordJitter); float ScanlineWide = ScanlineHeight + ScanlineVariation * max(1.0f, ScanlineHeight) * (1.0f - ColorBrightness); float ScanlineAmount = pow(ScanlineSine * ScanlineSine, ScanlineWide); diff --git a/hlsl/vector.fx b/hlsl/vector.fx index 71d53d030bc..686b617bbd0 100644 --- a/hlsl/vector.fx +++ b/hlsl/vector.fx @@ -82,9 +82,9 @@ float GetRoundCornerFactor(float2 coord, float2 bounds, float radiusAmount, floa smoothAmount = min(smoothAmount, radiusAmount); float range = min(bounds.x, bounds.y); - float amountMinimum = range > 0.0f ? 1.0f / range : 0.0f; + float amountMinimum = 1.0f / range; float radius = range * max(radiusAmount, amountMinimum); - float smooth = 1.0f / (range * max(smoothAmount, amountMinimum * 3.0f)); + float smooth = 1.0f / (range * max(smoothAmount, amountMinimum * 2.0f)); // compute box float box = roundBox(bounds * (coord * 2.0f), bounds, radius); diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_distortion.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_distortion.sc index be1f6ef43f6..449294978b0 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_distortion.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_distortion.sc @@ -105,7 +105,7 @@ float GetRoundCornerFactor(vec2 coord, vec2 bounds, float radiusAmount, float sm float range = min(bounds.x, bounds.y); float amountMinimum = range > 0.0f ? 1.0f / range : 0.0f; float radius = range * max(radiusAmount, amountMinimum); - float smooth_val = 1.0f / (range * max(smoothAmount, amountMinimum * 3.0f)); + float smooth_val = 1.0f / (range * max(smoothAmount, amountMinimum * 2.0f)); // compute box float box = roundBox(bounds * (coord * 2.0f), bounds, radius); diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_post.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_post.sc index 9d5b99d0546..a0d6f56772a 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_post.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_post.sc @@ -155,7 +155,7 @@ void main() ScanCoord *= u_source_dims.y * u_scanline_scale.x * 3.1415927; // PI - float ScanCoordJitter = u_scanline_jitter.x * u_jitter_amount.x * 1.618034; // PHI + float ScanCoordJitter = u_scanline_jitter.x * u_jitter_amount.x * 1.5707963; // half PI float ScanSine = sin(ScanCoord + ScanCoordJitter); float ScanlineWide = u_scanline_height.x + u_scanline_variation.x * max(1.0, u_scanline_height.x) * (1.0 - ColorBrightness); float ScanSineScaled = pow(ScanSine * ScanSine, ScanlineWide);