Sign in to follow this  
ClementLuminy

NVTriStrip Question..

Recommended Posts

Hello! I'm planning to use the NvTriStrip library to "optimize" my 3D Model: I Do not understand how this library can re-order the indices without any knowledge about the POSITION of the indiced vertices ... Because in the library, you only pass the indices list .... I just wanna understand a little bit, the tool i'm using ... Thanks a lot Clément Vidal

Share this post


Link to post
Share on other sites
afaik this optimization process only optimizes for vertex caching i.e. the order in which the geometry is processed. since you probably use most vertices more than once in you model it would be good to load every vertex only once - so you basically optimize your topology data in a way that all occurrances of a vertex are in very close to each other in the index array. that way there is a very high chance that the GPU already has the vertex data in it's cache and doesn't need to load it from memory again which in turn results in a speed increase. and as you noticed - this optimization process does not require knowledge of the actual position of the vertex in the coordinate system...

hope that helps and isn't too wrong.

Cheers,
Alex Stockinger

Share this post


Link to post
Share on other sites
But as it name say, NvTriStrip do not only reorder indices to increase the cache use, it also create triangle Strip from triangle list .... but to create this list, you need to know the position of the vertex ...

I cannot figuredout how this method can achieve such a thing without knowing anything about the localisation of input vertices ...

Thanks for your help !!!


Clement Vidal

Share this post


Link to post
Share on other sites
Quote:

I cannot figuredout how this method can achieve such a thing without knowing anything about the localisation of input vertices ...


Pretend we have 2 triangles that just consist of indices into an array of vertices. i.e. the way Opengl and Directx expects it.

Let triangle a =[0,1,2]
Let triangle b =[1,2,3]

Now without looking at the vertices we can make a tristrip [0,1,2,3], drawing this strip will be equivalent to drawing triange a then triangle b.

Share this post


Link to post
Share on other sites
Quote:
Original post by ClementLuminy
I cannot figuredout how this method can achieve such a thing without knowing anything about the localisation of input vertices ...

The location of the vertices don't matter. All that matters is how the vertices are connected...this can be gotten by analyzing the triangle list. Using foobarbazqux's example, vertices (1) and (2) could be miles apart or they could overlap, but they still define a common edge between two triangles, and the triangle list shows that.

If you're interested in the underlying algorithms, chances are NvTriStrip is performing basic graph analysis. Wikipedia has a number of good articles on this subject...this is probably a good start.

CM

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this