Home Technical Talk

Squares or triangles?

jhines142
polycounter lvl 10
Offline / Send Message
jhines142 polycounter lvl 10
So I am noticing that a lot of the professionals out there show triangles rather than polygons. I understand that one polygon is made up of two triangles, and I know that game engines deal with tris better than polygons. Therefore, what happens in the modeling process when modeling in polygons then ending up in triangles. I know to some this may sound like a dumb, noob question but I'm curious. I'm just looking for more information.

Replies

  • Ark
    Options
    Offline / Send Message
    Ark polycounter lvl 11
    The model gets triangulated anyways at the end of the day by the exporter/engine.
    Always better to triangulate the model yourself before export so you have more control of where the splits happen.

    Also a polygon can have more than two sides, normally referred to as a N-Gon once the polygon exceeds four edges.
  • WarrenM
    Options
    Offline / Send Message
    If the model is usable for it's intended purpose, then tris/quads/n-gons don't matter. That's how I look at it. :)
  • Mark Dygert
    Options
    Offline / Send Message
    Quads are easier to work with, you can use loops and rings and life is just easier when you model mostly in quads.

    Like Ark said everything gets triangulated in the end so keep that in mind. Some programs like max allow you to flip the non visible edges which in some programs and engines will be flipped to always face one way which might not be the way you intended. So those edges need to be made visible and the easiest way to do that is to triangulate the model. In max you can toss a "turn to poly" modifier on top of your stack and set the number of sides to 3, export and then delete the modifier so you go back to working in quads. Or most exporters do it automatically.
  • jhines142
    Options
    Offline / Send Message
    jhines142 polycounter lvl 10
    Hmm interesting. I have just noticed that, for instance, WOW, when importing their models into max, from milkshape, they are extremely low poly, when with modern technology of today, they could be a bit higher res. I wonder why this is.
  • WarrenM
    Options
    Offline / Send Message
    Because WoW needs to run on everything. Which means low poly is god.
  • Mark Dygert
    Options
    Offline / Send Message
    WoW is also a really old game, they started development in 1999 and it released in 2004. Sure they've done some things to upgrade the game since then but like WarrenM pointed out they want as many people playing on whatever kind of hardware they have. They also have potential for a lot of characters on screen at one time.
  • ExcessiveZero
    Options
    Offline / Send Message
    ExcessiveZero polycounter lvl 6
    I try and keep it in quads, mostly for sculpting, but you want quads as much as you can too for animation, and doing UVW maps, just so good to have that nice edge flow.

    but when it gets in game all those quads get split into tris so dont be afraid to use them, but for all the things you can do they are hardly ideal.
  • jhines142
    Options
    Offline / Send Message
    jhines142 polycounter lvl 10
    Thanks everyone for your information, that definitely sheds some light on the subject for me. Now I'm curious to know out of many high quality portfolio pieces that are made, how many 'duds' there were.
  • Catchingdusk
    Options
    Offline / Send Message
    Catchingdusk polycounter lvl 10
    What do you mean by "duds"?
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    You're over complicating this more then needed.

    Artists work in quads because they're easier to manage, model, animate, UV and read out with your eyes, period, there is no dud or cheating or anything else, it's as simple as that.

    You're still working with triangles, but under a pseudo quad interface so that it's easier for the artist to manage visually, you can at any time see the triangles on your mesh in your software.


    Engine/Renderer will triangulate it outright and show that only, because that's how code works, and because it is much, MUCH easier to calculate a triangle than a quad, especially if optimization is concerned (people aren't going to play a game to look at your wireframes and thus require a half-face cull or whatever the thing is called for the engine). Using the Pythagora's algorithm, triangles are, and will always be faster, in the current math engines are using.
  • 54Strat
    Options
    Offline / Send Message
    54Strat polycounter lvl 5
    A quad is just two optimized triangles and has four vertices.

    Two non-continuous triangles arranged as a quad has six vertices. 50% more.

    So by using quads, we promote continuity and that's always a good thing because it means less data and faster drawing.

    Non-planar quads are the ones you need to be careful about and can lead to unexpected results. Unless you're using predictable tessellation, you may find that in-game the non-planar quad is triangulated in one of two ways to resolve it's topology. This can be especially noticeable on low poly characters where skinned quads are undesirably deformed on high interest areas such as shoulders and knees. I'd suggest triangulating these appropriately beforehand.
  • EarthQuake
    Options
    Offline / Send Message
    54Strat wrote: »
    A quad is just two optimized triangles and has four vertices.

    Two non-continuous triangles arranged as a quad has six vertices. 50% more.

    So by using quads, we promote continuity and that's always a good thing because it means less data and faster drawing.

    Not really. A quad is just two triangles with the edge hidden.

    Quads will not save you any vertices, the vertex count is the same regardless of quad, ngon, or triangle. You will save an insignificant amount of memory on storing the unique indices, but this is totally irrelevant to performance. Many modern GPUs can't even handle quad indices, so its basically moot.

    Plus, a video card doesn't know how to draw a "quad", only triangles, if you manually split up your quads or ngons into triangles (triangulate) or not, by the time it gets to a game engine or to your GPU drivers its a triangle mesh one way or the other.

    Smoothing groups/hard edges, uv seams, and material splits do affect vertex count, however.
  • 54Strat
    Options
    Offline / Send Message
    54Strat polycounter lvl 5
    EarthQuake wrote: »
    Not really. A quad is just two triangles with the edge hidden.

    Sorry, but yes really. When we're talking about vertex load and complexity, a quad that is treated as such in maya or max or whatever will be treated as two optimized triangles in game with four vertices, two of which are shared. Even if you triangulate this quad, as long as you preserve it's continuity it'll still have the same four vertices.

    However, breaking continuity by splitting any normals, vertices, uvs or materials on these shared vertices will increase the vertex count up to two when it get's in game and is totally relevant concerning performance.

    So it's not moot, it's very important especially on PS3 where we have independent vertex and fragment shader pipelines, so it can be very easy to get vertex bound.

    If you want to go deeper, how these triangle strips fill up vertex caches also plays a part in performance, but that's super boring and not relevant here, but it does serve to illustrate that a lot more goes on than is usually assumed.
  • EarthQuake
    Options
    Offline / Send Message
    54Strat wrote: »
    Sorry, but yes really. When we're talking about vertex load and complexity, a quad that is treated as such in maya or max or whatever will be treated as two optimized triangles in game with four vertices, two of which are shared. Even if you triangulate this quad, as long as you preserve it's continuity it'll still have the same four vertices.

    However, breaking continuity by splitting any normals, vertices, uvs or materials on these shared vertices will increase the vertex count up to two when it get's in game and is totally relevant concerning performance.

    So it's not moot, it's very important especially on PS3 where we have independent vertex and fragment shader pipelines, so it can be very easy to get vertex bound.

    Did you get past the first line of my post before writing this up?
    EarthQuake wrote: »
    Smoothing groups/hard edges, uv seams, and material splits do affect vertex count, however.

    ^ Which is more or less the same concept as you're trying to explain here.

    You seem to be operating under the assumption that you have a single quad, and then two detached or non-continuous triangles, which is just a really odd way to look at it and not relevant to much of anything, unless your model is flat shaded and you've got split vertices for every face (which virtually never happens in games).

    Again, triangulating your mesh will not increase vertex count, though it may increase the number of unique indices your mesh has (which is basically moot). Your post seems to suggest otherwise, and is really confusing to someone who doesn't understand the technical side.
  • 54Strat
    Options
    Offline / Send Message
    54Strat polycounter lvl 5
    EarthQuake wrote: »

    You seem to be operating under the assumption that you have a single quad, and then two detached or non-continuous triangles, which is just a really odd way to look at it and not relevant to much of anything, unless your model is flat shaded and you've got split vertices for every face (which virtually never happens in games).

    I'm using this to illustrate that triangles and quads can be quite different in game, even though in the DCC app they can appear similar in result.
    EarthQuake wrote: »
    Again, triangulating your mesh will not increase vertex count, though it may increase the number of unique indices your mesh has (which is basically moot). Your post seems to suggest otherwise, and is really confusing to someone who doesn't understand the technical side.

    My posts, like yours, are trying to explain that continuity, or rather the lack of continuity causes performance degradation, and this can stem from a lack of understanding of how geometry is arranged.

    So quads are not just two triangles, they are two optimized triangles, which is a good thing. It's also the reason why the diagonal edge in a quad can be hidden.

    Our posts are saying the same thing more or less.
  • Bartalon
    Options
    Offline / Send Message
    Bartalon polycounter lvl 12
    The only thing quads seem to be useful for is a smooth work flow within modeling applications; they just give the convenience of hiding and ignoring these triangle edges that cut through every quad or ngon on your model (regardless of whether you can see them or not).

    Some tools/techniques start to break down if triangles are used. Simplest example would be to subdivide a triangulated cube. Same vertex count as an all-quad cube (assuming proper smoothing groups, etc.) but it'll end up looking like a lumpy wad of gum rather than a neat sphere.

    In very low poly situations triangle edges matter if a quad is bent too much, causing the application to draw that invisible triangle edge from one corner to the other, often choosing the shortest distance which may not be what the artist wants. If this added triangle edge doesn't land on a seam, smoothing border, or material ID, border, the vertex count is not affected.

    I believe the most optimal thing to display would be vertex count, however the numbers shown in Max and Maya do not take the various types of edge splitting into consideration and are therefore incorrect in a lot of circumstances.
Sign In or Register to comment.