Difference between revisions of "Bump map"
(Added additional information about bumpmaps on decals in CSGO) |
|||
(19 intermediate revisions by 11 users not shown) | |||
Line 6: | Line 6: | ||
[[Image:Example of bump mapping.jpg|thumb|200px|The above material in-game.]] | [[Image:Example of bump mapping.jpg|thumb|200px|The above material in-game.]] | ||
− | Textures often called '''Bump Maps''', or '''Normal Maps''' are used to simulate three-dimensional details on a two-dimensional surface by manipulating its lighting. | + | Textures often called '''Bump Maps''', or '''Normal Maps''' are used to simulate three-dimensional details on a two-dimensional surface by manipulating its lighting. |
+ | |||
+ | {{note|Static props using bump maps can not be lit per-vertex, except in {{csgo}}.}} | ||
+ | {{note|Bump maps cannot be used on decal textures, except in {{csgo}}. In order for these to function properly, the surface that they are placed on must also have a bumpmap.}} | ||
== Format == | == Format == | ||
Line 25: | Line 28: | ||
:* 255 = down | :* 255 = down | ||
; Blue | ; Blue | ||
− | : Height (Z axis) | + | : Height (Z axis). |
:* 0 = facing 'in' to the texture, away from the viewer. This is a 'bad' value. Anything under 128 means that the surface should be facing away from the player, which is not possible. | :* 0 = facing 'in' to the texture, away from the viewer. This is a 'bad' value. Anything under 128 means that the surface should be facing away from the player, which is not possible. | ||
:* 128 = maximum depth capable of receiving dynamic light. It's a bad idea to go under this. | :* 128 = maximum depth capable of receiving dynamic light. It's a bad idea to go under this. | ||
:* 255 = facing 'out' of the texture towards the viewer. | :* 255 = facing 'out' of the texture towards the viewer. | ||
+ | |||
+ | |||
+ | {{note|A flat bump map should be [128, 128, 255]. <code>dev/flat_normal</code> is a flat bump map present in every game.}} | ||
The three channels represent a normal vector for every pixel which represents the direction that the pixel is facing in 3D space. This allows the engine to generate shadows and highlights on a two-dimensional surface, or give a 3D model more detail. | The three channels represent a normal vector for every pixel which represents the direction that the pixel is facing in 3D space. This allows the engine to generate shadows and highlights on a two-dimensional surface, or give a 3D model more detail. | ||
− | A bump map is largely useless for really flat surfaces like smooth concrete or metal, but even | + | A bump map is largely useless for really flat surfaces like smooth concrete or metal, but even smooth concrete sometimes has enough depth to it to make one worthwhile. |
[[file:normalmap.gif]] | [[file:normalmap.gif]] | ||
Line 38: | Line 44: | ||
== Creation == | == Creation == | ||
− | A bump map should | + | A bump map should be rendered in Tangent space and use vector directions X+ Y- Z+. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | {{note| | + | {{note|There are basically two sets of rules for normal maps: [[DirectX]] and [[OpenGL]]. Their interpretation of green channels are opposite. [[Source]] takes the former. Thus, the green channel may need to be inverted depending on the software used to create it. }} |
=== Programs === | === Programs === | ||
Line 55: | Line 56: | ||
;2D | ;2D | ||
:[[Normal Map Creation in Photoshop or Paint Shop Pro|Photoshop or Paint Shop Pro]] | :[[Normal Map Creation in Photoshop or Paint Shop Pro|Photoshop or Paint Shop Pro]] | ||
+ | :[http://www.youtube.com/watch?v=WsFe-E-33IQ Substance Designer] | ||
:[[Normal Map Creation in The GIMP|The GIMP]] | :[[Normal Map Creation in The GIMP|The GIMP]] | ||
+ | :[http://www.youtube.com/watch?v=xDZDWvTUz-c nDo] | ||
;3D | ;3D | ||
:[[Normal Map Creation in XSI|XSI]] | :[[Normal Map Creation in XSI|XSI]] | ||
− | :[[Normal Map Creation in | + | :[[Normal Map Creation in ZBrush|ZBrush]] |
:[[Normal Map Creation in Lightwave|Lightwave]] | :[[Normal Map Creation in Lightwave|Lightwave]] | ||
− | :[[Normal Map Creation in | + | :[[Normal Map Creation in 3ds Max|3ds Max]] |
:[[Normal Map Creation in Maya|Maya]] | :[[Normal Map Creation in Maya|Maya]] | ||
:[[Normal Map Creation in Blender|Blender]] | :[[Normal Map Creation in Blender|Blender]] | ||
− | :[http:// | + | :[http://www.nvidia.com/object/melody_home.html NVIDIA Melody] |
:[http://planetpixelemporium.com/tutorialpages/normal2.html Cinema 4D] | :[http://planetpixelemporium.com/tutorialpages/normal2.html Cinema 4D] | ||
:[[NormalMapper]] | :[[NormalMapper]] | ||
:[http://xnormal.net/ xNormal] | :[http://xnormal.net/ xNormal] | ||
;Other | ;Other | ||
+ | :[http://store.steampowered.com/app/325910/ Bitmap2Material 3]: Alternative to CrazyBump. | ||
:[http://www.crazybump.com CrazyBump]: Produces some very good normal maps. Some of them can be argued as almost having the same depth as a parallax map. | :[http://www.crazybump.com CrazyBump]: Produces some very good normal maps. Some of them can be argued as almost having the same depth as a parallax map. | ||
:[http://filterforge.com/filters/8774.html Filter Forge]: Can generate normal maps for its filters and external images. | :[http://filterforge.com/filters/8774.html Filter Forge]: Can generate normal maps for its filters and external images. | ||
+ | :[https://sites.google.com/site/ccdsurgeon/download/ InsaneBump]: Specifically made to be a free alternative to CrazyBump, produces high quality normal maps. | ||
:[http://mindtex.com MindTex]: A cheaper alternative to CrazyBump. Also produces high-quality normal maps. | :[http://mindtex.com MindTex]: A cheaper alternative to CrazyBump. Also produces high-quality normal maps. | ||
+ | :[[Normal2dudv]]: a third party tool for converting bump maps to Dx8-friendly [[du/dv maps]]. | ||
:[http://shadermap.renderingsystems.com/ ShaderMap]: A free alternative to CrazyBump. | :[http://shadermap.renderingsystems.com/ ShaderMap]: A free alternative to CrazyBump. | ||
:[https://sourceforge.net/projects/ssbumpgenerator/ SSBump Generator 5.3]: Another free, open source alternative to CrazyBump that generates Self Shadowed Bump Maps as well as normal maps. | :[https://sourceforge.net/projects/ssbumpgenerator/ SSBump Generator 5.3]: Another free, open source alternative to CrazyBump that generates Self Shadowed Bump Maps as well as normal maps. | ||
− | |||
=== Conversion === | === Conversion === | ||
Line 81: | Line 86: | ||
When converting your texture: | When converting your texture: | ||
− | # Choose | + | # Choose your image format. Uncompressed formats like BGR888 are higher-quality than compressed formats like DXT1, but be wary of file size. |
# Check the "Normal map" box in the texture's flags list after the import is complete. It's about 1/5 of the way down the list. | # Check the "Normal map" box in the texture's flags list after the import is complete. It's about 1/5 of the way down the list. | ||
Line 88: | Line 93: | ||
==== In [[Vtex]] ==== | ==== In [[Vtex]] ==== | ||
− | # Save your normal map as a [[TGA]] | + | # Save your normal map as a [[TGA]]. 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. | # Add <code>nocompress 1</code> and <code>normal 1</code> to <texture filename>.txt in the same folder as your texture, then compile. | ||
=== Implementation === | === Implementation === | ||
− | See | + | See {{ent|$bumpmap}}. |
==See also== | ==See also== | ||
− | * | + | *{{ent|$ssbump}}: creation and usage of Valve's new self-shadowing bump maps. |
− | *[http://planetpixelemporium.com/tutorialpages/normal.html An old article that explains normal mapping quite well | + | *[http://planetpixelemporium.com/tutorialpages/normal.html An old article that explains normal mapping quite well] |
− | + | *[http://wiki.polycount.com/wiki/Normal_map Polycount wiki page about normal maps] | |
− | *[http:// | + | *[[Creating a Material]] |
[[Category:Material System]] | [[Category:Material System]] | ||
[[Category:Glossary]] | [[Category:Glossary]] | ||
[[Category:Tutorials]] | [[Category:Tutorials]] |
Latest revision as of 19:32, 16 April 2020

Textures often called Bump Maps, or Normal Maps are used to simulate three-dimensional details on a two-dimensional surface by manipulating its lighting.


Contents
Format
Each pixel in a bump map contains the (x, y, z) coordinates that define a normalized vector.
Because of this each color channel in a bump map has a meaning:
- Red
- Horizontal facing (X axis)
- 0 = left
- 128 = forward, or facing viewer
- 255 = right
- Green
- Vertical facing (Y axis)
- 0 = up
- 128 = forward, or facing viewer
- 255 = down
- Blue
- Height (Z axis).
- 0 = facing 'in' to the texture, away from the viewer. This is a 'bad' value. Anything under 128 means that the surface should be facing away from the player, which is not possible.
- 128 = maximum depth capable of receiving dynamic light. It's a bad idea to go under this.
- 255 = facing 'out' of the texture towards the viewer.

dev/flat_normal
is a flat bump map present in every game.The three channels represent a normal vector for every pixel which represents the direction that the pixel is facing in 3D space. This allows the engine to generate shadows and highlights on a two-dimensional surface, or give a 3D model more detail.
A bump map is largely useless for really flat surfaces like smooth concrete or metal, but even smooth concrete sometimes has enough depth to it to make one worthwhile.
Creation
A bump map should be rendered in Tangent space and use vector directions X+ Y- Z+.

Programs
Various programs can automate the creation of bump maps, either by image analysis or by using 3D geometry the user provides.
- 2D
- Photoshop or Paint Shop Pro
- Substance Designer
- The GIMP
- nDo
- 3D
- XSI
- ZBrush
- Lightwave
- 3ds Max
- Maya
- Blender
- NVIDIA Melody
- Cinema 4D
- NormalMapper
- xNormal
- Other
- Bitmap2Material 3: Alternative to CrazyBump.
- CrazyBump: Produces some very good normal maps. Some of them can be argued as almost having the same depth as a parallax map.
- Filter Forge: Can generate normal maps for its filters and external images.
- InsaneBump: Specifically made to be a free alternative to CrazyBump, produces high quality normal maps.
- MindTex: A cheaper alternative to CrazyBump. Also produces high-quality normal maps.
- Normal2dudv: a third party tool for converting bump maps to Dx8-friendly du/dv maps.
- ShaderMap: A free alternative to CrazyBump.
- SSBump Generator 5.3: Another free, open source alternative to CrazyBump that generates Self Shadowed Bump Maps as well as normal maps.
Conversion
In VTFEdit
When converting your texture:
- Choose your image format. Uncompressed formats like BGR888 are higher-quality than compressed formats like DXT1, but be wary of file size.
- Check the "Normal map" box in the texture's flags list after the import is complete. It's about 1/5 of the way down the list.

In Vtex
- Save your normal map as a TGA. 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
. - Add
nocompress 1
andnormal 1
to <texture filename>.txt in the same folder as your texture, then compile.
Implementation
See $bumpmap
.
See also
$ssbump
: creation and usage of Valve's new self-shadowing bump maps.- An old article that explains normal mapping quite well
- Polycount wiki page about normal maps
- Creating a Material