Fix scanline flicker caused by precision drift at boundaries (#3758)

This commit is contained in:
crashGG
2026-06-23 05:19:15 +03:00
committed by GitHub
parent 39cb9af981
commit e6694d1e23

View File

@@ -68,7 +68,7 @@ float4 PS_SCANLINE4x2(float4 vpos : SV_POSITION, float2 texcoord : TEXCOORD0) :
// Square wave generator: 1-pixel phase shift on Y-axis to form a -1, +1, +1, -1 pattern
float2 freq = float2(0.5, 0.25) * float2(BUFFER_WIDTH, BUFFER_HEIGHT);
float2 phase = frac(texYplus1 * freq);
float2 phase = frac(texYplus1 * freq +0.01); // +0.01 to avoid precision drift at boundaries
float2 wave = step(0.5, phase) * 2.0 - 1.0;
// Scanline edge detection