From a1f70b0b312fb00ee09beecf8e8f951ea0c3035b Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 22 Jan 2026 14:18:06 +0100 Subject: [PATCH] opengl: attempt to scale vhs effect "fuzzyness" this makes it appear more or less the same in all resolutions, similar to software, while also improving performance quite a bit on higher resolutions --- src/hardware/r_opengl/r_opengl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 0caf50636..8bc68d15e 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -3605,8 +3605,10 @@ void GL_RenderVhsEffect(fixed_t upbary, fixed_t downbary, UINT8 updistort, UINT8 uint32_t r = rand(); - const float stride = 2.f/scrwh; - for (i = 0; i < 1; i += stride) + const float dup = min(scrwf / BASEVIDWIDTH, scrwh / BASEVIDHEIGHT); + const float ystep = 2.f/scrwh * dup/4.f; + + for (i = 0; i < 1; i += ystep) { // avoid calling rand thousands of times r ^= r >> 13;