Skip to content

Commit

Permalink
SurfaceTool - efficiency improvements
Browse files Browse the repository at this point in the history
Changed to use LocalVector rather than linked lists.
  • Loading branch information
lawnjelly committed Dec 12, 2022
1 parent 5d5f0a3 commit ff714fb
Show file tree
Hide file tree
Showing 3 changed files with 262 additions and 212 deletions.
14 changes: 12 additions & 2 deletions scene/resources/mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1373,10 +1373,20 @@ Error ArrayMesh::lightmap_unwrap_cached(int *&r_cache_data, unsigned int &r_cach
surfaces_tools[surface]->add_tangent(t);
}
if (lightmap_surfaces[surface].format & ARRAY_FORMAT_BONES) {
surfaces_tools[surface]->add_bones(v.bones);
Vector<int> bones;
bones.resize(v.num_bones);
for (int n = 0; n < v.num_bones; n++) {
bones.set(n, v.bones[n]);
}
surfaces_tools[surface]->add_bones(bones);
}
if (lightmap_surfaces[surface].format & ARRAY_FORMAT_WEIGHTS) {
surfaces_tools[surface]->add_weights(v.weights);
Vector<float> weights;
weights.resize(v.num_bones);
for (int n = 0; n < v.num_bones; n++) {
weights.set(n, v.weights[n]);
}
surfaces_tools[surface]->add_weights(weights);
}

Vector2 uv2(gen_uvs[gen_indices[i + j] * 2 + 0], gen_uvs[gen_indices[i + j] * 2 + 1]);
Expand Down
Loading

0 comments on commit ff714fb

Please sign in to comment.