From Valve Developer Community
Jump to: navigation, search
The Citadel Core, which uses this shader.

Core is a material shader available in all Source games since <Half-Life 2: Episode One><Half-Life 2: Episode One> Half-Life 2: Episode One. It is used to create a unstable, reflecting and refracting core of energy, used exclusively for the Core reactor in the Citadel in Episode One.

Note.png Note: In order for this shader to work properly, it must be used with a prop_coreball at the position of (2688,12139,5170). This value is hardcoded into the shader.
Note.png Note: This shader does not exist in engine branches after the Orange Box.

Shader Parameters

$corecolortexture <texture>
The texture to use for the colors that get dynamically modified by the shader. The alpha channel of the $corecolortexture determines the translucency of the core.
$corecolortextureframe <texture>
The frame to start an animated $corecolortexture on.
$normalmap <texture>
$dudvmap <texture>  (DX8)
The pattern of refraction is defined by a normal map (DX9+) or DUDV map (DX8-). May be animated.
$bumpframe <integer>
The frame to start an animated bumpmap on. To do: This may not work with the proxy required for the effect.
$bumptransform <matrix>
Transforms the bump map texture.
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 X axis.
  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.
Note.png Note: All values must be included!
Bug.png Bug: Scaling the texture may cause odd issues where the Texture Lock tool in Hammer will not actually lock the texture in place.
Bug.png Bug: 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.
$envmap <texture>
Adds a cubemap reflection on top of the refraction.
Note.png Note: Specular reflections for this shader will be drawn even if mat_specular is set to 0.
$envmapframe <integer>
The frame to start an animated cubemap on.
$envmaptint <RGB matrix>
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.png Note: You must use quotemarks, as there are space characters within the value.
$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).
$envmapsaturation <normal>
Controls the colour saturation of the reflection. 0 is greyscale, while 1 is natural saturation.
$refractamount <float>
Controls the strength of the refraction by multiplying the normal map intensity.
$refracttint <RGB matrix>
Tints the color of the refraction.
$flowmap <texture>
Flowmap to scroll the normal map, which affects the refraction.
$flowmapframe <integer>
The frame to start an animated flowmap on.
$flowmapscrollrate <vector2>
The rate at which the normal map scrolls along the flowmap.
$flowmaptexcoordoffset <float>
To do: Texture offset for the flowmap? Modified by proxies, as seen below.


The Core material used in Episode One, materials/models/props_combine/core_sheet.vmt

	"$normalmap" "Models/props_combine/core_normal"
	"$dudvmap"  "Models/props_combine/core_dudv"

	"$corecolortexture" "models/props_combine/corewarpcolor"
	"$flowmap" "models/props_combine/core_flow"

	"$model" 1
	"$REFRACTAmOUNT" "0.15"
	"$FLOWMAPSCROLLRATE" "[.0475 .133]"
//	"$envmap" "CustomCubeMaps/core"
	"$envmap" "env_cubemap"
	"$refracttint" "[0.7 0.7 0.6]"
	"$envmaptint" "[0.8 0.6 0.6]"
	"$TempMin" 0
	"$TempMax" 1

		"$fallbackmaterial" "models/props_combine/coredx70"

		"$normalmap" "dev/water_normal"
		"$dudvmap"  "dev/water_dudv"
		"$bumptransform" "center .5 .5 scale 5 5 rotate 0 translate 0 0"
		"$envmapcontrast" "1.0"


			"sineperiod" 4
			"sinemin" "$TempMin"
			"sinemax" "$TempMax"
			"animatedtexturevar" "$normalmap" 
			"animatedtextureframenumvar" "$bumpframe"
			"animatedtextureframerate" 29.00