Optimize mesh serialization
See original GitHub issueEvery deformable has its dynamic mesh serialized as a unique mesh. This bloats scene file size. It’s unnecessary because the dynamic mesh can be generated from the original mesh. MeshData.DynamicMesh
isn’t serialized, but the target (Mesh Filter or Skinned Mesh Renderer) uses it and is serialized. Somehow the targets mesh reference needs to be overridden when serialized, to point to the original mesh. Then at runtime the dynamic mesh can be generated.
Issue Analytics
- State:
- Created 4 years ago
- Comments:22 (8 by maintainers)
Top Results From Across the Web
Scripting API: Mesh.Optimize
Optimizes the Mesh data to improve rendering performance. This function causes the geometry and vertices of the mesh to be reordered internally in...
Read more >meshoptimizer | meshoptimizer
Mesh optimization library that makes meshes smaller and faster to render. ... You can then either serialize vbuf / ibuf as is, or...
Read more >Optimize MeshSerializer (Smaller Size)
I started using the meshserializer and for a model that would usually be 450kb in W3d it comes out to 2.6mb using the...
Read more >Manual: Compressing mesh data
1. Open the Other Settings submenu and navigate to the Optimization heading. 1. Select the Vertex Compression dropdown and select any channel to...
Read more >How to save parts, and the idea of Serialization
Just store a list of all the meshes, then instead of storing mesh id, ... its stored in a optimized binary format and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve done a bit more testing and prefabs don’t seem to be an issue! 🤷♀️
I made a prefab with a bunch of default deformable cubes
It’s only 519 KB
![image](https://user-images.githubusercontent.com/9631530/89699746-90b7c480-d8ee-11ea-91c7-a5a03d684394.png)
I put a few of the prefabs into a scene like so![QRxMZImv4u](https://user-images.githubusercontent.com/9631530/89699780-daa0aa80-d8ee-11ea-89af-0be89488db19.gif)
It was super slow, but the scene was only 213 KB!![image](https://user-images.githubusercontent.com/9631530/89699794-f73ce280-d8ee-11ea-9475-06ed6cace940.png)
There’s definitely still a hiccup when loading a deformable-heavy scene since all the deformables have to initialize, but I’m pretty sure it’s faster than loading all the meshes off disk, so it’s a win in all regards.
If anyone runs into any issues or bugs with the changes let me know. I’d like to merge to main, but wanna be a little cautious so I might wait a bit.
oh yup I forgot to mention that part! thanks for catching that!
interesting, i’ll look into it!