Skip to content

Commit

Permalink
Merge pull request #49950 from Calinou/spatialmaterial-fix-triplanar-…
Browse files Browse the repository at this point in the history
…binormal

Fix flipped binormal in SpatialMaterial triplanar mapping (3.x)
  • Loading branch information
akien-mga authored Jun 28, 2021
2 parents 3a8bea3 + 11033be commit 109df27
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scene/resources/material.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

Expand Down

0 comments on commit 109df27

Please sign in to comment.