Template:MatParamDef/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
{{Documentation subpage}}
{{Doc/subpage}}
<!-- Please place categories where indicated at the bottom of this page. -->
<!-- Please place categories where indicated at the bottom of this page. -->
This template is used to generate [[material]] [[shader]] parameter definitions on material shader pages.
This template is used to generate [[material]] [[shader]] parameter definitions on material shader pages.


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


{{note|Don't forget to use [[Template:=]] to escape any "{{=}}" characters in the text.}}
{{ModernNote|Don't forget to use [[Template:=]] to escape any "{{=}}" characters in the text.}}


== Examples and Parameters ==  
== Examples and Parameters ==  
{| class=standard-table
{| class="standard-table"
! Parameter || Description || Example || Preview
! Parameter
! Description
! Example
! Preview
|-
|-
| <code>deprecated</code> || This material parameter is deprecated and should no longer be used. || <code><nowiki>{{MatParam|I'm deprecated|bool|Really, don't use me anymore!|deprecated=1}}</nowiki></code> || {{MatParam|I'm deprecated|bool|Really, don't use me anymore!|deprecated=1}}
| align="center" | {{Param|deprecated}}
| This material parameter is deprecated and should no longer be used.
| {{CodeBlock|margin=5px|<nowiki>{{MatParam
| I'm deprecated | bool | deprecated = 1
| Really, don't use me anymore!
}}</nowiki>}}
| {{MatParam|I'm deprecated|bool|deprecated=1|Really, don't use me anymore!}}
|-
|-
| <code>since</code> || This material parameter is available since this game. Uses the template {{tl|Since}}. || <code><nowiki>{{MatParam|$likealienswarm|bool|I'm available in Portal 2, too!|since={{as}}}}</nowiki></code> || {{MatParam|$likealienswarm|bool|I'm available in Portal 2, too!|since={{as}}}}
| align="center" | {{Param|since}}
| This material parameter is available since this game. Uses the template {{tl|Since}}.
| {{CodeBlock|margin=5px|<nowiki>{{MatParam
| $likealienswarm | bool | since = {{as}}
| I'm available in Portal 2, too!
}}</nowiki>}}
| {{MatParam|$likealienswarm|bool|since={{as}}|I'm available in Portal 2, too!}}
|-
|-
| <code>also</code> || This material parameter is also available in this game. Uses the template {{tl|Also}}. || <code><nowiki>{{MatParam|$likealienswarm|bool|I'm also available in Garry's Mod!|since={{as}}|also={{GMOD}}}}</nowiki></code> || {{MatParam|$likealienswarm|bool|I'm also available in Garry's Mod!|since={{as}}|also={{GMOD}}}}
| align="center" | {{Param|also}}
| This material parameter is also available in this game. Uses the template {{tl|Also}}.
| {{CodeBlock|margin=5px|<nowiki>{{MatParam
| $likealienswarm | bool | since = {{as}} | also = {{GMOD}}
| I'm also available in Garry's Mod!
}}</nowiki>}}
| {{MatParam|$likealienswarm|bool|since={{as}}|also={{GMOD}}|I'm also available in Garry's Mod!}}
|-
|-
| <code>only</code> || This material parameter is available only in this/these game(s). Uses the template {{tl|Only}}. || <code><nowiki>{{MatParam|$lovealienswarm|integer|I'm only available in Alien Swarm!|only={{as}}}}</nowiki></code> || {{MatParam|$lovealienswarm|integer|I'm only available in Alien Swarm!|only={{as}}}}
| align="center" | {{Param|only}}
| This material parameter is available only in this/these game(s). Uses the template {{tl|Only}}.
| {{CodeBlock|margin=5px|<nowiki>{{MatParam
| $lovealienswarm | integer | only = {{as}}
| I'm only available in Alien Swarm!
}}</nowiki>}}
| {{MatParam|$lovealienswarm|integer|only={{as}}|I'm only available in Alien Swarm!}}
|-
|-
| <code>removed</code> || This material parameter was removed in this game. Uses the template {{tl|Removed}}. || <code><nowiki>{{MatParam|$dxparameter|int|I was removed in Left 4 Dead!|removed={{l4d}}}}</nowiki></code> || {{MatParam|$dxparameter|integer|I was removed in Left 4 Dead!|removed={{l4d}}}}
| align="center" | {{Param|removed}}
| This material parameter was removed in this game. Uses the template {{tl|Removed}}.
| {{CodeBlock|margin=5px|<nowiki>{{MatParam
| $dxparameter | int | removed = {{l4d}}
| I was removed in Left 4 Dead!
}}</nowiki>}}
| {{MatParam|$dxparameter|integer|I was removed in Left 4 Dead!|removed={{l4d}}}}
|-
|-
| <code>dx9</code> || This material parameter requires DX9 or higher to function. || <code><nowiki>{{MatParam|$dx9parameter|bool|I require DX9 to work!|dx9=1}}</nowiki></code> || {{MatParam|$dx9parameter|bool|I require DX9 to work!|dx9=1}}
| align="center" | {{Param|dx9}}
| This material parameter requires DX9 or higher to function.
| {{CodeBlock|margin=5px|<nowiki>{{MatParam
| $dx9parameter | bool | dx9 = 1
| I require DX9 to work!
}}</nowiki>}}
| {{MatParam|$dx9parameter|bool|I require DX9 to work!|dx9=1}}
|-
|-
| <code>dx8</code> || This material parameter is for DX8, and should not be used for DX9. || <code><nowiki>{{MatParam|$dx8parameter|bool|I'm a material parameter for DX8!|dx8=1}}</nowiki></code> || {{MatParam|$dx8parameter|bool|I'm a material parameter for DX8!|dx8=1}}
| align="center" | {{Param|dx8}}
| This material parameter is for DX8, and should not be used for DX9.
| {{CodeBlock|margin=5px|<nowiki>{{MatParam
| $dx8parameter | bool | dx8 = 1
| I'm a material parameter for DX8!
}}</nowiki>}}
| {{MatParam|$dx8parameter|bool|I'm a material parameter for DX8!|dx8=1}}
|-
|-
| <code>to</code> || Use this to define a set of material parameters with very similar names. || <code><nowiki>{{MatParam|$basetexture1|to=$basetexture4|texture|There are many of us...}}</nowiki></code> || {{MatParam|$basetexture1|to=$basetexture4|texture|There are many of us...}}
| align="center" | {{Param|to}}
| Use this to define a set of material parameters with very similar names.
| {{CodeBlock|margin=5px|<nowiki>{{MatParam
| $basetexture1 | to = $basetexture4 | texture
| There are many of us...
}}</nowiki>}}
| {{MatParam|$basetexture1|to=$basetexture4|texture|There are many of us...}}
|-
|-
| <code>and</code> || Use this to define two material parameters with very similar names. || <code><nowiki>{{MatParam|$bumpmap|and=$bumpmap2|texture|This shader supports two bump maps.}}</nowiki></code> || {{MatParam|$bumpmap|and=$bumpmap2|texture|This shader supports two bump maps.}}
| align="center" | {{Param|and}}
| Use this to define two material parameters with very similar names.
| {{CodeBlock|margin=5px|<nowiki>{{MatParam
| $bumpmap | and = $bumpmap2 | texture
| This shader supports two bump maps.
}}</nowiki>}}
| {{MatParam|$bumpmap|and=$bumpmap2|texture|This shader supports two bump maps.}}
|-
|-
| <code>shaders</code> || Lists the shaders for a specific material parameter. Uses the template {{tl|Shaders}}. || <code><nowiki>{{MatParam|$shaderspecificparameter|float|I only work with specific shaders!|shaders=LightmappedGeneric, WorldVertexTransition}}</nowiki></code> || {{MatParam|$shaderspecificparameter|float|I only work with specific shaders!|shaders=LightmappedGeneric, WorldVertexTransition}}
| align="center" | {{Param|shaders}}
| Lists the shaders for a specific material parameter. Uses the template {{tl|Shaders}}.
| {{CodeBlock|margin=5px|<nowiki>{{MatParam
| $shaderspecificparameter | float
| shaders = VertexLitGeneric, UnlitGeneric
| I only work with specific shaders!
}}</nowiki>}}
| {{MatParam|$shaderspecificparameter|float|I only work with specific shaders!|shaders=VertexLitGeneric, UnlitGeneric}}
|-
|-
| <code>value</code> || Default Value || <code><nowiki>{{MatParam|$defaultvalue|integer|Bla bla bla|value=1}}</nowiki></code> || {{MatParam|$defaultvalue|integer|Bla bla bla|value=1}}
| align="center" | {{Param|value}}
| Default Value
| {{CodeBlock|margin=5px|<nowiki>{{MatParam
| $defaultvalue | integer | value = 1
| Bla bla bla
}}</nowiki>}}
| {{MatParam|$defaultvalue|integer|Bla bla bla|value=1}}
|}
|}


Line 39: Line 109:
* [[Template:IO]]
* [[Template:IO]]


<includeonly>{{sandbox other||
{{Doc/Sandbox other| [[Category:Formatting templates]] }}
<!-- Categories below this line, please -->
[[Category:Formatting templates]]
}}</includeonly>

Revision as of 04:32, 6 April 2023

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

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

Template:ModernNote

Examples and Parameters

Parameter Description Example Preview
{{{deprecated}}} This material parameter is deprecated and should no longer be used.
{{MatParam | I'm deprecated | bool | deprecated = 1 | Really, don't use me anymore! }}
I'm deprecated
{{{since}}} This material parameter is available since this game. Uses the template {{Since}}.
{{MatParam | $likealienswarm | bool | since = {{as}} | I'm available in Portal 2, too! }}
$likealienswarm
{{{also}}} This material parameter is also available in this game. Uses the template {{Also}}.
{{MatParam | $likealienswarm | bool | since = {{as}} | also = {{GMOD}} | I'm also available in Garry's Mod! }}
$likealienswarm
{{{only}}} This material parameter is available only in this/these game(s). Uses the template {{Only}}.
{{MatParam | $lovealienswarm | integer | only = {{as}} | I'm only available in Alien Swarm! }}
$lovealienswarm
{{{removed}}} This material parameter was removed in this game. Uses the template {{Removed}}.
{{MatParam | $dxparameter | int | removed = {{l4d}} | I was removed in Left 4 Dead! }}
$dxparameter
{{{dx9}}} This material parameter requires DX9 or higher to function.
{{MatParam | $dx9parameter | bool | dx9 = 1 | I require DX9 to work! }}
$dx9parameter
{{{dx8}}} This material parameter is for DX8, and should not be used for DX9.
{{MatParam | $dx8parameter | bool | dx8 = 1 | I'm a material parameter for DX8! }}
$dx8parameter
{{{to}}} Use this to define a set of material parameters with very similar names.
{{MatParam | $basetexture1 | to = $basetexture4 | texture | There are many of us... }}
$basetexture1
{{{and}}} Use this to define two material parameters with very similar names.
{{MatParam | $bumpmap | and = $bumpmap2 | texture | This shader supports two bump maps. }}
$bumpmap
{{{shaders}}} Lists the shaders for a specific material parameter. Uses the template {{Shaders}}.
{{MatParam | $shaderspecificparameter | float | shaders = VertexLitGeneric, UnlitGeneric | I only work with specific shaders! }}
$shaderspecificparameter
{{{value}}} Default Value
{{MatParam | $defaultvalue | integer | value = 1 | Bla bla bla }}
$defaultvalue

See Also