From bf8edd2c2adb973636e425db75931ad145f491fe Mon Sep 17 00:00:00 2001 From: Capry Date: Thu, 12 Jun 2025 14:40:14 +0200 Subject: [PATCH] Fix bent normal maps not working with triplanar UVs --- scene/resources/material.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 12796edfd00..a7d5693f185 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -1745,8 +1745,12 @@ void fragment() {)"; if (features[FEATURE_BENT_NORMAL_MAPPING]) { code += R"( // Bent Normal Map: Enabled - BENT_NORMAL_MAP = texture(texture_bent_normal, base_uv).rgb; )"; + if (flags[FLAG_UV1_USE_TRIPLANAR]) { + code += " BENT_NORMAL_MAP = triplanar_texture(texture_bent_normal, uv1_power_normal, uv1_triplanar_pos).rgb;\n"; + } else { + code += " BENT_NORMAL_MAP = texture(texture_bent_normal, base_uv).rgb;\n"; + } } if (features[FEATURE_EMISSION]) {