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

shader-uid
crashGG 3 months ago committed by GitHub
parent 39cb9af981
commit e6694d1e23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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

Loading…
Cancel
Save