summaryrefslogtreecommitdiffstatshomepage
path: root/hlsl
diff options
context:
space:
mode:
author Ryan Holtz <rholtz@batcountryentertainment.com>2011-05-31 02:04:28 +0000
committer Ryan Holtz <rholtz@batcountryentertainment.com>2011-05-31 02:04:28 +0000
commit37e8c1d7e4ac922dfd94276edf9690efb4ce9aba (patch)
tree0d93de3bc6bddf086a56e503996f5b77092cb2dc /hlsl
parent6bacece8590f644e1f67733c750595c87babd634 (diff)
Fixing some scanline-alignment issues.
Diffstat (limited to 'hlsl')
-rw-r--r--hlsl/phosphor.fx2
-rw-r--r--hlsl/post.fx9
2 files changed, 9 insertions, 2 deletions
diff --git a/hlsl/phosphor.fx b/hlsl/phosphor.fx
index 6fa136b9eb2..aba572743ba 100644
--- a/hlsl/phosphor.fx
+++ b/hlsl/phosphor.fx
@@ -79,7 +79,7 @@ VS_OUTPUT vs_main(VS_INPUT Input)
float2 InvTexSize = float2(1.0f / TargetWidth, 1.0f / TargetHeight);
Output.TexCoord = Input.TexCoord + 0.5f * InvTexSize;
- Output.PrevCoord = Output.TexCoord + 0.5f * InvTexSize;
+ Output.PrevCoord = Input.TexCoord + 0.5f * InvTexSize;
return Output;
}
diff --git a/hlsl/post.fx b/hlsl/post.fx
index d55e6a14ced..41e54118d95 100644
--- a/hlsl/post.fx
+++ b/hlsl/post.fx
@@ -116,6 +116,9 @@ uniform float RedFloor = 0.0f;
uniform float GrnFloor = 0.0f;
uniform float BluFloor = 0.0f;
+uniform float SnapX = 0.0f;
+uniform float SnapY = 0.0f;
+
float4 ps_main(PS_INPUT Input) : COLOR
{
float2 Ratios = float2(WidthRatio, HeightRatio);
@@ -125,7 +128,11 @@ float4 ps_main(PS_INPUT Input) : COLOR
float2 PinUnitCoord = (Input.TexCoord + PinViewpointOffset) * Ratios * 2.0f - 1.0f;
float PincushionR2 = pow(length(PinUnitCoord), 2.0f) / pow(length(Ratios), 2.0f);
float2 PincushionCurve = PinUnitCoord * PincushionAmount * PincushionR2;
- float2 BaseCoord = Input.TexCoord;
+ float2 BaseCoord = Input.TexCoord + float2(0.0f, 0.0f / TargetHeight);
+ BaseCoord.y *= TargetHeight;
+ BaseCoord.y -= frac(BaseCoord.y);
+ BaseCoord.y += 0.5f;
+ BaseCoord.y /= TargetHeight;
BaseCoord -= 0.5f / Ratios;
BaseCoord *= 1.0f - PincushionAmount * Ratios * 0.2f; // Warning: Magic constant
BaseCoord += 0.5f / Ratios;