summaryrefslogtreecommitdiff
path: root/scene/resources/material.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-12-11 15:21:43 +0100
committerGitHub <noreply@github.com>2018-12-11 15:21:43 +0100
commit55089d0b1aa6342ca5836bbd196cbc6e6ba9d23f (patch)
tree468c20f39f4a164261bd89a40e77f0141aa05a6c /scene/resources/material.cpp
parent244cc11edd7ba5cae95a909ada2fec207631ffc8 (diff)
parentfa63a0fe835868148c9ac6ab9a3f260928155c70 (diff)
Merge pull request #24224 from BastiaanOlij/flip_bitangent
Reverse bitangent on everythings
Diffstat (limited to 'scene/resources/material.cpp')
-rw-r--r--scene/resources/material.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp
index 5327ed318f..fa8c927813 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -699,7 +699,7 @@ void SpatialMaterial::_update_shader() {
if (features[FEATURE_DEPTH_MAPPING] && !flags[FLAG_UV1_USE_TRIPLANAR]) { //depthmap not supported with triplanar
code += "\t{\n";
- code += "\t\tvec3 view_dir = normalize(normalize(-VERTEX)*mat3(TANGENT*depth_flip.x,BINORMAL*depth_flip.y,NORMAL));\n"; // binormal is negative due to mikktspace
+ code += "\t\tvec3 view_dir = normalize(normalize(-VERTEX)*mat3(TANGENT*depth_flip.x,-BINORMAL*depth_flip.y,NORMAL));\n"; // binormal is negative due to mikktspace, flip 'unflips' it ;-)
if (deep_parallax) {
code += "\t\tfloat num_layers = mix(float(depth_max_layers),float(depth_min_layers), abs(dot(vec3(0.0, 0.0, 1.0), view_dir)));\n";