Difference between revisions of "Patch"

From Valve Developer Community
Jump to: navigation, search
m (I can't seem to...)
m
 
(4 intermediate revisions by 2 users not shown)
Line 14: Line 14:
 
:{{todo|Check if this is Orange-Box only. Seen in TF2.}}
 
:{{todo|Check if this is Orange-Box only. Seen in TF2.}}
  
<code>Patch</code>'s only limitation is that it cannot change a material's [[shader]].
+
<code>Patch</code>'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|A Patch material including another Patch material seems to work fine in SFM.}}
  
 
== Example ==
 
== Example ==
Line 22: Line 23:
 
  '''include''' materials\models\infected\common\common_infected_shared.vmt
 
  '''include''' materials\models\infected\common\common_infected_shared.vmt
 
  '''insert'''
 
  '''insert'''
{
+
{
$basetexture models\infected\common\military_national_guard\common_military_upper_01
+
$basetexture models\infected\common\military_national_guard\common_military_upper_01
}
+
}
 
  }
 
  }
  
 
[[Category:Shaders]]
 
[[Category:Shaders]]

Latest revision as of 05:05, 25 March 2020

Español

Patch 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:The complete path is required, including materials\ and .vmt.
insert
The parameters to add, inside { and }. Those that already exist are overridden.
Tip:<parameter> "" can be used to remove an established value.
replace
The parameters to replace, inside { and }.
To do: Check if this is Orange-Box only. Seen in TF2.

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:A Patch material including another Patch material seems to work fine in SFM.

Example

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