Skip to content

Commit

Permalink
Remove tangents.
Browse files Browse the repository at this point in the history
  • Loading branch information
fire committed Aug 9, 2021
1 parent bfb903e commit 91ae926
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions modules/gltf/gltf_document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2259,23 +2259,6 @@ Error GLTFDocument::_serialize_meshes(Ref<GLTFState> state) {
ERR_FAIL_COND_V(!a.size(), ERR_INVALID_DATA);
attributes["POSITION"] = _encode_accessor_as_vec3(state, a, true);
}
{
Vector<real_t> a = array[Mesh::ARRAY_TANGENT];
if (a.size()) {
const int ret_size = a.size() / 4;
Vector<Color> attribs;
attribs.resize(ret_size);
for (int i = 0; i < ret_size; i++) {
Color out;
out.r = a[(i * 4) + 0];
out.g = a[(i * 4) + 1];
out.b = a[(i * 4) + 2];
out.a = a[(i * 4) + 3];
attribs.write[i] = out;
}
attributes["TANGENT"] = _encode_accessor_as_color(state, attribs, true);
}
}
{
Vector<Vector3> a = array[Mesh::ARRAY_NORMAL];
if (a.size()) {
Expand Down Expand Up @@ -2457,20 +2440,6 @@ Error GLTFDocument::_serialize_meshes(Ref<GLTFState> state) {
if (varr.size()) {
t["NORMAL"] = _encode_accessor_as_vec3(state, narr, true);
}
Vector<real_t> tarr = array_morph[Mesh::ARRAY_TANGENT];
if (tarr.size()) {
const int ret_size = tarr.size() / 4;
Vector<Color> attribs;
attribs.resize(ret_size);
for (int i = 0; i < ret_size; i++) {
Color tangent;
tangent.r = tarr[(i * 4) + 0];
tangent.g = tarr[(i * 4) + 1];
tangent.b = tarr[(i * 4) + 2];
tangent.a = tarr[(i * 4) + 3];
}
t["TANGENT"] = _encode_accessor_as_color(state, attribs, true);
}
targets.push_back(t);
}
}
Expand Down

0 comments on commit 91ae926

Please sign in to comment.