Modeling for Torque - Quads or Tris?
by Nathan · in Artist Corner · 06/01/2005 (6:36 am) · 16 replies
Ok, I'm sure that Torque handles either/or in terms of quads or tris, but my curiousity (being more an artist and just a beginning programmer) is when I model in quads, should I manually cut them into tris so that the "strips" are uniform and flow appropriately?
I've seen game modeling tutorials where they discuss the inefficiency of "random" triangles that can occur from tossing on the "make quad to tri" menu feature in a modeling application. In dealing with Torque, what do you recommend.
On a side note, I haven't seen any wireframes from the games made with Torque (maybe I'm looking in the wrong place), if you can provide links or pics showing some geometry of the finished games, that would be awesome.
Thanks.
I've seen game modeling tutorials where they discuss the inefficiency of "random" triangles that can occur from tossing on the "make quad to tri" menu feature in a modeling application. In dealing with Torque, what do you recommend.
On a side note, I haven't seen any wireframes from the games made with Torque (maybe I'm looking in the wrong place), if you can provide links or pics showing some geometry of the finished games, that would be awesome.
Thanks.
#2
incidentally, letting the exporter handle the convrsion can result in significantly higher polygon counts IIRC.
Always better to model in triangles so you have more direct control over the output. (C;
06/01/2005 (7:04 am)
It's all triangles.incidentally, letting the exporter handle the convrsion can result in significantly higher polygon counts IIRC.
Always better to model in triangles so you have more direct control over the output. (C;
#3
That's exactly what I needed to know. Because, like I said, when exporting quads, who knows what the geometry will look like.
Thanks.
06/01/2005 (7:09 am)
@KirbyThat's exactly what I needed to know. Because, like I said, when exporting quads, who knows what the geometry will look like.
Thanks.
#4
06/01/2005 (7:10 am)
Glad I could help.
#5
@Kirby:
Of course it will be higher if you compare quads to quads converted to tris... a quad is two triangles after all. (Not sure about other software, but annoyingly 3d studio counts "polygons" rather than triangles making it seem like you have a whole lot less polygons than you really do).
But on the other hand I've noticed some other strange things with the max exporter, I always seem to get a couple of hundred extra triangles in the exported model compared to what max says for some reason. Really annoying. (I'm guessing it's some "optimizing" thing as I can take the exact same model and simply move things around a bit, export it again and I'll get a different polycount in the exported model).
06/01/2005 (9:45 am)
Yep. It's all converted to tris. I usually model (mostly) with quads, but I'm not overly zealotish about it if it's easier to use a triangle a little here and there. Once my model is done I'll convert it to tris and go over the whole thing making sure all the edges are turned the way I want them. @Kirby:
Of course it will be higher if you compare quads to quads converted to tris... a quad is two triangles after all. (Not sure about other software, but annoyingly 3d studio counts "polygons" rather than triangles making it seem like you have a whole lot less polygons than you really do).
But on the other hand I've noticed some other strange things with the max exporter, I always seem to get a couple of hundred extra triangles in the exported model compared to what max says for some reason. Really annoying. (I'm guessing it's some "optimizing" thing as I can take the exact same model and simply move things around a bit, export it again and I'll get a different polycount in the exported model).
#6
I've presonally always worked in triangles for game specefic content so I haven't paid much attention to how the Torque exporters work (with the exception of ms2dts). I didn't want to throw any assumptions out there as fact, but couldn't imagine they behaved differently. (C;
06/01/2005 (10:25 am)
Magnus - yeah, it's been my understanding that most exporters just split the quad to generate triangles, which would effectively double the polycount for all practical intents and purposes.I've presonally always worked in triangles for game specefic content so I haven't paid much attention to how the Torque exporters work (with the exception of ms2dts). I didn't want to throw any assumptions out there as fact, but couldn't imagine they behaved differently. (C;
#7
For the final models you still pretty much need to go to triangles though. Every little bit is important when doing low poly stuff, there's a lot of "cheating" you can do with triangles that just isn't possible with quads (without using twice as many polygons that is). As soon as it's okay to use 30-40.000 quads I'll dump tris.
I'd still like to get an explaination as to whats going on that's generating those extra faces though when I export my models from max. (no idea if this is a max specific behaviour or not, I haven't tried exporting to torque from any other tools).
06/01/2005 (11:01 am)
In the past I've always used tris from the start too, the last couple of years I've noticed it's a whole lot faster to work with quads though. Only half the amount of polygons you ever need to select =).For the final models you still pretty much need to go to triangles though. Every little bit is important when doing low poly stuff, there's a lot of "cheating" you can do with triangles that just isn't possible with quads (without using twice as many polygons that is). As soon as it's okay to use 30-40.000 quads I'll dump tris.
I'd still like to get an explaination as to whats going on that's generating those extra faces though when I export my models from max. (no idea if this is a max specific behaviour or not, I haven't tried exporting to torque from any other tools).
#8
That might shed some light as to how far reaching this anomaly really is.
~ Just a thought.
06/01/2005 (12:11 pm)
Magnus - have you tried exporting to a generic format like *.obj and viewing the mesh in another app?That might shed some light as to how far reaching this anomaly really is.
~ Just a thought.
#9
06/01/2005 (1:02 pm)
I don't really have any other program to try it out in right now (and I don't really have that much time to mess with it either). I did try to export a model as obj and then just reimport it into max though, exactly the same polygon count. My guess is it has something to do with the DTS exporter. But I still don't quite understand it, more vertices I can understand (there are a lot of situations where sharing vertices isn't possible), but more triangles makes absolutely no sense to me.
#10
Often starting with quads is a good idea, but with low poly work you often want to start with the tris towards the end, also turning the tris lets you optimize your mesh for animating, and controls how smoothly the mesh is lit over its surface normals.
It's particularly handy with quads as you can check your triangulation and see what state your model is in before export, and can turn edges to make better meshes for stripping or whatever your engine supports.
I've used alot of engines but only recently started working with torque so I'm not sure what kinds of optimizations it supoprts. Judging by the showtool it takes triangle stripping into account, what about fans and such, or best to stick with strips as much as possible?
Not sure about the DTS exporter, but often exporting mirrored geometry from max can add a few polys or verts as sometimes the seam where the halves join don't get exported correctly and you end up with different polycounts. Another thing to take into account is that certain type sof multitexturing requre more than one render pass and so polys get drawn multiple times, Same goes with edges of multimaterial objects, or edges of smoothing groups where often the verts will be doubles to get the crease you need for the sharp edge.
So some of your poly/vertex issues may be nothing more than how the mesh is rendered in GL or D3D
06/01/2005 (3:31 pm)
If your using max and quads thereas an easy solution, just go to the display tab and uncheck edges only, or rigt click on your objects and uncheck edges only and you can see the triangulation of your mesh and can use the turn tool to flip their orientation. Often starting with quads is a good idea, but with low poly work you often want to start with the tris towards the end, also turning the tris lets you optimize your mesh for animating, and controls how smoothly the mesh is lit over its surface normals.
It's particularly handy with quads as you can check your triangulation and see what state your model is in before export, and can turn edges to make better meshes for stripping or whatever your engine supports.
I've used alot of engines but only recently started working with torque so I'm not sure what kinds of optimizations it supoprts. Judging by the showtool it takes triangle stripping into account, what about fans and such, or best to stick with strips as much as possible?
Not sure about the DTS exporter, but often exporting mirrored geometry from max can add a few polys or verts as sometimes the seam where the halves join don't get exported correctly and you end up with different polycounts. Another thing to take into account is that certain type sof multitexturing requre more than one render pass and so polys get drawn multiple times, Same goes with edges of multimaterial objects, or edges of smoothing groups where often the verts will be doubles to get the crease you need for the sharp edge.
So some of your poly/vertex issues may be nothing more than how the mesh is rendered in GL or D3D
#11
I prefer to work with editable poly rather than editable mesh (it works fine for static objects, but before applying the skin modifier you have to convert it to a mesh object). I never really liked turning off "edges only" though, it makes everything so cluttered. If I have to turn an edge I either use the "Edit triangulation" tool in editable poly, or just simply create a new edge by selecting the vertices and running "Connect". And if I'm in an editable mesh I select the edges around the ones I want to turn so I can see what's going on.
06/01/2005 (3:40 pm)
@Adrian: Same here, worked with a lot of engines but just recently started doing stuff for torque. The exporter does indeed seem to automatically strippify the mesh (although this alone shouldn't create more triangles than what's already in the mesh should it?).I prefer to work with editable poly rather than editable mesh (it works fine for static objects, but before applying the skin modifier you have to convert it to a mesh object). I never really liked turning off "edges only" though, it makes everything so cluttered. If I have to turn an edge I either use the "Edit triangulation" tool in editable poly, or just simply create a new edge by selecting the vertices and running "Connect". And if I'm in an editable mesh I select the edges around the ones I want to turn so I can see what's going on.
#12
As I said before, vertices getting multiplied I can understand. As soon as something is different (could be even just that the same vertex exists twice in the UV map) that vertex probably have to get doubled. But how faces could get doubled I don't understand. I suppose I should try to export a really simple mesh and count the triangles manually... I'll do it some day if I get around to it.
As for mirrored geometry, I don't really buy that explanation. It's always advisable to collapse your mesh before adding a skin modifier and/or exporting.
06/01/2005 (3:48 pm)
@Adrian again: (hm, did you edit your post and add more info? Either that or I just missed the last part before =).As I said before, vertices getting multiplied I can understand. As soon as something is different (could be even just that the same vertex exists twice in the UV map) that vertex probably have to get doubled. But how faces could get doubled I don't understand. I suppose I should try to export a really simple mesh and count the triangles manually... I'll do it some day if I get around to it.
As for mirrored geometry, I don't really buy that explanation. It's always advisable to collapse your mesh before adding a skin modifier and/or exporting.
#13
I'm just wondering if perhaps you just had a similar problem. Might be worth trying it with your object and see what happens. When you load it back in. (both the max object pre export and the 3ds file had the same polycount in the max polygon counter, but only the imported 3ds file exported correctly and had matching numbers in the engine as to what was shown in max)
06/01/2005 (5:35 pm)
As far as the mirrored thing goes. I only discovered this one thing by chance. In the engine I was working on, we had AI floormaps made in max that had dynamic LOD assiged in game for plotting dynaic AI paths. Anyway to cut a long story short the AI couldn't pass over open edges. and I had a mirrored floormap. The reset Xform and colapse utilities in max seemed to work in max, but on export the plae where the mirror was welded was still classed as an open edge and there were a few dozem extra triangles. Despite being invisible vsualy, No matter what I did, the AI would not pass over the seam of the mirrored geometry. In the end the only solution that worked was to export the geometry to a 3ds or ASE and reimport the mesh. I'm just wondering if perhaps you just had a similar problem. Might be worth trying it with your object and see what happens. When you load it back in. (both the max object pre export and the 3ds file had the same polycount in the max polygon counter, but only the imported 3ds file exported correctly and had matching numbers in the engine as to what was shown in max)
#14
Showtool shows 1776 polygons and max 1392. (quite a big difference even!)
[edit: to clarify a bit, these counts are for both the original model and the imported .3ds, there's no difference at all).
I also tried a couple of other things. My model use several textures, so my first thought was; lets try only one. No change.
Then I though; hm... what happens if I collapse all the UV coords to a single point and weld them together? (to make sure it's not the UV mapping that's creating extra faces). Now it all of a sudden jumped down to 1719 polygons! Strange.
Just for the heck of it; My model already only had one smooth group, but I tried slitting it up in two; The poly count goes up to 1737.
I also decided to reduce my model down to 16 polygons; Showtool shows 18, but I could only count to 16 when I checked it.
So there's only two possible explainations I can come to; 1) The DTS "optimizing" routine does something very weird, or 2) showtool displays the wrong count.
You CAN reset the transformations in max by the way even though its a bit of a "hack". Just create a box and attach your mesh to it. Torque seem to want to have the transforms properly reset before exporting too so I've made a habit out of doing that with all my models.
06/01/2005 (6:20 pm)
Nope, that's not it. Showtool shows 1776 polygons and max 1392. (quite a big difference even!)
[edit: to clarify a bit, these counts are for both the original model and the imported .3ds, there's no difference at all).
I also tried a couple of other things. My model use several textures, so my first thought was; lets try only one. No change.
Then I though; hm... what happens if I collapse all the UV coords to a single point and weld them together? (to make sure it's not the UV mapping that's creating extra faces). Now it all of a sudden jumped down to 1719 polygons! Strange.
Just for the heck of it; My model already only had one smooth group, but I tried slitting it up in two; The poly count goes up to 1737.
I also decided to reduce my model down to 16 polygons; Showtool shows 18, but I could only count to 16 when I checked it.
So there's only two possible explainations I can come to; 1) The DTS "optimizing" routine does something very weird, or 2) showtool displays the wrong count.
You CAN reset the transformations in max by the way even though its a bit of a "hack". Just create a box and attach your mesh to it. Torque seem to want to have the transforms properly reset before exporting too so I've made a habit out of doing that with all my models.
#15
It is the stripping that's creating these "NULL faces". I noticed this when I tried flat shading a model (I just did it as a test since this effectively destroys the stripping routine as it creates strips with one face per strip). When I did this I got the exact same face count in max as showtool.
I confirmed my suspicions with Clark Fagot so this is what's happening; The exporter stitches all the strips together into one long strip by adding empty faces (that according to Clark should be ignored by the video card), so there's no need to worry. The higher polygon count showed in showtool is NOT the "real" polygon count. You can see in the dump file how many empty polygons are added by finding the line that says something like "178 strips with average length 14.01 (range 3 to 80) and 461 reversals", the 461 is the empty faces.
The one-long-strip method should be faster to render (on modern hardware) than using several shorter strips anyway so all is good.
07/16/2005 (2:36 pm)
Okay, I know this post is getting a bit old, but I've learned some new information now as to why showtool shows more polygons compared to 3d studio that I thought I'd share.It is the stripping that's creating these "NULL faces". I noticed this when I tried flat shading a model (I just did it as a test since this effectively destroys the stripping routine as it creates strips with one face per strip). When I did this I got the exact same face count in max as showtool.
I confirmed my suspicions with Clark Fagot so this is what's happening; The exporter stitches all the strips together into one long strip by adding empty faces (that according to Clark should be ignored by the video card), so there's no need to worry. The higher polygon count showed in showtool is NOT the "real" polygon count. You can see in the dump file how many empty polygons are added by finding the line that says something like "178 strips with average length 14.01 (range 3 to 80) and 461 reversals", the 461 is the empty faces.
The one-long-strip method should be faster to render (on modern hardware) than using several shorter strips anyway so all is good.
#16
Nice detective work! It's been bothering me for a while that the polycounts are different, and seemingly randomly. This explanation makes good sense. And now I know what that "reversals" thing in the dump file means too. Two birds with one stone, way to go. :)
07/16/2005 (3:07 pm)
Magnus, Nice detective work! It's been bothering me for a while that the polycounts are different, and seemingly randomly. This explanation makes good sense. And now I know what that "reversals" thing in the dump file means too. Two birds with one stone, way to go. :)
Torque Owner FruitBatInShades