Bump map: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
[[Image:Example_of_bump_mapping.jpg|right|thumb|350px|An example of normal maps being used in Half-Life 2. Click to enlarge.]]
[[Image:Brickwall021a normalcompare.jpg|thumb|A material's [[albedo]] (left) compared to its bump map.]]
[[Image:Example of bump mapping.jpg|thumb|The above material in-game.]]


A texture used to give a material the illusion of depth through refracting light cast upon it (pixel by pixel). This shader method is called [[bump mapping]], and is perhaps the main reason that games such as Doom 3, FarCry, and Half-Life 2 are able to look so much better than previous games. The ''normal map'' is the successor to the [[heightmap]]. While heightmaps only used one channel to decode the height of each pixel, normal maps use all three:
A '''bump map''' is an [[RGB]] image that can be used to simulate a three-dimensional surface through a process known as [[Wikipedia:Normal mapping|normal mapping]].


* The '''red''' channel contains the horizontal facing (X-axis)
Each color channel in a bump map has a meaning:
*:0 = left
*:128 = forward
*:255 = right
* The '''green''' channel includes the vertical facing (Y-axis)
*:0 = up
*:128 = forward
*:255 = down
* The '''blue''' channel decodes the height of the pixel (Z-axis)
*:0 = deepest
*:127 = maximum depth capable of receiving light
*:255 = at the material's surface


With these 3 channels, every pixel has a normal vector, means the engine knows in which direction the pixel is facing and can thereby calculate shadows and highlights.
# The '''red''' channel defines horizontal facing (X-axis)
#:0 = left
#:128 = forward (facing viewer)
#:255 = right
# The '''green''' channel defines vertical facing (Y-axis)
#:0 = up
#:128 = forward (facing viewer)
#:255 = down
# The '''blue''' channel defines height (Z-axis)
#:0 = deepest
#:127 = maximum depth capable of receiving light
#:255 = at the material's surface


A normal map is largely 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.
The three channels between them allow the engine to calculate a normal vector for every pixel, allowing it to generate shadows and highlights on a two-dimensional surface.
 
A bump map is largely useless for really flat surfaces like smooth concrete or metal, but even rough concrete sometimes has enough depth to it to make one worthwhile.


==See also==
==See also==
*[[$bumpmap]] for normalmap syntax in [[VMT]] files.
*[[$bumpmap]], for adding a bump map to a [[material]]
*[[Normal Map Creation]]
*[[Normal Map Creation]]
*[[Normal Map Creation in The GIMP]]
*[[Normal Map Creation in The GIMP]]
*[[Normal2dudv]] a third party tool for converting normalmaps to Dx8-friendly [[du/dv maps]].
*[[Normal2dudv]] a third party tool for converting normalmaps to Dx8-friendly [[du/dv maps]].
*[http://planetpixelemporium.com/tutorialpages/normal.html An old article that explains the concept well.]
*[http://planetpixelemporium.com/tutorialpages/normal.html An old article that explains the concept well.]
*[[Wikipedia:Bump mapping]]
*[[Wikipedia:Normal mapping]]
*[[Bump mapping]] (merge?)
*[[Bump mapping]] (merge?)



Revision as of 04:40, 10 July 2008

A material's albedo (left) compared to its bump map.
The above material in-game.

A bump map is an RGB image that can be used to simulate a three-dimensional surface through a process known as normal mapping.

Each color channel in a bump map has a meaning:

  1. The red channel defines horizontal facing (X-axis)
    0 = left
    128 = forward (facing viewer)
    255 = right
  2. The green channel defines vertical facing (Y-axis)
    0 = up
    128 = forward (facing viewer)
    255 = down
  3. The blue channel defines height (Z-axis)
    0 = deepest
    127 = maximum depth capable of receiving light
    255 = at the material's surface

The three channels between them allow the engine to calculate a normal vector for every pixel, allowing it to generate shadows and highlights on a two-dimensional surface.

A bump map is largely useless for really flat surfaces like smooth concrete or metal, but even rough concrete sometimes has enough depth to it to make one worthwhile.

See also

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