mirror of
https://github.com/stenzek/duckstation.git
synced 2026-07-08 17:46:19 +00:00
Fix scanline flicker caused by precision drift at boundaries (#3758)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user