Jump to content
  • Advertisement
Sign in to follow this  
The Rug

efficiently organising geometry (tri fans, strips, index ararys, etc)

This topic is 4839 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

A few questions: I'm currently rendering a large chunk of (static) geometry that is composed of raw triangles. Not strips, not fans, just triangles specified one after another in the vertex array. Am I right in thinking this is a collosal waste of memory? I recon I should be doing something about this, but what can I do? - use triangle strips / fans? Are there 3d file formats that store their geometry as strips or fans? If not, is it difficult to generate them from raw triangles? - use indicies? I'm guessing this would prevent data duplication, which is a big part of my problem. - Both of the above? If anyone could shed any light on this I'd be really grateful, I'm not sure exactly what I'm doing when it comes to stuff like this. And please correct me if I'm wrong in any of my assumptions, because it's more than likely I am [smile] Cheers

Share this post


Link to post
Share on other sites
Advertisement
"Are there 3d file formats that store their geometry as strips or fans? If not, is it difficult to generate them from raw triangles?"

No specific file format stores them as strips or fans. This is specified by the user at exportation time. It is fairly difficult to generate strips from raw triangles. Not many people use fans because their uses are obviously limited, and if you're going to try to be efficient you're better off using strips. Nvidia (God bless them) has created an open source library for generating tri-strips:
http://developer.nvidia.com/object/nvtristrip_library.html

"use indicies?"
As long as your file size or data size is smaller after using the indices, then yes I believe this would help make it smaller.


This is of course if you're rendering a ton of geometry. With most of today's cards you might not even notice a difference until you get over 10k triangles.

Another thing you might want to look at is OpenGL vertex buffer extensions:
http://www.devmaster.net/articles/oglVertexBuffer/

Share this post


Link to post
Share on other sites
In my engine I index my geometry, its really handy for my terrain, as I can store an array of vertices (use a little math to find the height elsewhere), and just reindex to suit the rendering speed. Geomipmapping i believe is the real name for the technique I use.

Share this post


Link to post
Share on other sites
Another thing to keep in mind is that if you only use vertex arrays, then each vertex in the array must pass through the vertex pipeline since each one could be potentially unique. GPUs have vertex caches to prevent this where possible, as long as you use some sort of indexing technique. Both cache-aware strips and triangle indices will boast your vertex throughput since they will make good use of the GPU cache.

T

Share this post


Link to post
Share on other sites
well optimizing strips to match the cache is somewhat difficult because the latest vertex cache sizes aren t available

the latest information i found about the cache size on nvidias developer page was from the geforce 3&4

if you have square patches and stripificate from left to right each row and each row is >20 vertices you transform each vertex - the top vertex row twice

e.g.:

//patch
012
345
678

so the strip would contains the quads this way
012345678

a better striptification would be

if you have such a field of quads
//patch
012
345
678
diagonal striptification

013642578 this way you have only once |edge size| vertices to transform twice
the other diagonals are < |edge size|


the original linear striptification would result in |edgesize|*|edgesize-1| which can be considered as quadratic amount of duplicates


but usually you can t use diagonal strips except in regular square meshes with all triangles having the same winding

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!