Skip to main content
gamedev.net
🔒 Locked

Mesh optimize

Started by Tosh777 Apr 4, 2011 at 2:15 PM 1 replies 1.7k views
Original Post
Tosh777
Tosh777
How does optimizing mesh benefits the rendering performormance?
Can someone explain it to me in details and is it worthing to optimize a mesh or just leave it unoptimized?
GraphicsDude
GraphicsDude
What people usually mean when they say optimize a mesh they usually optimize the vertex ordering for that mesh. The reason they do this is because the GPU has a cache holding the last few vertices it has operated on. Thus when the same vertex is referenced via the index buffer the GPU doesn't have to run the vertex shader on it again (if it is already in the cache). Since reading from the vertex cache is much faster that running the vertex shader you can get a speedup if you can order your indices such that they reference the same number of vertices within a short period of time. But as always early optimization is the root of all evil. Typically you might get a 10% maybe 20% reduction in frame time so it's not a huge win for the time/cost of writing a good optimizer.

Also, not all cards have the same size of vertex cache. A few years ago it was typical to be able to hold 24 verts. I'm not sure what they size is today, but I can't imagine it being much different. It's one of those areas like bandwidth that hasn't improved much over the years. But what this means is that if you optimize a mesh for a 24 vert cache and it runs on a machine with 16 vert cache it will actually hurt performance since you will be thrashing the vertex cache wildly.

There are a few common ways to optimize the mesh. Hugues Hoppe over at Microsoft has a good paper (http://research.microsoft.com/~hoppe/)about it. Tom's DirectX FAQ (http://tomsdxfaq.blogspot.com/) also talks about this in a bit more detail and covers some ways to do it.

If you're making an export pipeline for a large group of artists and/or you KNOW the art will run on a specific piece of hardware (ie. Xbox 360/PS3/Wii) then this is a fruitful endeavor. Otherwise I personally wouldn't worry about it. There are plenty of other areas where your rendering can be optimized.
Tosh777
Tosh777
Thank you. This really helped.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.