$emissiveblend

From Valve Developer Community
Jump to: navigation, search

$emissiveblend is a material shader parameter available in all Source games since <Source> Source 2007 for VertexLitGeneric. It provides advanced self-illumination that can be flowed using a flowmap. It is used for the Vortigaunts in <Half-Life 2> Half-Life 2: Episode Two and succeeds the VortWarp shader from <Half-Life 2> Half-Life 2: Episode One. All parameters must be specified except for $emissiveblendstrength in order for the effect to work properly.

Note:$emissiveblend is additive, and does not read from the material's albedo.
Note:$emissiveblend parameters are X+ and Y-, for both flowmap and scroll. (e.g. Giving X a positive scroll vector will have it go left and giving Y a positive scroll vector will have it go up)
Note:This effect does not need to use a flowmap, and can instead be used as a simple emissive map. Use dummy textures (dev/null or a pure white texture with a pure black alpha channel) for $emissiveblendtexture and $emissiveblendflowtexture, and use a value of "[0 0]" for $emissiveblendscrollvector. In this instance, illumination is solely provided by the $emissiveblendbasetexture, and the time proxy is not required.

Parameters

$emissiveblendenabled <boolean>
Enables the effect.
$emissiveblendtexture <texture>
The texture that the flowmap scrolls. Not mapped to a UV.
$emissiveblendbasetexture <texture>
The texture used for the self-illumination. Can be colored or grayscale. Does not adopt the base texture's color.
To do: Does the alpha channel of this texture do anything? The one Valve uses has a specific alpha channel defined.
$emissiveblendflowtexture <texture>
Flowmap used for the $emissiveblendtexture.
$emissiveblendtint <RGB matrix>
Color tint of the effect. Default "[1 1 1]".
$emissiveblendstrength <normal>
Strength of the effect.[Clarify] Default 1.
$emissiveblendscrollvector <vector2>
A matrix that controls the direction and speed the $emissiveblendtexture scrolls. X (horizontal) and Y (vertical) respectively. A setting of 1 results in the texture tiling every 1 second, 0.1 every 10 seconds. 0 is no scroll. Default "[1 1]".

Time Proxy

This shader or material parameter requires the below material proxy as specified to work properly.

	"$time" "0.0"
	"Proxies"
	{
		"CurrentTime"
		{
			"resultVar" "$time" //Needs the CurrentTime material proxy to work properly.
		}
	}

Example

The only known material using this shader parameter, found in <Half-Life 2> Half-Life 2: Episode Two, materials/models/vortigaunt/vortigaunt_blue.vmt

"VertexLitGeneric"
{
	"$surfaceprop" "default"
	"$basetexture" "Models/vortigaunt/vortigaunt_base"
	"$bumpmap" "Models/vortigaunt/vortigaunt_normal"
	"$phong" "1"
	"$phongboost" "10"
	"$phongexponenttexture" "Models/vortigaunt/vortigaunt_exponent"
	"$phongalbedotint" "1"
	"$phongfresnelranges" "[.18 .4 1]"
	"$halflambert" "1"
	"$nodecal" "1"

	// Rim lighting parameters
	"$rimlight" "1"												// To enable rim lighting (requires phong)
	"$rimlightexponent" "10"										// Exponent for phong component of rim lighting	
	"$rimlightboost" "3"										// Boost for ambient cube component of rim lighting


	// Blend between color textures
	"$detail" "Models/Vortigaunt/vortigaunt_blue"
	"$detailblendmode" "3"
	"$detailblendfactor" "0.0"
	"$detailScale" "1.0"

	// Emissive Scroll Pass
	"$emissiveBlendEnabled"     "1" // Enables effect
	"$emissiveBlendTexture"     "models/vortigaunt/vortigaunt_illum"
	"$emissiveBlendBaseTexture" "Models/Vortigaunt/vortigaunt_blue"
	"$emissiveBlendFlowTexture" "models/vortigaunt/vortigaunt_flow"
	"$emissiveBlendTint"        "[1 1 1]"
	"$emissiveBlendScrollVector" "[0.11 0.124]"
	"$time" "0"
	"Proxies"
	{
		"VortEmissive"
		{
		}
		"MaterialModify"
		{
		}
		"CurrentTime"
		{
			"resultVar" "$time"
		}
	}
}

See Also