$bumpmap: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(redone)
Line 1: Line 1:
{{stub}}
[[Image:Brickwall021a normalcompare.jpg|thumb|A material's [[albedo]] (left) compared to its normal map.]]


The $bumpmap [[VMT]] parameter specifies the [[VTF]] texture to use for the 'bump' or [[normalmap]] of the material surface.
[[Image:Example of bump mapping.jpg|thumb|The above material in-game.]]
 
The '''$bumpmap''' [[VMT]] parameter specifies a texture that will provide three-dimensional lighting information. The texture is known as a [[Normal Map]].


== Basic syntax ==
== Basic syntax ==
"$bumpmap" "<texture>"
* <code><texture></code>> is the name of the [[VTF]] texture to be used as the [[Normal Maps|normalmap]].
* The <code>.vtf</code> file extension is not used in VMT texture references.
* The name can be preceeded by the filepath relative to the <code>game_directory/materials</code> folder.
* Example:
"$bumpmap" "Path/Texture1_normal"


== Additional parameters ==
$bumpmap <texture>


===$bumpscale===
[[LightmappedGeneric]]
  $bumpscale <float>
  {
* Scales the [[$bumpmap]] by the <float> value.
[[$basetexture]] brick/brickwall021a
* Note:Currently only used by shadertest materials. Likely an old DirectX 8 fallback shader, later replaced by the DirectX 8 version of the ''$bumptransform'' parameter.
[[$surfaceprop]] brick
'''$bumpmap brick/brickwall021a_normal'''
}


===$bumpframe===
== Additional parameters ==
$bumpframe <integer>
* Frame number to use from an animated bumpmap texture.


===$bumptransform===
; <code>$bumptransform <matrix></code>
$bumptransform <matrix>
: Transforms the bumpmap texture. Requires DirectX 9 or above.
* Transforms the bumpmap texture.
{{VMT UVtransform}}
{{VMT UVtransform}}
 
; <code>$bumpscale <[[float]]></code>
===$bumpoffset===
: Scales the normal map by the given value in DirectX 8.
$bumpoffset <>
; <code>$bumpframe <[[integer]]></code>
* {{todo|dx8 version of center?}}
: Frame number to use from an animated texture.
 
;<code>$nodiffusebumplighting <[[bool]]></code>
===$bumpmap2===
: See [[Controlling Geometry Visibility and Compile Times#Dealing with fillrate issues|Dealing with fillrate issues]]. Only relevant when using [[LightmappedGeneric]].
$bumpmap2 <texture>
;<code>$forcebump <[[bool]]></code>
* Used by the [[WorldVertexTransition]] shader to blend materials on [[Displacement]] surfaces (eg terrain).
: Forces DirectX 8 cards to render the bump map. They normally don't for performance reasons.
* The percentage blend of each of the two textures is defined by alpha painting in Hammer.
; <code>$bumpoffset <?></code>
* DirectX 9 required.
: {{todo|dx8 version of center?}}
 
; <code>$bumpmap2 <texture></code>
===$bumpframe2===
; <code>$bumpframe2 <integer></code>
$bumpframe2 <integer>
: Used by the [[WorldVertexTransition]] shader in blend materials that display two textures. DirectX 9 required.
* Frame number for [[$bumpmap2]].
* DirectX 9 required.
 
===$nodiffusebumplighting===
$nodiffusebumplighting 1
* If set to ''1'', no diffuse bump lighting will be done.
* See [[Controlling Geometry Visibility and Compile Times#Dealing with fillrate issues|Dealing with fillrate issues]].
* Requires ''LightmappedGeneric'' shading.
 
===$forcebump ===
$forcebump 1
* If set to ''1'', always does bumpmapping (even if the graphics card doesn't say it can handle it).
* Requires DirectX 8.


== See also ==
== See also ==
* [[$bumpmap2]] for [[Displacements|Blended Materials]]
* [[Normal Map]]
* [[Normal Maps]]
** [[Normal Map Creation]]
* [[Normal Map Creation]]
** [[Normal Map Creation in The GIMP]]
* [[Normal Map Creation in The GIMP]]
 
 


[[Category:List of Shader Parameters]]
[[Category:List of Shader Parameters]]
[[Category:VMT Texture Reference]]
[[Category:VMT Texture Reference]]

Revision as of 04:00, 10 July 2008

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

The $bumpmap VMT parameter specifies a texture that will provide three-dimensional lighting information. The texture is known as a Normal Map.

Basic syntax

$bumpmap <texture>
LightmappedGeneric
{
	$basetexture	brick/brickwall021a
	$surfaceprop 	brick
	$bumpmap 	brick/brickwall021a_normal
}

Additional parameters

$bumptransform <matrix>
Transforms the bumpmap texture. Requires DirectX 9 or above.
The default position is center .5 .5 scale 1 1 rotate 0 translate 0 0.
  1. center defines the point of rotation. Only useful if rotate is being used.
  2. scale fits the texture into the material the given number of times. 2 1 is a 50% scale in the horizontal X axis while the vertical Y axis is still at original scale.
  3. rotate rotates the texture counter-clockwise in degrees. Accepts any number, including negatives.
  4. translate shifts the texture by the given numbers. .5 will shift it half-way. 1 will shift it once completely over, which is the same as not moving it at all.
Note.pngNote:All values must be included!
Icon-Bug.pngBug:Scaling the texture may cause odd issues where the Texture Lock tool in Hammer will not actually lock the texture in place.  [todo tested in ?]
Icon-Bug.pngBug:Rotating textures applied on brushes will rotate around the map origin (confirm: Orangebox engine only?). A fix for this is to change the center position in the VMT to the brush's origin.  [todo tested in ?]
$bumpscale <float>
Scales the normal map by the given value in DirectX 8.
$bumpframe <integer>
Frame number to use from an animated texture.
$nodiffusebumplighting <bool>
See Dealing with fillrate issues. Only relevant when using LightmappedGeneric.
$forcebump <bool>
Forces DirectX 8 cards to render the bump map. They normally don't for performance reasons.
$bumpoffset <?>
Todo: dx8 version of center?
$bumpmap2 <texture>
$bumpframe2 <integer>
Used by the WorldVertexTransition shader in blend materials that display two textures. DirectX 9 required.

See also