diff options
author | 2016-06-19 22:23:02 +0200 | |
---|---|---|
committer | 2016-06-20 00:03:44 +0200 | |
commit | 2f06a08ec466b21223abe6de277889f269c45890 (patch) | |
tree | 1f1505b7d58623189573e99aa0031c20a05f0332 /hlsl | |
parent | f056b622bcad7c19a521a9a5a181471ff301f5f2 (diff) |
Small shader corrections (nw)
Diffstat (limited to 'hlsl')
-rw-r--r-- | hlsl/distortion.fx | 4 | ||||
-rw-r--r-- | hlsl/post.fx | 4 | ||||
-rw-r--r-- | hlsl/vector.fx | 4 |
3 files changed, 6 insertions, 6 deletions
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); |