This article's documentation is for anything that uses the Source engine. Click here for more information.

Patch: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Nesciuse moved page Patch/en to Patch without leaving a redirect: Move en subpage to basepage)
(added note about chained patch materials working in l4d2)
 
(One intermediate revision by one other user not shown)
Line 9: Line 9:


<tt>Patch</tt>'s only limitations are that it cannot change a material's [[shader]], and a <code>Patch</code> material cannot use <code>include</code> to inherit from another <code>Patch</code> material.
<tt>Patch</tt>'s only limitations are that it cannot change a material's [[shader]], and a <code>Patch</code> material cannot use <code>include</code> to inherit from another <code>Patch</code> material.
:{{note|<tt>Patch</tt> material including other <tt>Patch</tt> materials seems to work fine in {{sfm}}.}}
:{{note|<tt>Patch</tt> material including other <tt>Patch</tt> materials seems to work fine in {{sfm}} and {{l4d2}}. The "The Last Stand" update added wounded L4D1 infected materials, which include their default materials, which in turn include the shared material.}}


==Example==
==Example==
Line 20: Line 20:
  }
  }
  }
  }
{{this is a|pixel shader|name=Patch}}

Latest revision as of 10:20, 6 November 2024

English (en)Español (es)Translate (Translate)

Patch is a Pixel shader available in all Source Source games. It is a special shader that allows materials to inherit from each other. This is achieved with two commands:

include
The base material from which to inherit.
Note.pngNote:The complete path is required, including materials\ and .vmt.
insert
The parameters to add, inside { and }. Those that already exist are overridden.
Tip.pngTip:<parameter> "" can be used to remove an established value.
replace
The parameters to replace, inside { and }.
Todo: Check if this is Orange-Box only. Seen in Team Fortress 2 and Counter-Strike: Source.

Patch's only limitations are that it cannot change a material's shader, and a Patch material cannot use include to inherit from another Patch material.

Note.pngNote:Patch material including other Patch materials seems to work fine in Source Filmmaker and Left 4 Dead 2. The "The Last Stand" update added wounded L4D1 infected materials, which include their default materials, which in turn include the shared material.

Example

patch
{
	include materials\models\infected\common\common_infected_shared.vmt
	insert
	{
		$basetexture models\infected\common\military_national_guard\common_military_upper_01
	}
}