summaryrefslogtreecommitdiffstatshomepage
path: root/hlsl/post.fx
diff options
context:
space:
mode:
author Ryan Holtz <rholtz@batcountryentertainment.com>2011-06-06 21:25:38 +0000
committer Ryan Holtz <rholtz@batcountryentertainment.com>2011-06-06 21:25:38 +0000
commit1ec454197a94b693b67f8b9d8bb702288b1478fe (patch)
tree9010ee023db94a28dde5ac5f5d5edaa5e38beb58 /hlsl/post.fx
parent1d33744bd45f67fd1bd6f1a71aaa42db5d49a138 (diff)
HLSL Updates: [Ryan Holtz, Bat Country Entertainment, austere]
- Reworked default shadow mask settings, eliminating rainbow banding and matching reference shots more closely - Moved color power to occur after shadow mask, as it is intended to simulate nonlinear phosphor response - Added a variable-width notch filter to the Y channel in NTSC post-processing, eliminating luma banding on e.g. CoCo 2 and Apple II
Diffstat (limited to 'hlsl/post.fx')
-rw-r--r--hlsl/post.fx10
1 files changed, 9 insertions, 1 deletions
diff --git a/hlsl/post.fx b/hlsl/post.fx
index 6a148637805..eee6aaa4798 100644
--- a/hlsl/post.fx
+++ b/hlsl/post.fx
@@ -119,6 +119,10 @@ uniform float BluFloor = 0.0f;
uniform float SnapX = 0.0f;
uniform float SnapY = 0.0f;
+uniform float RedPower = 2.2f;
+uniform float GrnPower = 2.2f;
+uniform float BluPower = 2.2f;
+
float4 ps_main(PS_INPUT Input) : COLOR
{
float2 Ratios = float2(WidthRatio, HeightRatio);
@@ -174,13 +178,17 @@ float4 ps_main(PS_INPUT Input) : COLOR
float2 ShadowDims = float2(ShadowWidth, ShadowHeight);
float2 ShadowUV = float2(ShadowU, ShadowV);
float2 ShadowMaskSize = float2(ShadowMaskSizeX, ShadowMaskSizeY);
- float2 ShadowFrac = frac(BaseCoord * ShadowMaskSize * 0.5f);
+ float2 ShadowFrac = frac(BaseCoord * ShadowMaskSize);
float2 ShadowCoord = ShadowFrac * ShadowUV + float2(1.5f / ShadowWidth, 1.5f / ShadowHeight);
float3 ShadowTexel = lerp(1.0f, tex2D(ShadowSampler, ShadowCoord).rgb, UseShadow);
// -- Final Pixel --
float4 Output = float4(Scanned * lerp(1.0f, ShadowTexel, ShadowBrightness), BaseTexel.a) * Input.Color;
+ Output.r = pow(Output.r, RedPower);
+ Output.g = pow(Output.g, GrnPower);
+ Output.b = pow(Output.b, BluPower);
+
return Output;
}