Normal Map Creation: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
Line 28: Line 28:
*[http://shadermap.renderingsystems.com/ ShaderMap] - A free alternative to CrazyBump!
*[http://shadermap.renderingsystems.com/ ShaderMap] - A free alternative to CrazyBump!


== Getting the normal map in the game ==
== Conversion ==
<ol><li>Save your normal map as a [[TGA]] in the same resolution as the original texture. Give it a name that ends in ''_normal''. 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>.</li>
<li>When compiling your normal maps with vtex, Add this line to the <texture filename>.txt file in the same directory as your textures then compile with vtex.
<br/>
<pre>"nocompress" "1"
"normal" "1"</pre></li>
After compiling the normal map, place the VTF in the same place as your original texture.</li>
<li>Add this line to the VMT somewhere between the braces:<br/>


<pre>"$bumpmap" "texture name"</pre>
=== In [[VTFEdit]] ===
and fill in the path and name of your normal map VTF. Here's an example VMT for a normal-mapped material:
<pre><nowiki>"LightmappedGeneric"
{
    "$basetexture" "walls/brickwall"
    "$surfaceprop" "brick"
    "$bumpmap" "walls/brickwall_normal"
}</nowiki></pre>


{{Note|Multiple materials can use the same normal map file.}}</li></ol>
When converting your texture:
 
# Choose BGR8888 or BGRA8888 (if your texture has an alpha channel) as your image format
# Check the "Normal map" box in the texture's flags list. It's about 1/5 of the way down the list.
 
=== In [[Vtex]] ===
 
# Save your normal map as a [[TGA]] in the same resolution as the original texture. Give it a name that ends in ''_normal''. 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>.
# Add <code>nocompress 1</code> and <code>normal 1</code> to <texture filename>.txt in the same folder as your texture, then compile.
#After compiling the normal map, place the VTF in the same place as your original texture.
 
=== In the [[material]] ===
 
Add this line to the VMT somewhere between the braces:
 
[[$bumpmap]] <texture name>
 
Then fill in the path and name of your normal map VTF. Here's an example VMT for a normal-mapped material:
 
LightmappedGeneric
{
$basetexture walls/brickwall
$surfaceprop brick
$bumpmap walls/brickwall_normal
}
 
{{tip|A single bump map texture can be used in any number of materials.}}


== See also ==
== See also ==

Revision as of 03:26, 3 December 2008

A normal map should be created in the same dimensions as the image texture (color map) it will go with. There are a few options for how to create one, depending on the quality you want, your skill with various programs, or your patience.

Test the Bump

Using tools

Converting from a heightmap

As the Source tool Height2Normal doesn't work anymore, you will have to resort to other tools in order to convert a heightmap to a normal map.

Todo: Which ones?

Using an image editing program

Using a 3D program

Other Tools

  • CrazyBump - Produces some very good normal maps. Some of them can be argued as almost having the same depth as a parallax map.
  • ShaderMap - A free alternative to CrazyBump!

Conversion

In VTFEdit

When converting your texture:

  1. Choose BGR8888 or BGRA8888 (if your texture has an alpha channel) as your image format
  2. Check the "Normal map" box in the texture's flags list. It's about 1/5 of the way down the list.

In Vtex

  1. Save your normal map as a TGA in the same resolution as the original texture. Give it a name that ends in _normal. 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.
  2. Add nocompress 1 and normal 1 to <texture filename>.txt in the same folder as your texture, then compile.
  3. After compiling the normal map, place the VTF in the same place as your original texture.

In the material

Add this line to the VMT somewhere between the braces:

$bumpmap	<texture name>

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

LightmappedGeneric
{
	$basetexture	walls/brickwall
	$surfaceprop	brick
	$bumpmap	walls/brickwall_normal
}
Tip.pngTip:A single bump map texture can be used in any number of materials.

See also

Template:Otherlang:en Template:Otherlang:en:jp