material_modify_control

From Source Entities
Jump to navigation Jump to search

Code classes:

material_modify_control is a point entity present in all Source games. It modifies a VMT parameter in real time.

Bug: The entity will not work unless it's parented to an object that's in the PVS, on-screen, and has at least one face facing towards the viewer that's textured with the Material to modify. The entity also does not limit itself to only controlling textures on its parent like the FGD says it does.

Example[edit | edit source]

material_modify_control is used by the clocks seen in the first Portal map. The centisecond number is a func_brush using a VMT that looks like this:

"LightMappedGeneric"
{
	"$baseTexture" "signage/clock/countdown"
	"Proxies"
	{
		"MaterialModify"
		{
			"dummy" 0 //This has to be here, or material loading barfs.
		}
	}
}

The material_modify_control has Material variable to modify set to $frame. A logic_timer with a Refire Interval of 1 sends the material_modify_control StartFloatLerp with the parameter 0 59 1 0. This makes the texture go from frame 0 to frame 59 within one second, every second.

Important: The material must have the MaterialModify or MaterialModifyAnimated proxy. MaterialModifyAnimated can take the same parameters as AnimatedTexture.

Keyvalues[edit | edit source]

Material to modify (materialName) <material>
The material that will get modified.
Material variable to modify (materialVar) <string>
Which parameter to modify. E.g. $color.

Inputs[edit | edit source]

SetMaterialVar <string>
Changes the actual value of the Material variable.
SetMaterialVarToCurrentTime
Sets the Material variable to the current server time. Valve probably created this input for debugging purposes.
StartAnimSequence <string>
Makes the material go through any frames that it has. Mouse over each parameter for more info.
Format: <Frame Start> <Frame End> <Frame Rate> <Loop>
StartFloatLerp <string>
Makes the Material variable transition from one value to another. Mouse over each parameter for more info.
Format: <Start Value> <End Value> <Transition Time> <Loop>

See Also[edit | edit source]