diff options
author | 2011-05-31 05:02:17 +0000 | |
---|---|---|
committer | 2011-05-31 05:02:17 +0000 | |
commit | ed6689e2d4934a8483a84ae65e1e8ac8a21c76e5 (patch) | |
tree | 90579ff2b4097409b49b1c4f7c6b98c54758de2b /hlsl/prescale.fx | |
parent | 37e8c1d7e4ac922dfd94276edf9690efb4ce9aba (diff) |
Fixed scanlines, nwn. This took much longer to fix than it should have. :[
Diffstat (limited to 'hlsl/prescale.fx')
-rw-r--r-- | hlsl/prescale.fx | 9 |
1 files changed, 7 insertions, 2 deletions
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; } |