Page 1 of 1

Descent 3 Able To Support 4 Sided Polygons?

Posted: Sun Apr 01, 2007 3:45 am
by []V[]essenjah
Can Descent 3 handle square polys? I just want to confirm this. I noticed that when I extracted the original Pyro-GL mesh and viewed it with OOFEDIT, I noticed that half the polygons were in fact four-sided! I thought D3 could only handle triangulated meshes?


If it can handle this, it would reduce my current 2500 triangulated mesh to about 1500 polygons. Allowing room for a lot more improvement!

The problem will be finding a good converter that will handle the job. I generally use Milkshape 3D and convert it with a utility that a friend wrote a few years back when I was modeling for the MSDS team.

This means that I may need to find someone that I can pay to write a plugin for Blender to handle the job. Shouldn't be too bad since there isn't any animation involved. Just need it to preserve texture coordinates and four-sided polys.

Posted: Sun Apr 01, 2007 4:40 am
by Floyd
in fact it handles n-sided polygons. i don't know what the maximum of n is though.

Posted: Sun Apr 01, 2007 6:32 am
by BUBBALOU
polygons are 3 sided.... what are you talking about?

hiding faces?

1 faced polygon = 3 vertex
2 faced polygon = 4 vertex

Re:

Posted: Sun Apr 01, 2007 7:26 am
by Floyd
BUBBALOU wrote:polygons are 3 sided.... what are you talking about?

hiding faces?

1 faced polygon = 3 vertex
2 faced polygon = 4 vertex
polygons have "many" sides, as the name indicates ("poly": greek for "many", "gon": greek for "angle"). a 3-vertex or 3-sided polygon would be a trigon/triangle and a 4-sided a tetragon then, and so on.
a face is the actual "filling" of a polygon on the side of the normal. thus, a polygon can have one or two faces, no matter how many verts it has.

in short: a polygon is an n-sided, geometric shape. it doesn't even have to be flat or closed (-> polytope), though geometry defines a polygon as 2D, thus flat.

a circle for instance, would be a polygon with infinite verts/sides. the cut figure of two cylinders is also a polygon, and not necessarily flat (then it's a polytope).

the polygon in computer graphics is just an exceptional case where the polygon is closed, flat, and in many cases 3-sided.

Posted: Sun Apr 01, 2007 1:37 pm
by []V[]essenjah
Floyd gets an A ;)


Simple Geometry actually.

In Maya, you can have as many sides to a poly as you wish. I'm just wondering if it makes a difference in Descent 3.

Posted: Sun Apr 01, 2007 2:31 pm
by Floyd
though i already said that, does this answer your question? ;)

Image

Posted: Sun Apr 01, 2007 3:41 pm
by []V[]essenjah
Image



:) This would make a HUGE difference in my models. IF we can get a converter for Blender that is.

Posted: Sun Apr 01, 2007 7:07 pm
by BUBBALOU
32+16+16 = more than one polygon in a modeling program for your 16 sided cylinder with 2 caps FLoyD! DoH!

64 Polygons bro! not including if you have that cylinder segmented in D3 Edit!

Posted: Sun Apr 01, 2007 7:30 pm
by []V[]essenjah
Interesting. So what your trying to say, is, that no matter what I am seeing here, those are not in-fact 4 sided polygons. Those are actually two different polygons, displayed as a 4 sided polygon by hiding the faces?

So what is going to have more of a performance hit on D3 in the end. Faces, or polygons?

And according to your statement Bubbs, that would be 64 faces, not polys.

If those are polys, the model would have to be triangulated.


Basically, what I'm getting at is this:

My new Pyro-GL is 1500 polygons. When triangulated, I see 2500 triangular faces.

So.... is there a performance hit difference between the non-triangulated mesh and the triangulated mesh?

Posted: Sun Apr 01, 2007 9:21 pm
by aldel
The way I understand it, the GPU will convert any polygon with more than 3 sides into triangles on the fly before rasterizing it. The conversion, I'm guessing, takes basically zero time, so pre-converting two coplanar triangles into a quadrilateral will have no effect on performance. I'd be interested to see an actual benchmark, though.

Posted: Sun Apr 01, 2007 9:23 pm
by Kyouryuu
Doesn't Descent 3 simply triangulate n-gons where n > 3 at some point? Most games I know only work with triangles.

