From f8a449539a149eb3d9aceeab2f4f49e5905319e7 Mon Sep 17 00:00:00 2001 From: Ryan Holtz Date: Mon, 23 May 2011 15:49:50 +0000 Subject: Hopefully fixing the HLSL UV issue once and for all, nw --- hlsl/color.fx | 2 +- hlsl/post.fx | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'hlsl') diff --git a/hlsl/color.fx b/hlsl/color.fx index 3aa8c99e4ca..b28fb2c3000 100644 --- a/hlsl/color.fx +++ b/hlsl/color.fx @@ -109,7 +109,7 @@ uniform float BluPower = 2.2f; float4 ps_main(PS_INPUT Input) : COLOR { - float4 BaseTexel = tex2D(DiffuseSampler, Input.TexCoord + 0.5f / float2(RawWidth, RawHeight)); + float4 BaseTexel = tex2D(DiffuseSampler, Input.TexCoord + 0.5f / float2(-RawWidth, -RawHeight)); float3 OutRGB = BaseTexel.rgb; diff --git a/hlsl/post.fx b/hlsl/post.fx index 7dae7446dce..423bab6d91a 100644 --- a/hlsl/post.fx +++ b/hlsl/post.fx @@ -83,8 +83,9 @@ VS_OUTPUT vs_main(VS_INPUT Input) Output.TexCoord = Input.TexCoord + 0.5f / float2(RawWidth, RawHeight); Output.ExtraInfo = Input.ExtraInfo; - //Output.TexCoord /= 16.0f; - //Output.TexCoord += float2(0.3f, 0.25f); + //float Zoom = 1.0f; + //Output.TexCoord /= Zoom; + //Output.TexCoord += float2(0.175f * (1.0f - 1.0f / Zoom) / WidthRatio, 0.175f * (1.0f - 1.0f / Zoom) / HeightRatio); return Output; } @@ -151,10 +152,10 @@ float4 ps_main(PS_INPUT Input) : COLOR float4 BaseTexel = tex2D(DiffuseSampler, BaseCoord); // -- Alpha Clipping (1px border in drawd3d does not work for some reason) -- - clip((ScreenClipCoord.x < 1.0f / TargetWidth) ? -1 : 1); - clip((ScreenClipCoord.y < 1.0f / TargetHeight) ? -1 : 1); - clip((ScreenClipCoord.x > 1.0f / WidthRatio) ? -1 : 1); - clip((ScreenClipCoord.y > 1.0f / HeightRatio) ? -1 : 1); + clip((BaseCoord.x < WidthRatio / RawWidth) ? -1 : 1); + clip((BaseCoord.y < HeightRatio / RawHeight) ? -1 : 1); + clip((BaseCoord.x > (1.0f / WidthRatio + 1.0f / RawWidth)) ? -1 : 1); + clip((BaseCoord.y > (1.0f / HeightRatio + 1.0f / RawHeight)) ? -1 : 1); // -- Scanline Simulation -- float3 ScanBrightness = lerp(1.0f, abs(sin(((BaseCoord.y * Ratios.y * RawHeight * ScanlineScale) * PI + ScanlineOffset * RawHeight))) * ScanlineBrightScale + ScanlineBrightOffset, ScanlineAmount); -- cgit v1.2.3