summaryrefslogtreecommitdiffstatshomepage
path: root/hlsl
diff options
context:
space:
mode:
author ImJezze <jezze@gmx.net>2016-06-06 19:40:10 +0200
committer ImJezze <jezze@gmx.net>2016-06-06 19:40:36 +0200
commit758aaa496aa546a372fd3f21612395a2dd65826e (patch)
tree55ebc7870667b32e3a53059e2f23a4833fcaded3 /hlsl
parent6e35713b486905bd5b744e17e34592e52fc68ac3 (diff)
Fixed scanlines if the screen output is less than twice the size of the host source
Diffstat (limited to 'hlsl')
-rw-r--r--hlsl/post.fx10
1 files changed, 8 insertions, 2 deletions
diff --git a/hlsl/post.fx b/hlsl/post.fx
index eddc4bb8da5..93a871a629a 100644
--- a/hlsl/post.fx
+++ b/hlsl/post.fx
@@ -98,7 +98,7 @@ VS_OUTPUT vs_main(VS_INPUT Input)
Output.TexCoord = Input.TexCoord;
Output.TexCoord += PrepareBloom
- ? 0.0f / TargetDims // use half texel offset (DX9) to do the blur for first bloom layer
+ ? 0.0f // use half texel offset (DX9) to do the blur for first bloom layer
: 0.5f / TargetDims; // fix half texel offset (DX9)
Output.ScreenCoord = Input.Position.xy / ScreenDims;
@@ -252,7 +252,13 @@ float4 ps_main(PS_INPUT Input) : COLOR
float ColorBrightness = 0.299f * BaseColor.r + 0.587f * BaseColor.g + 0.114 * BaseColor.b;
- float ScanlineCoord = SourceCoord.y * SourceDims.y * ScanlineScale * PI;
+ float ScanlineCoord = SourceCoord.y;
+ ScanlineCoord += QuadDims.y <= SourceDims.y * 2.0f
+ ? 0.5f / QuadDims.y // uncenter scanlines if the quad is less than twice the size of the source
+ : 0.0f;
+
+ ScanlineCoord *= SourceDims.y * ScanlineScale * PI;
+
float ScanlineCoordJitter = ScanlineOffset * PHI;
float ScanlineSine = sin(ScanlineCoord + ScanlineCoordJitter);
float ScanlineWide = ScanlineHeight + ScanlineVariation * max(1.0f, ScanlineHeight) * (1.0f - ColorBrightness);