material_modify_control is a point entity available in all Source games. 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
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.
Bug: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 Material to modify.
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.
- Material to modify
- Path to the VMT file you want to modify, relative to
Bug:Does not work if the VMT is just in
materials/. Should be in a subfolder, like
Bug:When a material has a
env_cubemapas the value, this entity will appear to not work for that material. This is because VBSP will patch the original material and give it a different name that corresponds to the position of the closest cubemap to the brush face that has that material. This happens for every occurrence of the material. In order to make it work, you can replace the
env_cubemapin your material with the path to the generated image of the closest cubemap. For example: env_cubemap "maps/yourmap/c124_28_-60". This means, however, that you will have to do it for every occurrence of the material you want to change, especially when you want them to use different cubemap images. This will make it so that VBSP will not try to patch the material and thus leave the original name. Another way is to just to directly specify the patched material name that is generated by VBSP, which you can find after unpacking the map file.
- Material variable to modify
- Name of the shader parameter you want to modify. Include the
$symbol like how they are written in the VMT.
- The targetname that other entities refer to this entity by.
- Sets the chosen material parameter to the specified value.
- This sets the material variable to the current time on the server.
- Force an animated material with the MaterialModifyAnimated proxy to play a set of animation frames.
<Frame Start> <Frame End> <Frame Rate> <Loop>
<Loop>should be 1 or 0.Tip: Setting "Frame End" to -1 uses the last frame of the texture.
- Force a material with the MaterialModifyAnimated proxy to linearly interpolate a material var between two floating point values.
<Start Value> <End Value> <Transition Time> <Loop>
<Loop>should be 1 or 0.
Note: For the linear interpolation to work correctly, you need both the MaterialModify and MaterialModifyAnimated proxies to be present.
Todo:There are some clarifications needed to be done about some quirks of this input.