Normal mapping using Nvidia plugin


Wile E Coyote
01-15-2007, 12:05 PM
1) I keep seeing normal maps released with skins that appear to be nothing more than the base skin with the Nvidia filter for photoshop applied. More often than not this leads what should be unwanted results that are apparently overlooked by the authors, possibly because they do not know better. A properly done Normal map gives the model so much more depth, so much more believability that is is almost a crime to casually pass the process soley unto a photoshop filter. This was my motivation to write.

2) This is not an all inclusive tutorial; nor is it intended as an be-all / end-all definition of how to create a normal map. There are many different methods. These are the methods I use. If you have a different method, feel free to add it. Do not bother posting comments about how my methods are incorrect; I can guarantee it is an arguement you will not win.

3) KALDERA, a plugin for 3DMax, is another way to make normal maps. I do not have 3DMax, so I cannot comment extensively on this. Kaldera will NOT take into account things that are not actually sculpted on the model, so it has it's issues also.
_________________________
RESOUCES

Nvidia normal map plugin for Photoshop (http://developer.nvidia.com/object/photoshop_dds_plugins.html)
VTF plugin for Photoshop (http://nemesis.thewavelength.net/index.php?c=154#p154)

USE

primary
a normal map is basically used simulate a 3D texture or object on a flat polygonal surface. In layman's terms it makes a flat surface look like it has lots of physical textures, but does it without the requirement of drawing lots of polygons.
secondary
it can also sometimes be used to correct a deficiency in a particular model when it is not feasible to make alterations to the model itself

I have separated normal maps into 2 categories: simple and complex. For this tutorial I will cover 2 skins, one of each

One basic rule to remember - when your normal map filter will compile, black = down (recessed) and white = up (raised).

Another thing to think about, although not completely needed, is to convert your intended skin to Black & White before attempting conversion to a normal map. This helps you see the highlights exactly how the filter will see them, without any illusions from color.


WEAPON SKINS

weapons, in my opinion, tend to be the simple type of normal map. Do not take this to mean they are easy to create. The reason I refer to these types as simple is for the fact that most of the surfaces do not actually have texture; they are machined, VERY flat, smooth surfaces, and the normal map should adhere to that. As you can see I removed all color by simply moving the "hue" saturation to "0"
http://usera.imagecave.com/WileECoyote/normal_tutorial/tut_weap01.jpg
My next step is decide what areas actual need bumpmapping. In this case the wooden stock is the most obvious part; the rest is going to be smooth machined and coated metal which pretty much has no textures. I outline, copy and paste the stock areas as a new layer.
http://usera.imagecave.com/WileECoyote/normal_tutorial/tut_weap02.jpg
Now I make another layer below the one I just created and fill it with a neutral grey (128)
http://usera.imagecave.com/WileECoyote/normal_tutorial/tut_weap03.jpg
I then merge the "stock" layer and the "neutral" layer. Then I use the Nvidia normal map filter, set to the power of 5.
http://usera.imagecave.com/WileECoyote/normal_tutorial/tut_weap04.jpg
Once this is done I save the whole thing as an uncompressed bitmap in a temp folder. I then start over, now paying attention to those few areas on the metal surfaces that are recessed, usually things like markings and stampings. Same process as above, I outline them, copy to a new layer, make a neutral background. The difference this time is I fill those outlined areas with black, because these are going to be recessed areas.
http://usera.imagecave.com/WileECoyote/normal_tutorial/tut_weap05.jpg
Conversely, I also outline all raised areas and fill them with white.
NOTE: Normal maps can be used to fill in a part of the model that was left out by the modellerYou will somtimes run into an area that the modeller oversimplified in order to save on polygons. Look at the rear of the default DOD:S Kar98k around the area of the safety lever - completely flat
http://img62.imageshack.us/img62/7444/qwertyug3.jpg
Now look at the finished product
http://img260.imageshack.us/img260/6817/wc98kpre3vh7.jpg
I hand drew in these parts as solid white on top of the neutral grey backroud.
Then, after merging the neutral gray, black and white layers, I use the Nvidia filter, this time to the power of 10
http://usera.imagecave.com/WileECoyote/normal_tutorial/tut_weap06.jpg
http://usera.imagecave.com/WileECoyote/normal_tutorial/tut_weap07.jpg
http://usera.imagecave.com/WileECoyote/normal_tutorial/tut_weap08.jpg
Notice how the areas that were black are recessed and the areas that were white are raised.
Once again I save the whole thing a a bitmap
Now I have 2 bitmaps. I create a PSD file with 2 layers and copy/paste both bitmaps. I then "cut out" the flat areas of the top layers
http://usera.imagecave.com/WileECoyote/normal_tutorial/tut_weap09.jpg allowing the bottom layer to be seen. Effectively what we are doing here is creating a composite of 2 different normal maps which were made at 2 different power settings.
http://usera.imagecave.com/WileECoyote/normal_tutorial/tut_weap11.jpg
Only thing left to do is save it as a VTF.

PLAYER SKINS

Picking up the pace here, player normal maps tend to be of the more complex type, meaning that there are rarely any smooth surfaces. Almost all surfaces, have some type of texture - it is the degree of depth and power to which they vary. Since we are using the same layering process as descibed above to create a composite I'm gonna run through this real fast.

First off, hopefully you have learned from experience the value of saving you PSD file as multiple separate layers. Yes it makes the PSD file huge, but it also makes it easy to go back, change or swap things around. So.... starting of with the basic skin
http://img95.imageshack.us/img95/3183/tutplay01bh9.jpg
first thing you want to do is eliminate ALL dirt, stains and painted decals. These things have no depth to them, but the Nvidia filter will not know that. It just sees a difference between light and dark, and acts accordingly.
As an illustration of what I'm talking about, compare the above and below pictures.
http://img225.imageshack.us/img225/8852/tutplay02cx9.jpg
Now here comes the tedious, time consuming boring/fun part. Adding emphasis on the areas you think NEED more emphasis for the filter to interpert them correctly. I purposely left the background skin in color so you could more easily see what I highlighted, but normally I would have already converted it to B&W. Rememeber - black = down and white = up.
http://img152.imageshack.us/img152/6030/tutplay03ae2.jpg
Now obviously wrinkles and folds in clothing are going to be more pronounced and obvious that, let's say, the beard stubble on the guy's face. Problem is that if you make the normal map for the folds in the uniforms to the correct depth, the guy's face will end up looking like Edward James Olmos (http://www.nndb.com/people/782/000024710/ejo.jpg) x 10 (i.e. it's not pretty). So just like on the weapon skin, we have to save as a bitmap, remove all color, create separate normal maps and then composite them. For this I created three:
to the power of 2
http://img299.imageshack.us/img299/5128/tutplay04uv7.jpg
to the power of 5
http://img225.imageshack.us/img225/3878/tutplay05qv5.jpg
to the power of 10
http://img95.imageshack.us/img95/3541/tutplay06sd2.jpg
(note that I also included the alternate helmet net in that one)

Then save the composite as your VTF
http://img458.imageshack.us/img458/904/tutplay07mr6.jpg

I may have been a bit sketchy or confusing on some parts, but I feel confident that if you have a rough idea of what you are doing in Photoshop and you look at the pictures, you'll be able to figure it out.

Wile E Coyote
01-26-2007, 03:19 PM
Small addition

Here is a photo comparison illustrating why it is a bad idea to let the Nvidia filter completely handle the process of creating the normal map. Ideally, you would want to create a normal map BEFORE you render things on the skin like shadows, reflections and dirtiness - however that isn't always possible.

http://usera.imagecave.com/WileECoyote/normal_tutorial/normal2.jpg

points of intrest as numbered on the photo:

1) here the model object is very smooth and the skin was rendered to give the illusion of shiness, but the filter gave a texture to what should be flat.

2) Here, ironically the filter did exactly the opposite of what was needed; it gave raised texture to what should have been depressions. The reason was that these were chips in a metal surface, so there appear shiny (i.e. lighter color). The filter can only read white as "up" and black as "down".

3) Here a rendered shadow on the original skin just simply plays havoc with the normal map filter and screws everything up.

4) This line is actually a painted yellow line. While sometimes you may want to have a painted area have a slightly different texture, in this case the result is very extreme and unwanted.

Wile E Coyote
03-04-2007, 11:32 AM
Here is a good example of why normal / bump mapping is important, and why it is critical to get it to look right. The comparison is between a model without any normal map and one with a highly detailed normal map. The model texture and the background are both the exact same shade of 1-color flat neutral gray All shading, reflectivity and detail you see is produced by the 3D engine only.


http://img232.imageshack.us/my.php?image=compare2mm6.jpg

Day of Defeat Forum Archive created by Neil Jedrzejewski.

This in an partial archive of the old Day of Defeat forums orignally hosted by Valve Software LLC.
Material has been archived for the purpose of creating a knowledge base from messages posted between 2003 and 2008.