summaryrefslogtreecommitdiffstatshomepage
path: root/hlsl
diff options
context:
space:
mode:
authorGravatarGravatar Ryan Holtz <rholtz@batcountryentertainment.com>2011-05-24 00:23:40 +0000
committerGravatarGravatar Ryan Holtz <rholtz@batcountryentertainment.com>2011-05-24 00:23:40 +0000
commit6760f6a40c1d98df84e3880005f874582f878c1c (patch)
tree59a887396552a8840ff4535f12d5a817ed7c3936 /hlsl
parent95f06e11a8766e27e7c955e48ea9b84e533624fb (diff)
HLSL bugfxes, nwn
Diffstat (limited to 'hlsl')
-rw-r--r--hlsl/deconverge.fx15
-rw-r--r--hlsl/focus.fx1
2 files changed, 15 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);
}
diff --git a/hlsl/focus.fx b/hlsl/focus.fx
index d5bd17971f1..d84b6b96922 100644
--- a/hlsl/focus.fx
+++ b/hlsl/focus.fx
@@ -92,6 +92,7 @@ VS_OUTPUT vs_main(VS_INPUT Input)
float2 InvTexSize = float2(1.0f / TargetWidth, 1.0f / TargetHeight);
float2 TexCoord = (Input.Position.xy * InvTexSize);
+ TexCoord = TexCoord + 0.5f * InvTexSize;
float2 DefocusVal = float2(DefocusX, DefocusY);
Output.TexCoord0 = TexCoord + Coord0Offset * InvTexSize * DefocusVal;
Output.TexCoord1 = TexCoord + Coord1Offset * InvTexSize * DefocusVal;