Material: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
m (Nesciuse moved page Material/en to Material without leaving a redirect: Move en subpage to basepage)
 
(11 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{langsp}}{{stub}}
{{LanguageBar}}
{{distinguish|Texture|desc1=the actual images being displayed}}
{{stub}}
==Overview==
A Material is the file that the engine uses to know what to display. A material contains information about what textures to draw, how to draw them, how to treat the textures being drawn, and how it should react. Materials are different from textures, which are the actual images that are being drawn.
 
Materials are the same concept in both Source and Source 2, however they are defined in different files:
* {{src|4}} materials are defined in [[VMT]] files.
* {{src|4}} materials are defined in [[VMT]] files.
* {{src2|4}} materials are defined in [[VMAT]] files.
* {{src2|4}} materials are defined in [[VMAT]] files.
{{goldsrc|4}} does not use materials; instead, textures are used directly, and flagged either via name in a [[WAD]] or by metadata in an [[MDL (GoldSrc)|MDL]] or [[SPR]].
{{gldsrc|4}} does ''not'' use materials; instead, textures are used directly, and flagged either via name in a [[WAD]] or by metadata in an [[MDL (GoldSrc)|MDL]] or [[SPR]]. Information about a texture's "material" is instead stored in {{mono|[[materials.txt]]}} and [[MAT file]]s.
 
{{modernConfusion|This page is for the concept of materials in general. More information about materials in specific engines can be found on the documentation about the specific engines' material format pages.}}
== Creating materials with XBLAH's Modding Tool ==
[[Category:Glossary]]
{{Xblahmt|4}} can be used to create some types of materials.
 
<br/><span style="color: #FFFFFF; font-weight: bold">Where to find it</span><br/>
This can be accessed within the tool through '''Materials > Material Editor'''.
 
<br/><span style="color: #FFFFFF; font-weight: bold">How to use it</span><br/>
When you are creating the material, the tool will create all the necessary files after the user selects the desired source images, either from a local bitmap resource or from a mounted vtf.
 
[[File:XBLAH's Modding Tool v1.18.1.1 - Material Editor.png|854px]]
 
==== Selecting the Shader ====
Currently, the following [[Shader|shaders]] are supported:
* [[UnlitGeneric]]
* [[LightmappedGeneric]]
* [[VertexLitGeneric]]
 
If the mod runs on Mapbase branch, when saving the material, it will automatically add sdk_ to the shader name.
 
==== Selecting textures ====
When creating a new material, you can use existing textures, or use directly image files, without any prior conversion. Once you save the material, the tool will automatically compile the materials to the required format.
To load a texture, right click the image preview of the desired texture, and click '''Open Texture''' to select an existing texture, or '''Import''' to load an image file. You can also export the current texture to an image format by right clicking the image preview, and clicking '''Export'''.
 
==== Generating Normal Maps ====
If the base texture has a bland color and dark and bright spots represent bevels, you can use the Generate Normal Map button to automatically create a normal map. This works for most cases.

Latest revision as of 08:19, 12 July 2024

English (en)Deutsch (de)Español (es)Français (fr)Hrvatski (hr)Português do Brasil (pt-br)Русский (ru)中文 (zh)Translate (Translate)
Not to be confused with Texture (the actual images being displayed).

Stub

This article or section is a stub. You can help by expanding it.

Overview

A Material is the file that the engine uses to know what to display. A material contains information about what textures to draw, how to draw them, how to treat the textures being drawn, and how it should react. Materials are different from textures, which are the actual images that are being drawn.

Materials are the same concept in both Source and Source 2, however they are defined in different files:

GoldSrc GoldSrc does not use materials; instead, textures are used directly, and flagged either via name in a WAD or by metadata in an MDL or SPR. Information about a texture's "material" is instead stored in materials.txt and MAT files.

Warning.pngRisk of Confusion:This page is for the concept of materials in general. More information about materials in specific engines can be found on the documentation about the specific engines' material format pages.