Posted: Mon Apr 02, 2007 7:45 am
by BUBBALOU
Polygon in 3D modeling; Three vertices, connected to the each other by three edges, define a triangle, which is the simplest polygon in Euclidean space.

For this thread we are talking Polygon Modeling.


Also look at the ADV/DIS section and D3 falls into that Fixed LOD category so it uses Polygon Meshes


\"snippit\"
Polygon mesh:
A collection of polygons, along with normal
vectors associated with each vertex of each polygon.
– Polygons are normally “stitched” together to form various
topological structures
– If the polygon mesh encloses a space, it represents a
solid object. Otherwise, it represents a surface.
– If the mesh is used to approximate a curved surface, the
normal vectors are the actual surface normals at the
associated verticies.

To get an accurate poly count for models intended to be used in games (face count), you must convert the model to an editable mesh before using the polygon counter. This is because the game engine will view the model in the same way, ie. with triangular faces. If you use the polygon counter with an editable poly, it'll count any sided poly, so the value will appear lower.

Posted: Mon Apr 02, 2007 11:07 am
by Floyd
bubba you don't want to argue with me over fly dirt, are you? the question discussed here is if the modeling actually supports n-sided polys, not how gfx cards or lowest level code handles it.
have you ever worked with d3edit? if so, remember how to fix t-joints? that's where my example is aimed.
also, what i stated is the geometrical (almost) correct definition, nothing else.

also, try \"outlinem\" in d3. then you see the engines top level polygon meshes, which are mostly 4-sided. which is what you have to put into the editor.

i'm not engaging in a flame war because you can't admit an obvious failure, be it careless lax writing or just lack of knowledge.
i'm out of this topic. people who HAVE to know, well - know. ;)

Posted: Mon Apr 02, 2007 11:55 am
by Ferno
you're getting polygons confused with tris bubba.

Re:

Posted: Mon Apr 02, 2007 12:14 pm
by []V[]essenjah
Ferno wrote:you're getting polygons confused with tris bubba.
Which is exactly what's confusing me. I talked to the guy in charge of Rebirth and Stryker yesterday. They both agree that square polys are more efficient. From what I was told, that in D2, they have both tris and squares because the square polys were more efficient but weren't as good for lighting. But tris were better for lighting but more resource consuming. So most games are trying to get better lighting. I doubt D3 has much to worry about though, since it's lighting system is less complex than current games. Also, make note that catmul-clark uses square polys for round surfaces since they seem to be very efficient at creating round shapes.

Just my $0.02. I could be wrong though.

Posted: Mon Apr 02, 2007 1:16 pm
by DigiJo
its name is POLYgone, its not triangle.

-Poly, a prefix often meaning more than one or many.

d3 supports polygones with up to 64 vertices, however, if a polygone has more then 32 vertices in any given mesh d3 might crash. (if i recall that right, long time ago i helped someone here from the dbb, cant remember who it was, with a bug in his high-poly md-ammo powerup. the reason it crashed d3 was to many vertices in one of the polygones)

