Talk:Material modify control

From Valve Developer Community
Jump to navigation Jump to search

Using this with a simple $alpha transition of 0 to 1 (Transparent to Opaque) - seems that dynamic models are not "fading" as world geometry does. Any suggestions? --RTF 03:09, 30 November 2011 (PST)

Edit: Seems to be doing this with any dynamic entity or brush, I.E. func_brush, prop_dynamic, func_door etc.

Added an important detail to getting this to work in the description. --Gir 01:40, 16 Feb 2007 (PST)

Ooh, didn't know I could use this on models. I'm going to guess "no" but it won't hurt to ask: does it work on env_screenoverlay? Because that would be awesome if it did. --4LT 10:56, 19 Aug 2008 (PDT)

It should if you can get the material proxy in the overlay. And someone how to tie it to that. --JakeB 17:11, 19 Aug 2008 (PDT)
I played around with it, and it seems to work. You have to use material proxy on a brush (or maybe model) that has the material, then apply the same material as a screen overlay. The thing is, using material_modify_control does not work while the overlay is enabled, you have to use it before enabling the screen overlay. --4LT 09:37, 22 Aug 2008 (PDT)


Don't works on shader water with parameter "$fogenable" et "$fogcolor". Help pls. --Anarkia777 21:37, 27 July 2010 (UTC) Edit : Oh ok I thing it's because I forget transform my block water to entity, but water shader don't works on block entity, how I can do ?. --Anarkia777 22:09, 27 July 2010 (UTC)

You cannot use material_modify_control on water. --Omnicoder 00:00, 28 July 2010 (UTC)


Bug in StartFloatLerp, Fractional values for <Start Value> <End Value> are truncated to 0, or at least in l4d2. One work-around for this is to scale your values to integers and then use a Divide proxy. Does anyone know how "expense" that adds to a material? --Shotgunefx 18:10, 19 August 2011 (PDT)


Possible bug/limitation: game could crash if you try to modify 2 textures with 2 separate material controls on a single model. -MrKleiner 13-05-2021

Some bugs/caveats I just found in Counter-Strike: Source

  • SetMaterialVar and SetMaterialVarToCurrentTime require the MaterialModify proxy.
  • On a material with only the MaterialModifyAnimated proxy StartFloatLerp will repeat the StartAnimSequence input (or maybe reuses the same values from it. Same difference.) If that input hasn't been fired nothing happens.
  • On a material with the MaterialModify proxy the StartAnimSequence input crashes the game.
  • StartFloatLerp never loops.
  • StartAnimSequence will get a random texture from the map if for the <frame end> param you use -1 or a value greater than the last frame. If setting -1 it will display it for 1 frame before ending on the first frame.

--Sirhephaestus (talk) 12:44, 21 November 2024 (PST)

It seems StartFloatLerp doesn't accept values lower than 1 for the start and end value? Setting anything from 0.01 to 0.99 acts as 0. This may only apply to texturescrollrate in a TextureScroll proxy however. Setting a value lower than 1 works if you directly use a float in the vmt. StartAnimSequence will go to the previous frame after the frame end. Ex. if frame start and end are 0 and 2 respectively, the sequence will go 0, 1, 2, 1.

--Sirhephaestus (talk) 04:33, 2 June 2026 (PDT)

It appears entities spawned by a point_template/env_entity_maker do not work with material_modify_control.

If there are multiple entities with the same name it will cause issues. Unless/until the face of the material being modified is visible on what appears to the entity with the lowest HammerID/Model number (and i assume those are relative to the entity number), none of the entities with the material will be modified. This doesn't appear to be related to visleaves, the face has to actually be visible on screen. When they do update it's as if the input was queued, so StartFloatLerp for example will start from the beginning and function as normal, if the face was not initially visible. The materials will only be updated as long as the face with the lowest ent number is visible. If in the middle of a interpolation and the face becomes invisible (via looking away), the interpolation will visually freeze. When the face becomes visible again the materials will snap to the value they should be had it not been visually frozen, which is jarring. This happens regardless of the material being modified, or the type of brush entity. Untested on model entities.

--Sirhephaestus (talk) 02:18, 25 June 2026 (PDT)