Fix flipped binormal in SpatialMaterial triplanar mapping

This made normal maps on triplanar materials use an inverted Y direction
compared to non-triplanar materials.

(cherry picked from commit 11033be5c6)
This commit is contained in:
Hugo Locurcio 2021-06-27 16:32:03 +02:00 committed by Rémi Verschelde
parent e0223edafc
commit 747450a777
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

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