diff --git a/bgfx/shaders/dx11/chains/hlsl/fs_post.bin b/bgfx/shaders/dx11/chains/hlsl/fs_post.bin index 740cea66bf5..3aa4cd21700 100644 Binary files a/bgfx/shaders/dx11/chains/hlsl/fs_post.bin and b/bgfx/shaders/dx11/chains/hlsl/fs_post.bin differ diff --git a/bgfx/shaders/dx9/chains/hlsl/fs_post.bin b/bgfx/shaders/dx9/chains/hlsl/fs_post.bin index cc98415c59f..4cbc9b2fb7b 100644 Binary files a/bgfx/shaders/dx9/chains/hlsl/fs_post.bin and b/bgfx/shaders/dx9/chains/hlsl/fs_post.bin differ diff --git a/bgfx/shaders/gles/chains/hlsl/fs_post.bin b/bgfx/shaders/gles/chains/hlsl/fs_post.bin index 3969bd47936..185b92fa882 100644 Binary files a/bgfx/shaders/gles/chains/hlsl/fs_post.bin and b/bgfx/shaders/gles/chains/hlsl/fs_post.bin differ diff --git a/bgfx/shaders/glsl/chains/hlsl/fs_post.bin b/bgfx/shaders/glsl/chains/hlsl/fs_post.bin index 60cc2675a22..eda1c602e9f 100644 Binary files a/bgfx/shaders/glsl/chains/hlsl/fs_post.bin and b/bgfx/shaders/glsl/chains/hlsl/fs_post.bin differ diff --git a/bgfx/shaders/metal/chains/hlsl/fs_post.bin b/bgfx/shaders/metal/chains/hlsl/fs_post.bin index 2be5d0aaa6e..e261b0e6431 100644 Binary files a/bgfx/shaders/metal/chains/hlsl/fs_post.bin and b/bgfx/shaders/metal/chains/hlsl/fs_post.bin differ 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);