You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
BuildSkeletalMeshChunks is used during cooking when saving skeletal meshes (calls originate from USkeletalMesh::BuildLODModel, see linked jira ticket for full callstacks) and deduplicates overlapping vertices. In contrast to many other places in the engine, it is using a multimap instead of the FOverlappingCorners type. Using a multimap is technically more correct since "points overlap each other" is not an equivalence relation (it is not transitive, i.e. "A overlaps B" and "B overlaps C" but "A does not overlap C" is possible). FOverlappingCorners pretends that transitivity is given, because that is pretty much always true. Note also that there is another check later on for whether two vertices within the same cluster actually overlap. In especially degenerate cases this can save a lot of memory because we only store each group of overlapping vertices once (instead of having a copy for every vertex in that group). With user content in UEFN, it is unfortunately very much possible to hit these degenerate cases, allocate gigabytes of memory, and have the cooking process terminate with an OOM error. This CL changes this codepath to use FOverlappingCorners instead. The memory savings and time savings are significant, find a comparison here https://docs.google.com/document/d/1qHnY_6WXpcEmJL_61myQDczxG6XDZRuVUCE8yQ-FkDs/edit?usp=sharing #rb alexis.matte, laura.hermanns [CL 31119331 by sebastian schoner in ue5-main branch]