VMT: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (→‎External links: SDK nuts has closed)
(redone)
Line 1: Line 1:
A '''material''' is what the [[Source]] engine uses to define which [[texture]]s ([[VTF|.vtf]]) and [[shader]]s (function which defines how materials are rendered to the screen) are used on a surface ([[:Category:World Models|models]], [[Brush|world surfaces]], [[env_sprite|sprites]], etc). This information is stored in a [[VMT|Valve Material (.vmt)]] file.
A '''material''' is a <code>.VMT</code> text file in a mod's <code>materials/</code> folder that defines the appearance and behaviour of a surface. Its chief component is usually a texture, but it also includes information about how the surface reacts when walked on or shot, what [[shader]](s) will draw it, what type of reflections to use, and potentially many, many other properties.


For a quick overlook on the entire process of creating a material from scratch, see [[Material Creation]].
== A simple example ==


For a more lengthy tutorial on this process, see [[Creating a Material]].
LightmappedGeneric
{
$basetexture city44/derelict_floor_1a
$surfaceprop tile
}
 
This is an example of a material for use on [[brush]]es.
 
*It is drawn by the  <code>LightmappedGeneric</code> shader
*It displays <code>materials/city44/derelict_floor_1a.vtf</code>
*It has the physical and reactive properties of ceramic tile.
 
A material for use on [[model]]s would be identical except for the shader, which would be <code>VertexLitGeneric</code>. Valve's stock shaders generally support the same properties (commands starting with <code>$</code>), allowing you to easily switch between them.
 
See [[Shader Types and Parameters]] for a full list of Valve's shaders, or [[Shader Authoring]] if you are interested in creating your own.


== See also ==
== See also ==
* [[Shader Types and Parameters]]
* [[Half-Life 2 Shader Fallbacks]]
* [[Normal Maps]]
* [[Reflective Materials]]
* [[Parallax mapping]]
* [[:Category:Third Party Tools|Third Party Tools]]


<!-- SDK nuts has closed. When (and if) these tutorials are ported onto the VDC, please link to them instead!
*[[:Category:Material System]]
== External links ==
*[[Creating a Material]]
* [http://www.sdknuts.net/akg/tutorials/wisePSPtrans.asp Creating materials with transparency in Paint Shop Pro]
*[[Shader Types and Parameters]]
-->
 
[[Category:Material System]]
[[Category:Material System]]
[[Category:Glossary]]
[[Category:Glossary]]

Revision as of 05:15, 20 March 2008

A material is a .VMT text file in a mod's materials/ folder that defines the appearance and behaviour of a surface. Its chief component is usually a texture, but it also includes information about how the surface reacts when walked on or shot, what shader(s) will draw it, what type of reflections to use, and potentially many, many other properties.

A simple example

LightmappedGeneric
{
	$basetexture city44/derelict_floor_1a
	$surfaceprop tile
}

This is an example of a material for use on brushes.

  • It is drawn by the LightmappedGeneric shader
  • It displays materials/city44/derelict_floor_1a.vtf
  • It has the physical and reactive properties of ceramic tile.

A material for use on models would be identical except for the shader, which would be VertexLitGeneric. Valve's stock shaders generally support the same properties (commands starting with $), allowing you to easily switch between them.

See Shader Types and Parameters for a full list of Valve's shaders, or Shader Authoring if you are interested in creating your own.

See also