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:
parent
e0223edafc
commit
747450a777
|
@ -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";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue