From a37b7858b0a39c06d83f6076fa88c886bdc71dcd Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 22 Jan 2026 13:27:02 +0100 Subject: [PATCH] try to make the downsample shader less blurry still a bit funky but whatever lel --- src/hardware/hw_shaders.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/hardware/hw_shaders.h b/src/hardware/hw_shaders.h index fc3642b21..cc6fdc4a9 100644 --- a/src/hardware/hw_shaders.h +++ b/src/hardware/hw_shaders.h @@ -82,14 +82,12 @@ "void main(void) {\n" \ "vec2 uv = gl_TexCoord[0].st;\n" \ "vec2 texel_size = 1.0 / textureSize(tex, 0);\n" \ - "vec2 offset1 = vec2(texel_size.x * inv_supersamplefactor.x, texel_size.y * inv_supersamplefactor.y);\n" \ - "vec2 offset2 = vec2(-texel_size.x * inv_supersamplefactor.x, texel_size.y * inv_supersamplefactor.y);\n" \ - "vec2 offset3 = vec2(texel_size.x * inv_supersamplefactor.x, -texel_size.y * inv_supersamplefactor.y);\n" \ - "vec2 offset4 = vec2(-texel_size.x * inv_supersamplefactor.x, -texel_size.y * inv_supersamplefactor.y);\n" \ - "vec4 color1 = texture2D(tex, uv + offset1);\n" \ - "vec4 color2 = texture2D(tex, uv + offset2);\n" \ - "vec4 color3 = texture2D(tex, uv + offset3);\n" \ - "vec4 color4 = texture2D(tex, uv + offset4);\n" \ + "float blur = min(inv_supersamplefactor.x, inv_supersamplefactor.y) * 0.005;\n" \ + "vec2 offset = texel_size * blur;\n" \ + "vec4 color1 = texture2D(tex, uv + vec2(offset.x, offset.y));\n" \ + "vec4 color2 = texture2D(tex, uv + vec2(-offset.x, offset.y));\n" \ + "vec4 color3 = texture2D(tex, uv + vec2(offset.x, -offset.y));\n" \ + "vec4 color4 = texture2D(tex, uv + vec2(-offset.x, -offset.y));\n" \ "vec4 blurred_color = (color1 + color2 + color3 + color4) * 0.25;\n" \ "#ifdef SRB2_PALETTE_RENDERING\n" \ "float tex_pal_idx = texture3D(palette_lookup_tex, vec3((blurred_color.rgb * 63.0 + 0.5) / 64.0))[0] * 255.0;\n" \