Normalmaps for the Technical Game Modeler
By Ariel Chai, 7th of December 2007, all rights reserved.
*Article is currently a work in progress*

This article is aimed towards technical modeling (such as weapons vehicles, pros, etc), and i hope it will help to explain the pros/cons for smoothed and unsmoothed tangent normalmaps, and provide an overview for doom3's hybrid unsmoothed tangents method.
This article assumes knowledge of UV's, and the core idea of what normalmaps are.

Theory : Implementation : Advanced Features :


Intro : Smoothed and Unsmoothed Tangents

Normalmaps are baked differently depending on object's smoothing.
The renderer goal is to compensate for the smoothing, so the lowpoly with the applied result will be as close as possible to the highpoly version.





Smoothed Tangents - Smoothing Errors Problem and Walkaround

In current realtime rendering technology, smoothing on faces with hard angles (such as cubes, and sharp slopes), leads to bad shading - commonly referred as smoothing errors.



The walkaround to this problem, is to add more geometry to the edges - which makes them smoother, and lead to more accurate smoothing results by the realtime renderer.

Although this walkaround is useful for objects with a few problematic areas - on objects with a lot of sharp edges the polycount overhead would be tremendous, thus making this method pretty useless for most technical models.
This is also one of the reasons many games reserve normalmapping for characters (which are good for smoothing) and use very little on technical models.




Unsmoothed Tangents - Edges Errors Problem and Walkaround

Unsmoothed Tangents don't use smoothing, and therefore wouldn't have the above smoothing errors.
However let's render the simple box with Unsmoothed Tangents and see the problem that occurs :


The problems occurs because each face normalmap points to a different direction as illustrated below.
Even if the uv edge is exactly between the pixels, the way those pixels would be pulled by the realtime renderer will mix them up resulting in a sharp normal transition which stands out from the rest.


So, where there are seams, this problem won't occur - therefore using unique uv's would completly eliminate the problem.


As you can see, this UV both sacrifices precious texture real-estate, and also impractical to texture first hand. However it can still be used with projection technology (which is available for most high-end packages) - for example this can be textured on a proper UV second hand and then projected to this model with the unique UV's.




Doom3's unsmoothed tangents

Although Doom3 has a standard support for Smoothed Tangents, The Unsmoothed Support is different. (accessed by adding "unsmoothed tangents" to the material file)


Although not properly documented, this method proves very useful when used right. (and the above pic isn't one)
It is a hybrid map between smoothed and unsmoothed tangents with texture mirroring support.
The general approach is that the smoothing occurs only on faces which are connected in the UV map, and thus can be said (though not accurately) that each UV island act as a different smoothing group.

The benefits are many and as follows :
1. Since we saw unsmoothed tangents are accurate but have edge errors for connected uv islands, smoothing comes between those faces to correct it.
2. Doom3 borrows the advantage of unsmoothed tangents by applying no smoothing on UV island's seams (borders), which means less smoothing errors at no cost.
3. It eliminates the need of an app that supports smoothing groups, and make them accessible from any 3d package that supports UVing.
4. Can use automatically generated UV's (with pretty good results) when testing the model before UVing.


A few notes when uving for doom3 tech :
1. This method still has smoothing errors, but a lot less, the popular error is the "orange/green" cut, however with experience it can be predicted. Therefore you'll have to modify you UV routine, usually that simply means breaking the uv into a few more island, i found out that rougly each UV island on a "normal" UV would split up to two island on doom3.
2. When using LWO's, you might find it useful to turn smoothing angle to 360 degrees, or you will experience some odd problems every now and then.




3d studio max's smoothgroups

This theory can be replicated through the use of 3ds max smoothgroups, although it's not as efficient, the results are satisfactory.
  1. Wherever there's extreme sharpness - seperate to smooth groups.
  2. Make sure UV Islands don't contain multiple smooth groups, or you'll have a black line where they seperate.
  3. This is mainly needed for the baking, post baking you can use the next method.






Implementing the theory in engines without smooth groups

If you're working on an engine or package that doesn't have smooth groups, the only way to break smoothing is by manually seperating the geometry where you'd put a smoothing group. (so the faces won't be connected)
This is quite simple, and is widely used - unfortunately when baking wth this method geometrical data is lost where the edges, making them appear less smooth.

However the strength of this, is if you have access to a package such a 3dsmax for the baking part, you can then seperate the normals manually - and then your model will be supported in most engines.



Overlapping UV's - Cloning

Will explain how to take advantage of ovelapping uv's, and mirroring capabilities with normalmaps.




This documented is free to be distributed as long as it remains intact and unedited.
http://www.svartberg.com