most 3d-modeller programms work only with triangles, any given output-mesh is allways made from triangles. if you convert this meshes into the d3-orf format you have to join all the fitting faces made from triangles into polygones , otherwise the fps in d3 will get a hughe hit. (and alligning textures isnt really fun on triangle meshes...

Posted: Mon Apr 02, 2007 1:22 pm
by DarkHorse
Actually most 3D applications handle at least 4-sided polygons fine (because they're much more useful for subsurface modelling than triangles). Games don't.

Posted: Mon Apr 02, 2007 2:21 pm
by Sirius
Um, actually the name is polygon, not polygone.

P.S. You don't need a converter for Blender - export to a file format there IS a converter for and then try it.

Re:

Posted: Mon Apr 02, 2007 5:18 pm
by aldel
[]V[]essenjah wrote:But tris were better for lighting but more resource consuming.
Hmm, I wasn't even thinking about lighting. If lighting is calculated once per poly, you'd get better performance with quads than with (twice as many) triangles. If lighting is per vertex, you'd get the same performance. I think there's a place in the table file where you can set the lighting model for an object, but it's been a while since I looked at this stuff. But if you have a choice, lighting per vertex will give a smoother appearance for "rounded" objects. Gouraud shading does per-vertex lighting calculations, and I think that's one of the options in the table file.

Posted: Mon Apr 02, 2007 9:09 pm
by BUBBALOU
Messenger when you had your fill of whether a flat square polygon has 4 edges or 5 edges and all you're going to do is make square boxes then who cares..and listen to the D3Editor's otherwise File/Edges/Select All/View All in your own modeling program, convert to a Poly-Mesh and Export and Enjoy! KTHXBYE

Posted: Mon Apr 02, 2007 11:40 pm
by []V[]essenjah
Bubbs, I'm not trying to slap you here. But I tend not to draw conclusions from any single person. I listen to the viewpoints of many and make my own personal decisions. I'm not saying your wrong, I'm just confused, as are many others here.

I'm basing my thoughts on the advice of programmers, techs, D3 Editors and artists alike. Not just any single source.

That comment was VERY uncalled for. I never slapped you here. I know I haven't produced a mesh on this board for a few years. I've been busy watching VTM's learning 3 different 3D modeling programs and Photoshop and modding for other games. I didn't really want to deal much with this crowd for a while. I wanted to come back to it prepared, and here I am. I have a lot of experience at this point but I'm certainly no expert. Anyone, that is good at what they do, doesn't believe they know everything 110% about what they do. Especially involving technology as it is ever-changing. So, we constantly adapt and humble ourselves and embrace it.

I have produced more in-game meshes than I have ever seen from you. Hope your ego fits through the door on your way out.

Re:

Posted: Tue Apr 03, 2007 1:52 am
by []V[]essenjah
most 3d-modeling programms work only with triangles, any given output-mesh is allways made from triangles. if you convert this meshes into the d3-orf format you have to join all the fitting faces made from triangles into polygones , otherwise the fps in d3 will get a hughe hit. (and alligning textures isnt really fun on triangle meshes...
I think you are mixed up here. The only 3D modeling app that I am aware of that only allows you to work with triangles is Milkshape 3D. There may be others, but this is the only one I have ever seen. Maya, Max, Blender, GMax, XSI, all allow for multi-sided polys.

Where you convert it to polys, is either within the modeling program or within D3 Edit. There is in fact a button somewhere within the program to do that if I remember correctly.

Posted: Tue Apr 03, 2007 9:59 am
by Kyouryuu
The bottom line is if the Descent 3 models use n-gons, then there is no reason you can't. The wireframe of the Pyro you post shows this is the case, so you might as well do it. As is true of most games you can mod, treat the \"official\" content as gospel and best practice. In most cases, they've put it through the paces and know what they are doing. When in doubt, refer to their content. :)

Something deeper in the code might triangulate the mesh on-the-fly, but on your end, it shouldn't matter.

I would imagine, though, that for dynamic lighting reasons, you might not want to use things other than triangles or quads. I believe Descent 3's implementation of dynamic light uses vertex lighting. Open up any level with a circular floor in the Automap and you can see why vertex lighting doesn't play nice with n-gons for a large n.

For the record, most 3D modeling applications take any kind of n-gon. Games tend to use triangles because graphics cards are optimized around pushing triangles and because they are the lowest common denominator.

And BUBBALOU has it wrong (sorry, BUBBA). :P The definition he posted speaks of a triangle as the \"simplest polygon in Euclidean space,\" which is true and the reason, as I said before, why most games are optimized around them. However, it is not the ONLY polygon, merely the simplest.

In the original Descent games, I believe they relied on quads. However, if the quad was concave, they would then divide it into two triangles. This is easily seen on some maps with twisted floors, where the division between the triangles can \"shift\" depending on the angle you are looking at it. :wink:

Posted: Tue Apr 03, 2007 6:07 pm
by Sirius
The textures would do that, but not the face itself from memory - I think they had a rule for how to subdivide them.

Still, it was a kind of messy little feature that made some things rather difficult to get looking right...

Posted: Sat Dec 01, 2007 9:44 am
by psionik
Polygons can be N-sided in d3, the conversion happens in the card where everything is split into tris for rendering. There is also something called triangle stripping in modern engines where it will actually lay triangles on top of each other for the prerender. Models get really picky when shoved thru this process but it apparently speeds up render times. I never triple my models until theyre frozen/done and even then i make a separate tripled copy and keep the quad copy in lightwave. A large portion of 3d apps out there wont even let you make Ngons.