diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2021-06-27 16:28:57 +0200 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2021-06-27 16:28:57 +0200 |
commit | 9a4c76ea1211dff442081219d1e1becc111e3018 (patch) | |
tree | 0f12c081151a4ba9f8dfb13960e2c98ad2219c96 /scene/resources | |
parent | 92f75046378a63b46946e8acbd7c224f027ebfa5 (diff) |
Fix flipped binormal in StandardMaterial3D triplanar mapping
This made normal maps on triplanar materials use an inverted Y direction
compared to non-triplanar materials.
Diffstat (limited to 'scene/resources')
-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 7027319554..092aba8b33 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -822,9 +822,9 @@ void BaseMaterial3D::_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"; } |