Fr/VMT: Difference between revisions

From Valve Developer Community
< Fr
Jump to navigation Jump to search
No edit summary
No edit summary
Line 3: Line 3:
On peut diviser le .VMT en plusieurs catégories :
On peut diviser le .VMT en plusieurs catégories :


# [[Shader]] utiliser
# Non de la texture
# Non de la texture
# [[Material surface properties|Proprété physique du materiaux]]
# [[Material surface properties|Proprété physique du materiaux]]

Revision as of 04:42, 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. Shader utiliser
  2. Non de la texture
  3. Proprété physique du materiaux
  4. Paramètre specifique du Shader
  5. Fallbacks - Permet d'optimiser selon la version DX du PC
  6. 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