diff --git a/bgfx/shaders/dx11/chains/hlsl/fs_distortion.bin b/bgfx/shaders/dx11/chains/hlsl/fs_distortion.bin index b86b2f303f9..41f4aef5d24 100644 Binary files a/bgfx/shaders/dx11/chains/hlsl/fs_distortion.bin and b/bgfx/shaders/dx11/chains/hlsl/fs_distortion.bin differ diff --git a/bgfx/shaders/dx11/chains/hlsl/fs_post.bin b/bgfx/shaders/dx11/chains/hlsl/fs_post.bin index 3aa4cd21700..927c16d8057 100644 Binary files a/bgfx/shaders/dx11/chains/hlsl/fs_post.bin and b/bgfx/shaders/dx11/chains/hlsl/fs_post.bin differ diff --git a/bgfx/shaders/dx9/chains/hlsl/fs_distortion.bin b/bgfx/shaders/dx9/chains/hlsl/fs_distortion.bin index a89c29f59b6..d009657e88c 100644 Binary files a/bgfx/shaders/dx9/chains/hlsl/fs_distortion.bin and b/bgfx/shaders/dx9/chains/hlsl/fs_distortion.bin differ diff --git a/bgfx/shaders/dx9/chains/hlsl/fs_post.bin b/bgfx/shaders/dx9/chains/hlsl/fs_post.bin index 4cbc9b2fb7b..451ddc62b05 100644 Binary files a/bgfx/shaders/dx9/chains/hlsl/fs_post.bin and b/bgfx/shaders/dx9/chains/hlsl/fs_post.bin differ diff --git a/bgfx/shaders/gles/chains/hlsl/fs_distortion.bin b/bgfx/shaders/gles/chains/hlsl/fs_distortion.bin index b40b16a3052..fa2f788eecc 100644 Binary files a/bgfx/shaders/gles/chains/hlsl/fs_distortion.bin and b/bgfx/shaders/gles/chains/hlsl/fs_distortion.bin differ diff --git a/bgfx/shaders/gles/chains/hlsl/fs_post.bin b/bgfx/shaders/gles/chains/hlsl/fs_post.bin index 185b92fa882..f7039993aac 100644 Binary files a/bgfx/shaders/gles/chains/hlsl/fs_post.bin and b/bgfx/shaders/gles/chains/hlsl/fs_post.bin differ diff --git a/bgfx/shaders/glsl/chains/hlsl/fs_distortion.bin b/bgfx/shaders/glsl/chains/hlsl/fs_distortion.bin index 1840874ea5a..15f466dbc53 100644 Binary files a/bgfx/shaders/glsl/chains/hlsl/fs_distortion.bin and b/bgfx/shaders/glsl/chains/hlsl/fs_distortion.bin differ diff --git a/bgfx/shaders/glsl/chains/hlsl/fs_post.bin b/bgfx/shaders/glsl/chains/hlsl/fs_post.bin index eda1c602e9f..49f23896de7 100644 Binary files a/bgfx/shaders/glsl/chains/hlsl/fs_post.bin and b/bgfx/shaders/glsl/chains/hlsl/fs_post.bin differ diff --git a/bgfx/shaders/metal/chains/hlsl/fs_distortion.bin b/bgfx/shaders/metal/chains/hlsl/fs_distortion.bin index fe7f7a4c495..2ea407b3195 100644 Binary files a/bgfx/shaders/metal/chains/hlsl/fs_distortion.bin and b/bgfx/shaders/metal/chains/hlsl/fs_distortion.bin differ diff --git a/bgfx/shaders/metal/chains/hlsl/fs_post.bin b/bgfx/shaders/metal/chains/hlsl/fs_post.bin index e261b0e6431..ad8382250a9 100644 Binary files a/bgfx/shaders/metal/chains/hlsl/fs_post.bin and b/bgfx/shaders/metal/chains/hlsl/fs_post.bin differ 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);