Heightmap: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Image:concrete_wall_height.jpg|right|thumb|256px|Example of an heightmap file.]]
[[File:concrete_wall_height.jpg|right|thumb|256px|Example of an heightmap file.]]
A '''heightmap''' is a grayscale texture where the brightness of each pixel represents its height (relative to its surface).
A '''heightmap''' is a grayscale texture where the brightness of each pixel represents its height (relative to its surface).


Older game engines use these textures for a shader method known as [[bump mapping]], as they are the predecessors to the [[Normal Maps|normal maps]] that the Source engine use for this method.
Older game engines use these textures for a shader method known as [[bump mapping]], as they are the predecessors to the [[Normal Maps|normal maps]] that the Source engine use for this method.


Features for its use is [[parallax mapping]] and creation of [[$ssbump|Self-Shadowing Bump Maps]].
In modern versions of Source, heightmaps are still used for [[parallax mapping]] in supported games and the creation of [[normal map]]s and [[$ssbump|self-shadowing bump maps]].
 




===Steps to creating a heightmap===
===Steps to creating a heightmap===
# Create a copy of a texture in grayscale and edit it if you wish. White corresponds to the pixels closest to you and black corresponds to pixels farthest from you.
# Create a copy of a texture in grayscale and edit it if you wish. White corresponds to the pixels closest to you and black corresponds to pixels farthest from you.
# Save the image as a [[TGA|targa (.tga)]] with <code>_height</code> at the end of the filename.
# Save the image as a [[TGA|targa (.tga)]] with <code>_height</code> at the end of the filename.
Line 15: Line 13:
# Put it in the same directory as your texture.
# Put it in the same directory as your texture.


==See Also==
==See also==
 
*[[Parallax mapping]]
*[[Parallax mapping]]
*[[Wikipedia:heightmap|Heightmap]] - The Wikipedia article.
*[[Wikipedia:heightmap|Heightmap]] - The Wikipedia article.
*[[Height2Normal]] a defunct Source SDK tool for converting a heightmap to a [[Normal Maps|normalmap]]
*[[Height2Normal]] a Source SDK tool for converting a heightmap to a [[Normal Maps|normalmap]]


[[Category:Material System]]
[[Category:Material System]]

Latest revision as of 08:01, 10 April 2025

Example of an heightmap file.

A heightmap is a grayscale texture where the brightness of each pixel represents its height (relative to its surface).

Older game engines use these textures for a shader method known as bump mapping, as they are the predecessors to the normal maps that the Source engine use for this method.

In modern versions of Source, heightmaps are still used for parallax mapping in supported games and the creation of normal maps and self-shadowing bump maps.


Steps to creating a heightmap

  1. Create a copy of a texture in grayscale and edit it if you wish. White corresponds to the pixels closest to you and black corresponds to pixels farthest from you.
  2. Save the image as a targa (.tga) with _height at the end of the filename.
  3. Convert the targa image to a Valve Texture File (.vtf).
  4. Put it in the same directory as your texture.

See also