{{htmlmetatags>metatag-keywords=(pac3,wiki,gmod,mdl,tutorial,guide,help,vmt,vtf,material,texture,convert)
metatag-description=(A relatively simple tutorial on converting textures to .VMT materials.)
metatag-og:title=(Simple .MDL: Basic Materials)
metatag-og:description=(A relatively simple tutorial on converting textures to .VMT materials.)
}}
{{tag>tutorial model obj mdl zip vmt vtf material}}
====== Basic Materials ======
This is a part of the [[:tutorial:simple_mdl]] tutorial and is meant for people who want to convert their textures into .MDL compatible materials. Keep in mind that this is completely optional and you can add materials in PAC, however this method should be easier than going through all the settings in PAC materials. To keep things simple this will only cover diffuse (color) textures.
===== Requirements - VTFEdit =====
This part of the tutorial requires one more tool. Download {{ :tutorial:simple_mdl:materials:vtfedit133.zip|VTFEdit}}, open the archive and extract the **x64** folder. ((It might not work on some systems, in that case use **x86**.))
===== Creating materials =====
This is a continuation of the previous tutorial, at this point you should be in the folder with all the compiled files.((Click Goto in **Crowbar** to find them.))
- Create and open a new folder called materials
==== Converting images to .VTFs ====
- Open **VTFEdit.exe**((It is in the **x64** folder that you extracted earlier.)) and go to File -> Import
- Select the image file that you want to use and click Open
- A new window called VTF Options will pop up, simply click OK((Default settings will do fine in most cases.))
- Go to File -> Save As.. and save the file in the materials folder
==== Creating material files (.VMTs) ====
- Download {{ :tutorial:simple_mdl:materials:material.vmt }} and put it in the materials folder
- In **Blender** go to the **Materials** panel
- Rename the material.vmt file and give it the same name as in **Blender**\\ {{:tutorial:simple_mdl:materials:blender-material-to-vmt.jpg}}
- Open the **.VMT** file with any text editor
- Change texture in the $basetexture "texture" line to your texture name and save it\\ {{:tutorial:simple_mdl:materials:vmt-basetexture.png}}
----
That's it, if your model has multiple materials repeat these steps for each of them.
<- Go back to [[:tutorial:simple_mdl#creating a zip archive]]
===== Additional Information =====
If your model uses a normal map texture (usually a purple image) you can add it as well, just convert it and replace dev/bump_normal with %%%%
If your model has many textures you can convert all of them at once by using the File -> Convert Folder option in **VTFEdit**. Just make sure that Create VMT files is NOT checked.
For the curious -> [[https://developer.valvesoftware.com/wiki/Category:List_of_Shader_Parameters|List of .VMT shader parameters]]
Ask for help -> {{icon>fa fab fa-discord?color=#7289da&fw&lg}} [[https://discordapp.com/invite/utpR3gJ|Official PAC Discord]]