summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Ryan Holtz <rholtz@batcountryentertainment.com>2011-05-23 15:49:50 +0000
committer Ryan Holtz <rholtz@batcountryentertainment.com>2011-05-23 15:49:50 +0000
commitf8a449539a149eb3d9aceeab2f4f49e5905319e7 (patch)
tree1afd3a7879b5d7e16d5abcb5b352d3c439822416
parentb756d28cb28584832d6842445c442e9f3d0392f1 (diff)
Hopefully fixing the HLSL UV issue once and for all, nw
-rw-r--r--hlsl/color.fx2
-rw-r--r--hlsl/post.fx13
2 files changed, 8 insertions, 7 deletions
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);