Material modify control: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:
For the entity to work, its target material must have the <code>MaterialModify</code> or <code>MaterialModifyAnimated</code> [[Material Proxies|proxy]] installed, and must be applied to an entity.
For the entity to work, its target material must have the <code>MaterialModify</code> or <code>MaterialModifyAnimated</code> [[Material Proxies|proxy]] installed, and must be applied to an entity.


Compare this with the {{ent|env_texturetoggle}} entity, which can control brushes or overlays by [[targetname]].
Does similar things to the {{ent|env_texturetoggle}} entity, which can control brushes or overlays by [[targetname]].
 
{{ModernBug|The entity will not work unless it's parented to an object that's in the [[PVS]], is on-screen, and has at least one face facing towards the viewer that's textured with the <tt>Material to modify</tt>.}}
{{ModernBug|The entity will not work unless it's parented to an object that's in the [[PVS]], is on-screen, and has at least one face facing towards the viewer that's textured with the <tt>Material to modify</tt>.}}
Instances of the Material to Modify on world geometry are controlled by the lowest-ID (first created in Hammer) <tt>material_modify_control</tt>, in addition to instances of the material on the <tt>material_modify_control</tt>'s parent.
Instances of the Material to Modify on world geometry are controlled by the lowest-ID (first created in Hammer) <tt>material_modify_control</tt>, in addition to instances of the material on the <tt>material_modify_control</tt>'s parent.

Revision as of 04:53, 21 April 2023

English (en)Translate (Translate)

Template:Entity It is used to modify arbitrary material properties in response to I/O events.

For the entity to work, its target material must have the MaterialModify or MaterialModifyAnimated proxy installed, and must be applied to an entity.

Does similar things to the env_texturetoggle entity, which can control brushes or overlays by targetname.

Template:ModernBug Instances of the Material to Modify on world geometry are controlled by the lowest-ID (first created in Hammer) material_modify_control, in addition to instances of the material on the material_modify_control's parent.

Keyvalues

Material to modify (materialName) <string>
Path to the VMT file you want to modify, relative to materials/ folder. Without .vmt suffix.

Template:ModernBug Template:ModernBug

Material variable to modify (materialVar) <string>
Name of the shader parameter you want to modify. Include the $ symbol like how they are written in the VMT.
Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Inputs

SetMaterialVar <stringRedirectInput/string>
Sets the chosen material parameter to the specified value.
SetMaterialVarToCurrentTime
This sets the material variable to the current time on the server.
StartAnimSequence <stringRedirectInput/string>
Force an animated material with the MaterialModifyAnimated proxy to play a set of animation frames.
Format is: <Frame Start> <Frame End> <Frame Rate> <Loop>
<Loop> should be 1 or 0. Template:ModernTip
StartFloatLerp <stringRedirectInput/string>
Force a material with the MaterialModifyAnimated proxy to linearly interpolate a material var between two floating point values.
Format is: <Start Value> <End Value> <Transition Time> <Loop>
<Loop> should be 1 or 0.

Template:ModernNote

Todo: There are some clarifications needed to be done about some quirks of this input.