Patch: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Patch is a special shader that allows materials to inherit from each other.)
 
No edit summary
Line 6: Line 6:
:The [[:Category:List of Shader Parameters|parameters]] to add, inside <code>{</code> and <code>}</code>. If you pass one that already exists it will override the original.
:The [[:Category:List of Shader Parameters|parameters]] to add, inside <code>{</code> and <code>}</code>. If you pass one that already exists it will override the original.
:{{tip|<code><parameter> ""</code> can be used to remove an established value.}}
:{{tip|<code><parameter> ""</code> can be used to remove an established value.}}
<code>Patch</code>'s only limitation is that it cannot change a material's [[shader]].


== Example ==
== Example ==

Revision as of 04:25, 31 December 2008

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. Can be anything.
insert
The parameters to add, inside { and }. If you pass one that already exists it will override the original.
Tip.pngTip:<parameter> "" can be used to remove an established value.

Patch's only limitation is that it cannot change a material's shader.

Example

patch
{
	include materials\models\infected\common\common_infected_shared.vmt
	insert
	{
		$basetexture models\infected\common\military_national_guard\common_military_upper_01
	}
}
Note.pngNote:include requires the complete path to the base material, including the materials\ folder and .vmt extension.