Category:Material System: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(→‎Introduction: tried to make it a little clearer)
Line 1: Line 1:
==Introduction==
==Introduction==
In the Source Material System, the visible ''Surface'' of a Brush, Model, Sprite, etc. is defined by it's '''Valve ''Material'' Type''' ([[VMT]]) file. The Material is [[UV map|UV mapped]] onto the object's ''Geometry'' to specify the appearance of its Polygonal Surfaces. Other Physical Properties (which are not limited to the object's ''Surface'') are handled by the [[Vphysics & Qphysics|Physics System(s)]]. For example: Breakable objects derive some additional "material" properties from their [[propdata]] configuration.
In Source, the '''Material System''' defines how the visible ''surfaces'' of an object are rendered on the Player's screen.


* Each [[VMT]] or '''Valve ''Material'' Type''' file defines which [[Shader]] and [[Shader Parameters]] to use to render the textures, which [[VTF]] textures to use to 'paint the polygons', and a number of [[$surfaceprop|surface collision effects]] such as the sounds and decals to use when bullet hits the surface. [[VMT]] files are uncompiled scripts that can be tweaked and edited with any [[text editor]].
* Each [[VTF]] or '''Valve ''Texture'' Format''' file, is basically a rasta image file or pixel-map. Most material surfaces will layer several [[VTF]]s  together, each containing a different type of surface information; for example, in addition to the [[$basetexture|colormap]], a material may also use a [[$bumpmap|normalmap]], [[$envmapmask|specularmap]], [[$translucent|opacitymap]], [[$selfillum|luminositymap]], [[:Category:VMT Texture Reference|etc]]. All the separate frames of an [[Animated Texture]] can be stored in single VTF file.  
** A [[VTF]] must be [[VTF#Utilities|decompiled]] before it can be edited with an [[image editor]].


* Each [[VTF]] or '''Valve ''Texture'' Format''' file, is basically a rasta image file or pixel-map. Most material surfaces will use more than one [[VTF]]; eg in addition to the ([[$basetexture]]) colormap or diffusemap , a normalmap, specularmap, [[:Category:VMT Texture Reference|etc]]. Specialist types of VTF include [[Animated Texture]]s, [[Normalmap]]s, [[Heightmap]]s etc. [[VTF]]s must be [[VTF#Utilities|decompiled]] before they can be edited with an [[image editor]].
* Each [[VMT]] or '''Valve ''Material'' Type''' file specifies which [[VTF]] Textures to use to 'paint the polygons', which [[Shader]] (and [[Shader Parameters]]) to use for rendering those Textures, and a few [[$surfaceprop|surface collision effects]] such as the sounds and decals to use when bullet hits the surface. A Material file needs to specify at least two things: a Texture and a Shader.
** A [[VMT]] file is an uncompiled script that can be tweaked and edited with any [[text editor]].


Generally a '''Brush Material''' refers to a '''[[VMT]]''' designed for use with World [[Brushes]] (stored in <code>game_dir/materials/</code>), and a '''Skin''' is a '''[[VMT]]''' designed to be mapped onto a particular [[Model]] (stored in <code>game_dir/materials/models</code>). A '''Texture''' is a '''[[VTF]]''' file, used by either a ''Brush Material'' or a ''Skin'' - but rarely both. Usually VTFs are stored in the same folder as the VMTs that use them.
* Each '''Shader''' is a specific routine in the the Rendering Engine used to translate all the texture and lighting (etc) information into screen pixels. In Source, '''Per-Object Shaders''' are applied to Material Surfaces (eg Lightmappedgeneric, Vertexlitgeneric, Water) and '''Post Process Shaders''' are applied to the Player's Viewport (eg Bloom, Sepia, Fog). The Material System is only concerned with ''[[:Category:List of Shaders|Per-Object Shaders]]''.
** Editing Shaders is a bit of a [[Shaders|dark art]].
 
* Each object's '''[[UV map]]''' takes the name of one or more VMT files, and maps pixels from all the Texture layers specified for that Material to the appropriate polygons.
** A UV map is part of an object's Geometry, see [[UV map]]ping for more info on editing UV maps.
 
Generally a '''Brush Material''' refers to a '''[[VMT]]''' designed for use with World [[Brushes]] (stored in <code>game_dir/materials/</code>), and a '''Skin''' is a '''[[VMT]]''' designed to be mapped onto a particular [[Model]] (stored in <code>game_dir/materials/models</code>). A '''Texture''' is a '''[[VTF]]''' file, used by either a ''Brush Material'' or a ''Skin'' - but rarely both. VTFs are usually stored in the same folder as the VMTs that use them.
 
{{note|Non-Surface Material Properties are handled by the [[Vphysics & Qphysics|Physics System(s)]], not the Material System; for example: Breakable objects derive some additional "material" properties from their [[propdata]] configuration.}}


==Basics==
==Basics==

Revision as of 17:49, 27 April 2008

Introduction

In Source, the Material System defines how the visible surfaces of an object are rendered on the Player's screen.

  • Each VMT or Valve Material Type file specifies which VTF Textures to use to 'paint the polygons', which Shader (and Shader Parameters) to use for rendering those Textures, and a few surface collision effects such as the sounds and decals to use when bullet hits the surface. A Material file needs to specify at least two things: a Texture and a Shader.
    • A VMT file is an uncompiled script that can be tweaked and edited with any text editor.
  • Each Shader is a specific routine in the the Rendering Engine used to translate all the texture and lighting (etc) information into screen pixels. In Source, Per-Object Shaders are applied to Material Surfaces (eg Lightmappedgeneric, Vertexlitgeneric, Water) and Post Process Shaders are applied to the Player's Viewport (eg Bloom, Sepia, Fog). The Material System is only concerned with Per-Object Shaders.
  • Each object's UV map takes the name of one or more VMT files, and maps pixels from all the Texture layers specified for that Material to the appropriate polygons.
    • A UV map is part of an object's Geometry, see UV mapping for more info on editing UV maps.

Generally a Brush Material refers to a VMT designed for use with World Brushes (stored in game_dir/materials/), and a Skin is a VMT designed to be mapped onto a particular Model (stored in game_dir/materials/models). A Texture is a VTF file, used by either a Brush Material or a Skin - but rarely both. VTFs are usually stored in the same folder as the VMTs that use them.

Note.pngNote:Non-Surface Material Properties are handled by the Physics System(s), not the Material System; for example: Breakable objects derive some additional "material" properties from their propdata configuration.

Basics

Advanced topics

Useful applications

Subcategories

This category has the following 5 subcategories, out of 5 total.

G

R

S

Pages in category "Material System"

The following 133 pages are in this category, out of 133 total.