Welcome to the TWC Wiki! You are not logged in. Please log in to the Wiki to vote in polls, change skin preferences, or edit pages. See HERE for details of how to LOG IN.

Difference between revisions of "Beveling"

From TWC Wiki
Jump to navigationJump to search
(category added)
Line 1: Line 1:
 
There is information floating around, especially of recent, about never having hard edges (except in certain cases), and instead, bevel everything.  The information here is not from my own investigations, but merely what I've heard, checked, and had confirmed.
 
There is information floating around, especially of recent, about never having hard edges (except in certain cases), and instead, bevel everything.  The information here is not from my own investigations, but merely what I've heard, checked, and had confirmed.
 +
 +
===How Real-Time Rendering Works===
  
 
===Should I Bevel Everything?===
 
===Should I Bevel Everything?===

Revision as of 17:27, 4 June 2007

There is information floating around, especially of recent, about never having hard edges (except in certain cases), and instead, bevel everything. The information here is not from my own investigations, but merely what I've heard, checked, and had confirmed.

How Real-Time Rendering Works

Should I Bevel Everything?

Well, no. In many or most cases, beveling will have exactly the same cost as a hard edge. However, your poly count will increase by two for each beveled edge... suddenly we go from a 12 faced cube, to a 44 faced cube (try it out). And your vertex count will increase as well. But what we have to worry about is not what our modelling program tells us about vertex count, but how the GPU treats vertices.

A vertex is broken or split when it has a hard normal, or new UV coordinate. Let us take the cube again. We select all vertices, and we get 8 vertices. However, if this cube has hard normals (no smoothing groups), we have 24 vertices! Each vertex is broken for each coincident face. Smooth normals do not break the vertex, so a box with one smoothing group will have a vertex count of 8 (well... not really but let's say it does, for now).

What has how much?

So, to recap:

  • Hard Cube in Software: 12 faces, 8 vertices
  • Hard Cube in Game: 12 faces, 24 vertices
  • Soft Cube in Software: 12 faces, 8 vertices
  • Soft Cube in Game: 12 faces, 8 vertices

However, the soft cube looks like crap, because soft normals at a 90 degree angle distort things far too much. Beveling, however, splits this 90 degree transition between two angles, for two (close to) 45 degree transitions, that look infinitely better than the soft cube, and, when lit correctly, far better than the hard edge (since now its edge will catch highlights, which is very important).

  • Soft Beveled (Chamfered) Cube in Software: 44 faces, 24 vertices
  • Soft Beveled Cube in Game: 44 faces, 24 vertices

As I stated earlier, its only vertex count that is really important, and the vertex count between the hard cube and soft chamfered cube is identical, but the latter looks much better. So, always bevel, right!

Wrong.

Vertices break at discontinuous UV's as well. So, where you have a break in UV's, you can have a hard edge, and you won't increase your vertex count, since they are breaking anyway.

Epitome of Efficiency

Let us consider the most simple example, a cube, with no top or bottom. We apply a Cylindrical UV Map with its UV border at Edge 1 (vertices 1 and 2, let's say).

So, what is the best arrangement? We should bevel edges 2, 3, and 4. Edge 1, since it is broken for the UV's, we can leave Hard.

Conclusion

The conclusion here isn't really to try to get one to achieve pure mathematical efficiency and plan out your UV's according to where your hard normals would be (though this isn't a bad idea if you can manage it, since hard normals will hide seams). It is just so that you are aware of the math behind beveling and broken vertices. Use this knowledge well.