VMT: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(mention VTF)
(→‎A simple example: an example that everyone can implement would be nice...)
Line 5: Line 5:
  LightmappedGeneric
  LightmappedGeneric
  {
  {
  $basetexture city44/derelict_floor_1a
  $basetexture coast/shingle_01
  $surfaceprop tile
  $surfaceprop gravel
  }
  }


This is an example of a material for use on [[brush]]es.
This is an example of a material for use on [[brush]]es.


*It is drawn by the <code>LightmappedGeneric</code> shader
*It is drawn by the <code>LightmappedGeneric</code> shader
*It displays <code>materials/city44/derelict_floor_1a.vtf</code>
*It displays <code>materials/coast/shingle_01.vtf</code>
*It has the physical and reactive properties of ceramic tile.
*It has the physical and reactive properties of gravel


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.
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.

Revision as of 05:28, 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 Valve Texture Format image file, but it also includes information about how the surface reacts when walked on, shot, or applied to a physical object, what shader(s) will draw it, what type of reflections to use, and potentially many, many other properties.

A simple example

LightmappedGeneric
{
	$basetexture coast/shingle_01
	$surfaceprop gravel
}

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

  • It is drawn by the LightmappedGeneric shader
  • It displays materials/coast/shingle_01.vtf
  • It has the physical and reactive properties of gravel

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