I thought it was more to do with turning triangle soups into triangle strips which have less vertex data. Particularly for procedurally generated meshes.
I assume it does the same thing as MeshUtility.Optimize:
So, yes, performance will be improved at runtime. It just sorts the underlying mesh data so the parts it is going to need all at once are closer together in memory. When the GPU needs to process triangle Y with vertex X, there is a greater chance it can go: “Hey, look I still have this vertex in my cache because I was just using it previously! That is very convenient, and thoughtful of whomever sorted this list!” The CPU gives him the ol’ finger-guns-and-wink, and then everyone gets a pony for Christmas.
Hi!
Has anyone ever tried to use amd tootle or the meshoptimizer library for optimising mesh performance? I would be very interested to know if this would be a way of boosting performance. Maybe unitys built in function is not as advanced or developed?
Both of those do roughly do the same thing as Unity’s built in optimizer to start with. They reorder the vertex and triangle lists for better efficiency. I doubt any of them are significantly better than the other in this regard.
The one feature they both have that Unity doesn’t have is the overdraw optimization. How much this helps is highly dependent on your mesh. For simple models it won’t have any impact at all, but for complex shapes with a lot of overlapping geometry it may help to some small degree. How much depends greatly on the situation, but 99% of the time it’s unlikely to be measurable. It’s also only going to be an improvement in very specific scenarios, and can actually decrease performance in others. For example if you have a house with rooms and furnishing that’s a single material & model, this can make it slightly faster to render when viewed from the exterior, but also slower when inside. For very specific and somewhat contrived examples I could see this being helpful, like a basic model viewer (like Sketchfab) on low end hardware or high resolutions. For real gameplay use I doubt it’ll have a significant impact, and for 2D game’s with a lot of alpha usage it can actually be working against you.
The second link has two other options, mesh compression and mesh simplification. Mesh compression is already built into Unity, and what’s in that tool wouldn’t be useful anyway since it would require deeper implementation into the engine, or only be useful for reducing load times if you wanted to manually load mesh data from disk for some reason rather than use the built in assets (which, again, can already be compressed).
Simplification is the only thing I can see being mildly useful, either as a way to trim down messy high poly models to something more useable or to generate LODs. But there are a ton of tools out there built for that purpose already that are likely far more effective.
Thank you very much for the detailed explanation! I think unity should pay you for all the help you have given in the forums. Whenever i needed an explanation for something regarding optimisation and rendering, i would eventually find a post from yout hat wraps everything up in a really concise manner.
My use case is actually a model viewer scenario, but i guess there might be lower hanging fruit to pick first.