Template:Shader/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Updated due to the expansion of functionality)
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 11: Line 11:
| align=center | {{Param}}
| align=center | {{Param}}
| Shader / parameter name
| Shader / parameter name
| {{CodeBlock|margin=5px| <nowiki>{{Shader_Name|UnlitGeneric}}</nowiki> }}
| {{CodeBlock|margin=5px| <nowiki>{{shader|UnlitGeneric}}</nowiki> }}
| {{Capsule|margin=5px| {{Shader_Name|UnlitGeneric}} }}
| {{Capsule|margin=5px| {{shader|UnlitGeneric}} }}
|-
|-
| align=center | {{Param|2}}
| align=center | {{Param|2}}
| Value.<br>Works only if {{code|preset=1|type}} is {{code|preset=1|param}}
| Value.<br>Works only if {{code|preset=1|type}} is {{code|preset=1|param}}
| {{CodeBlock|margin=5px| <nowiki>{{Shader_Name|type=param|$detail|texture}}</nowiki> }} {{CodeBlock|margin=5px| <nowiki>{{Shader_Name|type=param|$detail|notexisting}}</nowiki> }}
| {{CodeBlock|margin=5px| <nowiki>{{shader|type=param|$detail|texture}}</nowiki> }} {{CodeBlock|margin=5px| <nowiki>{{shader|type=param|$detail|notexisting}}</nowiki> }}
| {{Capsule|margin=5px| {{Shader_Name|type=param|$detail|texture}} }} {{Capsule|margin=5px| {{Shader_Name|type=param|$detail|notexisting}} }}
| {{Capsule|margin=5px| {{shader|type=param|$detail|texture}} }} {{Capsule|margin=5px| {{shader|type=param|$detail|notexisting}} }}
|-
|-
| align=center | {{Param|type}}
| align=center | {{Param|type}}
| At the moment it has one value - {{code|preset=1|param}}. {{code|preset=1|Param}} sets shader parameter icon and unlock 3rd field.
| At the moment it has one value - {{code|preset=1|param}}. {{code|preset=1|Param}} sets shader parameter icon and unlock 3rd field.
| {{CodeBlock|margin=5px| <nowiki>{{Shader_Name|key|value}}</nowiki>}} {{CodeBlock|margin=5px| <nowiki>{{Shader_Name|type=param|key|value}}</nowiki>}}
| {{CodeBlock|margin=5px| <nowiki>{{shader|key|value}}</nowiki>}} {{CodeBlock|margin=5px| <nowiki>{{shader|type=param|key|value}}</nowiki>}}
| {{Capsule|margin=5px| {{Shader_Name|key|value}} }} {{Capsule|margin=5px| {{Shader_Name|type=param|key|value}} }}
| {{Capsule|margin=5px| {{shader|key|value}} }} {{Capsule|margin=5px| {{shader|type=param|key|value}} }}
|-
|-
| align=center | {{Param|alt}}
| This displays alternate text for the {{param|1}} parameter. Useful when wanting to make the link to the, for example, [[Water (shader)]] shader look more formal.
| {{CodeBlock|margin=5px| <nowiki>{{shader|Water (shader)|alt=Water}}</nowiki>}}
| {{Capsule|margin=5px| {{shader|Water (shader)|alt=Water}} }}
|}
|}

Latest revision as of 22:46, 14 September 2025

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

Shader name/param

Parameters and Examples

Parameter Description Examples Preview
{{{1}}} Shader / parameter name
{{shader|UnlitGeneric}}
{{{2}}} Value.
Works only if type is param
{{shader|type=param|$detail|texture}}
{{shader|type=param|$detail|notexisting}}
Shader-ball-settings.png $detailnotexisting
{{{type}}} At the moment it has one value - param. Param sets shader parameter icon and unlock 3rd field.
{{shader|key|value}}
{{shader|type=param|key|value}}
Shader-ball.png key
Shader-ball-settings.png keyvalue
{{{alt}}} This displays alternate text for the {{{1}}} parameter. Useful when wanting to make the link to the, for example, Water (shader) shader look more formal.
{{shader|Water (shader)|alt=Water}}