PDA

View Full Version : Optimizing polystrips


rube
06-04-2007, 02:32 PM
First off. I'm using maya 8.5.

I've seen a few people in various threads now mentioning optimizing the polystrips on a model and I understand the reason why you'd want to do that. What I don't know is *how to do it. I'm pretty much clueless where that is concerned. Do you just rebuild the model face by face? are there tools that help with that?

rube

StJoris
06-05-2007, 02:07 AM
Well I don't really know too much about it, Per128 seems to be the guru on that, this could probably also be asked in the ultimate be-all thread. It seems it is about adding geometry where the polys get split/verts get doubled, due to smoothing groups/uv border/material, but I'm really a noob on that.

MoP
06-05-2007, 02:47 AM
I thought it was something to do with triangle-stripping, but I might be wrong.
If I'm right, then it means having a row of quads all triangulated in the same direction, so their vertex winding order is always the same. I'm not sure how much of a benefit this is, I seem to remember reading some engines/platforms handle this much better than others.
Might be worth Googling up more info on "tri-stripping".
Here's a post from JamieF over on CGChat that might explain it better than I did:
http://www.cgchat.com/forum/showpost.php?p=124544&postcount=9

StJoris is part-way there, UVs and Smoothing Groups affect tri-stripping, because if there is a UV seam over the middle of a consistent tri-strip, it will have to be split up anyway.

Eric Chadwick has a nice resource from a Game Developer article by Guillaume Provost concerning UV and smoothing breaks: http://www.ericchadwick.com/examples/provost/byf2.html

perna
06-05-2007, 05:08 AM
Basically what happens is when drawing a new strip, the renderer only has to plot one new vert to describe an entire polygon.

The problem is.. it's not like you can spend time benchmarking every single model you make and tweak it until it has the optimal tri flow. Most of the time you'd be talking about such tiny performance improvements that it's not even worth considering.

There are so many other factors involved as well, when it comes to tweaking for performance, that you're better off just following the polybudget you're given fairly accurately.

The reason why geometry is split up and vertices doubled at UV and normal seams, is that the typically a vertex is stored on the graphics card as having only one uv coordinate and one normal.

Adding this to the normal map workflow thread

Whargoul
06-05-2007, 09:06 AM
For the most part, modern game renderers don't use tri-strips anymore. They are pretty much outdated - a lot of times wee use vertex buffers and their are lots of algorithms for optimizing those - and there's not much we can do to make our models more efficient as we could with strips. ie. laying down edges in a zig-zag doesn't help. Of course, I'm no programmer so I may have messed up my terms a bit... screw you if that's the case /images/graemlins/wink.gif

What does help is reducing seams - all types, as much as possible. Less UV borders, less hard edges, even mirrored UV borders. This causes extra verts (as Per mentioned) to be created, which increases the cost of drawing the model. Programmers really would like to give you a vertex count instead of a poly count for a budget for your models, but that's damn hard to follow! It's easy to build a 8k triangle model, but very hard to build a 4k vertex model, when you don't know how many there will be after processing. Usually we just assume a constant vert/tri ratio and set our budgets based on that.

CrazyButcher
06-05-2007, 10:04 AM
there are code libraries that will optimize vertex/triangle order internally, and can also generate for long strips.
It is too hard for an artist (human being) to predict all the "vertex splits" and still manage to make a optimal mesh, leave that to algorithms, as whargoul suggested.
Make it pretty stay within "limits" (but dont take limits too serious, there are so many "ifs" and "whens" concerning performant rendering that hard limits dont do justice, but serve as guidelines)

strips internally can still help to keep index uploads fast and make use of vertex caches, then again similar can be achieved without strips, too. But nothing an artist should really worry about.
the one things you can do to "help" is trying to achieve large UV charts (ie less vertex splits) and similar for smoothing groups (or dont use any at all), anything beyond is too "much" to be sane /images/graemlins/wink.gif