Skip to content

Commit

Permalink
Merge pull request godotengine#9 from lawnjelly/surface_tool_revamp
Browse files Browse the repository at this point in the history
SurfaceTool - efficiency improvements
  • Loading branch information
lawnjelly committed Mar 30, 2023
2 parents 15f4c07 + ff714fb commit 86d791e
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 86d791e

Please sign in to comment.