diff options
Diffstat (limited to 'hlsl/phosphor.fx')
-rw-r--r-- | hlsl/phosphor.fx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/hlsl/phosphor.fx b/hlsl/phosphor.fx index 44b00ac0ee7..13c7700e2e8 100644 --- a/hlsl/phosphor.fx +++ b/hlsl/phosphor.fx @@ -68,18 +68,20 @@ uniform bool Passthrough; VS_OUTPUT vs_main(VS_INPUT Input) { VS_OUTPUT Output = (VS_OUTPUT)0; - + Output.Position = float4(Input.Position.xyz, 1.0f); Output.Position.xy /= ScreenDims; 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.TexCoord = Input.TexCoord; + Output.TexCoord += 0.5f / TargetDims; // half texel offset correction (DX9) + Output.PrevCoord = Output.TexCoord; Output.Color = Input.Color; - + return Output; } @@ -93,13 +95,13 @@ float4 ps_main(PS_INPUT Input) : COLOR { float4 CurrPix = tex2D(DiffuseSampler, Input.TexCoord); float3 PrevPix = tex2D(PreviousSampler, Input.PrevCoord).rgb * float3(Phosphor.r, Phosphor.g, Phosphor.b); - + float RedMax = max(CurrPix.r, PrevPix.r); float GreenMax = max(CurrPix.g, PrevPix.g); float BlueMax = max(CurrPix.b, PrevPix.b); return Passthrough - ? CurrPix + ? CurrPix : float4(RedMax, GreenMax, BlueMax, CurrPix.a); } |