summaryrefslogtreecommitdiffstatshomepage
path: root/hlsl
diff options
context:
space:
mode:
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;