About VTFLib - NemPosted: Apr 18th, 2005 - 10:27:01 pm

VTFLib is a LGPL open source programming library, written by Neil Jedrzejewski and I. VTFLib provides a C and C++ API that, with a few simple functions, can open and save .vtf and .vmt files, providing access to all known features. The library functions independent of Steam, allowing third party applications to use the library without Steam present or runningi on the target system.

VTFLib includes two GPL example applications, VTFCmd and VTFEdit. VTFCmd is a C command line frontend for VTFLib that can create .vtf and .vmt files from various source formats. It is similar in functionality to Valve's vtex Source SDK utility, but offers a lot more control. VTFEdit is a C++ .NET graphical frontend for VTFLib with viewing and creation capabilities. Both VTFCmd and VTFEdit support several source image formats, including, but not limited to .bmp, .dds, .gif, .jpg, .png and .tga.


VTFEdit .vtf frame/face/mipmap viewing. VTFEdit .vtf information viewing.

VTFEdit file system browsing. VTFEdit .vmt viewing.

VTFEdit import options. VTFEdit batch conversion options.

VTFEdit .wad conversion options. VTFEdit .vmt creation wizard.

VTFEdit .vmt creation wizard. VTFCmd command line options.

Documentation: Features:
  • Convert .bmp, .dds, .gif, .jpg, .png and .tga files to .vtf and .vmt files with easy access to all .vtf options.
  • Convert .vtf files to .bmp, .jpg, .png and .tga files.
  • Convert entire folders to and from .vtf and .vmt files.
  • Convert .wad files to .vtf and .vmt files.
  • Explore .bsp, .gcf, .pak, .wad and .xzp packages.
  • Preview .vtf files.
  • Recent file menu.
  • 100% Free.
Download: Third Party Downloads:
Modified: Sep 14th, 2007 - 3:28:10 am[ 596332 Views ]

[ 1 2 3 4 5 6 7 8 9 ]

76. [ TSF ] LORD DAVROSModified: Nov 29th, 2008 - 5:41:03 pm
ok thanks again for the reply
here is a pic with mip maps

and here is a pic with out mip maps

alternativly you can see my post on this with the pics and description of my problem here on my clansweb site.


77. NemPosted: Nov 29th, 2008 - 8:08:13 pm
That definitely looks like bilinear texture filtering to me. Perhaps you have your video card driver set to override the quality settings of other applications and optimize them for speed? You'll want to use trilinear texture filtering at the very least.

78. [ TSF ] LORD DAVROSModified: Nov 30th, 2008 - 3:45:20 am
OK I rhink you might have hit the nail on the head as all my settings were on let the aplication decide but they are all using trilinear, But I have just found that if I up my setting for this to 16x it seems to be much better.in hammer and in the game.
I am not the only one to see this problem as now that I have pointed it out to him, SADIST (another well known mapper for Hl2 Death-Match ) can also see this problem.

I will see if I van get sadist to try this out tonight as well .

Ps my wifes pc has the same game on it and her setting is only at trilinear but looks great on the screen but she is using an old ati 1950 pro GPU and i know that there are quite allot of differences between ATI and Nvidia.

EDIT..... Just spent a bit of time testing this and yes you are definatly right it is the Anisotropic filtering but it only fixes it if i change the gpu setting for this to 16x...

Many thanks for your time on this for me .....

79. NemPosted: Nov 30th, 2008 - 11:26:39 am
I'm not sure if Hammer will use anisotropic texture filtering on it's own (it's a pretty old application - older than the filtering technique). Source engine games should choose the best filter depending on your video card.

Most recent mid-range video cards should be able to handle 16x anisotropic texture filtering with virtually no performance loss, so I do recommend forcing it on if you have a decent card.

80. [ TSF ] LORD DAVROSPosted: Nov 30th, 2008 - 11:38:06 am
well the Nvidia 280 I am using is one of the most powerfull cards out at the mo ...

And putting the gpu on 16 times also fixes the image in hammer as well as in the game.My friend sadist has an old AGP slot card and he also notices no drop in fps when he turned on 16x as well so I think the problem is solved.

Thanks for your help on this nem... much apreciated...

81. asclanModified: Dec 1st, 2008 - 2:54:19 pm
I have ran into a strange problem with VTFCmd....in valves hammer editor I can see the texture perfectly fine in the "browse" list. But as soon as I apply the texture in hammer, in the 3D View it shows nothing but pink and black squares...

I cannot for the life of me figure out what is wrong...If I go into photoshop and resave the vtf using the photoshop vtf plugin, all is well so it has to be something I am not doing with your tool...I really would like to use the VTFCmd tool for batch operations.

For the below I just simply dragged and dropped a file brick004b.PNG onto the VTFCmd.exe file:

Just for the the technical info, here is my materials path


Contents of the pack1 folder:

Here is the contents of my brick004b.vmt file:

"$basetexture" "asclan/pack1/brick004b"

As you can see from the above, everything is correct, but here is what I see when using my texture:


What would be the CORRECT command line syntax for VTFCmd to do:
1. Texture (VTF)
2. Normal Texture (Bumpmap VTF)

Please Help!! :)

