From c09b5cd467c9c0d5815b0ee1930805d37003092c Mon Sep 17 00:00:00 2001 From: izzy2lost Date: Thu, 15 Jan 2026 17:24:50 -0500 Subject: [PATCH] fix textures around trees and other objects --- Src/Graphics/New3D/R3DShaderTriangles.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Src/Graphics/New3D/R3DShaderTriangles.h b/Src/Graphics/New3D/R3DShaderTriangles.h index 52e8455..f320b82 100644 --- a/Src/Graphics/New3D/R3DShaderTriangles.h +++ b/Src/Graphics/New3D/R3DShaderTriangles.h @@ -58,20 +58,21 @@ out vec4 oColor; void main() { vec4 col = vColor; + vec4 tex = vec4(1.0); if (textureEnabled != 0) { - vec4 t = texture(tex1, vTexCoord); + tex = texture(tex1, vTexCoord); if (textureAlpha != 0) { - col *= t; + col *= tex; } else { - col.rgb *= t.rgb; + col.rgb *= tex.rgb; } } // keep vDummy "used" col.rgb += vDummy * 0.0; - if (alphaTest != 0 && col.a < 0.5) discard; + if (alphaTest != 0 && tex.a < (32.0/255.0)) discard; if (discardAlpha != 0 && col.a < 0.99) discard; oColor = col;