summaryrefslogtreecommitdiffstatshomepage
path: root/hlsl
diff options
context:
space:
mode:
author Ryan Holtz <rholtz@batcountryentertainment.com>2011-05-31 13:53:25 +0000
committer Ryan Holtz <rholtz@batcountryentertainment.com>2011-05-31 13:53:25 +0000
commitf42b5ccda0d819869951538876e8cb8a0433d77b (patch)
tree0e82d407707cfcc4192e7c19e9bed704ea9e7b25 /hlsl
parent7418f28a638b43aadccc5149340817eca5a69486 (diff)
No whatsnew
Attempting to fix the HLSL 'blurriness' reported by a few people. Now HLSL will auto-prescale to the nearest texture size that is greater than the target screen size on both axes and is also an even multiple of the raw bitmap's size.
Diffstat (limited to 'hlsl')
-rw-r--r--hlsl/deconverge.fx4
-rw-r--r--hlsl/phosphor.fx4
-rw-r--r--hlsl/post.fx2
-rw-r--r--hlsl/prescale.fx3
4 files changed, 7 insertions, 6 deletions
diff --git a/hlsl/deconverge.fx b/hlsl/deconverge.fx
index bb56c56274b..38651a060d4 100644
--- a/hlsl/deconverge.fx
+++ b/hlsl/deconverge.fx
@@ -117,8 +117,8 @@ float4 ps_main(PS_INPUT Input) : COLOR
Deconverge = 1.0f;//clamp(Deconverge, 0.0f, 1.0f);
float Alpha = tex2D(DiffuseSampler, Input.TexCoord).a;
- float2 TargetDims = float2(RawWidth * Prescale, RawHeight * Prescale);
- float2 DimOffset = 0.5f / TargetDims;
+ float2 TargetDims = float2(RawWidth, RawHeight);
+ float2 DimOffset = 0.0f / TargetDims;
float2 TexCoord = Input.TexCoord;
float2 RedCoord = Input.RedCoord;
float2 GrnCoord = Input.GrnCoord;
diff --git a/hlsl/phosphor.fx b/hlsl/phosphor.fx
index 5f94828dfc3..d7d50f8efab 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 = Input.TexCoord;// + 0.5f * InvTexSize;
+ Output.PrevCoord = Output.TexCoord;
return Output;
}
@@ -101,7 +101,7 @@ float4 ps_main(PS_INPUT Input) : COLOR
float GreenMax = max(CurrPix.g, PrevPix.g);
float BlueMax = max(CurrPix.b, PrevPix.b);
- return CurrPix;//float4(RedMax, GreenMax, BlueMax, CurrPix.a);
+ return float4(RedMax, GreenMax, BlueMax, CurrPix.a);
}
//-----------------------------------------------------------------------------
diff --git a/hlsl/post.fx b/hlsl/post.fx
index b3c793e197f..6a148637805 100644
--- a/hlsl/post.fx
+++ b/hlsl/post.fx
@@ -129,7 +129,7 @@ float4 ps_main(PS_INPUT Input) : COLOR
float PincushionR2 = pow(length(PinUnitCoord), 2.0f) / pow(length(Ratios), 2.0f);
float2 PincushionCurve = PinUnitCoord * PincushionAmount * PincushionR2;
float2 BaseCoord = Input.TexCoord;
- float2 ScanCoord = BaseCoord - 0.5f / (float2(RawWidth, RawHeight) * Ratios);
+ float2 ScanCoord = BaseCoord - 0.5f / float2(TargetWidth, TargetHeight);
BaseCoord -= 0.5f / Ratios;
BaseCoord *= 1.0f - PincushionAmount * Ratios * 0.2f; // Warning: Magic constant
diff --git a/hlsl/prescale.fx b/hlsl/prescale.fx
index 633b0872d48..6b3dff8d058 100644
--- a/hlsl/prescale.fx
+++ b/hlsl/prescale.fx
@@ -72,7 +72,8 @@ float4 ps_main(PS_INPUT Input) : COLOR
{
float2 RawDims = float2(RawWidth, RawHeight);
float2 TexCoord = Input.TexCoord * RawDims;
- TexCoord -= frac(float2(0.0f, TexCoord.y));
+ TexCoord -= frac(TexCoord);
+ TexCoord += 0.5f;
TexCoord /= RawDims;
float4 Center = tex2D(DiffuseSampler, TexCoord);