summaryrefslogtreecommitdiffstatshomepage
path: root/hlsl/prescale.fx
diff options
context:
space:
mode:
author ImJezze <jezze@gmx.net>2015-12-31 16:59:23 +0100
committer ImJezze <jezze@gmx.net>2015-12-31 16:59:23 +0100
commita2c7b61daa5d66e0e9d7b1d1f683cf2f6d9f5973 (patch)
tree253a2da2a557260a1910e844c5c6bcd2b79b0fa9 /hlsl/prescale.fx
parenteea40fd0e47699261332904b5d930f0be68756e9 (diff)
Refactoring
- replaced shader parameters OrientationSwapXY xor RotationSwapXY by SwapXY - made shader parameters SourceDims, SourceRect, TargetDims, ScreenDims, QuadDims and SwapXY available for all shaders - color convolution, defocus and phosphor pass will now be skipped if all influencing parameters are 0 - removed unused bloom_texture and bloom_target arrays from cache_target class - fixed half texel offset in prescale.fx
Diffstat (limited to 'hlsl/prescale.fx')
-rw-r--r--hlsl/prescale.fx10
1 files changed, 6 insertions, 4 deletions
diff --git a/hlsl/prescale.fx b/hlsl/prescale.fx
index 33b2a4efb06..846c02577ce 100644
--- a/hlsl/prescale.fx
+++ b/hlsl/prescale.fx
@@ -49,6 +49,7 @@ struct PS_INPUT
//-----------------------------------------------------------------------------
uniform float2 ScreenDims;
+uniform float2 TargetDims;
VS_OUTPUT vs_main(VS_INPUT Input)
{
@@ -56,11 +57,12 @@ VS_OUTPUT vs_main(VS_INPUT Input)
Output.Position = float4(Input.Position.xyz, 1.0f);
Output.Position.xy /= ScreenDims;
- Output.Position.y = 1.0f - Output.Position.y;
- Output.Position.xy -= 0.5f;
- Output.Position *= float4(2.0f, 2.0f, 1.0f, 1.0f);
+ Output.Position.y = 1.0f - Output.Position.y; // flip y
+ Output.Position.xy -= 0.5f; // center
+ Output.Position.xy *= 2.0f; // zoom
- Output.TexCoord = Input.TexCoord + 0.5f / ScreenDims;
+ Output.TexCoord = Input.TexCoord;
+ Output.TexCoord += 0.5f / TargetDims; // half texel offset correction (DX9)
return Output;
}