$envmap: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
| TomEdwards (talk | contribs) | TomEdwards (talk | contribs)  No edit summary | ||
| Line 1: | Line 1: | ||
| [[File:Specular.jpg|thumb|Specular reflections.]] | [[File:Specular.jpg|thumb|Specular reflections.]] | ||
| The '''<code>$envmap</code>''' [[VMT]] parameter creates [[wikipedia:specular reflection|specular reflection]]s, which are seen on smooth surfaces. It does this by defining an "environment map" (specifically a [[cubemap]]) to draw as a reflection; normally that of the nearest [[env_cubemap]] entity. | The '''<code>$envmap</code>''' [[VMT]] parameter creates [[wikipedia:specular reflection|specular reflection]]s, which are seen on smooth surfaces. It does this by defining an "environment map" (specifically a [[cubemap]]) to draw as a reflection; normally that of the nearest [[env_cubemap]] entity. The reflection is not dynamic. | ||
| The other form of reflection supported by Source is the diffuse [[phong]] type. | The other form of reflection supported by Source is the diffuse [[phong]] type. | ||
Revision as of 08:23, 29 July 2009
The $envmap VMT parameter creates specular reflections, which are seen on smooth surfaces. It does this by defining an "environment map" (specifically a cubemap) to draw as a reflection; normally that of the nearest env_cubemap entity. The reflection is not dynamic.
The other form of reflection supported by Source is the diffuse phong type.
Syntax
$envmap env_cubemap
"env_cubemap" is normally used, as it tells VBSP to swap in the name of the nearest env_cubemap when the map compiles. However it is also possible to enter the name of a texture directly.
Additional Parameters
- $envmapmask <texture>
- See $envmapmask. A VTF file that determines per-texel reflection intensity.
- $envmaptint "[<red float> <green float> <blue float>]"
- Controls the intensity of the reflection's red, green and blue color channels. Any positive number can be used. Default is "[1 1 1]", which means 100% intensity. Note:You must use quotemarks, as there are space characters within the value. Note:You must use quotemarks, as there are space characters within the value. Tip:This command is often used to dim the brightness of a specular reflection without the overhead of an Tip:This command is often used to dim the brightness of a specular reflection without the overhead of an$envmapmask.
- $envmapcontrast <normal>
- Controls the contrast of the reflection. 0 is natural contrast, while 1 is the full squaring of the color (i.e. color*color).
 Tip:Use higher contrasts to diminish relatively darker areas and increase "hot spots". Tip: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 natural saturation.
- $envmapframe <int>
- The frame to start an animated cubemap on.
- $envmapmode <int?>
- Todo: ?
- $basetexturenoenvmap <bool>
- $basetexture2noenvmap <bool>
- Probably used for materials with two albedos, to make one or the other matte. Require DirectX 9; see also $basetextureand$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)
 
Console commands
- buildcubemaps
- Generates cubemaps for use in materials. If this isn't run, objects will reflect the skybox (OB) or have an invalid, white reflection (Ep1).
- r_showenvcubemap <bool>
- Debug command to display cubemaps on all dynamic objects at full intensity. It was used to create the image at the start of this article.
See Also
- $envmapmask (specular mask)
- $phong (for diffuse reflection)
- Cubemap
