summaryrefslogtreecommitdiffstatshomepage
path: root/hlsl/phosphor.fx
diff options
context:
space:
mode:
authorGravatarGravatar Ryan Holtz <rholtz@batcountryentertainment.com>2013-08-28 00:36:02 +0000
committerGravatarGravatar Ryan Holtz <rholtz@batcountryentertainment.com>2013-08-28 00:36:02 +0000
commita86d35158c890edd96950f980c2a8545ba35e2f9 (patch)
tree3919411d8ad5aab33af091445588bea1275e0fb0 /hlsl/phosphor.fx
parent80fa5fade3d0e8a56588d2a02713cc7715ee3fc2 (diff)
minor shader cleanup, nw
Diffstat (limited to 'hlsl/phosphor.fx')
-rw-r--r--hlsl/phosphor.fx13
1 files changed, 5 insertions, 8 deletions
diff --git a/hlsl/phosphor.fx b/hlsl/phosphor.fx
index b1842fdf02a..99f7574e1f5 100644
--- a/hlsl/phosphor.fx
+++ b/hlsl/phosphor.fx
@@ -59,8 +59,7 @@ struct PS_INPUT
// Simple Vertex Shader
//-----------------------------------------------------------------------------
-uniform float TargetWidth;
-uniform float TargetHeight;
+uniform float2 ScreenDims;
uniform float TextureWidth;
uniform float TextureHeight;
@@ -72,16 +71,14 @@ 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;
- float2 InvTexSize = float2(1.0f / TextureWidth, 1.0f / TextureHeight);
- Output.TexCoord = Input.TexCoord + float2(0.5f, 0.5f) * InvTexSize;
+ float2 HalfTexOffset = 0.5f / float2(TextureWidth, TextureHeight);
+ Output.TexCoord = Input.TexCoord + HalfTexOffset;
Output.PrevCoord = Output.TexCoord;
return Output;