How to make usable images for hammer editor?

Maps, decals, textures, graphics, videos...
Post Reply
User avatar
FougereDeGuerre
Posts: 190
Joined: Fri Oct 06, 2006 7:40 pm
Location: Belgium, Rebecq

How to make usable images for hammer editor?

Post by FougereDeGuerre »

In order to do a usable picture for the Hammer editor, you should do at least 2 different files:

1) The VTF file
To be usable in hammer (the valve map and mods editor), either textures and decal should be saved in a vtf format, which is understandable by Hammer. Those files should be square images, with a lenght and a high which is a power of two (Mines usually are from a size of 512*512).
So just make your picture, with an alpha layer for the transparency (if you want some transparency, of course you want :wink: ), then convert it to a vtf.

2) The VMT file

What is this another file?
This vtf is an image file that can be understanded by hammer, but hammer don't use directly the vtf files, he needs some directive to know how to use this vtf file. So you also have to create a vmt file, who is a little text file describing the material type (either texture, decal, ...), the transparency (use the alpha channel to give transparency or not), the relative path of the vtf file concerned and, finally, the scale factor between the vmt and this particular vtf. There are also other parameters, but used mainly for texture and not for decals, like the kind of material to adapt the sounds when hitten and de reflexion following this particular material (metal, wood, granite, concrete, marble, ...).

While creating your map in hammer, when you browse the textures, you have a textures for each vmt file present in the textures and decals standard directories.

In other word, if you do one vmf of 512*512, which is already a big decal in hammer ( by example the big einstein on killbox1 or the e=mc2 grafiti on the wall in hangar) you can do smaller sized decalls just by adding a vmt with particular scale factor, and then in hammer you can choose the vmt you want to use.

Is this file difficult to understand and create?

In practice, don't worry about that vmt file, making the vmt files is very easy.

Here follow a vmt file for a decal (here for the picture style_512.vtf)
The path of this file (on my computer): D:\Games\Valve\Steam\SteamApps\fougeredeguerre\half-life 2 deathmatch\hl2mp\materials\decals\custom\Emc2\style_512.vmt

Code: Select all

"LightmappedGeneric"
{
    "$basetexture" "decals\custom\Emc2\style_512"
    "$decal" 1
    "$decalscale" 1
    "$translucent" 1
}
The first line, in fact, I don't know exactly why its stand for :oops: (certainly a subdivision in the directive file, and this is the subdivision for the texture and related directives), but this is the common first line for basical decal and textures vmt files.

The second line is teh relative path of the vtf used.

The third one is a flag to say if it is a decal or not.

The fourth give the scale factor between the vtf and the vmt.

The last one is a flag to say if the alpha layer shoud be used as the transparency filter.

Easy no?



How to convert a standard file to a vtf file?

If you use photoshop, here is a link to a plugin to add in photoshop so that you can directly save your work in a vtf (your photoshop vresion should at least be the 6.0). I usually choose the DXT5 compression format, which i think to be a slightly compressed one. A 512*512 picture with an aditionnal alpha layer is about 300 ko.

Well, if you don't use photoshop or you don't want to install this plugin, i know that some free TGA2vtf converter exists, but I don't know which nor or they exactly work.

Another solution: just send me a TGA file (standard format with an alpha layer) (or another format, I can convert it :wink: ) and I will send you back the converted one and the vmt in an archive, made with the relative path needed.


Now I think that you know a litle bit more about how to create personnal decals for mapping. I'm not a pro at all in this art, so google can certainly found more precise tutorial about those files format. But I think thats the essential, and this quite short introduction is sufficient to understand the role of eahc file. If you have any question, feel free to post those here, I will do my best to answer.
La misere des amis n'est pas plus amusante qu'un jardin dont la flore est mourante.
zoubab
Posts: 704
Joined: Sun Apr 15, 2007 6:24 pm
Location: France (26)

Post by zoubab »

:!: For those who don't have photoshop (like me),
and want free software, :twisted:

they can use Paint.NET with VTF-Plugin for Paint.NET to convert your pics in vtf,
and VTFEdit to create .vmt etc...
all is free and easy to use,
so now you have no excuses guys ! :wink: :lol:

VTFEdit : http://nemesis.thewavelength.net/index.php?c=178

Paint.NET : http://www.getpaint.net/

VTF-Plugin for Paint.NET : http://nemesis.thewavelength.net/index.php?p=50

ENJOY !

*Bump of the year ^^
OMGWTFBBQ
Post Reply