Category:Material System: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(→‎Introduction: tried to make it a little clearer)
m (Nesciuse moved page Category:Material System/en to Category:Material System without leaving a redirect: Move en subpage to basepage)
 
(35 intermediate revisions by 17 users not shown)
Line 1: Line 1:
==Introduction==
{{LanguageBar}}
In Source, the '''Material System''' defines how the visible ''surfaces'' of an object are rendered on the Player's screen.
__NOTOC__


* 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.
{{category header|background-color=#E0E0E0|border-color=lightgray}}
** A [[VTF]] must be [[VTF#Utilities|decompiled]] before it can be edited with an [[image editor]].
{{category newcolumn|rowspan=6|width=50%|background-color=#F7F7F7|border-color=lightgray}}


* 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.
== Terms ==
** A [[VMT]] file is an uncompiled script that can be tweaked and edited with any [[text editor]].
* [[VMT|Valve Material Type]] (<code>.vmt</code>)
* [[Valve Texture Format]] (<code>.vtf</code>)
* [[Half-Life Wads]] (<code>.wad</code>)
* [[VMAT|Source 2 Vmats]] (<code>.vmat</code>)
* [[Texture]]
* [[Shader]]


* 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]]''.
== Basics ==
** 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.
*'''[[Creating a Material]]'''
** A UV map is part of an object's Geometry, see [[UV map]]ping for more info on editing UV maps.
* [[Material optimization]]
* [[Decals]]
* [[Skybox (2D)#Creating a 2D Skybox|Skybox (2D)]]
* [[VTFEdit]], [[VMT Editor]] and [[VTF Shell Extensions]]
* <code>[[Patch]]</code>


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.
== Shader Commands ==


{{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.}}
*[[:Category:Shaders|List of Shaders]]
*[[:Category:List of Shader Parameters|List of Shader Parameters]]


==Basics==
{{category newcolumn|rowspan=1|width=50%|background-color=#FBF7EA|border-color=#E4DCCD}}
* [[Material Creation|Creating a Texture using VTFEdit]] - The basics of VTF creation.
* [[Materials for models|Materials for Models]] - These are slightly different to Brush Materials.
* [[Materials for Brush Displacements]] - These are slightly different to ordinary Brush Materials.
* [[Materials for Sprites]] - Slightly different again. <!-- please link this to available info if you know where to find it! -->
* [[Decals]] - How to make decal and overlay materials.
* [[Skybox (2D)]] - How to use and make the cubic materials used for the sky.
* [[Animated Texture]]s. <!-- please link this to available info if you know where to find it! -->


==Advanced topics==
== Common Shader Effects ==
* [[Material Proxies]] - Advanced materials that can vary based on changing data.
* [[Water Shader]] - Description of the special water shader.
* [[Half-Life 2 Shader Fallbacks]] - Fallback settings of Half-Life 2 shaders on different platforms.
* [[DirectX Versions]] - How shaders are rendered on different versions of DirectX.


==Useful applications==
=== Lighting ===
* See [[:Category:Tools]] and [[:Category:Third Party Tools]]
*[[Bump map]]
*[[Parallax mapping]]
*[[Half Lambert]]


=== Reflection ===
*[[Phong]]
*[[Specular]]
*[[Water Shader|Water]] / [[Refract]]
=== Blending ===
* <code>[[WorldVertexTransition]]</code>
== Troubleshooting ==
* [[Fixing DXT Green Tint Compression]]
== Proxies ==
*[[Material Proxies]]
*[[List Of Material Proxies]]
*[[material_modify_control]]
*[[Procedural Materials]]
{{category end}}
[[Category:Modding]]
[[Category:Modding]]

Latest revision as of 15:43, 12 July 2024

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.