PDA

View Full Version : Triangles - Good / Bad - Why?


CombineMind
05-26-2009, 11:27 PM
Hello all I'm new here and wanted to get the input of the community on the issue of triangles in topology.

My friend last night who is enrolled in the graphics college I graduated from was asking me why triangles were bad. I could only think of the fact that in an area that deforms durring animation, a triangle can cause pops and uneven surface shading.

My professors in college however swore by having all quads though, and I can't for the life of me remember other reasons they were so serious about the issue.

Any input is greatly appreciated, thank you!

-Dan

eldee
05-27-2009, 02:24 AM
It all depends on what you're doing with it.. if you're doing SubD modeling and not animating, tris/ngons don't really even matter, because once you subdivide everything becomes quads anyway. If you're taking it into zbrush or something like that it's different, because some software doesn't handle tris very well, but yeah.. distortion while animating/deforming is the big one.

CombineMind
05-27-2009, 03:28 AM
Ive been seeing so many triangles on game studio art on this forum Im starting to think I've been wasting time trying to be 100% quad all these years.

I have a faint memory of having trouble importing an obj to mudbox when i was in school for normal mapping, would a triangle interfere with something like that?

jakobweiq
06-17-2009, 05:20 AM
not entirely true..

to think quad is equal to 2 tri, then the time u take to render will b like doubled.. unless ur PC config is top top notch or u haf a personal render farm :D

wat my lecturer like to enforce is to always keep it simple..

PieJesu
08-07-2009, 08:19 PM
People generally try and stick to quads as edge loops can be quickly added and it subdivides better without pinching (unless you intend for it to pinch).

Laa-Yosh
08-11-2009, 02:46 PM
Games are a completely different field, but even there if you build something for Zbrush (highpoly) then you should try to avoid triangles. Only on the ingame, low res model can and should you use triangles.

kab0om
10-17-2009, 06:02 AM
It is common practice to triangulate game models before exporting them to a game engine. This was to prevent deforming errors in an animation sequence which usually occurred when the collision detection scripts were active.

Most cg artist prefer to use quads simply because it is cleaner geometry to work with.

krisCrash
11-04-2009, 01:23 PM
People generally try and stick to quads as edge loops can be quickly added and it subdivides better without pinching (unless you intend for it to pinch).
Triangles and five-sided polygons can be used to CONTROL where those loops go, so in that sense they are awesome and useful (see also 3-poles and 5-poles)
I remember a very long thread about this at another forum, I can try to find it.

It is common practice to triangulate game models before exporting them to a game engine. This was to prevent deforming errors in an animation sequence which usually occurred when the collision detection scripts were active.

Most cg artist prefer to use quads simply because it is cleaner geometry to work with.
Another reason game engines require triangles is their rendering method.
Scanline and Raytracing renderers cast a ray from the pixel to see what geometry it hits
Realtime renderers project the geometry's faces onto the display.
A triangle is always planar, a polygon with more sides may not be and as such its exposure to light will be ambiguous.

At least that is how I understand it.

pjz99
12-27-2009, 11:57 PM
Polygons with more than 4 sides (n-gons) will be turned into one or more quads + one or more triangles when subdivided, only you don't have the choice of where the edge(s) will be cut. If you work with a modeler that does dynamic subdivision and you're working with a low poly control cage, you will see this plainly. Personally I don't think there is any point in working with n-gons, I don't think they can possibly do anything except make a model harder to modify the geometry and harder to UVmap.

Triangles are another matter. They behave predictably and can save you a lot of work, as long as whatever pipeline you're working with can handle them (not all apps like triangles).

krisCrash
12-28-2009, 06:54 AM
Would they convert to triangles along the triangulation lines?
Or along completely random lines?

