1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-05 19:31:35 +00:00

Fix flipped binormal in StandardMaterial3D triplanar mapping

This made normal maps on triplanar materials use an inverted Y direction
compared to non-triplanar materials.
This commit is contained in:
Hugo Locurcio
2021-06-27 16:28:57 +02:00
parent 92f7504637
commit 9a4c76ea12

View File

@@ -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";
}