Fix flipped binormal in SpatialMaterial 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:32:03 +02:00
parent 3a8bea3ae3
commit 11033be5c6
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C

View file

@ -702,9 +702,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";
}