What does "mesh.Optimize()" do?

I checked the docs and still didn’t understand what it’s doing. When should I use it? Thanks!

I think you need to experiment, as it seems to depend on the mesh in question. The one project I tried it when I was building my own meshes, I actually got lower fps.

–Eric

You should use it if you generate a mesh from scratch procedurally and you want to trade better runtime performance against higher load time. Internally it tri-strips your model and optimizes the triangles for vertex cache locality.

For imported models you should never call this as the import pipeline already does it for you.

… ahhh, that makes sense Joe, thanks for explaining that.

FYI: I submitted a bug about this issue so we can clarify the Optimize() entry a bit. Joachim’s comments above can easily be massaged and added to the docs so the entry reads a bit better.

And, as I mentioned, you don’t always get better runtime performance…in my project, the fps consistently either stayed the same or dropped slightly when I tried it, so I ended up not using mesh.Optimize() at all. But then my meshes weren’t really typical.

–Eric