Difference between revisions of "Bump map"

From Valve Developer Community
Jump to: navigation, search
m (See also)
(Adding a normal map (aka bump map): link fix)
Line 10: Line 10:
 
'''1.''' First, create the normal map. If you have Photoshop or PaintShop Pro, you can use Nvidia's normal map tools, available [http://developer.nvidia.com/object/photoshop_dds_plugins.html here]. There are also tools for those who use the GIMP [http://nifelheim.dyndns.org/%7ecocidius/normalmap/ here], but we will focus on the Photoshop tools. To use them, open a copy of the texture and apply the Normal Map filter. Fiddle with the settings until you get something that you feel will be bumpy enough for your texture. The greater the range of colors, the greater the range of angles on the surface.  A very flat surface will look that medium blue color all over.  If you want to have more control over it, change the image to grayscale and fiddle with brightness and contrast to make certain details stand out before applying the filter- however, be sure to change the texture back to RGB mode, or else the normal map tool will not work.  Do this step multiple times to get different details to stand out, and then put the images together in layers with the blend mode set to overlay.
 
'''1.''' First, create the normal map. If you have Photoshop or PaintShop Pro, you can use Nvidia's normal map tools, available [http://developer.nvidia.com/object/photoshop_dds_plugins.html here]. There are also tools for those who use the GIMP [http://nifelheim.dyndns.org/%7ecocidius/normalmap/ here], but we will focus on the Photoshop tools. To use them, open a copy of the texture and apply the Normal Map filter. Fiddle with the settings until you get something that you feel will be bumpy enough for your texture. The greater the range of colors, the greater the range of angles on the surface.  A very flat surface will look that medium blue color all over.  If you want to have more control over it, change the image to grayscale and fiddle with brightness and contrast to make certain details stand out before applying the filter- however, be sure to change the texture back to RGB mode, or else the normal map tool will not work.  Do this step multiple times to get different details to stand out, and then put the images together in layers with the blend mode set to overlay.
  
'''2.''' Save your normal map as a [[TGA]] in the same resolution as the original texture. Give it a name that ends in _normal. Then convert it to a VTF. The _normal at the end of the name will affect how [[VTEX]] converts it. For the brick wall example, we would name the file <code>brickwall_normal.tga</code>. Place the new VTF in the same place as your original texture.
+
'''2.''' Save your normal map as a [[TGA]] in the same resolution as the original texture. Give it a name that ends in _normal. Then convert it to a VTF. The _normal at the end of the name will affect how [[Vtex]] converts it. For the brick wall example, we would name the file <code>brickwall_normal.tga</code>. Place the new VTF in the same place as your original texture.
  
 
'''3.''' Add this line to the VMT somewhere between the braces:
 
'''3.''' Add this line to the VMT somewhere between the braces:

Revision as of 21:51, 19 July 2005

If your texture is supposed to have depth to it, adding a normal map will make the lighting on it far more realistic. (This is perhaps the main reason Doom3, FarCry, and HL2 are able to look so much better than previous games.) The normal map tells the game what direction each pixel would be facing if your texture were in 3D instead of being a flat image. A normal map is kind of useless for really flat surfaces like smooth concrete or metal. But even rough concrete sometimes has enough depth to it to make a normal map worthwhile. This is an old article but explains the concept well: Normal Maps

This tutorial is a step-by-step process you can go through to create a normal map for a material.

Adding a normal map (aka bump map)

Texture that the below normal map is based on.
Normal map created from above texture.

1. First, create the normal map. If you have Photoshop or PaintShop Pro, you can use Nvidia's normal map tools, available here. There are also tools for those who use the GIMP here, but we will focus on the Photoshop tools. To use them, open a copy of the texture and apply the Normal Map filter. Fiddle with the settings until you get something that you feel will be bumpy enough for your texture. The greater the range of colors, the greater the range of angles on the surface. A very flat surface will look that medium blue color all over. If you want to have more control over it, change the image to grayscale and fiddle with brightness and contrast to make certain details stand out before applying the filter- however, be sure to change the texture back to RGB mode, or else the normal map tool will not work. Do this step multiple times to get different details to stand out, and then put the images together in layers with the blend mode set to overlay.

2. Save your normal map as a TGA in the same resolution as the original texture. Give it a name that ends in _normal. Then convert it to a VTF. The _normal at the end of the name will affect how Vtex converts it. For the brick wall example, we would name the file brickwall_normal.tga. Place the new VTF in the same place as your original texture.

3. Add this line to the VMT somewhere between the braces:

"$bumpmap" "texture name"

and fill in the path and name of your normal map VTF. Here's an example VMT for a normalmapped material:

"LightmappedGeneric"
{
    "$basetexture" "walls/brickwall"
    "$surfaceprop" "brick"
    "$bumpmap" " walls/brickwall_normal"
}

Also note that multiple materials can use the same normal map file.

See also

Creating Materials