- Feb 25, 2019
- 359
- 287
This is a super short guide about materials I made for myself and I felt like sharing it here. Most of this has been taken from VDC, so go there for more information. Keep in mind this is super short, so I won’t go in detail about the stuff I mention.
Also in this guide I will not teach you how to create cool textures images, that’s something you have to do yourself (sorry).
To create a material we need a little software called VTFEdit, which allows us to create textures (vtf) and materials (vmt).
If what you are trying to do is an edit of an official texture, you probably should use VTFEdit Reloaded, which exports textures correctly, but for some reason it doesn't import textures properly (at least to me), so in a nutshell:
VTFEdit Reloaded -> Extract textures
VTFEdit -> Import textures
First we have to create our texture, so we open VTFEdit, and we Import the image we want to use, this will open a box with some options. The most important thing here is the General options, we have to select different formats depending of what we want, here are the most useful ones:
Now we have our texture done, but we can still change a few things using the flags (down left corner). Since there is a lot of them I’ll just list the most useful ones:
Once we have set everything as we want, we can save the file and place it in the right direction:
tf/custom/”Any name you want”/materials/ ”Any name you want”
This is very important because later in the vmt we have to specify the exact location of the vtf.
Now we have to create the material. so in VTFEdit we go to File > New, and that creates us a text file.
A vmt file is made of 2 parts; the header and the body (using html slang).
The header sets what type of material you are creating. These are the most used ones:
The body contains the parameters of the material. Since there is a lot (and is not easy to understand) I’ll simplify the most useful ones:
Keep in mind that many of these parameters require more parameters, this is just a small introduction after all.
I hope this super quick guide was helpful. I’ll also leave a text file attached with the default parameters you need for any type of texture you wanna do.
Also if you have any suggestions on how to improve this guide, please let me know!
Also in this guide I will not teach you how to create cool textures images, that’s something you have to do yourself (sorry).
Getting started
To create a material we need a little software called VTFEdit, which allows us to create textures (vtf) and materials (vmt).If what you are trying to do is an edit of an official texture, you probably should use VTFEdit Reloaded, which exports textures correctly, but for some reason it doesn't import textures properly (at least to me), so in a nutshell:
VTFEdit Reloaded -> Extract textures
VTFEdit -> Import textures
Creating a Texture (VTF)
First we have to create our texture, so we open VTFEdit, and we Import the image we want to use, this will open a box with some options. The most important thing here is the General options, we have to select different formats depending of what we want, here are the most useful ones:Type | Use | Notes |
---|---|---|
DXT1 | Most Textures | Compressed, no alpha |
DXT5 | Overlays | Compressed, with alpha |
BGR888 | Skyboxes | Uncompressed, no alpha |
ABGR8888 | High Quality Overlays(?) | Uncompressed, with alpha |
Now we have our texture done, but we can still change a few things using the flags (down left corner). Since there is a lot of them I’ll just list the most useful ones:
Type | Notes |
---|---|
Clamp S | Prevents horizontal texture wrapping |
Clamp T | Prevents vertical texture wrapping |
SRGB | Uses sRGB color space |
No Mipmap | Load largest mipmap only |
No Level Of Detail | Not affected by texture resolution settings |
Eight Bit Alpha | Uses alpha (this checks automatically when we choose a format with alpha) |
Once we have set everything as we want, we can save the file and place it in the right direction:
tf/custom/”Any name you want”/materials/ ”Any name you want”
This is very important because later in the vmt we have to specify the exact location of the vtf.
Creating a Material (VMT)
Now we have to create the material. so in VTFEdit we go to File > New, and that creates us a text file.A vmt file is made of 2 parts; the header and the body (using html slang).
The header sets what type of material you are creating. These are the most used ones:
Type | Use |
---|---|
LightmappedGeneric | Brushes |
WorldVertexTransition | Blend Brushes |
VertexLitGeneric | Models |
Sky | Skyboxes |
UnlitGeneric | UI |
The body contains the parameters of the material. Since there is a lot (and is not easy to understand) I’ll simplify the most useful ones:
Type | |
---|---|
$basetexture | Shows the texture (basically the most important one) |
$surfaceprop | It sets what kind of surface is (wood, metal, ...) |
$bumpmap | It provides lighting information to the material (basically a normal map) |
$phong | It basically provides reflections |
$rimlight | It adds a constant rim light (only works for models) |
$translucent | It specifies that the material should be partially see-through (mostly used for stuff like windows) |
$decal | Prevents decal texture clipping |
$vertexcolor $vertexalpha | Basically used for transparent overlays |
$nocull | It disables backface culling, meaning you can see the material from both sides (mostly used for stuff like pennants) |
$ignorez | It shows things in front of everything else (basically for UI) |
%keywords | It filters materials in the browser, making easier to find them |
%tooltexture | Sets a custom icon for the material in the browser (basically for blend materials) |
%notooltexture | Hides the material in the browser (basically for skybox materials) |
Keep in mind that many of these parameters require more parameters, this is just a small introduction after all.
Conclusion
I hope this super quick guide was helpful. I’ll also leave a text file attached with the default parameters you need for any type of texture you wanna do.Also if you have any suggestions on how to improve this guide, please let me know!