$basetexture: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
m (Used colorful game links. Added anchors for shader parameters so redirects can directly target the right spot of this page.)
Line 1: Line 1:
{{lang|$basetexture}}
{{lang|$basetexture}}
{{Shaderparam|<code>$basetexture</code>}} It defines an [[albedo]] texture. It is very rare for a [[material]] not to use this parameter and some [[shader|shaders]] will load a default [[texture]] if it stays undefined.
{{Shaderparam|<code>$basetexture</code>}} It defines an [[albedo]] texture. It is very rare for a [[material]] not to use this parameter and some [[shader]]s will load a default [[texture]] if it stays undefined.


==VMT syntax ==
== VMT syntax ==
  $basetexture <texture without extension, relative to <game>\materials\>
  $basetexture <texture without extension, relative to <game>\materials\>


Line 11: Line 11:


== Additional parameters ==
== Additional parameters ==
<span  id="$basetexturetransform"></span>
{{MatParam|$basetexturetransform|matrix|Transforms the texture before use in the material. This does not affect [[lightmaps]] on the surface.
{{MatParam|$basetexturetransform|matrix|Transforms the texture before use in the material. This does not affect [[lightmaps]] on the surface.
{{VMT UVtransform}}}}
{{VMT UVtransform}}}}
{{MatParam|$frame|int|The frame displayed for a multi-frame texture. This is normally set by the [[List_Of_Material_Proxies#Texture_manipulation|AnimatedTexture]] or [[List_Of_Material_Proxies#Entity_integration|TextureToggle]] proxies, but can be set manually. The value must be a valid index, or crashes might occur.}}
<span  id="$frame"></span>
{{MatParam|$frame|int|The frame displayed for a multi-frame texture. This is normally set by the [[List_Of_Material_Proxies#Texture_manipulation|AnimatedTexture]] or [[List_Of_Material_Proxies#Entity_integration|TextureToggle]] proxies, but can be set manually. {{warning|The value must be a valid index, or crashes might occur.}}}}


= <code>$basetexture2</code> =
= <code>$basetexture2</code> =
Some shaders (most notably [[WorldVertexTransition]]) allow the use of two albedos. The second texture is handled by a mirrored set of commands with '2' in their name:
Some shaders (most notably [[WorldVertexTransition]]) allow the use of two albedos. The second texture is handled by a mirrored set of commands with '2' in their name:
{{MatParam|$basetexture2|texture}}
{{MatParam|$basetexture2|texture}}
{{MatParam|$basetexturetransform2|matrix|{{bugfix|<code>$basetexturetransform2</code> doesn't exist in the DX9 version of WorldVertexTransition, only working with the DX8 shader. In DX9, <code>$basetexture2</code> will instead move with the original <code>$basetexturetransform</code> in sync with <code>$basetexture</code>. This is the case in {{Game link|Source 2007}}, {{Game link|Source 2013}}, and {{Game link|Alien Swarm}}. Other games have not been tested.|{{Game link|Mapbase}} adds support for <code>$basetexturetransform2</code> in Source 2013. The specific code can be found [https://github.com/mapbase-source/source-sdk-2013 on its repository] in the [[LightmappedGeneric]] shader files.|code}}}}
<span  id="$basetexturetransform2"></span>
{{MatParam|$basetexturetransform2|matrix|{{bugfix|<code>$basetexturetransform2</code> doesn't exist in the DX9 version of WorldVertexTransition, only working with the DX8 shader. In DX9, <code>$basetexture2</code> will instead move with the original <code>$basetexturetransform</code> in sync with <code>$basetexture</code>. This is the case in {{Game name|src07|name=Source 2007}}, {{Game name|src13|name=Source 2013}}, and {{Game name|as|name=Alien Swarm}}. Other games have not been tested.|{{Game name|mapbase|name=Mapbase}} adds support for <code>$basetexturetransform2</code> in Source 2013. The specific code can be found [https://github.com/mapbase-source/source-sdk-2013 on its repository] in the [[LightmappedGeneric]] shader files.|code}}}}
<span  id="$frame2"></span>
{{MatParam|$frame2|int}}
{{MatParam|$frame2|int}}



Revision as of 14:29, 6 February 2022

English (en)Español (es)Русский (ru)Translate (Translate)

Template:Shaderparam It defines an albedo texture. It is very rare for a material not to use this parameter and some shaders will load a default texture if it stays undefined.

VMT syntax

$basetexture	<texture without extension, relative to <game>\materials\>
LightmappedGeneric
{
	$basetexture	brick\brickwall031b
}

Additional parameters

$basetexturetransform $frame

$basetexture2

Some shaders (most notably WorldVertexTransition) allow the use of two albedos. The second texture is handled by a mirrored set of commands with '2' in their name: $basetexture2 $basetexturetransform2 $frame2

There are further '2' commands applying to various shader effects, which are each documented in their respective articles.

See Also