Fr/VMT: Difference between revisions

From Valve Developer Community
< Fr
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
A '''material''' is a <code>.vmt</code> text file that defines a two-dimensional surface. It contains all of the information needed for Source to simulate the surface visually, aurally, and physically. VMT stands for "Valve Material Type".
Sous Source, en général, un matériaux est une combinaison d'un .VMT, un fichier texte, avec une ou plusieurs textures (bumps, specual-mask,...). Des matériaux plus complexe comme l'eau utilise deux .VMT.


The contents of a material will fall into some or all of these categories:
On peut diviser le .VMT en plusieurs catégories :


# [[Texture]] names
# Non de la texture
# [[Material surface properties|Physical surface types]]
# [[Material surface properties|Proprété physique du materiaux]]
# [[Shader]]-specific parameters
# Paramètre specifique du shader
# [[Material optimization|Fallbacks]]
# Fallbacks - Permet d'optimiser selon la version DX du PC
# [[Material Proxy|Proxies]]
# Proxies - Permet de faire varier dans le temps certains parametre


== A simple example ==
== Exemple simple ==


  LightmappedGeneric
  LightmappedGeneric
Line 17: Line 17:
  }
  }


This is a very basic [[Wikipedia:Shingle beach|shingle beach]] material.
Voici un materiaux très basic.


#The <code>[[LightmappedGeneric]]</code> shader is used, which means that the material is for use on surfaces with [[lightmap]]s - i.e. [[brush]]es.
#Le <code>[[LightmappedGeneric]]</code> shader est utilise
#''The { character opens a set of parameters''
# Le { ouvre les parametre propre au shader
#The <code>[[$basetexture]]</code> parameter is given with <code>coast\shingle_01</code> (a texture). This is what will be drawn on the screen.
# Le parametre <code>[[$basetexture]]</code> donne le chemin de votre texture de base.
#<code>[[$surfaceprop]]</code> gives the material the physical properties of gravel.
#<code>[[$surfaceprop]]</code> indique a Source les propriete physique, quand par exemple vous tirez dessus ou quand vous marchez dessus.
#''The } character closes a set of parameters''


It's important to remember that this material can only be used on brushes. If it needed to be used on [[model]]s, for instance, another version would need to be created using the <code>[[VertexLitGeneric]]</code> shader.
It's important to remember that this material can only be used on brushes. If it needed to be used on [[model]]s, for instance, another version would need to be created using the <code>[[VertexLitGeneric]]</code> shader.

Revision as of 04:36, 1 November 2008

Sous Source, en général, un matériaux est une combinaison d'un .VMT, un fichier texte, avec une ou plusieurs textures (bumps, specual-mask,...). Des matériaux plus complexe comme l'eau utilise deux .VMT.

On peut diviser le .VMT en plusieurs catégories :

  1. Non de la texture
  2. Proprété physique du materiaux
  3. Paramètre specifique du shader
  4. Fallbacks - Permet d'optimiser selon la version DX du PC
  5. Proxies - Permet de faire varier dans le temps certains parametre

Exemple simple

LightmappedGeneric
{
	$basetexture coast\shingle_01
	$surfaceprop gravel
}

Voici un materiaux très basic.

  1. Le LightmappedGeneric shader est utilise
  2. Le { ouvre les parametre propre au shader
  3. Le parametre $basetexture donne le chemin de votre texture de base.
  4. $surfaceprop indique a Source les propriete physique, quand par exemple vous tirez dessus ou quand vous marchez dessus.

It's important to remember that this material can only be used on brushes. If it needed to be used on models, for instance, another version would need to be created using the VertexLitGeneric shader.

Most of the time switching materials from one shader to another is as simple as changing their first line, since a great number of parameters are shared between them. But some params only work with certain shaders - for instance, Phong effects are only available with VertexLitGeneric. The good news is that you won't encounter any critical errors if a param isn't understood by the shader.

Tip.pngAstuce:If you ever need to use a space or tab character in a parameter value, you must wrap the whole value with "quote marks". You'll often see absolutely everything wrapped like this - save yourself some typing, as that's unnecessary.

Finding materials

Materials are stored in the materials\ folder of your game or mod. The best way to browse them is from Hammer's texture selection screen.

If you want to edit or view the code of Valve's material files you will first need to extract them from their GCF package with GCFScape. They tend to be stored in GCFs with 'materials' in their name.

See also