Thursday, September 23, 2010

Performance Tuning and Future Proofing

I wrote up some performance tuning notes for OBJs on the wiki. A few notes on how these rules will change with version 10:
  • Everything on that note applies to version 10 too. If you've tuned your model for version 9, that effort will be worth it in version 10.

  • A few rules are even more important in version 10 than before. In particular, I've done a lot of performance tuning for OBJ drawing, but you don't get those wins if you use ATTRibutes. Clean your objects out for maximum speed.

  • One special case: objects with very small vertex count are sometimes extra fast in version 10. For example, in version 9, a tree with 8 vertices and no attributes is horribly slow. In version 10, this tree will be quite fast. So in version 9 you might make the tree have 64 vertices and look nicer; in version 10 by keeping the tree lean and mean, you get a speed improvement.


Anonymous said...

*Don't* use attributes? Huh? Then what's the point of their existence?

Benjamin Supnik said...

Attributes are like donuts...they are very tasty, but if you eat too many, you'll regret it later.

They are meant to be used sparingly to increasing the quality of a few special art assets.

If you have one OBJ, putting attributes into it isn't going to hurt anything.

If you build an OBJ and place it 10,000 times, those attributes are now 10,000x more expensive and really matter.

That wiki link goes into more detail about when you have to care about attributes vs. tex res, etc.