diff options
author | 2011-05-31 02:04:28 +0000 | |
---|---|---|
committer | 2011-05-31 02:04:28 +0000 | |
commit | 37e8c1d7e4ac922dfd94276edf9690efb4ce9aba (patch) | |
tree | 0d93de3bc6bddf086a56e503996f5b77092cb2dc /hlsl/post.fx | |
parent | 6bacece8590f644e1f67733c750595c87babd634 (diff) |
Fixing some scanline-alignment issues.
Diffstat (limited to 'hlsl/post.fx')
-rw-r--r-- | hlsl/post.fx | 9 |
1 files changed, 8 insertions, 1 deletions
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; |