Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple copies of the same mesh are duplicated in the output bundle #119

Open
sboys3 opened this issue Aug 24, 2024 · 3 comments
Open

Multiple copies of the same mesh are duplicated in the output bundle #119

sboys3 opened this issue Aug 24, 2024 · 3 comments

Comments

@sboys3
Copy link

sboys3 commented Aug 24, 2024

When there are multiple copies a specific skinned mesh on an avatar they wind up getting optimized separately. This causes there to be two duplicates of the same mesh asset in the BinaryAssetBundle and eventually the final output bundle as well. Therefore increasing the download and unpacked size.

In my case, a majority of these meshes have not been merged at all. They are just slightly optimized copies of the original meshes. It would be nice if at least basic unmerged meshes are de-duplicated in the output.
Alternatively an option to just keep the original mesh instead for when there is no major optimization would work well for my case. For most of my meshes the only thing changed in BinaryAssetBundle vs the original seems to be the number of referenced bones.

@d4rkc0d3r
Copy link
Owner

Keeping track of which meshes I could potentially do this with and making sure everything works correctly with movement and scaling of bones seams pretty complicated. So don't get your hopes up of this happening.

Alternatively an option to just keep the original mesh instead for when there is no major optimization would work well for my case.

Put them into the exclusion list if it doesn't even optimize much anyways.

@sboys3
Copy link
Author

sboys3 commented Oct 4, 2024

I made a script to do it. The ragdoll system winds up creating numerous copies of just about everything, so there were many duplicated meshes.
Here is the repository https://github.com/sboys3/VRCAvatarMeshDeduplicator
It compares meshes to find identical matches. If you feel that it is not too much of a hack or unique of an issue, feel free to reuse my code in your project.

@SloneFallion
Copy link

If the above isn't viable, perhaps a more visible warning of the impact could be considered. The chart that shows how many skinned mesh renderers, etc... could have poly count added when it will increase.

Admittedly, there is already an informational blurb about poly count increasing, but it is easily looked over as it doesn't show a caution, etc... as other elements do and is in smaller print, especially when there is already so much presented on the component already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants