diff options
author | Ryan Holtz <rholtz@batcountryentertainment.com> | 2011-05-24 00:23:40 +0000 |
---|---|---|
committer | Ryan Holtz <rholtz@batcountryentertainment.com> | 2011-05-24 00:23:40 +0000 |
commit | 6760f6a40c1d98df84e3880005f874582f878c1c (patch) | |
tree | 59a887396552a8840ff4535f12d5a817ed7c3936 /hlsl/deconverge.fx | |
parent | 95f06e11a8766e27e7c955e48ea9b84e533624fb (diff) |
HLSL bugfxes, nwn
Diffstat (limited to 'hlsl/deconverge.fx')
-rw-r--r-- | hlsl/deconverge.fx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/hlsl/deconverge.fx b/hlsl/deconverge.fx index 5b46ca1ddb6..c5630666918 100644 --- a/hlsl/deconverge.fx +++ b/hlsl/deconverge.fx @@ -112,12 +112,25 @@ float4 ps_main(PS_INPUT Input) : COLOR float2 MagnetCenter = float2(0.9f / WidthRatio, 0.9f / HeightRatio); float MagnetDistance = length((MagnetCenter - Input.TexCoord) * float2(WidthRatio, HeightRatio)); float Deconverge = 1.0f - MagnetDistance / MagnetCenter; - Deconverge = clamp(Deconverge, 0.0f, 1.0f); + Deconverge = 1.0f;//clamp(Deconverge, 0.0f, 1.0f); float Alpha = tex2D(DiffuseSampler, Input.TexCoord).a; float RedTexel = tex2D(DiffuseSampler, lerp(Input.TexCoord, Input.RedCoord, Deconverge) + 0.5f / float2(RawWidth, RawHeight)).r; float GrnTexel = tex2D(DiffuseSampler, lerp(Input.TexCoord, Input.GrnCoord, Deconverge) + 0.5f / float2(RawWidth, RawHeight)).g; float BluTexel = tex2D(DiffuseSampler, lerp(Input.TexCoord, Input.BluCoord, Deconverge) + 0.5f / float2(RawWidth, RawHeight)).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; + return float4(RedTexel, GrnTexel, BluTexel, Alpha); } |