Quads vs. Triangles
Started by Vincent_M, Nov 10 2011 03:45 PM
5 replies to this topic
#1 Members - Reputation: 295
Posted 10 November 2011 - 03:45 PM
My environment modeler was telling me that the engines she's used, such as Unity, accept geometry in batches of quads instead of triangles. I've always thought models were stored a in triangle lists. She also uses Headus to UV unwrap textures onto our OBJ models, but again, it only loads OBJ files as quads. This appears odd to me as most models should be stored as triangle lists or triangle strips. OpenGL supports quad rendering, but I do not think it's that efficient on most GPUs, and OpenGL ES doesn't support quads.
Which are better support-wise and performance-wise?
Which are better support-wise and performance-wise?
Ad:
#2 Members - Reputation: 1377
Posted 10 November 2011 - 04:48 PM
for tessellation it makes sense to have quads, but in general you have rather just triangles, my engines also always 'support' triangles (like you said, loading .obj), but I convert them into triangles on load.
is there any reason that would prevent you from splitting a quad into two triangles?
is there any reason that would prevent you from splitting a quad into two triangles?
#3 Moderators - Reputation: 5415
Posted 10 November 2011 - 06:55 PM
How artists author meshes and how you render them are independent. An artist can author with quads, and then you can just split those quads into triangles during export or mesh processing. You're almost always going to want to render with triangles, since that's what GPU's natively support.
#4 Members - Reputation: 534
Posted 10 November 2011 - 07:13 PM
Tessellation doesn't need quads, it can slightly better than using triangles in some cases, but your GFX card will split quads to triangles in the end. I don't know what the overhead is in instruction cycles to split quads to triangles, but if you send triangles it won't need to split them up. Most likely the splitting takes almost 0 time anyway, but again its still something.
#6 Members - Reputation: 1377
Posted 11 November 2011 - 06:42 AM
that's not fully the case, you have always two ways to split a quad. imagin a plane with all vertices in diagonal from top left to bottom right, splitting the quads also along the topleft-bottomright border will give you one straight bump, splitting topright-bottomleft will give you a lot of peaks.How artists author meshes and how you render them are independent.
It's differently solved between content tools, I had it implemented based on what I saw in 3dsmax, but as the artist in my company used maya, they complained about quite some cases where it looks odd.
simplest solution is of course to triangulate in the content tools.
.it can improve quality quite a lot if you use quads. the problem isn't just the pure triangle vs quad tessellation, but the usual smoothing that you apply. with just 3 'anchor' points, you won't have the smoothing of the mesh curvature like with 4 per primitive.you can of course try to use the same smoothing informations (e.g. based on nurbs data that you pass as constants), but then you end up with twice as many source primitives.Tessellation doesn't need quads, it can slightly better than using triangles in some cases
from my experience it was faster to use quads than triangles if you don't use smoothing. if you use smoothing, it's faster to use triangles than quads, because you evaluate just 3/4 the data for triangles. but if you try to reach the same quality in both cases, you have more work on triangles and you end up way slower.I don't know what the overhead is in instruction cycles to split quads to triangles, but if you send triangles it won't need to split them up. Most likely the splitting takes almost 0 time anyway, but again its still something.
that's a sample of the quality difference you can get when tessellating with quads vs triangles
the problem is not that triangles were inferior, but if an artist creates tessellation content with quads, they don't validate it with triangles, this can have unpredicted results.






