Skip to content

Commit ac43768

Browse files
committed
Merge pull request godotengine#88931 from clayjohn/GLTF-normals
Fix wrong indexing when generating dummy tangents in GLTF import
2 parents 2a05632 + 14c776f commit ac43768

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/gltf/gltf_document.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2796,7 +2796,7 @@ Error GLTFDocument::_parse_meshes(Ref<GLTFState> p_state) {
27962796

27972797
Vector<Vector3> normals = array[Mesh::ARRAY_NORMAL];
27982798
for (int k = 0; k < vertex_num; k++) {
2799-
Vector3 tan = Vector3(normals[i].z, -normals[i].x, normals[i].y).cross(normals[k].normalized()).normalized();
2799+
Vector3 tan = Vector3(normals[k].z, -normals[k].x, normals[k].y).cross(normals[k].normalized()).normalized();
28002800
tangentsw[k * 4 + 0] = tan.x;
28012801
tangentsw[k * 4 + 1] = tan.y;
28022802
tangentsw[k * 4 + 2] = tan.z;

0 commit comments

Comments
 (0)