Jump to content
  • Advertisement
Sign in to follow this  
lonewolff

Convert triangle list to a triangle strip?

This topic is 948 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

Hi guys,

 

Is there any way to convert a triangle list to a triangle strip? Either via code or some external utility?

 

A game I am working on is very heavy in geometry and I am hoping to cut down them memory footprint to a third. I am currently hitting ~800 MB of VRAM due to animations.

 

Thanks in advance. :)

Share this post


Link to post
Share on other sites
Advertisement

Any reason to not prefer indexing?  There are plenty of arguments (e.g from the likes of Tom Forsyth) that indexing is so superior to strips in so many ways (higher vertex reuse ratio, better vertex cache optimization, better match to hardware) that you should at least have a really good reason to not consider it.

 

Also - is using 800mb of VRAM actually a problem?  Or do you just not like the fact thatyou're using so much?  If the latter then I'd suggest that you may be prematurely optimizing.

Edited by mhagain

Share this post


Link to post
Share on other sites

Bear in mind that even if your geometry is 800MB, the majority of that will be vertices rather than indices. Stripifying your data may reduce the size of the index buffer by 2/3rds but it does nothing for the size of your vertex buffers which are typically going to be ~5-15x larger than your index buffers (depending on vertex/index size).

 

Are your vertices slimmed down and compressed to the bare minimum size? In what format are you storing each vertex attribute?

Share this post


Link to post
Share on other sites

Bear in mind that even if your geometry is 800MB, the majority of that will be vertices rather than indices. Stripifying your data may reduce the size of the index buffer by 2/3rds but it does nothing for the size of your vertex buffers which are typically going to be ~5-15x larger than your index buffers (depending on vertex/index size).

 

Are your vertices slimmed down and compressed to the bare minimum size? In what format are you storing each vertex attribute?

 

I can clean up the geometry a bit, but it is pretty lean at the moment.

 

The FVF is purely vertex positional data. Each vertex attribute is 12 bytes. So, I don't have any unnessesary data tied to it. No normals, colour data etc. Colour is handled purely by the shader.

 

 

Any reason to not prefer indexing?  There are plenty of arguments (e.g from the likes of Tom Forsyth) that indexing is so superior to strips in so many ways (higher vertex reuse ratio, better vertex cache optimization, better match to hardware) that you should at least have a really good reason to not consider it.

 

Also - is using 800mb of VRAM actually a problem?  Or do you just not like the fact thatyou're using so much?  If the latter then I'd suggest that you may be prematurely optimizing.

 

Hi mhagain,

 

My game is created in GameMaker Studio, which sadly doesn't support indexing. The other issue with the 800MB VRAM usage is that GM stores a copy of the geometry in system RAM also. 800 MB is 1600 MB in reality. Couple that with GM only being able to create 32 bit applications, I am right on the threshold of exceeding the available RAM for an application.

Share this post


Link to post
Share on other sites

and one another thing i hardly can imagine 800 MB for animations consider 3 joints per finger * 5 fingers * 2 + 2 joints per foot + 2*anckle * 4 for legs + 8 others gives us

 

48 matrices per frame  * 16*4 bytes = 3 Kilobytes per frame, considering that:

hitting ~800 MB of VRAM due to animations.

 

 

this sounds like gamemaker exporst each frame to different model, instead of using one vbuff for one character. or maybe you did the animtion wrong, there is a way to export triangle set to tri_strip, but i wonder how are you supposed to go through vertice data, if this program stores animation set in 800 MB seriously

 

 

i may calculated that wrong but it seems: 2.53 hours of pure animation at 30 fps. for one vertex buffer set.

 

 

anyway to the answer...

 

how exactly it would work i don't know but finding shared vertices between triangles and then converting these shared ones (you group by 2 triangles, and convert that to tri_strip) next would be to find shared vertice of tri strip quad but i mean ' 'the' 'next' ' shared vertice i reckon for first quad tri strip is 4th vert and for second quad tri strip is first vert.

 

 

so first step group shared verts and connect by 2 triangles , then you will have almost everywhere quads made out of triangle strips,, you could find shared verts there and connect them accordingly. but i wish you could say how did you do the animation on this game maker. coz it seems pretty unreasonable,

 

but still if you have way too much gemoetry you could consider using dynamic level of detail, or at least precompute models to lower LODs, or make lower polygon models,

anyway if you plan really to release the game that uses such amount of vram onyl to draw a menu, then so be it, i have seen way too much unity games that were drawing 2 quads and it ran at 1 fps... so why would you care?

Edited by WiredCat

Share this post


Link to post
Share on other sites

and one another thing i hardly can imagine 800 MB for animations consider 3 joints per finger * 5 fingers * 2 + 2 joints per foot + 2*anckle * 4 for legs + 8 others gives us

 

48 matrices per frame  * 16*4 bytes = 3 Kilobytes per frame, considering that:

hitting ~800 MB of VRAM due to animations.

 

 

 

 

Careful about what you are assuming I am animating.

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!