Template:MatParamDef/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
Line 17: Line 17:
! Preview
! Preview
|-
|-
| align="center" | {{Param|text}}<br>{{param|3}}
| align="center" | <code>{{param|text}}</code><br>or</br><code>{{param|3}}</code>
| Description of the parameter.
| Description of the parameter.


Line 23: Line 23:


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>{{MatParamDef
| <pre style="margin:0">{{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>}}
}}</pre>
{{CodeBlock|margin=5px|<nowiki>{{MatParamDef
| bgcolor="#262626" | {{MatParamDef|$stupidequalsign|bool|text=Wow, I've been fixed! Look at this {{Emoji|point_right}} 2 + 2 = 5}}
| $stupidequalsign | bool
| 3 = Wow, I've been fixed! Look at this {{Emoji|point_right}} 2 + 2 = 5
}}</nowiki>}}
| {{MatParamDef|$stupidequalsign|bool|text=Wow, I've been fixed! Look at this {{Emoji|point_right}} 2 + 2 = 5}}
|-
|-
| align="center" | {{Param|deprecated}}
| align="center" | <code>{{param|deprecated}}</code>
| 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>{{MatParamDef
| <pre style="margin:0">{{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>}}
}}</pre>
| {{MatParamDef|I'm deprecated|bool|deprecated=1|Really, don't use me anymore!}}
| bgcolor="#262626" | {{MatParamDef|I'm deprecated|bool|deprecated=1|Really, don't use me anymore!}}
|-
|-
| align="center" | {{Param|since}}
| align="center" | <code>{{param|since}}</code>
| 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>{{MatParamDef
| <pre style="margin:0">{{MatParamDef
| $likealienswarm | bool | since = {{as}}
| $likealienswarm | bool | since = {{as}}
| I'm available in Portal 2, too!
| I'm available in Portal 2, too!
}}</nowiki>}}
}}</pre>
| {{MatParamDef|$likealienswarm|bool|since={{as}}|I'm available in Portal 2, too!}}
| bgcolor="#262626" | {{MatParamDef|$likealienswarm|bool|since={{as}}|I'm available in Portal 2, too!}}
|-
|-
| align="center" | {{Param|also}}
| align="center" | <code>{{param|also}}</code>
| 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>{{MatParamDef
| <pre style="margin:0">{{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>}}
}}</pre>
| {{MatParamDef|$likealienswarm|bool|since={{as}}|also={{GMOD}}|I'm also available in Garry's Mod!}}
| bgcolor="#262626" | {{MatParamDef|$likealienswarm|bool|since={{as}}|also={{GMOD}}|I'm also available in Garry's Mod!}}
|-
|-
| align="center" | {{Param|only}}
| align="center" | <code>{{param|only}}</code>
| 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>{{MatParamDef
| <pre style="margin:0">{{MatParamDef
| $lovealienswarm | integer | only = {{as}}
| $lovealienswarm | integer | only = {{as}}
| I'm only available in Alien Swarm!
| I'm only available in Alien Swarm!
}}</nowiki>}}
}}</pre>
| {{MatParamDef|$lovealienswarm|integer|only={{as}}|I'm only available in Alien Swarm!}}
| bgcolor="#262626" | {{MatParamDef|$lovealienswarm|integer|only={{as}}|I'm only available in Alien Swarm!}}
|-
|-
| align="center" | {{Param|removed}}
| align="center" | <code>{{param|removed}}</code>
| 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>{{MatParamDef
| <pre style="margin:0">{{MatParamDef
| $dxparameter | int | removed = {{l4d}}
| $dxparameter | int | removed = {{l4d}}
| I was removed in Left 4 Dead!
| I was removed in Left 4 Dead!
}}</nowiki>}}
}}</pre>
| {{MatParamDef|$dxparameter|integer|I was removed in Left 4 Dead!|removed={{l4d}}}}
| bgcolor="#262626" | {{MatParamDef|$dxparameter|integer|I was removed in Left 4 Dead!|removed={{l4d}}}}
|-
|-
| align="center" | {{Param|dx9}}
| align="center" | <code>{{param|dx9}}</code>
| This material parameter requires DX9 or higher to function.
| This material parameter requires DX9 or higher to function.
| {{CodeBlock|margin=5px|<nowiki>{{MatParamDef
| <pre style="margin:0">{{MatParamDef
| $dx9parameter | bool | dx9 = 1
| $dx9parameter | bool | dx9 = 1
| I require DX9 to work!
| I require DX9 to work!
}}</nowiki>}}
}}</pre>
| {{MatParamDef|$dx9parameter|bool|I require DX9 to work!|dx9=1}}
| bgcolor="#262626" | {{MatParamDef|$dx9parameter|bool|I require DX9 to work!|dx9=1}}
|-
|-
| align="center" | {{Param|dx8}}
| align="center" | <code>{{param|dx8}}</code>
| 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>{{MatParamDef
| <pre style="margin:0">{{MatParamDef
| $dx8parameter | bool | dx8 = 1
| $dx8parameter | bool | dx8 = 1
| I'm a material parameter for DX8!
| I'm a material parameter for DX8!
}}</nowiki>}}
}}</pre>
| {{MatParamDef|$dx8parameter|bool|I'm a material parameter for DX8!|dx8=1}}
| bgcolor="#262626" | {{MatParamDef|$dx8parameter|bool|I'm a material parameter for DX8!|dx8=1}}
|-
|-
| align="center" | {{Param|to}}
| align="center" | <code>{{param|to}}</code>
| 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>{{MatParamDef
| <pre style="margin:0">{{MatParamDef
| $basetexture1 | to = $basetexture4 | texture
| $basetexture1 | to = $basetexture4 | texture
| There are many of us...
| There are many of us...
}}</nowiki>}}
}}</pre>
| {{MatParamDef|$basetexture1|to=$basetexture4|texture|There are many of us...}}
| bgcolor="#262626" | {{MatParamDef|$basetexture1|to=$basetexture4|texture|There are many of us...}}
|-
|-
| align="center" | {{Param|and}}
| align="center" | <code>{{param|and}}</code>
| 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>{{MatParamDef
| <pre style="margin:0">{{MatParamDef
| $bumpmap | and = $bumpmap2 | texture
| $bumpmap | and = $bumpmap2 | texture
| This shader supports two bump maps.
| This shader supports two bump maps.
}}</nowiki>}}
}}</pre>
| {{MatParamDef|$bumpmap|and=$bumpmap2|texture|This shader supports two bump maps.}}
| bgcolor="#262626" | {{MatParamDef|$bumpmap|and=$bumpmap2|texture|This shader supports two bump maps.}}
|-
|-
| align="center" | {{Param|shaders}}
| align="center" | <code>{{param|shaders}}</code>
| 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>{{MatParamDef
| <pre style="margin:0">{{MatParamDef
| $shaderspecificparameter | float
| $shaderspecificparameter | float
| shaders = VertexLitGeneric, UnlitGeneric
| shaders = VertexLitGeneric, UnlitGeneric
| I only work with specific shaders!
| I only work with specific shaders!
}}</nowiki>}}
}}</pre>
| {{MatParamDef|$shaderspecificparameter|float|shaders=VertexLitGeneric, UnlitGeneric|I only work with specific shaders!}}
| bgcolor="#262626" | {{MatParamDef|$shaderspecificparameter|float|shaders=VertexLitGeneric, UnlitGeneric|I only work with specific shaders!}}
|-
|-
| align="center" | {{Param|value}}
| align="center" | <code>{{param|value}}</code>
| Default value of the parameter.
| Default value of the parameter.
| {{CodeBlock|margin=5px|<nowiki>{{MatParamDef
| <pre style="margin:0">{{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>}}
}}</pre>
| {{MatParamDef|$defaultvalue|integer|value=1|Why do I have such a small value? :(}}
| bgcolor="#262626" | {{MatParamDef|$defaultvalue|integer|value=1|Why do I have such a small value? :(}}
|}
|}



Revision as of 08:31, 24 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

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

Examples and Parameters

Parameter Description Example Preview
{{{text}}}
or
{{{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
}}
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