82. JackBALLPosted: Dec 29th, 2008 - 7:43:13 am
Hey Nem, how hard would it be to allow mass modification .VMT files?

I need to add the same attributes to 800+ material files. lazy

83. NemPosted: Dec 31st, 2008 - 4:57:35 pm
VTFLib can parse .vmt files. If you know C++ you could use VTFLib to write a program that can do this for you. Depending on what the modification you need is, this might not be too difficult.

84. gtamike_TSGKModified: Jan 4th, 2009 - 3:01:30 pm
Really good work with VTF Edit I use it alot, not sure what I would do with out it. free
Keep up the good work nemesis. skate

85. BlubPosted: Jan 12th, 2009 - 8:34:20 am
If you would add a thumbnail browser (for vtf and tga files) + syntax highlighting and line numbering for the vmt editor it would be perfect!

86. VarsityPosted: Jan 15th, 2009 - 8:00:42 am
It would be great if files could be imported by dragging them onto the app window.

87. hogscraperModified: Mar 4th, 2009 - 10:16:27 pm
I cooked up a method to create recursive vmt files customized to whatever you want. You can use batch file commands to parse for the text you want and replace it but its been a decade since I used this kind of technique and can't remember how.

To create new vmt files you must first delete the old ones if there are any. Then in in your base materials directory create these two files master.bat and function.bat.

Open master.bat and insert this code

for /r %%f in (*.vtf) do call function.bat %%~nf

then inside function.bat insert this code

@echo off&setlocal enableextensions

for %%* in (.) do set MyDir=%%~n*

if not defined MyDir set MyDir=%CD:\=%

echo "LightmappedGeneric" >> %1
echo { >> %1

echo "$basetexture" "%MYDIR%\%1" >> %1
echo } >> %1
ren *. *.vmt

the bits of code that start echo and end >> %1 are the lines where you decide what gets added into the vmt. The format is straight forward
echo codetobeinserted >> %1
If it requires "" just add them, no special parsing stuff, it adds literally whatever you type.
Master.bat looks for any vtf file in the directory where you run the batch then sends each one's name to the function.bat file. Function takes the name and creates a file with the same name. It then inserts the code you told it to and finally renames all the files to .vmt. After it finishes the directory its in it goes through every sub-directory until it can't find any more vtf files.
These bat files will keep the directory structure for all vtf in all sub directories but you may have to edit the ones in the base directory because it sometimes puts in /material/texture instead of just texture...
Hope this is helpful! I had the problem of having my copy of vtfedit add in translucent on all my vmt when i converted a folder. I also needed to add in comments to certain folders' vmt files for my own purposes.

88. bybloPosted: Mar 6th, 2009 - 1:36:36 pm
Is it possible to created animated textures with the VTFCmd.exe ?
I searched for infos but could not find anything about it.

89. XaphanModified: Oct 22nd, 2009 - 9:58:40 am
Is there a simple solution to one side stretching and the other not?
My Vtex compile parameters checked.

Eight Bit Alpha
Clamp S ("clamps" "0")
Clamp T ("clampt" "0")
No Mipmap ("nomip" "0")

I've tested with vtex.dll and VTFEdit and I'm getting the same results.

And this only happens to one side of the in-game radar map.
http://v4servers.com/overview_ss/top.jpg <= incorrect
http://v4servers.com/overview_ss/bottom.jpg <= correct
FIXED: My .tga file wasn't correct! FIXED!
Thanks Anyways Great Tool!

90. BoltyPosted: Jan 16th, 2010 - 5:25:46 pm
Hey! I got a little question about this program: Will I be able to compile sprite sheets in vmt with this? I tried it several times with other programs, and searched for the "mksheet.exe" sprite sheet maker in the Source SDK, which is currently non-funcional.
I desperately need to compile one where

[ 1 2 3 4 5 6 7 8 9 ]

You must be logged in to post a comment.
New users can register here.
Nem's Tools v2.0 © 2006 Ryan Gregg.
Execution time: 0.030948s; Queries: 17.
dishes served.
Powered by The Wavelength.

Valid XHTML 1.0 Transitional Valid CSS