mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Reverse bitangent on everythings to ensure default normal map behavriour is consistent
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user