Home Technical Talk

Manual triangle stripping

polycounter lvl 11
Offline / Send Message
Vrav polycounter lvl 11
Was curious if people did much tri-stripping manually for game models, or if there is an automatic triangulation in one of the larger suites that applies optimal flow. Are triangle strips always meaningful, or does it require the programmers to implement efficiencies taking them into account? Is this performance boost lost if the verts are not all perfectly indexed in strip form?

Personally, if I'm going to be baking tangent space normals to a character or object, especially if it has mirroring, I like to. Seems to help the bakes come out more predictably, especially if different engines/apps are going to be automatically triangulating quads in a different way. But I'd like to know if it actually provides a performance benefit to simply cut strips manually.

Of course there are the benefits of manual triangulation in making lowpoly meshes, but I mean creating strips in modern stuff with lots of quad loops. It feels a lot like knitting; I don't mind it, but am curious what other, more experienced persons tend to do.

knitting.jpg

Replies

  • sama.van
    Options
    Offline / Send Message
    sama.van polycounter lvl 14
    Hmmm maybe you should understand first what is triangle_strip method :

    - http://en.wikipedia.org/wiki/Triangle_strip

    And then how we are create a model with GL_TRIANGLE_STRIP method in openGL :

    - http://www.falloutsoftware.com/tutorials/gl/gl3.htm

    (Method is same with QUAD_STRIP)


    To make it short and easier to understand :

    - GL_TRIANGLES method : Action to list 3 vertex and then to create a triangle.
    Order is not important, because he will need 3 coordinate to create a triangle.

    - GL_TRIANGLE_STRIP method : Action to list vertex in a right order and then to deduce the triangle structure from the beginning to the end of the list.
    Image we start to create the model from the top and we turn around the model to finish the structure to bottom of the model like a spiral.



    Then. with this information I can easly say that :

    IMPOSSIBLE to you as a 3D artist to create a model ready for the TRIANGLE_STRIP method.

    And you have to use a plugin for it (I didn't find any plug in for it yet...)


    Also the plug you will use will create the triangle flow. vertex. quad, what you want, but in the way the programmer built it.
    For that reason sometime with some plugin, to export as quad with create shit in the engine.
    Same exporting triangle will give shit because using the QUAD method in the engine :D...

    And also, the engine you are using has been creating by human, I am not sure they will test your model when loading it in the engine to understand if you model is ready for TRIANGLES, QUAD, TRIANGLE_STRIP or TRIANGLE_STRIP method.


    Hope my english is not so broken and you will understand the explanation :(


    Do you use Maya for creating 3D?
  • Lamont
    Options
    Offline / Send Message
    Lamont polycounter lvl 15
    Something that was done on start of our engine. Took the mesh and re-knitted it for stripping. This was for terrain databases, things that are static/gridded.

    You don't tri-strip manually. Not something you can do in say Maya/3DS Max.

    Even if the terrain was in tris, it still stripified it. Gave a boost in performance by like 30%.
  • r_fletch_r
    Options
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    Lamont wrote: »
    You don't tri-strip manually. Not something you can do in say Maya/3DS Max.

    Thats not strictly true. manually triangulting the model used to be done quite a bit to ensure that it tri stripped well.
  • SHEPEIRO
    Options
    Offline / Send Message
    SHEPEIRO polycounter lvl 17
    really i wouldnt have thought so, adding any triangles breaks that tristrip...so adding any males it worse, at least that has been my experience
  • r_fletch_r
    Options
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    SHEPEIRO wrote: »
    really i wouldnt have thought so, adding any triangles breaks that tristrip...so adding any males it worse, at least that has been my experience

    perhaps i've got it arse ways but it was my understanding that the direction of the middle edge of the quad was essential for maintaining the strip
  • Lamont
    Options
    Offline / Send Message
    Lamont polycounter lvl 15
    I think you're thinking of "triangulation". Tri-stripping is way different.
  • sama.van
    Options
    Offline / Send Message
    sama.van polycounter lvl 14
    But guys.....

    Striping is absolutely not similar with triangulate your model in your 3D application XD :D:D:D
    Or to keep quad in your model for optimization O_o...


    Striping is a method to connect vertex together with a right vertex list in a right order and then to deduce triangle.


    To triangulate your model or to create quad definitely never, and absolutely never from the absolute no way to help to build a model with strip method. :D:D

    For the simple reason : STRIP method is both available with QUAD and TRIANGLE.


    To get a model ready for STRIP method you need to list all vertex of your model, and to create a new index list of your vertex from a Vtx.n and to follow the next vertex from the same triangle, etc.. etc.. etc..

    triangle_strip.gif

    Actually I am sure on your model vtx[0] is somewhere on your model and vtx[1] and the complete opposite!

    If you want send to me your 3d model and I will export it as C++ code and then load it in openGL with glBegin(GL_TRIANGLE_STRIP); method! and yu will see the result.



    I follow Lamont here.

    If you are working in Maya I can prove with a melscript in realtime in the viewport your model is far away to be ready for strip.
  • r_fletch_r
    Options
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    I know the difference. I was under the impression that the manner in which the model was triangulated had an appreciable effect on the length of the tri strips.

    stripping_good_bad.jpg
  • sama.van
    Options
    Offline / Send Message
    sama.van polycounter lvl 14
    r_fletch_r wrote: »
    effect on the length of the tri strips.]

    strippingtesta.jpg

    Yeah yeah it can change the lenght and some vertex could be listed 2 times. (green zone)

    But look, with Quad method vertex list is the same.
    Maybe the orientation of the edge in the blue zone will be not same at the end, but...


    No seriously to triangulate your model and then to create good orientation of your edge to help to reduce of 10 the vertex list of your model is really poor in optimization.

    And, you maybe do not know yourself if :

    - the plug you are using to export 3D will create a cool algo for STRIP in the engine..
    - the plug for importing 3D data in the game editor will build the model with STRIP method..
    - the engine you are using is using TRIANGLES, QUADS, TRIANGLE_STRIP or QUAD_STRIP method to create the model when rendering.

    isn't it?


    And you are the 3D artist.

    Then if you create character on a big production, the animator will take your model and turn edge if the deformation are bad with the current poly flow :D


    No seriously, about STRIP, keep cool, orient your edge for a good rendering of your model in game and it should be ok! :)
  • r_fletch_r
    Options
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    sama.van wrote: »
    strippingtesta.jpg

    Yeah yeah it can change the lenght and some vertex could be listed 2 times. (green zone)

    But look, with Quad method vertex list is the same.
    Maybe the orientation of the edge in the blue zone will be not same at the end, but...


    No seriously to triangulate your model and then to create good orientation of your edge to help to reduce of 10 the vertex list of your model is really poor in optimization.

    And, you maybe do not know yourself if :

    - the plug you are using to export 3D will create a cool algo for STRIP in the engine..
    - the plug for importing 3D data in the game editor will build the model with STRIP method..
    - the engine you are using is using TRIANGLES, QUADS, TRIANGLE_STRIP or QUAD_STRIP method to create the model when rendering.

    isn't it?


    And you are the 3D artist.

    Then if you create character on a big production, the animator will take your model and turn edge if the deformation are bad with the current poly flow :D


    No seriously, about STRIP, keep cool, orient your edge for a good rendering of your model in game and it should be ok! :)

    Thanks for taking the time to explain it. I haven't had to tristrip since using torque(which is something i'm trying to forget) so im clearly behind the curve.
  • sama.van
    Options
    Offline / Send Message
    sama.van polycounter lvl 14
    ... and last point....

    Because 2 constraint for strip :

    - to list vertex in a right order
    - to list vertex in the right way (CCW and CW)

    :D

    yeah because after if I apply a
    glCullFace(GL_BACK)....


    Could ghave more surprise :D
  • Vrav
    Options
    Offline / Send Message
    Vrav polycounter lvl 11
    Hm, I see! Thanks Sama and all.

    I can't send you the character I am working on now but will ask the programmer if he knows about any of this.

    My problem now lies elsewhere, it seems. I was actually just triangulating my model (and keeping it in proper strips because I thought that was good practice, na
  • sama.van
    Options
    Offline / Send Message
    sama.van polycounter lvl 14
    Vrav wrote: »
    So, to summarize, you are saying that if triangle stripping is to be used, I should leave as many quads as possible so the algorithm can work out the most efficient stripping method? That's rough.

    noo...

    Triangle strip : to triangulate...
    Quad strip : to create quad...

    But really... it depends of the plug in...

    Question for your programmer could be :
    - What method do you use to draw model in game?
    ---- Triangles?
    ---- Quads?
    ---- Triangle Strip?
    ---- quad strip?
    - About the plug in to export 3D, to your prepare the model :
    ---- Do you list triangle or quad?
    ---- do you create a new index flow for stripping?

    It could be a good beginning. o_<

    Vrav wrote: »
    I can't stand mirrored tangent space normals looking crap due to improper vertex shading.

    Oh sorry I donno anything about how works the vertex shading in the engine yet. Just can help for the model structure. :(
Sign In or Register to comment.