$basetexture: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
{{lang|$basetexture}}__NOTOC__
{{Lang}}__NOTOC__
 
{{Shaderparam|$basetexture}} 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.
{{Shaderparam|$basetexture}} 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 10: Line 12:


== Additional Parameters ==
== Additional Parameters ==
<span  id="$basetexturetransform"></span>
{{MatParam|$basetexturetransform|matrix| Transforms the texture before use in the material. This does not affect [[lightmap]]s on the surface. {{VMT UVtransform}} }}
{{MatParam|$basetexturetransform|matrix|Transforms the texture before use in the material. This does not affect [[lightmap]]s on the surface.
 
{{VMT UVtransform}}}}
{{MatParam|$frame|int| The frame displayed for a multi-frame texture. This is normally set by the {{Code|[[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.}} }}
<span  id="$frame"></span>
{{MatParam|$frame|int|The frame displayed for a multi-frame texture. This is normally set by the <code>[[List_Of_Material_Proxies#Texture_manipulation|AnimatedTexture]]</code> or <code>[[List_Of_Material_Proxies#Entity_integration|TextureToggle]]</code> 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 {{ent|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 {{Code|[[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}}
<span  id="$basetexturetransform2"></span>
 
{{MatParam|$basetexturetransform2|matrix|{{bugfix|<code>$basetexturetransform2</code> doesn't exist in the DX9 version of <code>WorldVertexTransition</code>, 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 {{src07|4}}, {{src13|4}}, and {{as|4}}. Other games have not been tested.|{{mapbase|4}} 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 {{ent|LightmappedGeneric}} shader files.|code}}}}
{{MatParam|$basetexturetransform2|matrix|
<span  id="$frame2"></span>
 
{{Bugfix
| {{Code|$basetexturetransform2}} doesn't exist in the DirectX 9 version of {{Code|[[WorldVertexTransition]]}}, only working with the DX8 shader. In DX9, {{Code|$basetexture2}} will instead move with the original {{Code|$basetexturetransform}} in sync with {{Code|$basetexture}}. This is the case in {{src07|4}}, {{src13|4}}, and {{as|4}}. Other games have not been tested.
| {{Mapbase|4}} adds support for {{Code|$basetexturetransform2}} in Source 2013. The specific code can be found [https://github.com/mapbase-source/source-sdk-2013 on its repository] in the {{Ent|LightmappedGeneric}} shader files.
| code
}}
 
}}
 
{{MatParam|$frame2|int}}
{{MatParam|$frame2|int}}


There are further '2' commands applying to various shader effects, which are each documented in their respective articles.
There are further '2' commands applying to various shader effects, which are each documented in their respective articles.
==See Also==
 
* {{ent|$envmapmask}} (specular mask)
== See Also ==
* {{ent|$envmap}} (environment map)
* {{Ent|$envmapmask}} (specular mask)
* {{ent|$phong}} (diffuse reflection)
* {{Ent|$envmap}} (environment map)
* {{ent|$selfillum}}
* {{Ent|$phong}} (diffuse reflection)
* {{Ent|$selfillum}}


[[Category:List of Shader Parameters|B]]
[[Category:List of Shader Parameters|B]]

Revision as of 06:54, 2 May 2023

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