forked from blender/blender
Optimized SubMesh to hold only used vertices #84
Labels
No Label
No Milestone
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: BogdanNagirniak/blender#84
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "BLEN-474"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Purpose
Following warning in Storm delegate could happen with multimaterials:
Invalid Hydra prim '/scene/O_000001C64A534808/SM_0001': Vertex primvar points has 42 elements, while its topology references only upto element index 40.
Technical steps
Moved vertices to
MeshData::SubMesh
. Optimized SubMesh to hold only used vertices.@ -276,0 +283,4 @@
else {
/* Optimizing submeshes: getting only used vertices, rearranged indices */
for (SubMesh &sm : submeshes_) {
Map<int, int> index_map;
I would guess something like this is more efficient, instead of multiple loops and hash maps.
You are right, your algorithm is more efficient and faster, thank you.