VMT: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(If think it was mistake. Undo revision 158242 by G.R.A.D.I. (talk))
Line 5: Line 5:
}}
}}


'''Материал''' представлен в игре в формате <code>.vmt</code> ("Valve Material Type"), текстовый файл, который определяет основные свойства поверхности. Он включает все необходимые данные для Source движка, чтобы правильно отображать поверхность, правильно "озвучивать", а так же, чтобы правильно работала физика.
A '''material''' is a <code>.vmt</code> ("Valve Material Type") 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.


Тип материала может совпасть с одной или всеми из следующих категорий:
The contents of a material will fall into some or all of these categories:


# Имя [http://developer.valvesoftware.com/wiki/Texture Тестуры]  
# [[Texture]] names
# [[$surfaceprop|Физические типы поверхности]](Прим. переводчика: я не уверен. На английском: Physical surface types)
# [[$surfaceprop|Physical surface types]]
# [[:Category:List of Shader Parameters|Параметры]] [http://developer.valvesoftware.com/wiki/Shader Шейдеров]
# [[Shader]] [[:Category:List of Shader Parameters|parameters]]
# [[Material optimization|Fallbacks]]
# [[Material optimization|Fallbacks]]
# [[Material Proxy|Прокси]]
# [[Material Proxy|Proxies]]


== Простой пример ==
== A simple example ==


  LightmappedGeneric
  LightmappedGeneric
Line 23: Line 23:
  }
  }


Это самый базовый [[Wikipedia:Shingle beach|shingle beach]] материал.
This is a very basic [[Wikipedia:Shingle beach|shingle beach]] material.


#The <code>[[LightmappedGeneric]]</code> shader использован, что означает, что данный материал используется на поверхностях с [[lightmap]]s (Например, [http://developer.valvesoftware.com/wiki/Brush Кисти]).
#The <code>[[LightmappedGeneric]]</code> shader is used, which means that the material is for use on surfaces with [[lightmap]]s (i.e. [[brush]]es).
#''Этот символ  '''{''' означает, что дальше идёт набор определённый параметров.''
#''The '''{''' character opens a set of parameters''
#<code>[[$basetexture]]</code> параметр со значением <code>coast\shingle_01</code>, означает расположение текстуры. Это то, что будет нарисовано на экране.
#The <code>[[$basetexture]]</code> parameter is given with <code>coast\shingle_01</code>, which is the location of a texture. This is what will be drawn on the screen.
#<code>[[$surfaceprop]]</code> этот параметр дает материалу физические свойства гравия.
#<code>[[$surfaceprop]]</code> gives the material the physical properties of gravel.
#''Этот символ '''}''' означает закрытие набора параметров''
#''The '''}''' character closes a set of parameters''


Важно помнить, что данный материал может быть использован только в брашах. если необходимо использовать на  [http://developer.valvesoftware.com/wiki/Model  моделях], например, другая версия материала должна быть создана с использованием  <code>[[VertexLitGeneric]]</code> шейдеров.
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.


Большая часть времени переключения материалов  с одного шейдера на другой Так же просто, как переключение их первых линий(Прим. переводчика: Я не уверен. На английском:"Most of the time switching materials from one shader to another is as simple as changing their first line" ), т.к. большая часть параметров являются общими для всех. Некоторые параметры работают только с  определенными шейдерами, как [[Phong]] эффекты, которые доступны только с  <code>VertexLitGeneric</code>, но к счастью у вас не будет никаких критических  ошибок, если шейдер не понял параметр. просто не будет ни какого эффекта.
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. Some params only work with certain shaders, like [[Phong]] effects, which are only available with <code>VertexLitGeneric</code>, but fortunately you won't encounter any critical errors if a param isn't understood by the shader. It just won't have any effect.


{{Tip|Если вам понадобится использовать пробел или символ табуляции в значении параметра, вы должны заключить все значение в "кавычки". Вы часто будете видеть абсолютно все в кавычках - это позволяет сохранить пару нажатий на клавиши}}
{{tip|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 ==


Материалы расположены в  <code>materials\</code> директрия вашей игры. Лучший способ просматривать их с использованием [[Hammer]]'s texture selection screen.
Materials are stored in the <code>materials\</code> folder of your game or mod. The best way to browse them is from [[Hammer]]'s texture selection screen.


Если вы хотите отредактировать или просмотреть код материалов Valve для начала вам нужно распаковать их из [[GCF]]архива с использованием [[GCFScape]]. Они, как правило, располагаются в  GCFs с припиской 'materials' в конце их имени.
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 ==


* [http://developer.valvesoftware.com/wiki/Creating_a_Material Создание материала]
* [[Creating a Material]]
* [[Notepad++ VDF languages|Notepad++ syntax highlighting for materials]]
* [[Notepad++ VDF languages|Notepad++ syntax highlighting for materials]]
* [[Valve Texture Format]]
* [[Valve Texture Format]]
* [http://developer.valvesoftware.com/wiki/Category:List_of_Shaders Список Шейдеров]
* [[:Category:List of Shaders|List of Shaders]]
* [http://developer.valvesoftware.com/wiki/Category:List_of_Shader_Parameters Список параметров шейдеров]
* [[:Category:List of Shader Parameters|List of Shader Parameters]]


[[Category:Material System]]
[[Category:Material System]]
[[Category:Glossary]]
[[Category:Glossary]]

Revision as of 04:56, 25 August 2011

Template:Otherlang2

A material is a .vmt ("Valve Material Type") 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.

The contents of a material will fall into some or all of these categories:

  1. Texture names
  2. Physical surface types
  3. Shader parameters
  4. Fallbacks
  5. Proxies

A simple example

LightmappedGeneric
{
	$basetexture coast\shingle_01
	$surfaceprop gravel
}

This is a very basic shingle beach material.

  1. The LightmappedGeneric shader is used, which means that the material is for use on surfaces with lightmaps (i.e. brushes).
  2. The { character opens a set of parameters
  3. The $basetexture parameter is given with coast\shingle_01, which is the location of a texture. This is what will be drawn on the screen.
  4. $surfaceprop gives the material the physical properties of gravel.
  5. 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 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. Some params only work with certain shaders, like Phong effects, which are only available with VertexLitGeneric, but fortunately you won't encounter any critical errors if a param isn't understood by the shader. It just won't have any effect.

Tip.pngTip: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