A couple questions on modeling for games

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
doornail
Halfling
Posts: 48
Joined: Fri Jul 08, 2005 4:44 pm

A couple questions on modeling for games

Post by doornail »

When it comes to low poly modeling for Ogre3D:

I've heard you should avoid triangles (three vertice faces) when modeling in Blender and always go for quads (four vertice faces). I'm guessing that this is because triangles can cause odd creases when using Blender to render. Is this also an issue with game models or do game engines basically render all faces as flat (but shaded) anyway?

And are quads rendered as two triangles? So if my model has 300 quad faces, it will have 600 in game?

Lastly, with models that wont be deformed (like a sword), is it better to keep the whole thing one mesh surface or should I use sub-objects that bisect (like have a blade mesh that collides with the hilt mesh) if it reduces the polygon count?

Thank you.
User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 2
Contact:

Post by Kencho »

Most (if not all) the graphics cards convert quads (and any other polygon) to triangles, so if you want to control the right shape of the model (for instance, when animated), you should use tris (or at least convert all the quads to tris and check them just before exporting), as a quad can be converted to tris in two different ways, depending on the implementation (and hence, the vendor).

Also, I would suggest you not to use intersecting polygons, specially if you plan to use transparency and/or shadows. But that's just a matter of balancing which is better: Less triangle count or better performance/visual aspect.

Of course, avoid 'T' vertices ;)
Image
Minion
Gnoblar
Posts: 19
Joined: Fri Mar 25, 2005 5:46 am

Post by Minion »

Modelling in quads is something people normally recommend because triangles can (*SUPPOSEDLY*) lead to animation deformations that you do not want. Personally I don't understand the premise of this.

If you use ZBrush, you cannot, and I stress this, CANNOT have triangles in your model. Zbrush will not subdivide triangles properly, only quads.

Intersecting meshes can lead to awkward and more complex shadowing but that's pretty much its only drawback.
reimpell
OGRE Contributor
OGRE Contributor
Posts: 570
Joined: Mon Mar 01, 2004 10:35 am
Location: Hamburg, Germany

Re: A couple questions on modeling for games

Post by reimpell »

doornail wrote:And are quads rendered as two triangles? So if my model has 300 quad faces, it will have 600 in game?
The exporter will split all quads into triangles on the shorter diagonal.
doornail
Halfling
Posts: 48
Joined: Fri Jul 08, 2005 4:44 pm

Post by doornail »

Ok, because a couple times I've gone to stitch together two meshes and ended up with the last face forming a triangle. I wasn't sure if this was a Bad Thing(tm) or not. I probably need to study the best ways to transition from X sided polygons to Y.

Kencho,

What are 'T' vertices?

Minion,

No Zbrush. Doing everything in Blender.

Reimpell,

Thank you for the Blender/Ogre3D exporter, Sir.
User avatar
DrPain
Gnome
Posts: 349
Joined: Tue Jul 05, 2005 2:51 pm
Location: Connecticut, USA

Post by DrPain »

doornail wrote:What are 'T' vertices?
T vertices are when you have an intersection of two triangles aligned with an edge of another triangle, thusly:

Image

The T vertex in this instance is circled in red. Triangle C should be split at this point to avoid the T intersection.
Rixeh
Greenskin
Posts: 135
Joined: Sat Nov 20, 2004 8:36 am

Post by Rixeh »

The reason "Quads Are Good" is because the "stress point" is directly in the middle of four vertexes. This makes it very deformable, as you will know exactly where the bend point is (right in the center). This goes for SubDs as well, when converted to a surface, a quad will deform in a predictable way. Triangles, having only 3 vertexes, will have a stress point that might not always be dead-center (say you have 1 point way the hell out there, and the other 2 are close together).

Using quads is always preferred when doing modeling for animation because of that. But quads will always get triangulated before a render (or when you bring it inside Ogre). This is ok - the 2 triangles were made out of a single quad, so they are mirror copies and will deform the same way. ;)

BTW, having a few tris in a mesh of quads isnt necessarily a bad thing. I know of some people that don't give a shit if they split their polys all over the place because they can visualize the edge flow so well.
User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 2
Contact:

Post by Kencho »

