summaryrefslogtreecommitdiffstatshomepage
path: root/hlsl/post.fx
diff options
context:
space:
mode:
author Ryan Holtz <rholtz@batcountryentertainment.com>2011-05-30 21:10:23 +0000
committer Ryan Holtz <rholtz@batcountryentertainment.com>2011-05-30 21:10:23 +0000
commit796e691522ba5c47fc0610da4f557514563f85b9 (patch)
tree961683497fd1e4d7369da812c579572f880b188a /hlsl/post.fx
parente532e74a8a869af6da71222657f39684210b624e (diff)
HLSL Updates: [Ryan Holtz, Bat Country Entertainment, austere, SoltanGris42]
- Added the ability to render screenshots at arbitrary resolutions. - Added the ability to record AVI videos (albeit with no audio) at arbitrary resolutions. - Added a 43-tap-wide FIR-based NTSC filter with tunable Y, I and Q frequency response. - Updated scanlines to have a user-tunable pixel-height ratio in addition to the current screen-height ratio. - Fixed a VRAM leak that was causing many dynamic-resolution drivers to run out of memory mid-run.
Diffstat (limited to 'hlsl/post.fx')
-rw-r--r--hlsl/post.fx7
1 files changed, 4 insertions, 3 deletions
diff --git a/hlsl/post.fx b/hlsl/post.fx
index ff1cbfa1f47..69ececd4249 100644
--- a/hlsl/post.fx
+++ b/hlsl/post.fx
@@ -99,6 +99,7 @@ uniform float ScanlineScale = 1.0f;
uniform float ScanlineBrightScale = 1.0f;
uniform float ScanlineBrightOffset = 1.0f;
uniform float ScanlineOffset = 1.0f;
+uniform float ScanlineHeight = 0.5f;
uniform float UseShadow = 0.0f;
uniform float ShadowBrightness = 1.0f;
@@ -155,8 +156,8 @@ float4 ps_main(PS_INPUT Input) : COLOR
// -- Scanline Simulation --
float InnerSine = BaseCoord.y * RawHeight * ScanlineScale;
- float3 ScanBrightness = lerp(1.0f, abs(sin(InnerSine * PI + ScanlineOffset * RawHeight)) * ScanlineBrightScale + 1.0f, ScanlineAmount);
- //float3 Scanned = BaseTexel.rgb * ScanBrightness;
+ float ScanBrightMod = sin(InnerSine * PI + ScanlineOffset * RawHeight);
+ float3 ScanBrightness = lerp(1.0f, pow(ScanBrightMod * ScanBrightMod, ScanlineHeight) * ScanlineBrightScale + 1.0f, ScanlineAmount);
float3 Scanned = BaseTexel.rgb * ScanBrightness;
float2 ShadowDims = float2(ShadowWidth, ShadowHeight);
@@ -164,7 +165,7 @@ float4 ps_main(PS_INPUT Input) : COLOR
float2 ShadowMaskSize = float2(ShadowMaskSizeX, ShadowMaskSizeY);
float2 ShadowFrac = frac(BaseCoord * ShadowMaskSize * 0.5f);
float2 ShadowCoord = ShadowFrac * ShadowUV + float2(1.5f / ShadowWidth, 1.5f / ShadowHeight);
- float3 ShadowTexel = lerp(1.0f, tex2D(ShadowSampler, ShadowCoord), UseShadow);
+ 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;