Patch: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Undo revision 237955 by MrFunreal (talk) Apologies, turns out the model i was testing didn't load the patch-patch material i made.)
Tag: Undo
m (updated language bar. also some formatting.)
Line 1: Line 1:
{{otherlang2
{{lang|Patch}}
|es=Patch:es
{{shader|Patch}} It is a special shader that allows materials to [[Wikipedia:Inheritance (computer science)|inherit]] from each other. This is achieved with two commands:
}}
;<code>include</code>:The base material from which to inherit.{{note|The ''complete'' path is required, including <code>materials\</code> and <tt>.vmt</tt>.}}
'''<code>Patch</code>''' is a special shader that allows materials to [[Wikipedia:Inheritance (computer science)|inherit]] from each other. This is achieved with two commands:
;<code>insert</code>:The [[:Category:List of Shader Parameters|parameters]] to add, inside <code>{</code> and <tt>}</tt>. Those that already exist are overridden.{{tip|<code><parameter> ""</code> can be used to remove an established value.}}
;<code>replace</code>:The [[:Category:List of Shader Parameters|parameters]] to replace, inside <code>{</code> and <tt>}</tt>.{{todo|Check if this is Orange-Box only. Seen in {{Tf2}}.}}


;<code>include</code>
<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.
:The base material from which to inherit.
:{{note|<tt>Patch</tt> material including other <tt>Patch</tt> materials seems to work fine in {{sfm}}.}}
:{{note|The ''complete'' path is required, including <code>materials\</code> and <code>.vmt</code>.}}
;<code>insert</code>
:The [[:Category:List of Shader Parameters|parameters]] to add, inside <code>{</code> and <code>}</code>. Those that already exist are overridden.
:{{tip|<code><parameter> ""</code> can be used to remove an established value.}}
;<code>replace</code>
:The [[:Category:List of Shader Parameters|parameters]] to replace, inside <code>{</code> and <code>}</code>.
:{{todo|Check if this is Orange-Box only. Seen in TF2.}}
 
<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 ==
  '''patch'''
  '''patch'''
  {
  {
Line 27: Line 17:
  }
  }
  }
  }
[[Category:Shaders]]

Revision as of 10:08, 10 June 2022

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

Shader-ball.png Patch 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.

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.

Example

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