diff --git a/hlsl/color.fx b/hlsl/color.fx index e04d93daabd..a980b47614e 100644 --- a/hlsl/color.fx +++ b/hlsl/color.fx @@ -58,6 +58,7 @@ VS_OUTPUT vs_main(VS_INPUT Input) { VS_OUTPUT Output = (VS_OUTPUT)0; + float2 invDims = float2(1.0f / RawWidth, 1.0f / RawHeight); Output.Position = float4(Input.Position.xyz, 1.0f); Output.Position.x /= TargetWidth; Output.Position.y /= TargetHeight; @@ -66,7 +67,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.Color = Input.Color; - Output.TexCoord = Input.TexCoord; + Output.TexCoord = Input.TexCoord + 0.5f * invDims; return Output; } @@ -105,7 +106,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); float3 OutRGB = BaseTexel.rgb; diff --git a/hlsl/deconverge.fx b/hlsl/deconverge.fx index 91c40cb999a..e2e72eb3700 100644 --- a/hlsl/deconverge.fx +++ b/hlsl/deconverge.fx @@ -124,22 +124,22 @@ float4 ps_main(PS_INPUT Input) : COLOR GrnCoord.y = GrnCoord.y - frac(GrnCoord.y); BluCoord.y = BluCoord.y - frac(BluCoord.y); - float RedTexel = tex2D(DiffuseSampler, lerp(TexCoord, RedCoord, Deconverge) / RawDims + 0.5f / float2(RawWidth, RawHeight)).r; - float GrnTexel = tex2D(DiffuseSampler, lerp(TexCoord, GrnCoord, Deconverge) / RawDims + 0.5f / float2(RawWidth, RawHeight)).g; - float BluTexel = tex2D(DiffuseSampler, lerp(TexCoord, BluCoord, Deconverge) / RawDims + 0.5f / float2(RawWidth, RawHeight)).b; + float RedTexel = tex2D(DiffuseSampler, lerp(TexCoord, RedCoord, Deconverge) / RawDims + 0.5f / RawDims).r; + float GrnTexel = tex2D(DiffuseSampler, lerp(TexCoord, GrnCoord, Deconverge) / RawDims + 0.5f / RawDims).g; + float BluTexel = tex2D(DiffuseSampler, lerp(TexCoord, BluCoord, Deconverge) / RawDims + 0.5f / RawDims).b; - RedTexel *= Input.RedCoord.x < (1.0f / TargetWidth) ? 0.0f : 1.0f; - RedTexel *= Input.RedCoord.y < (1.0f / TargetHeight) ? 0.0f : 1.0f; - RedTexel *= Input.RedCoord.x > (1.0f / WidthRatio) ? 0.0f : 1.0f; - RedTexel *= Input.RedCoord.y > (1.0f / HeightRatio) ? 0.0f : 1.0f; - GrnTexel *= Input.GrnCoord.x < (1.0f / TargetWidth) ? 0.0f : 1.0f; - GrnTexel *= Input.GrnCoord.y < (1.0f / TargetHeight) ? 0.0f : 1.0f; - GrnTexel *= Input.GrnCoord.x > (1.0f / WidthRatio) ? 0.0f : 1.0f; - GrnTexel *= Input.GrnCoord.y > (1.0f / HeightRatio) ? 0.0f : 1.0f; - BluTexel *= Input.BluCoord.x < (1.0f / TargetWidth) ? 0.0f : 1.0f; - BluTexel *= Input.BluCoord.y < (1.0f / TargetHeight) ? 0.0f : 1.0f; - BluTexel *= Input.BluCoord.x > (1.0f / WidthRatio) ? 0.0f : 1.0f; - BluTexel *= Input.BluCoord.y > (1.0f / HeightRatio) ? 0.0f : 1.0f; + //RedTexel *= Input.RedCoord.x < (1.0f / TargetWidth) ? 0.0f : 1.0f; + //RedTexel *= Input.RedCoord.y < (1.0f / TargetHeight) ? 0.0f : 1.0f; + //RedTexel *= Input.RedCoord.x > (1.0f / WidthRatio) ? 0.0f : 1.0f; + //RedTexel *= Input.RedCoord.y > (1.0f / HeightRatio) ? 0.0f : 1.0f; + //GrnTexel *= Input.GrnCoord.x < (1.0f / TargetWidth) ? 0.0f : 1.0f; + //GrnTexel *= Input.GrnCoord.y < (1.0f / TargetHeight) ? 0.0f : 1.0f; + //GrnTexel *= Input.GrnCoord.x > (1.0f / WidthRatio) ? 0.0f : 1.0f; + //GrnTexel *= Input.GrnCoord.y > (1.0f / HeightRatio) ? 0.0f : 1.0f; + //BluTexel *= Input.BluCoord.x < (1.0f / TargetWidth) ? 0.0f : 1.0f; + //BluTexel *= Input.BluCoord.y < (1.0f / TargetHeight) ? 0.0f : 1.0f; + //BluTexel *= Input.BluCoord.x > (1.0f / WidthRatio) ? 0.0f : 1.0f; + //BluTexel *= Input.BluCoord.y > (1.0f / HeightRatio) ? 0.0f : 1.0f; return float4(RedTexel, GrnTexel, BluTexel, Alpha); } diff --git a/hlsl/post.fx b/hlsl/post.fx index 2128dc222e1..b79f069ce33 100644 --- a/hlsl/post.fx +++ b/hlsl/post.fx @@ -77,7 +77,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.Color = Input.Color; - Output.TexCoord = Input.TexCoord + 0.5f / float2(RawWidth, RawHeight); + Output.TexCoord = Input.TexCoord + 0.5f / float2(TargetWidth, TargetHeight); //float Zoom = 32.0f; //Output.TexCoord /= Zoom; @@ -150,8 +150,8 @@ float4 ps_main(PS_INPUT Input) : COLOR // -- Alpha Clipping (1px border in drawd3d does not work for some reason) -- 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); + //clip((BaseCoord.x > 1.0f / WidthRatio) ? -1 : 1); + //clip((BaseCoord.y > 1.0f / HeightRatio) ? -1 : 1); // -- Scanline Simulation -- float InnerSine = BaseCoord.y * RawHeight * ScanlineScale + 0.5f;