From 2f06a08ec466b21223abe6de277889f269c45890 Mon Sep 17 00:00:00 2001 From: ImJezze Date: Sun, 19 Jun 2016 22:23:02 +0200 Subject: Small shader corrections (nw) --- hlsl/distortion.fx | 4 ++-- hlsl/post.fx | 4 ++-- hlsl/vector.fx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'hlsl') 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); -- cgit v1.2.3-70-g09d2