Jump to content
  • Advertisement
Sign in to follow this  
giugio

Unity Faces, Edges, Vertices, Indices

This topic is 3784 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hy . I'm reading the article 07 in nehe about a poligon class. I'm not understan this concept(edges) The edge setup immediately looks more attractive, but there is a problem. Without some difficult coding, there is no way for one edge to know if it is next to another one, so you can only draw wireframes. If this is all you intend to do, then that is fine. In particulary "there is no way for one edge to know if it is next to another one, so you can only draw wireframes" another question: what is hard edges? what they do? and what is the difference between hard edges and edges? I' read about on http://www.gamedev.net/community/forums/topic.asp?topic_id=500413&whichpage=1� Thanks

Share this post


Link to post
Share on other sites
Advertisement
The issue with hard edges is that sometimes you need some edge on your mesh to be hard to look/feel right - it is a common edge on the boundary of two logical/functional mesh subparts. Then, the artist makes sure that the vertices on edge get duplicated and each set of vertices is assigned a different normal. Thus, you are left with two sets of vertices, both describing same edge, just with different normal. That`s why it`s important to create the triangle list based not on unique vertices, but their combination - i.e. uniqie normals and/or unique texture coords (it`s common for a vertex to be duplicated 3-4 times in the mesh due to it having 3 or more texture coordinates (since it ison boundary of 3 or more faces, each being textured with different part of texture)).

Share this post


Link to post
Share on other sites
I've also been interestded in this (since i'm making a export from 3ds max to my dx app). So the final mesh in the game usually has more vertices than the one in the 3d modeling programming?

Share this post


Link to post
Share on other sites
Definitely. And if you`re texturing your mesh with utilities like Bodypaint, where you manually paint the texture, rest assured that each vertex shall be usually duplicated as many times, as there are faces containing this vertex. Which might be a lot in case of a hi-poly mesh.

So, let`s say that your mesh in 3dsmax has 2000 vertices and 1000 faces. After the texturing it can have easily 3000 unique vertices, and each of them has to be transformed during rendering.

This can lead to initially ironic situations, when you reduce the polycount (number of triangles), but raise the actual unique vertexcount.

And the graphics card is transforming vertices (calling Vertex Shader upon each vertex), not polygons. So, it`s not the poly-count that is important, rather the unique vertex-count.
Unfortunately, 3dsmax doesn`t show that information right away, while modelling. Not sure about the latest versions, maybe there`s some option under main menu. If not, you can always export the collapsed object into ASE and check yourself for value of MESH_TVERTLIST, which is the number of unique vertices.
Of course, many of them will be duplicated in neighbouring polys (gone from post-trasnform cache), thus raising the transform cost of the mesh.

Share this post


Link to post
Share on other sites
Quote:
Original post by joe1024
So, let`s say that your mesh in 3dsmax has 2000 vertices and 1000 faces. After the texturing it can have easily 3000 unique vertices, and each of them has to be transformed during rendering.

That's incorrect. Using indexing you'll avoid multiple transformations of vertices.

Share this post


Link to post
Share on other sites
but with index i must use more than one field for texture in a vertex structure(in c++)?

but for the original post....
A Polygon structure will need and array of vertices, certainly. However, it will need either:

1. An Array of Edges, each edge having a pair of Indices into the vertex array. With this layout you would dray a series of lines.
2. An Array of Faces, each one having a variable array of Indices into the vertex array. With this setup, you would iterate through the index array, drawing a polygon for each face.

The edge setup immediately looks more attractive, but there is a problem. Without some difficult coding, there is no way for one edge to know if it is next to another one, so you can only draw wireframes. If this is all you intend to do, then that is fine

why?????
"so you can only draw wireframes"

Sorry , but i'm not understand, this class(http://nehe.gamedev.net/data/articles/article.asp?article=07) draw only wireframe???

sorry for my english.

Share this post


Link to post
Share on other sites
I've read the article and it's all fine when you're drawing your models in immediate mode, but what when you want to draw them using VBO's or vertex arrays? You can't have a seperate index array for the texture coordinates. How would this work then?

Jeroen

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!