$envmap: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
The $envmap [[VMT]] parameter defines the environment map of a material, normally reflecting the nearest [[env_cubemap]].
The $envmap [[VMT]] parameter defines the 'environment map' of a material, normally reflecting the nearest [[env_cubemap]].
 
This creates 'specular' reflections, for use on smooth surfaces.


== Basic VMT Syntax==
== Basic VMT Syntax==
"$envmap" <texture>
* This is the texture to use as the environment map (envmap).
* Normally <nowiki><texture></nowiki> is set to ''"env_cubemap"''.
* See also [[$envmapmask]].


$envmap <texture or "env_cubemap">
env_cubemap is normally used, as it tells [[Vbsp|VBSP]] to substitute it for the name of the nearest [[env_cubemap]] entity when the map compiles. However, it is also possible to enter the name of a texture directly.


== Additional Parameters ==
== Additional Parameters ==


====$envmapcontrast====
; <code>$envmapcontrast <[[normal]]></code>
"$envmapcontrast" <float>
: Controls the [[Wikipedia:Contrast (vision)|contrast]] of the reflection.
* Controls the contrast (i.e. dynamic range) of the reflected [[$envmap]].
: 0 is the normal contrast, while 1 is the full squaring of the color (i.e. color*color).
* The parameter accepts a value between ''0'' and ''1'', where ''0'' is the normal contrast, and ''1'' is the full squaring of the color (color*color).
: {{tip|Use higher contrasts to diminish relatively darker areas and increase "hot spots".}}
* Use higher contrasts to diminish relatively darker areas and increase "hot spots".  
; <code>$envmapsaturation <normal></code>
 
: Controls the colour saturation of the reflection.
 
: 0 is greyscale, while 1 is normal saturation.
====$envmapsaturation====
; <code>$envmapmask <texture></code>
"$envmapsaturation" <float>
: See [[$envmapmask]].
* Controls the colour saturation of the reflected [[$envmap]].
; <code>$envmaptint "[<red float> <green float> <blue float>]"</code>
* The parameter accepts a value between ''0'' and ''1'', where ''0'' is 100% greyscale, and ''1'' is normal saturation.
: Controls the colour tint (red, green and blue channels) of the reflection. Any positive number can be used.
 
: Default value is <code>"[1 1 1]"</code>. You must use quotemarks.
 
: {{tip|This command is useful for controlling the brightness of a specular reflection without an <code>[[$envmapmask]]</code>.}}
====$envmaptint====
; <code>$envmapframe <[[integer]]></code>
"$envmaptint" "[<float> <float> <float>]"
: The frame of an animated texture to use for reflections.
* Controls the tint (red, green and blue channels) of the reflected [[$envmap]].
; <code>$envmapmode <[[int]]?></code>
* The default is ''"[1 1 1]"''.
: {{todo|?}}
 
; <code>$envmapsphere <[[bool]]></code>
 
: {{todo|Probably related to using spheremaps instead of cubemaps. How is this useful?}}
====$envmapframe====
; <code>$basetexturenoenvmap <bool></code>
"$envmapframe" <integer>
; <code>$basetexture2noenvmap <bool></code>
* {{todo|?}}
: {{todo|What do they do?}}
 
: Require DirectX 9.
 
: See also [[$basetexture]] and [[$basetexture2]].
====$envmapmode====
;<code>$envmapoptional <choices></code>
"$envmapmode" 1
: Sets the oldest DirectX version that should draw the reflection. Choose from:
* {{todo|?}}
:*<code>80</code> (DirectX 8)
 
:*<code>81</code> (DirectX 8.1)  
 
:*<code>90</code> (DirectX 9)
====$envmapsphere====
:*<code>95</code> (DirectX 9 with Shader Model 3)
"$envmapsphere" 1
:*<code>98</code> (DirectX 9 with DirectX 10 hardware)
* {{todo|?}}
 
 
====$basetexturenoenvmap====
* Requires DirectX 9.
"$basetexturenoenvmap" <boolean>
* {{todo|what does it do?}}
* Default is ''0''.
* See also [[$basetexture]].
 
 
====$basetexture2noenvmap====
* Requires DirectX 9.
"$basetexture2noenvmap" <boolean>
* {{todo|what does it do?}}
* Default is ''0''.
* See also [[$basetexture2]].
 
 
====$envmapoptional====
* Requires DirectX 8.
"$envmapoptional" <choices>
* Sets the oldest DirectX version required for the shader to do a specular pass.
* Valid values are:
**<code>80</code> (DirectX 8.0)
**<code>81</code> (DirectX 8.1)  
**<code>90</code> (DirectX 9.0)
* Default value is <code>90</code>.
 
 


== See Also ==
== See Also ==
Line 76: Line 47:
* Tutorial: [[Cubemap]]s in Level Design.
* Tutorial: [[Cubemap]]s in Level Design.
* Tutorial: [[Reflective Materials]]
* Tutorial: [[Reflective Materials]]


[[Category:List of Shader Parameters]]
[[Category:List of Shader Parameters]]
[[Category:VMT Reflections]]
[[Category:VMT Reflections]]
[[Category:VMT Lighting]]
[[Category:VMT Lighting]]

Revision as of 05:22, 9 July 2008

The $envmap VMT parameter defines the 'environment map' of a material, normally reflecting the nearest env_cubemap.

This creates 'specular' reflections, for use on smooth surfaces.

Basic VMT Syntax

$envmap <texture or "env_cubemap">

env_cubemap is normally used, as it tells VBSP to substitute it for the name of the nearest env_cubemap entity when the map compiles. However, it is also possible to enter the name of a texture directly.

Additional Parameters

$envmapcontrast <normal>
Controls the contrast of the reflection.
0 is the normal contrast, while 1 is the full squaring of the color (i.e. color*color).
Tip.pngTip:Use higher contrasts to diminish relatively darker areas and increase "hot spots".
$envmapsaturation <normal>
Controls the colour saturation of the reflection.
0 is greyscale, while 1 is normal saturation.
$envmapmask <texture>
See $envmapmask.
$envmaptint "[<red float> <green float> <blue float>]"
Controls the colour tint (red, green and blue channels) of the reflection. Any positive number can be used.
Default value is "[1 1 1]". You must use quotemarks.
Tip.pngTip:This command is useful for controlling the brightness of a specular reflection without an $envmapmask.
$envmapframe <integer>
The frame of an animated texture to use for reflections.
$envmapmode <int?>
Todo: ?
$envmapsphere <bool>
Todo: Probably related to using spheremaps instead of cubemaps. How is this useful?
$basetexturenoenvmap <bool>
$basetexture2noenvmap <bool>
Todo: What do they do?
Require DirectX 9.
See also $basetexture and $basetexture2.
$envmapoptional <choices>
Sets the oldest DirectX version that should draw the reflection. Choose from:
  • 80 (DirectX 8)
  • 81 (DirectX 8.1)
  • 90 (DirectX 9)
  • 95 (DirectX 9 with Shader Model 3)
  • 98 (DirectX 9 with DirectX 10 hardware)

See Also