diff options
Diffstat (limited to 'hlsl/post.fx')
-rw-r--r-- | hlsl/post.fx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/hlsl/post.fx b/hlsl/post.fx index c9bd0f79b04..4186e040e47 100644 --- a/hlsl/post.fx +++ b/hlsl/post.fx @@ -154,18 +154,19 @@ float4 ps_main(PS_INPUT Input) : COLOR clip((BaseCoord.y > (1.0f / HeightRatio + 1.0f / RawHeight)) ? -1 : 1); // -- Scanline Simulation -- - float3 ScanBrightness = lerp(1.0f, abs(sin(((BaseCoord.y * Ratios.y * RawHeight * ScanlineScale) * PI + ScanlineOffset * RawHeight))) * ScanlineBrightScale + ScanlineBrightOffset, ScanlineAmount); + float InnerSine = BaseCoord.y * RawHeight * ScanlineScale + 0.5f; + float3 ScanBrightness = lerp(1.0f, sin(InnerSine * PI * 2.0f + ScanlineOffset * RawHeight) * ScanlineBrightScale + 1.0f, ScanlineAmount); float3 Scanned = BaseTexel.rgb * ScanBrightness; float2 ShadowDims = float2(ShadowWidth, ShadowHeight); float2 ShadowUV = float2(ShadowU, ShadowV); float2 ShadowMaskSize = float2(ShadowMaskSizeX, ShadowMaskSizeY); - float2 ShadowFrac = frac(ScreenCurveCoord * ShadowMaskSize * Ratios * 0.5f); + float2 ShadowFrac = frac((ScreenCurveCoord * ShadowMaskSize * 0.5f) / Ratios); float2 ShadowCoord = ShadowFrac * ShadowUV + 1.5f / ShadowDims; float3 ShadowTexel = lerp(1.0f, tex2D(ShadowSampler, ShadowCoord), UseShadow); // -- Final Pixel -- - float4 Output = float4(Scanned * lerp(1.0f, ShadowTexel * 1.25f, ShadowBrightness), BaseTexel.a) * Input.Color; + float4 Output = float4(Scanned * lerp(1.0f, ShadowTexel, ShadowBrightness), BaseTexel.a) * Input.Color; return Output; } |