summaryrefslogtreecommitdiffstatshomepage
path: root/hlsl/phosphor.fx
diff options
context:
space:
mode:
Diffstat (limited to 'hlsl/phosphor.fx')
-rw-r--r--hlsl/phosphor.fx17
1 files changed, 9 insertions, 8 deletions
diff --git a/hlsl/phosphor.fx b/hlsl/phosphor.fx
index 85647fb83e9..44b00ac0ee7 100644
--- a/hlsl/phosphor.fx
+++ b/hlsl/phosphor.fx
@@ -47,7 +47,6 @@ struct VS_INPUT
float3 Position : POSITION;
float4 Color : COLOR0;
float2 TexCoord : TEXCOORD0;
- float2 Unused : TEXCOORD1;
};
struct PS_INPUT
@@ -62,10 +61,9 @@ struct PS_INPUT
//-----------------------------------------------------------------------------
uniform float2 ScreenDims;
-
uniform float2 TargetDims;
-uniform float Passthrough;
+uniform bool Passthrough;
VS_OUTPUT vs_main(VS_INPUT Input)
{
@@ -73,13 +71,14 @@ 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.Color = Input.Color;
+ 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 / TargetDims;
Output.PrevCoord = Output.TexCoord;
+
+ Output.Color = Input.Color;
return Output;
}
@@ -99,7 +98,9 @@ float4 ps_main(PS_INPUT Input) : COLOR
float GreenMax = max(CurrPix.g, PrevPix.g);
float BlueMax = max(CurrPix.b, PrevPix.b);
- return lerp(float4(RedMax, GreenMax, BlueMax, CurrPix.a), CurrPix, Passthrough);
+ return Passthrough
+ ? CurrPix
+ : float4(RedMax, GreenMax, BlueMax, CurrPix.a);
}
//-----------------------------------------------------------------------------