diff options
author | 2013-08-28 00:36:02 +0000 | |
---|---|---|
committer | 2013-08-28 00:36:02 +0000 | |
commit | a86d35158c890edd96950f980c2a8545ba35e2f9 (patch) | |
tree | 3919411d8ad5aab33af091445588bea1275e0fb0 /hlsl/post.fx | |
parent | 80fa5fade3d0e8a56588d2a02713cc7715ee3fc2 (diff) |
minor shader cleanup, nw
Diffstat (limited to 'hlsl/post.fx')
-rw-r--r-- | hlsl/post.fx | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/hlsl/post.fx b/hlsl/post.fx index bbc924af8ed..e8213b345f2 100644 --- a/hlsl/post.fx +++ b/hlsl/post.fx @@ -57,8 +57,7 @@ struct PS_INPUT // Scanline & Shadowmask Vertex Shader //----------------------------------------------------------------------------- -uniform float TargetWidth; -uniform float TargetHeight; +uniform float2 ScreenDims; uniform float2 RawDims; @@ -69,14 +68,12 @@ VS_OUTPUT vs_main(VS_INPUT Input) VS_OUTPUT Output = (VS_OUTPUT)0; Output.Position = float4(Input.Position.xyz, 1.0f); - Output.Position.x /= TargetWidth; - Output.Position.y /= TargetHeight; + Output.Position.xy /= ScreenDims; Output.Position.y = 1.0f - Output.Position.y; - Output.Position.x -= 0.5f; - Output.Position.y -= 0.5f; + Output.Position.xy -= 0.5f; Output.Position *= float4(2.0f, 2.0f, 1.0f, 1.0f); Output.Color = Input.Color; - Output.TexCoord = Input.TexCoord + 0.5f / RawDims;//float2(TargetWidth, TargetHeight); + Output.TexCoord = Input.TexCoord + 0.5f / RawDims; return Output; } @@ -120,7 +117,7 @@ float4 ps_main(PS_INPUT Input) : COLOR float PincushionR2 = pow(length(PinUnitCoord), 2.0f) / pow(length(Ratios), 2.0f); float2 PincushionCurve = PinUnitCoord * PincushionAmount * PincushionR2; float2 BaseCoord = Input.TexCoord; - float2 ScanCoord = BaseCoord - 0.5f / float2(TargetWidth, TargetHeight); + float2 ScanCoord = BaseCoord - 0.5f / ScreenDims; BaseCoord -= 0.5f / Ratios; BaseCoord *= 1.0f - PincushionAmount * Ratios * 0.2f; // Warning: Magic constant |