I have found a small mistake in the code that made blend shape normals look ugly.
vertices = geom->vertices;
normals = geom->normals;
Vec3* vr = &allocator.vec3_tmp[0];
Vec3* nr = &allocator.vec3_tmp2[0];
int* ir = &allocator.int_tmp[0];
for (int i = 0, c = (int)allocator.int_tmp.size(); i < c; ++i)
{
int old_idx = ir[i];
GeometryImpl::NewVertex* n = &geom->to_new_vertices[old_idx];
if (n->index == -1) continue; // skip vertices which aren't indexed.
while (n)
{
vertices[n->index] = vertices[n->index] + vr[i];
normals[n->index] = vertices[n->index] + nr[i]; // <------------------------- line 2781, there should be 'normals' instead
n = n->next;
}
}
I have found a small mistake in the code that made blend shape normals look ugly.
P.S. This project is great! Have a good day!