summaryrefslogtreecommitdiffstatshomepage
path: root/hlsl/prescale.fx
diff options
context:
space:
mode:
Diffstat (limited to 'hlsl/prescale.fx')
-rw-r--r--hlsl/prescale.fx18
1 files changed, 4 insertions, 14 deletions
diff --git a/hlsl/prescale.fx b/hlsl/prescale.fx
index 3c207875ca2..c4aa19d86c0 100644
--- a/hlsl/prescale.fx
+++ b/hlsl/prescale.fx
@@ -42,24 +42,20 @@ struct PS_INPUT
// Passthrough Vertex Shader
//-----------------------------------------------------------------------------
-uniform float TargetWidth;
-uniform float TargetHeight;
-
uniform float2 RawDims;
+uniform float2 ScreenDims;
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.TexCoord = Input.TexCoord + 0.5f / float2(TargetWidth, TargetHeight);
+ Output.TexCoord = Input.TexCoord + 0.5f / ScreenDims;
return Output;
}
@@ -70,12 +66,6 @@ VS_OUTPUT vs_main(VS_INPUT Input)
float4 ps_main(PS_INPUT Input) : COLOR
{
- //float2 TexCoord = Input.TexCoord * RawDims;
- //TexCoord -= frac(TexCoord);
- //TexCoord += 0.5f;
- //TexCoord /= RawDims;
- //
- //return tex2D(DiffuseSampler, TexCoord);
return tex2D(DiffuseSampler, Input.TexCoord);
}