Skip to content

Commit bf8edd2

Browse files
committed
Fix bent normal maps not working with triplanar UVs
1 parent 03bd8ba commit bf8edd2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scene/resources/material.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1745,8 +1745,12 @@ void fragment() {)";
17451745
if (features[FEATURE_BENT_NORMAL_MAPPING]) {
17461746
code += R"(
17471747
// Bent Normal Map: Enabled
1748-
BENT_NORMAL_MAP = texture(texture_bent_normal, base_uv).rgb;
17491748
)";
1749+
if (flags[FLAG_UV1_USE_TRIPLANAR]) {
1750+
code += " BENT_NORMAL_MAP = triplanar_texture(texture_bent_normal, uv1_power_normal, uv1_triplanar_pos).rgb;\n";
1751+
} else {
1752+
code += " BENT_NORMAL_MAP = texture(texture_bent_normal, base_uv).rgb;\n";
1753+
}
17501754
}
17511755

17521756
if (features[FEATURE_EMISSION]) {

0 commit comments

Comments
 (0)