If the first, it is fairly predictable after all... one can turn them on for display (in Max this shows as a dotted edge at the face's fold), and edit them, but not have them in the way of one's rings, loops, subdivisions etc. (pjz99: you probably know this, but to anyone having questions I explain more x3)

pjz99
12-28-2009, 08:10 AM
I'm only really familiar with Catmull-Clark subdivision (http://en.wikipedia.org/wiki/Catmull%E2%80%93Clark_subdivision_surface), in which triangles are 100% predictable. That is not to say they'll always do what you want them to do, just that what they do to a mesh, they'll do the same way every time. Which is the attached:

edit: err, I think you're actually talking about quads or n-gons with respect to "triangulation line". That line, for a quad, is (or should be, anyway) selected based on which points of a polygon form a plane, which means for a curved surface, that's predictable. For a flat surface, it's not (all points are planar).

krisCrash
12-28-2009, 10:56 AM
Whew, I learned something there, I had to experiment to see...
I think we are talking about 2 different things:
http://kriscrash.dk/art/09dec/trianglefuns.png
1: auto-converting n-gons to triangles: are the edges cut in a predictable manner?
Yes, they follow the triangulation "bends" (diagonals?) which you can set for polygons without putting an actual edge there. This can be shown via Object Properties, disable "edges only" display (in 3dsmax) and altered with "edit triangulation" (under face sub-object), this lets you draw a new diagonal.

2: subdivision predictability, does it respect triangulation lines?
No, it seems to average a tangential plane to the face, forming "saddles" from bent quads. 5-sided polygons perform the most unpredictably too.

then
3: triangle-conversion with subsequent subdivision, respects your convex and concave forms?
Yes, because you don't give it any choices.

Laa-Yosh
12-28-2009, 11:10 AM
The trouble with n-gons (and most of the times with quads around n-sided vertices) is that they break the continuity of the subdivided surface. The general solutions are
- don't use n-gons
- use as few n-sided vertices as you can
- and place them where surface continuity is broken anyway

pjz99
12-28-2009, 11:10 AM
The thing is, as the mesh is deformed (e.g. in animation) that triangulation line may change and create some drastically different surface, depending on the app you're using. With quads and triangles that will never happen. Triangulation line might swap corners for quads, but you'll get a predictable surface because there's only two options. Your pentagon example is a very good one, a cone section vs. a single elevated triangle.

pjz99
12-28-2009, 11:16 AM
Kris I'm actually surprised you got such different results for the pentagons using Meshsmooth vs. Turbosmooth (assuming 3ds Max) - I thought Turbosmooth was the newer algo that uses Catmull-Clark. I'm a bit surprised Meshsmooth does a more predictable job there.

krisCrash
12-28-2009, 12:05 PM
- and place them where surface continuity is broken anyway
I see, such as an extrusion?
And if you mean to end a loop? Oh I guess it needs to be redirected rather than ended.

Triangulation line might swap corners for quads, but you'll get a predictable surface because there's only two options. Your pentagon example is a very good one, a cone section vs. a single elevated triangle.
Very interesting point, I was not aware
That sort of gives triangles a weakness
and yes, the pentagon was just plain useless there

Kris I'm actually surprised you got such different results for the pentagons using Meshsmooth vs. Turbosmooth (assuming 3ds Max) - I thought Turbosmooth was the newer algo that uses Catmull-Clark. I'm a bit surprised Meshsmooth does a more predictable job there.
I didn't post any results for Turbosmooth (???). They're all done with the meshsmooth modifier on NURMS mode
I was not sure which one of the smoothers would use catmull-clark either, but went with meshsmooth as it has more options. Neither smoother respected the triangulation lines when approximating the new surface (though they have enough geometry to do so); that surprised me. I often uncritically toss a smoother on too.

I am beginning to think 3ds Max doesn't expect the average user to care for triangulation lines, since it applies them automatically (when creating a face), and trounces them again (when subdividing)

Well, I don't really have anything else to add to the thread.. I don't know a lot about this, really :P I only recently started looking into the triangulation lines after watching some of Ben Mather's stuff

pjz99
12-28-2009, 01:07 PM
Triangles aren't a big deal at all imo (as long as your apps are happy with them). There are a lot of aspects of topology where you bust your ass to make sure a section is all quads, and when you step back and relax, you realize all you did was achieve the same geometry as a subdivided triangle anyway. On the other hand, a corollary of this is, if you stick with the habit of modeling in all quads, eventually this becomes second nature and you don't really think about it any more.

edit: here's an example, see what I mean?

Laa-Yosh
12-28-2009, 01:47 PM
It does make sense to use a more dense mesh though, for example when you want to build some sharp edges into a hard surface model - UVs can get some serious stretching artifacts if you place thin and wide polygons next to each other. The only good and controlled way to deal with that is to increase the mesh density. It also happens with Zbrush a lot, because of how it deals with UVs and subdivision.
Organics can use more geometry as well, for more control over deformations.

Building a low poly mesh with triangles/pentagons and then subdividing it might be a valid modeling approach, but so far I've found that it needs a lot of reworking, because it tends to produce too much geometry. Still, it might be a good solution with some more refinement, I'll continue to experiment with it.

Laa-Yosh
12-28-2009, 01:50 PM
I see, such as an extrusion?
And if you mean to end a loop? Oh I guess it needs to be redirected rather than ended.


Not just extrusions - on characters you sometimes need to change the direction of the edge flow on top of the surface, like the cheek bones, temples, or the chest, shoulders etc.
In the end the best strategy for me has proven to be to minimize the number of n-sided vertices... which works fine with relatively dense geometry.

I should really do some personal stuff to have wireframes to show, though. Most of the models we make at work are copyrighted by the publishers and we're not allowed to publish images on our own...

earlyworm
01-22-2010, 02:08 PM
UVs can get some serious stretching artifacts if you place thin and wide polygons next to each other. The only good and controlled way to deal with that is to increase the mesh density.

This is only a problem if your UVs aren't subdivided using the same rules as your geometry - ie. Catmull-Clark subdivision with bilinear UV subdivision.

You can add mesh density by subdividing the mesh (negating any of the benefits of using SubD's in the first place) or additional edge loops to reduce the problem, but it can still cause artefacts.

The correct way to deal with this is by having the UVs use the same subdivision rule as the geometry - ie. Catmull-Clark subdivision with Catmull-Clark UV subdivision.

CGTalk Moderation
01-22-2010, 02:08 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.