Posts Tagged ‘custom textures’

In this post I will teach you how to turn an image file such as (.jpg, .bmp, .png) into a texture which then can be used in CS:GOs Hammer Editor.

Hammer editor takes texture files as .vtf and .vmt.

VTF (Valve Texture Format) – Is the proprietary texture format used by the Source engine. VTF files are generally referenced in a Material instead of being accessed directly, which allows re-use in different ways.

VMT (Valve Material Type) – Is a text file that defines a two-dimensional surface. It contains all of the information needed for Source to simulate the surface visually, aurally, and physically.

So it works as VTF the texture and VMT is the information that hammer needs to use that texture.

So for the purpose of this post you will need two things;

1- Converter (VTFEditor)

This will use to convert image into .vmt and .vft files. The converter that you will be required to use can be found Here (vtfedit125-11 Archive Version). If link does not work then download it from here.

Open the zip file and extract the files within it. (I use WinRAR to open zip files, if you don’t have it download it here: WinRAR). There will be the files within vtfedit125-11;

vtfeditor

Double click the vtfedit application to open it and under optiosn tab make sure that ‘Auto Create VMT file’ is selected.

vtfeditor1

Now you have that done we move on to selecting image.

 

2- Image file (.jpg, .png ..etc)

Note: Source engine requires images dimensions to be of power of two (64×64, 128×128, 1024×1024, 128×512 256×1024 …etc).

I have created an image that is 128×128 (Right click the image and ‘Save image as..’ if you want it);

RedSteel

 

Converting Image File

Now that we have converter downloaded and have the image that we want to convert, we move on now to creating the vmt and vtf files.

Open up vtfeditor, under File tab select Import

import

A Dialog box will open, here you will search for the image file that you want to import in the software. When you find it double click it to select it. After selecting it another a ‘VTF Options’ window will show, leave everything and just press OK.

vtfoptions

Now you will reach to this stage

vtfeditorred

All is left to do is name and save it at the appropriate file location. Hit file table and click ‘Save’ or ‘Save As’. A dialog box will show, give the file a name and save it in the game materials folder. Here;

C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\materials

savesteel

All you need to do now is check if the information in the .vmt file is correct. Select and right click the file, and click on ‘Open With’. (If you don’t see ‘Open With’ then double click it and select option ‘Select a program from a list of installed programs. Select Notepad and deselect ‘Always use the selected program to open this kind of file’) This is how vmt file will show;

vmt

If you plan to save them in a custom sub folder, then make sure you add sub folders name before the texture in vmt file. Like so “$basetexture” “CustomTexture/RedSteel”. If not then leave it as it is.

Note: Make sure that they both in the materials folder.

 

Testing the Texture in Editor and in game

Now that you have the texture, launch CS:GO hammer editor. Select the browse button located on right side of the editor to open the ‘Textures’ window. Filter for name of the texture (mine is RedSteel)

ingame

Apply it on to an block and then Compile and Run the game to test it in-game.

2014-05-10_00001