Minion wrote:Modelling in quads is something people normally recommend because triangles can (*SUPPOSEDLY*) lead to animation deformations that you do not want. Personally I don't understand the premise of this.
this is what happens. Think you have a quad. When you split it into two triangles, you can come with any of these:

Code: Select all

Possibility #1:
+----+
|\   |
| \  |
|  \ |
|   \|
+----+

Possibility #2:
+----+
|   /|
|  / |
| /  |
|/   |
+----+
The problem here is that your model might look fine when animated (or just rendered) in your modelling tool with #1, but maybe the exporter takes the #2 approach, and then your model looks ugly into the engine.
reimpell wrote:The exporter will split all quads into triangles on the shorter diagonal.
Fortunately reimpell advances you which approach the exporter will take ;)
Image
reimpell
OGRE Contributor
OGRE Contributor
Posts: 570
Joined: Mon Mar 01, 2004 10:35 am
Location: Hamburg, Germany

Low Poly Modeling

Post by reimpell »

There is an excellent article about low-poly modeling: Paul Steed, "Low Poly Tricks, Tips & Techniques". E.g. in the section "Accommodation" you can see a benefit of quads, whereas in section "Having the Right Set of Balls" you can see a benefit of triangles.

Further articles by Paul Steed are linked from the worldforge site.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

/* Puts on TODO: Add these links to some Art-related section of the Ogre Wiki :) */

/* Hopes that someone beats me to it! :P */
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Minion
Gnoblar
Posts: 19
Joined: Fri Mar 25, 2005 5:46 am

Post by Minion »

Kencho wrote:
Minion wrote:Modelling in quads is something people normally recommend because triangles can (*SUPPOSEDLY*) lead to animation deformations that you do not want. Personally I don't understand the premise of this.
this is what happens. Think you have a quad. When you split it into two triangles, you can come with any of these:

Code: Select all

Possibility #1:
+----+
|\   |
| \  |
|  \ |
|   \|
+----+

Possibility #2:
+----+
|   /|
|  / |
| /  |
|/   |
+----+
The problem here is that your model might look fine when animated (or just rendered) in your modelling tool with #1, but maybe the exporter takes the #2 approach, and then your model looks ugly into the engine.
So then why is it that people claim triangles cause deformations, not quads?

Your description seems to imply that modelling in triangles is better but this is the opposite of what most animators say.
User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 2
Contact:

Post by Kencho »

Mainly because modelling for a game is different than modelling for complex render/animation (way more complex than the render algorithms for games).
I suggest you to render in quads, as I find it easier too, but convert to triangles just before exporting. Then, you can check if the animation is ok or not. You might need to invert some edges... (passing from #1 to #2 or viceversa)
Image
User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 2
Contact:

Post by Kencho »

Image
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

Thanks, Kencho! :)

I don't know the terminology, but using quads for modelling enables you to use *organic* modeling - NURBS and bezier stuff, which you cannot do using triangulated meshes.
Just my 0.2 DKK. :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 2
Contact:

Post by Kencho »

I'm not sure, but I remember seeing a modelling tutorial for MAX where someone explained the usage of quad and triangular NURBS patches to model a face. I'm not sure of this though. Some experienced modeller that could clarify this, please?

[EDIT]
Clarified: ALL the NURBS patches are quads :)
Last edited by Kencho on Tue Jul 26, 2005 12:50 pm, edited 1 time in total.
Image
Minion
Gnoblar
Posts: 19
Joined: Fri Mar 25, 2005 5:46 am

Post by Minion »

All nurbs patches are 4 sided (even nurbs spheres dont have 3 sided patches.) You create pseudo-3sided patches by collapsing points onto eachother on one edge, but the nurbs patch itself is still a quad.

Disregarding patch modeling though even in poly modeling its generally favorable to use quads because you can use edge functions (edgeloop, edgering, ringsplit, loopsplit, etc.)
doornail
Halfling
Posts: 48
Joined: Fri Jul 08, 2005 4:44 pm

Post by doornail »

I have to say, this is a great board. Thanks for the clarifications, Everyone.
User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 2
Contact:

Post by Kencho »

Glad you found our answers useful :)
Image
Post Reply