diff options
author | 2016-06-06 19:40:10 +0200 | |
---|---|---|
committer | 2016-06-06 19:40:36 +0200 | |
commit | 758aaa496aa546a372fd3f21612395a2dd65826e (patch) | |
tree | 55ebc7870667b32e3a53059e2f23a4833fcaded3 | |
parent | 6e35713b486905bd5b744e17e34592e52fc68ac3 (diff) |
Fixed scanlines if the screen output is less than twice the size of the host source
-rw-r--r-- | bgfx/shaders/dx11/chains/hlsl/fs_post.bin | bin | 3394 -> 3550 bytes | |||
-rw-r--r-- | bgfx/shaders/dx9/chains/hlsl/fs_post.bin | bin | 3015 -> 3135 bytes | |||
-rw-r--r-- | bgfx/shaders/gles/chains/hlsl/fs_post.bin | bin | 4609 -> 5017 bytes | |||
-rw-r--r-- | bgfx/shaders/glsl/chains/hlsl/fs_post.bin | bin | 4384 -> 4769 bytes | |||
-rw-r--r-- | bgfx/shaders/metal/chains/hlsl/fs_post.bin | bin | 5115 -> 5468 bytes | |||
-rw-r--r-- | hlsl/post.fx | 10 | ||||
-rw-r--r-- | src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_post.sc | 8 |
7 files changed, 15 insertions, 3 deletions
diff --git a/bgfx/shaders/dx11/chains/hlsl/fs_post.bin b/bgfx/shaders/dx11/chains/hlsl/fs_post.bin Binary files differindex 740cea66bf5..3aa4cd21700 100644 --- a/bgfx/shaders/dx11/chains/hlsl/fs_post.bin +++ b/bgfx/shaders/dx11/chains/hlsl/fs_post.bin diff --git a/bgfx/shaders/dx9/chains/hlsl/fs_post.bin b/bgfx/shaders/dx9/chains/hlsl/fs_post.bin Binary files differindex cc98415c59f..4cbc9b2fb7b 100644 --- a/bgfx/shaders/dx9/chains/hlsl/fs_post.bin +++ b/bgfx/shaders/dx9/chains/hlsl/fs_post.bin diff --git a/bgfx/shaders/gles/chains/hlsl/fs_post.bin b/bgfx/shaders/gles/chains/hlsl/fs_post.bin Binary files differindex 3969bd47936..185b92fa882 100644 --- a/bgfx/shaders/gles/chains/hlsl/fs_post.bin +++ b/bgfx/shaders/gles/chains/hlsl/fs_post.bin diff --git a/bgfx/shaders/glsl/chains/hlsl/fs_post.bin b/bgfx/shaders/glsl/chains/hlsl/fs_post.bin Binary files differindex 60cc2675a22..eda1c602e9f 100644 --- a/bgfx/shaders/glsl/chains/hlsl/fs_post.bin +++ b/bgfx/shaders/glsl/chains/hlsl/fs_post.bin diff --git a/bgfx/shaders/metal/chains/hlsl/fs_post.bin b/bgfx/shaders/metal/chains/hlsl/fs_post.bin Binary files differindex 2be5d0aaa6e..e261b0e6431 100644 --- a/bgfx/shaders/metal/chains/hlsl/fs_post.bin +++ b/bgfx/shaders/metal/chains/hlsl/fs_post.bin 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); diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_post.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_post.sc index ee2fd0fd148..9d5b99d0546 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_post.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_post.sc @@ -148,7 +148,13 @@ void main() float ColorBrightness = 0.299 * BaseColor.r + 0.587 * BaseColor.g + 0.114 * BaseColor.b; - float ScanCoord = BaseCoord.y * u_source_dims.y * u_scanline_scale.x * 3.1415927; // PI + float ScanCoord = BaseCoord.y; + ScanCoord += u_quad_dims.y <= u_source_dims.y * 2.0f + ? 0.5f / u_quad_dims.y // uncenter scanlines if the quad is less than twice the size of the source + : 0.0f; + + ScanCoord *= u_source_dims.y * u_scanline_scale.x * 3.1415927; // PI + float ScanCoordJitter = u_scanline_jitter.x * u_jitter_amount.x * 1.618034; // PHI float ScanSine = sin(ScanCoord + ScanCoordJitter); float ScanlineWide = u_scanline_height.x + u_scanline_variation.x * max(1.0, u_scanline_height.x) * (1.0 - ColorBrightness); |