summaryrefslogtreecommitdiffstatshomepage
path: root/hlsl
diff options
context:
space:
mode:
author Ryan Holtz <rholtz@batcountryentertainment.com>2011-05-28 14:14:05 +0000
committer Ryan Holtz <rholtz@batcountryentertainment.com>2011-05-28 14:14:05 +0000
commit244eb4cf248f642c4ab572af923c4b902ebc7ebf (patch)
treedfcf6ce1dc13d6012bee0cef7708b45563986539 /hlsl
parent75f1480ae9499ba59f9f1ac9d2bbdf77230591f8 (diff)
No whatnsew: Really, really, really fixed the remaining pixel alignment and UV clamping issues. Tested Gradius, Pac-Man, Mr. Do, and Stompin' with no observed issues. Gradius, in particular, is a good test case as the bottom row of its "Credits" readout lies on the bottom row of pixels, and the scrolling starfield allows visual verification of the X extents as they scroll on and off.
Diffstat (limited to 'hlsl')
-rw-r--r--hlsl/color.fx2
-rw-r--r--hlsl/deconverge.fx24
-rw-r--r--hlsl/phosphor.fx2
-rw-r--r--hlsl/post.fx10
4 files changed, 19 insertions, 19 deletions
diff --git a/hlsl/color.fx b/hlsl/color.fx
index a980b47614e..6832d8b1d03 100644
--- a/hlsl/color.fx
+++ b/hlsl/color.fx
@@ -67,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 + 0.5f * invDims;
+ Output.TexCoord = Input.TexCoord + float2(0.5f, 0.5f) * invDims;
return Output;
}
diff --git a/hlsl/deconverge.fx b/hlsl/deconverge.fx
index e2e72eb3700..a65f06bbe92 100644
--- a/hlsl/deconverge.fx
+++ b/hlsl/deconverge.fx
@@ -128,18 +128,18 @@ float4 ps_main(PS_INPUT Input) : COLOR
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 < (WidthRatio / RawWidth) ? 0.0f : 1.0f;
+ //RedTexel *= Input.RedCoord.y < (HeightRatio / RawHeight) ? 0.0f : 1.0f;
+ //RedTexel *= Input.RedCoord.x > (1.0f / WidthRatio + 1.0f / RawWidth) ? 0.0f : 1.0f;
+ //RedTexel *= Input.RedCoord.y > (1.0f / HeightRatio + 1.0f / RawHeight) ? 0.0f : 1.0f;
+ //GrnTexel *= Input.GrnCoord.x < (WidthRatio / RawWidth) ? 0.0f : 1.0f;
+ //GrnTexel *= Input.GrnCoord.y < (HeightRatio / RawHeight) ? 0.0f : 1.0f;
+ //GrnTexel *= Input.GrnCoord.x > (1.0f / WidthRatio + 1.0f / RawWidth) ? 0.0f : 1.0f;
+ //GrnTexel *= Input.GrnCoord.y > (1.0f / HeightRatio + 1.0f / RawHeight) ? 0.0f : 1.0f;
+ //BluTexel *= Input.BluCoord.x < (WidthRatio / RawWidth) ? 0.0f : 1.0f;
+ //BluTexel *= Input.BluCoord.y < (HeightRatio / RawHeight) ? 0.0f : 1.0f;
+ //BluTexel *= Input.BluCoord.x > (1.0f / WidthRatio + 1.0f / RawWidth) ? 0.0f : 1.0f;
+ //BluTexel *= Input.BluCoord.y > (1.0f / HeightRatio + 1.0f / RawHeight) ? 0.0f : 1.0f;
return float4(RedTexel, GrnTexel, BluTexel, Alpha);
}
diff --git a/hlsl/phosphor.fx b/hlsl/phosphor.fx
index 6512cc4739a..6fa136b9eb2 100644
--- a/hlsl/phosphor.fx
+++ b/hlsl/phosphor.fx
@@ -78,7 +78,7 @@ VS_OUTPUT vs_main(VS_INPUT Input)
Output.Color = Input.Color;
float2 InvTexSize = float2(1.0f / TargetWidth, 1.0f / TargetHeight);
- Output.TexCoord = Input.TexCoord + 0.5f * InvTexSize;
+ Output.TexCoord = Input.TexCoord + 0.5f * InvTexSize;
Output.PrevCoord = Output.TexCoord + 0.5f * InvTexSize;
return Output;
diff --git a/hlsl/post.fx b/hlsl/post.fx
index a02c3c6e97b..ff1cbfa1f47 100644
--- a/hlsl/post.fx
+++ b/hlsl/post.fx
@@ -148,13 +148,13 @@ 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((BaseCoord.x < WidthRatio / RawWidth) ? -1 : 1);
- clip((BaseCoord.y < HeightRatio / RawHeight) ? -1 : 1);
- clip((BaseCoord.x > (1.0f / WidthRatio + 1.0f / RawWidth + 1.0f / TargetWidth)) ? -1 : 1);
- clip((BaseCoord.y > (1.0f / HeightRatio + 1.0f / RawHeight + 1.0f / TargetHeight)) ? -1 : 1);
+ clip((BaseCoord.x < 1.0f / RawWidth) ? -1 : 1);
+ clip((BaseCoord.y < 1.0f / 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 --
- float InnerSine = BaseCoord.y * RawHeight * ScanlineScale + 0.5f;
+ float InnerSine = BaseCoord.y * RawHeight * ScanlineScale;
float3 ScanBrightness = lerp(1.0f, abs(sin(InnerSine * PI + ScanlineOffset * RawHeight)) * ScanlineBrightScale + 1.0f, ScanlineAmount);
//float3 Scanned = BaseTexel.rgb * ScanBrightness;
float3 Scanned = BaseTexel.rgb * ScanBrightness;