From a4bef7d4be5708dfa244b3b4c438644cc6564986 Mon Sep 17 00:00:00 2001 From: IntegratedQuantum Date: Tue, 12 Sep 2023 17:01:48 +0200 Subject: [PATCH] Fix backface textures. --- assets/cubyz/shaders/chunks/transparent_fragment.fs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/cubyz/shaders/chunks/transparent_fragment.fs b/assets/cubyz/shaders/chunks/transparent_fragment.fs index 275fc49f..8ae88fca 100644 --- a/assets/cubyz/shaders/chunks/transparent_fragment.fs +++ b/assets/cubyz/shaders/chunks/transparent_fragment.fs @@ -221,7 +221,8 @@ void main() { // Apply the texture: vec4 textureColor = texture(texture_sampler, vec3(getTextureCoordsNormal(startPosition/16, faceNormal), textureIndex))*vec4(ambientLight*normalVariation, 1); blendColor.rgb = vec3(1 - textureColor.a); - fragColor.rgb += textureColor.rgb*textureColor.a; + fragColor.rgb *= blendColor.rgb; + fragColor.rgb += textureColor.rgb*textureColor.a*fragColor.a; // Apply the block fog: applyBackfaceFog(fogDistance, fogColor);