Template:MatParamDef: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Fixed inconsistent language between example and preview for "and" named parameter)
(Moved documentation to subpage)
Line 1: Line 1:
<noinclude>
; {{#if: {{{deprecated|}}} | <del> }}<code>{{{1}}}</code> {{#if: {{{to|}}} | <span style="font-weight: normal;">to</span> <code>{{{to}}}</code> }} {{#if: {{{and|}}} | <span style="font-weight: normal;">and</span> <code>{{{and}}}</code> }} {{#if: {{{2|}}} | {{KV Type|{{{2}}}}} }}{{#if: {{{deprecated|}}} | </del> }}{{#if: {{{since|}}} | &nbsp;{{{{{since}}} add}} }}{{#if: {{{only|}}} | &nbsp;{{{{{only}}} only}} }}{{#if: {{{also|}}} | &nbsp;{{{{{also}}} also}} }}{{#if: {{{dx8|}}} | &nbsp;{{Dx8}} }}{{#if: {{{dx9|}}} | &nbsp;{{Dx9}} }} {{#if: {{{deprecated|}}} | &nbsp;{{obs}} }}
This template is used to generate [[material]] [[shader]] parameter definitions on material shader pages.
: {{#if: {{{deprecated|}}} | Deprecated.&nbsp; }} {{#if: {{{3|}}} | {{{3}}}}}<noinclude>
 
{{documentation}}
== Basic usage ==
<!-- Add categories to the /doc subpage, not here -->
<nowiki>{{MatParam|<name>|<variable type>|<description>}}</nowiki>
</noinclude>
 
{{note|Don't forget to use [[Template:=]] to escape any "{{=}}" characters in the text.}}
 
== Named parameters ==
{| class=standard-table
! 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}}
|-
| <code>since</code> || This material parameter is available since this game. Uses the template <nowiki>{{<game> add}}</nowiki>. || <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}}
|-
| <code>also</code> || This material parameter is also available in this game. Uses the template <nowiki>{{<game> also}}</nowiki>. || <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}}
|-
| <code>only</code> || This material parameter is available only in this game. Uses the template <nowiki>{{<game> only}}</nowiki>. || <code><nowiki>{{MatParam|$lovealienswarm|bool|I'm only available in Alien Swarm!|only=AS}}</nowiki></code> || {{MatParam|$lovealienswarm|integer|I'm only available in Alien Swarm!|only=AS}}
|-
| <code>dx9</code> || This material parameter requires DX9 or higher to function. || <code><nowiki>{{MatParam|$dx9parameter|boolean|I require DX9 to work!|dx9=1}}</nowiki></code> || {{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|boolean|I'm a material parameter for DX8!|dx8=1}}</nowiki></code> || {{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...}}
|-
| <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.}}
|}
 
== See also ==
* [[Template:KV]]
* [[Template:IO]]
 
<hr>
</noinclude>; {{#if: {{{deprecated|}}} | <del> }}<code>{{{1}}}</code> {{#if: {{{to|}}} | <span style="font-weight: normal;">to</span> <code>{{{to}}}</code> }} {{#if: {{{and|}}} | <span style="font-weight: normal;">and</span> <code>{{{and}}}</code> }} {{#if: {{{2|}}} | {{KV Type|{{{2}}}}} }}{{#if: {{{deprecated|}}} | </del> }}{{#if: {{{since|}}} | &nbsp;{{{{{since}}} add}} }}{{#if: {{{only|}}} | &nbsp;{{{{{only}}} only}} }}{{#if: {{{also|}}} | &nbsp;{{{{{also}}} also}} }}{{#if: {{{dx8|}}} | &nbsp;{{Dx8}} }}{{#if: {{{dx9|}}} | &nbsp;{{Dx9}} }} {{#if: {{{deprecated|}}} | &nbsp;{{obs}} }}
: {{#if: {{{deprecated|}}} | Deprecated.&nbsp; }} {{#if: {{{3|}}} | {{{3}}}}}

Revision as of 14:30, 3 March 2020

{{{1}}}
English (en)Deutsch (de)Esperanto (eo)Español (es)Français (fr)Suomi (fi)Hrvatski (hr)Magyar (hu)Italiano (it)日本語 (ja)한국어 (ko)Nederlands (nl)Polski (pl)Português (pt)Português do Brasil (pt-br)Русский (ru)Slovenčina (sk)Svenska (sv)Türkçe (tr)Українська (uk)Tiếng Việt (vi)中文 (zh)中文(臺灣) (zh-tw)
Curly brackets white.pngTemplate Documentation [view] [edit]
Icon-translate.png Available doc translations
View
Page history

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

Usage

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

Examples and Parameters

Warning.pngWarning:The code in the example will not work correctly due to the use of <kbd> in the template. Please refer to the $bumpmap page code to see the current code.
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.

If not specified, it is replaced with TODO.

{{MatParamDef
| $stupidequalsign | bool | text = Wow, I've been fixed! Look at this {{Emoji|point_right}} 2 + 2 = 5
}}
$stupidequalsign <boolean>
{{{described}}} Replaces the text with a link to the specified material parameter.
{{MatParamDef
| $describedcutie | texture | described = true
}}
$describedcutie <texture>
{{{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!
}}
I'm deprecated <boolean>  Obsolete
Deprecated.  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> {{Alien Swarm add}}
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> {{Alien Swarm add}} {{Garry's Mod also}}
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> {{Alien Swarm only}}
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>
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!
}}
$dx8parameter <boolean> (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...
}}
$basetexture1 to $basetexture4 <texture>
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.
}}
$bumpmap and $bumpmap2 <texture>
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!
}}
$shaderspecificparameter <float>
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? :(
}}
$defaultvalue <integer>
Why do I have such a small value? :(

See also