$bumpmap: Difference between revisions
Jump to navigation
Jump to search
Warning:
. Not enough data is stored in the vertices for normal mapping, so the engine has no choice but to fall back.
Note:
Deprecated (talk | contribs) (Documented normal map blending from CSGO, removed $bumpoffset as it doesn't seem to exist, misc fixes) |
Deprecated (talk | contribs) (Changed to use Shaderparam and MatParam templates) |
||
Line 2: | Line 2: | ||
[[Image:Example of bump mapping.jpg|thumb|The above material in-game.]] | [[Image:Example of bump mapping.jpg|thumb|The above material in-game.]] | ||
{{Shaderparam|$bumpmap}} It specifies a [[texture]] that will provide three-dimensional lighting information for a material. The texture is a [[bump map]], but the process it is used for is called [[Wikipedia:Normal mapping|normal mapping]]. The two terms are often used interchangeably, however. | |||
{{warning|<code>$bumpmap</code> will disable <code>[[prop_static]]</code>'s per-vertex lighting in every Source game but {{csgo}}. Not enough data is stored in the vertices for normal mapping, so the engine has no choice but to fall back.}} | {{warning|<code>$bumpmap</code> will disable <code>[[prop_static]]</code>'s per-vertex lighting in every Source game but {{csgo}}. Not enough data is stored in the vertices for normal mapping, so the engine has no choice but to fall back.}} | ||
Line 21: | Line 21: | ||
==Additional parameters== | ==Additional parameters== | ||
{{MatParam|$bumptransform|matrix|Transforms the bump map texture. {{todo|Does this actually require DX9? Present in DX8 fallback shaders.}} | |||
{{VMT UVtransform}}|dx9=1}} | |||
{{VMT UVtransform}} | {{MatParam|[[$ssbump]]|bool|Flags the bump map texture as being self-shadowing. Click for more details.|since=EP2}} | ||
{{MatParam|$bumpscale|float|Scales the bump map by the given value in DirectX 8. {{Todo|Does this actually exist? Seemingly not present in DX8 fallback shaders.}}|dx8=1}} | |||
{{MatParam|$bumpframe|int|The frame to start an animated bump map on.}} | |||
{{MatParam|$nodiffusebumplighting|bool|Stops the bump map affecting the lighting of the material's [[albedo]], which help combat [[Material optimization#Overdraw|overdraw]]. Does not affect the [[specular]] map. | |||
: {{bug|Does not function in Orange Box builds and later.}}}} | |||
{{MatParam|$forcebump|bool|If 0, use bumpmapping if the card says it can handle it. If 1, always force bumpmapping on.|dx8=1}} | |||
{{MatParam|$addbumpmaps|bool|Enables the usage and blending of two bump maps together for <code>[[LightmappedGeneric]]</code>.|since=CSGO}} | |||
{{MatParam|$bumpmap2|texture|The second bump map to use, for either <code>[[WorldVertexTransition]]</code> or for <code>LightmappedGeneric</code> in {{csgo}} for bump map blending.|dx9=1}} | |||
{{MatParam|$bumpframe2|int|Same as <code>$bumpframe</code>, but for the second bump map.|dx9=1}} | |||
: {{bug|Does not function in Orange Box builds and later.}} | {{MatParam|$bumptransform2|matrix|Same as <code>$bumptransform</code>, but for the second bump map. | ||
: {{Note|<code>[[$detail]]</code> used with <code>$detailscale</code> will override this on <code>LightmappedGeneric</code>.}}|dx9=1}} | |||
{{MatParam|$bumpdetailscale1|normal|The strength of the first bumpmap, used for bump map blending.|since=CSGO}} | |||
{{MatParam|$bumpdetailscale2|normal|The strength of the second bumpmap, used for bump map blending.|since=CSGO}} | |||
: {{Note|<code>[[$detail]]</code> used with <code>$detailscale</code> will override this on <code>LightmappedGeneric</code>.}} | |||
==Console commands== | ==Console commands== |
Revision as of 08:49, 26 June 2019

A material's albedo (left) compared to its bump map.
Template:Shaderparam It specifies a texture that will provide three-dimensional lighting information for a material. The texture is a bump map, but the process it is used for is called normal mapping. The two terms are often used interchangeably, however.

$bumpmap
will disable prop_static
's per-vertex lighting in every Source game but 

Basic syntax
LightmappedGeneric
{
$basetexture brick/brickwall021a
$surfaceprop brick
$bumpmap brick/brickwall021a_normal
}
Additional parameters
$bumptransform
[[$ssbump|$ssbump]]
$bumpscale
$bumpframe
$nodiffusebumplighting
$forcebump
$addbumpmaps
$bumpmap2
$bumpframe2
$bumptransform2
$bumpdetailscale1
$bumpdetailscale2
Console commands
mat_fastnobump <bool>
- Quickly enables/disabled normal mapping.
mat_normalmaps <bool>
- Displays the bump map texture of all materials that have one in place of their albedo.
(Yes, these two commands have bump and normal the wrong way around!)