diff options
author | Bojidar Marinov <bojidar.marinov.bg@gmail.com> | 2019-07-18 19:31:45 +0300 |
---|---|---|
committer | Bojidar Marinov <bojidar.marinov.bg@gmail.com> | 2019-07-18 19:31:45 +0300 |
commit | bdffdd7e38354c66f0ec34db56bd249854949e70 (patch) | |
tree | 6cd43160b12db73948d766805815fb175ecd7621 | |
parent | 22c843b0c451a0c3d79a3b3e6af900b841c51c12 (diff) |
Fix binormal sign when using triplanar mapping
Fixes #30671
-rw-r--r-- | scene/resources/material.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 197ff14b38..5372a69079 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -691,9 +691,9 @@ void SpatialMaterial::_update_shader() { code += "\tTANGENT+= vec3(1.0,0.0,0.0) * abs(NORMAL.z);\n"; code += "\tTANGENT = normalize(TANGENT);\n"; - code += "\tBINORMAL = vec3(0.0,1.0,0.0) * abs(NORMAL.x);\n"; - code += "\tBINORMAL+= vec3(0.0,0.0,-1.0) * abs(NORMAL.y);\n"; - code += "\tBINORMAL+= vec3(0.0,1.0,0.0) * abs(NORMAL.z);\n"; + code += "\tBINORMAL = vec3(0.0,-1.0,0.0) * abs(NORMAL.x);\n"; + code += "\tBINORMAL+= vec3(0.0,0.0,1.0) * abs(NORMAL.y);\n"; + code += "\tBINORMAL+= vec3(0.0,-1.0,0.0) * abs(NORMAL.z);\n"; code += "\tBINORMAL = normalize(BINORMAL);\n"; } |