Merge pull request #30683 from bojidar-bg/30671-triplanar-binormal

Fix binormal sign when using triplanar mapping
This commit is contained in:
Rémi Verschelde 2019-07-19 11:22:59 +02:00 committed by GitHub
commit b79303d39a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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