try to make the downsample shader less blurry
still a bit funky but whatever lel
This commit is contained in:
1 parent
53dead76fd
commit
a37b7858b0
1 file changed
+6
-8
@@ -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" \
|
||||
|
||||
Reference in new issue
Block a user