Template:MatParamDef/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (THE OWL moved page Template:MatParam/doc to Template:Material Parameter Definition/doc: MatParam does not represent the meaning of the template very well)
No edit summary
Line 4: Line 4:


== Usage ==
== Usage ==
{{Code|<nowiki>{{MatParam|<name>|<variable type>|<description>}}</nowiki>}}
{{Code|<nowiki>{{MatParamDefDef|<name>|<variable type>|<description>}}</nowiki>}}


== Examples and Parameters ==  
== Examples and Parameters ==  
Line 19: Line 19:


You can also use {{tl|&#61;}}, but this may overload the page.
You can also use {{tl|&#61;}}, but this may overload the page.
| {{CodeBlock|margin=5px|<nowiki>{{MatParam
| {{CodeBlock|margin=5px|<nowiki>{{MatParamDef
| $stupidequalsign | bool
| $stupidequalsign | bool
| text = Wow, I've been fixed! Look at this {{Emoji|point_right}} 2 + 2 = 5
| text = Wow, I've been fixed! Look at this {{Emoji|point_right}} 2 + 2 = 5
}}</nowiki>}}
}}</nowiki>}}
{{CodeBlock|margin=5px|<nowiki>{{MatParam
{{CodeBlock|margin=5px|<nowiki>{{MatParamDef
| $stupidequalsign | bool
| $stupidequalsign | bool
| 3 = Wow, I've been fixed! Look at this {{Emoji|point_right}} 2 + 2 = 5
| 3 = Wow, I've been fixed! Look at this {{Emoji|point_right}} 2 + 2 = 5
}}</nowiki>}}
}}</nowiki>}}
| {{MatParam|$stupidequalsign|bool|text=Wow, I've been fixed! Look at this {{Emoji|point_right}} 2 + 2 = 5}}
| {{MatParamDef|$stupidequalsign|bool|text=Wow, I've been fixed! Look at this {{Emoji|point_right}} 2 + 2 = 5}}
|-
|-
| align="center" | {{Param|deprecated}}
| align="center" | {{Param|deprecated}}
| This material parameter is deprecated and should no longer be used.
| This material parameter is deprecated and should no longer be used.
| {{CodeBlock|margin=5px|<nowiki>{{MatParam
| {{CodeBlock|margin=5px|<nowiki>{{MatParamDef
| I'm deprecated | bool | deprecated = 1
| I'm deprecated | bool | deprecated = 1
| Really, don't use me anymore!
| Really, don't use me anymore!
}}</nowiki>}}
}}</nowiki>}}
| {{MatParam|I'm deprecated|bool|deprecated=1|Really, don't use me anymore!}}
| {{MatParamDef|I'm deprecated|bool|deprecated=1|Really, don't use me anymore!}}
|-
|-
| align="center" | {{Param|since}}
| align="center" | {{Param|since}}
| This material parameter is available since this game. Uses the template {{tl|Since}}.
| This material parameter is available since this game. Uses the template {{tl|Since}}.
| {{CodeBlock|margin=5px|<nowiki>{{MatParam
| {{CodeBlock|margin=5px|<nowiki>{{MatParamDef
| $likealienswarm | bool | since = {{as}}
| $likealienswarm | bool | since = {{as}}
| I'm available in Portal 2, too!
| I'm available in Portal 2, too!
}}</nowiki>}}
}}</nowiki>}}
| {{MatParam|$likealienswarm|bool|since={{as}}|I'm available in Portal 2, too!}}
| {{MatParamDef|$likealienswarm|bool|since={{as}}|I'm available in Portal 2, too!}}
|-
|-
| align="center" | {{Param|also}}
| align="center" | {{Param|also}}
| This material parameter is also available in this game. Uses the template {{tl|Also}}.
| This material parameter is also available in this game. Uses the template {{tl|Also}}.
| {{CodeBlock|margin=5px|<nowiki>{{MatParam
| {{CodeBlock|margin=5px|<nowiki>{{MatParamDef
| $likealienswarm | bool | since = {{as}} | also = {{GMOD}}
| $likealienswarm | bool | since = {{as}} | also = {{GMOD}}
| I'm also available in Garry's Mod!
| I'm also available in Garry's Mod!
}}</nowiki>}}
}}</nowiki>}}
| {{MatParam|$likealienswarm|bool|since={{as}}|also={{GMOD}}|I'm also available in Garry's Mod!}}
| {{MatParamDef|$likealienswarm|bool|since={{as}}|also={{GMOD}}|I'm also available in Garry's Mod!}}
|-
|-
| align="center" | {{Param|only}}
| align="center" | {{Param|only}}
| This material parameter is available only in this/these game(s). Uses the template {{tl|Only}}.
| This material parameter is available only in this/these game(s). Uses the template {{tl|Only}}.
| {{CodeBlock|margin=5px|<nowiki>{{MatParam
| {{CodeBlock|margin=5px|<nowiki>{{MatParamDef
| $lovealienswarm | integer | only = {{as}}
| $lovealienswarm | integer | only = {{as}}
| I'm only available in Alien Swarm!
| I'm only available in Alien Swarm!
}}</nowiki>}}
}}</nowiki>}}
| {{MatParam|$lovealienswarm|integer|only={{as}}|I'm only available in Alien Swarm!}}
| {{MatParamDef|$lovealienswarm|integer|only={{as}}|I'm only available in Alien Swarm!}}
|-
|-
| align="center" | {{Param|removed}}
| align="center" | {{Param|removed}}
| This material parameter was removed in this game. Uses the template {{tl|Removed}}.
| This material parameter was removed in this game. Uses the template {{tl|Removed}}.
| {{CodeBlock|margin=5px|<nowiki>{{MatParam
| {{CodeBlock|margin=5px|<nowiki>{{MatParamDef
| $dxparameter | int | removed = {{l4d}}
| $dxparameter | int | removed = {{l4d}}
| I was removed in Left 4 Dead!
| I was removed in Left 4 Dead!
}}</nowiki>}}
}}</nowiki>}}
| {{MatParam|$dxparameter|integer|I was removed in Left 4 Dead!|removed={{l4d}}}}
| {{MatParamDef|$dxparameter|integer|I was removed in Left 4 Dead!|removed={{l4d}}}}
|-
|-
| align="center" | {{Param|dx9}}
| align="center" | {{Param|dx9}}
| This material parameter requires DX9 or higher to function.
| This material parameter requires DX9 or higher to function.
| {{CodeBlock|margin=5px|<nowiki>{{MatParam
| {{CodeBlock|margin=5px|<nowiki>{{MatParamDef
| $dx9parameter | bool | dx9 = 1
| $dx9parameter | bool | dx9 = 1
| I require DX9 to work!
| I require DX9 to work!
}}</nowiki>}}
}}</nowiki>}}
| {{MatParam|$dx9parameter|bool|I require DX9 to work!|dx9=1}}
| {{MatParamDef|$dx9parameter|bool|I require DX9 to work!|dx9=1}}
|-
|-
| align="center" | {{Param|dx8}}
| align="center" | {{Param|dx8}}
| This material parameter is for DX8, and should not be used for DX9.
| This material parameter is for DX8, and should not be used for DX9.
| {{CodeBlock|margin=5px|<nowiki>{{MatParam
| {{CodeBlock|margin=5px|<nowiki>{{MatParamDef
| $dx8parameter | bool | dx8 = 1
| $dx8parameter | bool | dx8 = 1
| I'm a material parameter for DX8!
| I'm a material parameter for DX8!
}}</nowiki>}}
}}</nowiki>}}
| {{MatParam|$dx8parameter|bool|I'm a material parameter for DX8!|dx8=1}}
| {{MatParamDef|$dx8parameter|bool|I'm a material parameter for DX8!|dx8=1}}
|-
|-
| align="center" | {{Param|to}}
| align="center" | {{Param|to}}
| Use this to define a set of material parameters with very similar names.
| Use this to define a set of material parameters with very similar names.
| {{CodeBlock|margin=5px|<nowiki>{{MatParam
| {{CodeBlock|margin=5px|<nowiki>{{MatParamDef
| $basetexture1 | to = $basetexture4 | texture
| $basetexture1 | to = $basetexture4 | texture
| There are many of us...
| There are many of us...
}}</nowiki>}}
}}</nowiki>}}
| {{MatParam|$basetexture1|to=$basetexture4|texture|There are many of us...}}
| {{MatParamDef|$basetexture1|to=$basetexture4|texture|There are many of us...}}
|-
|-
| align="center" | {{Param|and}}
| align="center" | {{Param|and}}
| Use this to define two material parameters with very similar names.
| Use this to define two material parameters with very similar names.
| {{CodeBlock|margin=5px|<nowiki>{{MatParam
| {{CodeBlock|margin=5px|<nowiki>{{MatParamDef
| $bumpmap | and = $bumpmap2 | texture
| $bumpmap | and = $bumpmap2 | texture
| This shader supports two bump maps.
| This shader supports two bump maps.
}}</nowiki>}}
}}</nowiki>}}
| {{MatParam|$bumpmap|and=$bumpmap2|texture|This shader supports two bump maps.}}
| {{MatParamDef|$bumpmap|and=$bumpmap2|texture|This shader supports two bump maps.}}
|-
|-
| align="center" | {{Param|shaders}}
| align="center" | {{Param|shaders}}
| Lists the shaders for a specific material parameter. Uses the template {{tl|Shaders}}.
| Lists the shaders for a specific material parameter. Uses the template {{tl|Shaders}}.
| {{CodeBlock|margin=5px|<nowiki>{{MatParam
| {{CodeBlock|margin=5px|<nowiki>{{MatParamDef
| $shaderspecificparameter | float
| $shaderspecificparameter | float
| shaders = VertexLitGeneric, UnlitGeneric
| shaders = VertexLitGeneric, UnlitGeneric
| I only work with specific shaders!
| I only work with specific shaders!
}}</nowiki>}}
}}</nowiki>}}
| {{MatParam|$shaderspecificparameter|float|shaders=VertexLitGeneric, UnlitGeneric|I only work with specific shaders!}}
| {{MatParamDef|$shaderspecificparameter|float|shaders=VertexLitGeneric, UnlitGeneric|I only work with specific shaders!}}
|-
|-
| align="center" | {{Param|value}}
| align="center" | {{Param|value}}
| Default value of the parameter.
| Default value of the parameter.
| {{CodeBlock|margin=5px|<nowiki>{{MatParam
| {{CodeBlock|margin=5px|<nowiki>{{MatParamDef
| $defaultvalue | integer | value = 1
| $defaultvalue | integer | value = 1
| Why do I have such a small value? :(
| Why do I have such a small value? :(
}}</nowiki>}}
}}</nowiki>}}
| {{MatParam|$defaultvalue|integer|value=1|Why do I have such a small value? :(}}
| {{MatParamDef|$defaultvalue|integer|value=1|Why do I have such a small value? :(}}
|}
|}



Revision as of 11:42, 23 August 2025

Edit-copy.png
This is a documentation subpage for Template:MatParamDef.
Don't forget to purge the contents of the base page upon creating or editing this subpage.

This template is used to generate material shader parameter definitions on material shader pages.

Usage

{{MatParamDefDef|<name>|<variable type>|<description>}}

Examples and Parameters

Parameter Description Example Preview
{{{text}}}
{{{3}}}
Description of the parameter.

If specified, then you will not encounter the problem of a broken description if there are equal signs in it.

You can also use {{=}}, but this may overload the page.

{{MatParamDef | $stupidequalsign | bool | text = Wow, I've been fixed! Look at this {{Emoji|point_right}} 2 + 2 = 5 }}
{{MatParamDef | $stupidequalsign | bool | 3 = Wow, I've been fixed! Look at this {{Emoji|point_right}} 2 + 2 = 5 }}
Wow, I've been fixed! Look at this {{Emoji|point_right}} 2 + 2 = 5
{{{deprecated}}} This material parameter is deprecated and should no longer be used.
{{MatParamDef | I'm deprecated | bool | deprecated = 1 | Really, don't use me anymore! }}
Really, don't use me anymore!
{{{since}}} This material parameter is available since this game. Uses the template {{Since}}.
{{MatParamDef | $likealienswarm | bool | since = {{as}} | I'm available in Portal 2, too! }}
$likealienswarm <boolean> (in all games since Alien Swarm)
I'm available in Portal 2, too!
{{{also}}} This material parameter is also available in this game. Uses the template {{Also}}.
{{MatParamDef | $likealienswarm | bool | since = {{as}} | also = {{GMOD}} | I'm also available in Garry's Mod! }}
$likealienswarm <boolean> (in all games since Alien Swarm) (also in Garry's Mod)
I'm also available in Garry's Mod!
{{{only}}} This material parameter is available only in this/these game(s). Uses the template {{Only}}.
{{MatParamDef | $lovealienswarm | integer | only = {{as}} | I'm only available in Alien Swarm! }}
$lovealienswarm <integer> (only in Alien Swarm)
I'm only available in Alien Swarm!
{{{removed}}} This material parameter was removed in this game. Uses the template {{Removed}}.
{{MatParamDef | $dxparameter | int | removed = {{l4d}} | I was removed in Left 4 Dead! }}
$dxparameter <integer> (removed since Left 4 Dead)
I was removed in Left 4 Dead!
{{{dx9}}} This material parameter requires DX9 or higher to function.
{{MatParamDef | $dx9parameter | bool | dx9 = 1 | I require DX9 to work! }}
$dx9parameter <boolean> (DX9 SM2)
I require DX9 to work!
{{{dx8}}} This material parameter is for DX8, and should not be used for DX9.
{{MatParamDef | $dx8parameter | bool | dx8 = 1 | I'm a material parameter for DX8! }}
I'm a material parameter for DX8!
{{{to}}} Use this to define a set of material parameters with very similar names.
{{MatParamDef | $basetexture1 | to = $basetexture4 | texture | There are many of us... }}
There are many of us...
{{{and}}} Use this to define two material parameters with very similar names.
{{MatParamDef | $bumpmap | and = $bumpmap2 | texture | This shader supports two bump maps. }}
This shader supports two bump maps.
{{{shaders}}} Lists the shaders for a specific material parameter. Uses the template {{Shaders}}.
{{MatParamDef | $shaderspecificparameter | float | shaders = VertexLitGeneric, UnlitGeneric | I only work with specific shaders! }}
Shader(s): VertexLitGeneric, UnlitGeneric
I only work with specific shaders!
{{{value}}} Default value of the parameter.
{{MatParamDef | $defaultvalue | integer | value = 1 | Why do I have such a small value? :( }}
Default Value: 1
Why do I have such a small value? :(

See also