From ed6689e2d4934a8483a84ae65e1e8ac8a21c76e5 Mon Sep 17 00:00:00 2001 From: Ryan Holtz Date: Tue, 31 May 2011 05:02:17 +0000 Subject: Fixed scanlines, nwn. This took much longer to fix than it should have. :[ --- hlsl/prescale.fx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'hlsl/prescale.fx') diff --git a/hlsl/prescale.fx b/hlsl/prescale.fx index 4ba0495320e..633b0872d48 100644 --- a/hlsl/prescale.fx +++ b/hlsl/prescale.fx @@ -59,7 +59,7 @@ VS_OUTPUT vs_main(VS_INPUT Input) Output.Position.y -= 0.5f; Output.Position *= float4(2.0f, 2.0f, 1.0f, 1.0f); - Output.TexCoord = Input.TexCoord + 0.5f / float2(RawWidth, RawHeight); + Output.TexCoord = Input.TexCoord; return Output; } @@ -70,7 +70,12 @@ VS_OUTPUT vs_main(VS_INPUT Input) float4 ps_main(PS_INPUT Input) : COLOR { - float4 Center = tex2D(DiffuseSampler, Input.TexCoord); + float2 RawDims = float2(RawWidth, RawHeight); + float2 TexCoord = Input.TexCoord * RawDims; + TexCoord -= frac(float2(0.0f, TexCoord.y)); + TexCoord /= RawDims; + + float4 Center = tex2D(DiffuseSampler, TexCoord); return Center; } -- cgit v1.2.3