Keeps an eye on a folder, and when any image gets modified, it makes or updates the VTF with the same name
- Supported image formats: PNG, BMP, TGA, JPG, JPEG, PSD
VTF image format and flags persist when image is updated!
(it works this way when any supported image file is updated, this is just an example of photoshop updating a .psd file)
Important
Photoshop notice:
Alpha channel won't be recognized if you have only 1 layer locked like this:
Due to Adobe's closed-source nature, new Photoshop versions have features which are unsupported, and may cause differences in exporting. It's advisable to use an older version like Photoshop CS6
-
Dragging a VTF:
- Allows exporting to PNG, TGA or PSD
Make Simple VMT
with LightmappedGeneric shader and $basetexture pointing to VTF, relative tomaterials/
-
Dragging an image:
Lossless
Makes VTF with BGRA8888 compression if image is transparent, or RGB888 if opaqueCompressed
Makes VTF with DXT5 compression if image is transparent, or DXT1 if opaque- These presets are set to version
7.1
and mipmap generation is enabled withHANNING
filtering
I think that only these 6 flags have an actual impact. If I missed an useful flag let me know.
Same with the image formats that this program accepts:
- BGRA8888
- RGB888
- IA88
- I8
- DXT5
- DXT1
- RGB565 (todo: is this format supported in any branch of the source engine?)
-
Updates VTF files while preserving the settings (flags, image format, version).
- If the VTF has no mipmaps, the updated VTF will also not have mipmaps. If it has, the updated VTF will have mipmaps with the
HANNING
filtering. - The image format of the updated VTF can alternate between having alpha or not having alpha, depending on whether the input image has any transparent pixels or it's fully opaque. For example, a VTF with
I8
image format will becomeIA88
if the updated content has any transparency, and will go back toI8
if it's updated with a fully opaque content. And the same for the other format pairs (DXT5/DXT1
,BGRA8888/RGB888
,IA88/I8
) and the special case pair: (BGRA8888/RGB565
) because there is no equivalent ofRGB565
with alpha. If the program tries to update a VTF which has any other image format, the updated VTF will default to having an image format ofBGRA8888
(lossless with alpha).
- If the VTF has no mipmaps, the updated VTF will also not have mipmaps. If it has, the updated VTF will have mipmaps with the
-
Images can be any size, they are automatically resized to the nearest power of two
- Can't make animated textures or envmaps yet
- I couldn't find a way to support Gimp's native XCF file format
- Currently the program can't be notified if VTFCmd fails for some reason, so it just silently fails
Requires .NET 8.0
VTFCmd is compiled from >>> here
How to compile VTFCmd: (or at least how I managed to compile it)
-
Open
sln\vs2019\VTFLib.sln
solution with Visual Studio 2022 -
Accept updating the projects
-
Set Startup project to VTFCmd
-
Inside
VTFCmd\VTFCmd.rc
replace#include "afxres.h"
with#include<windows.h>
-
Build for Release 64bit
-
Output will be in
sln\vs2019\VTFCmd\x64\Release\
- in the AutoVTF build folder, make a new folder called
vtfcmd
. Copy VTFCmd.exe and VTFLib.dll there
- in the AutoVTF build folder, make a new folder called
-
VTFCmd requires DevIL, which can be found >>> here
- Put DevIL.dll, ILU.dll, ILUT.dll in the
vtfcmd
folder
- Put DevIL.dll, ILU.dll, ILUT.dll in the
NuGet packages:
I hope that this will be useful to people, because it has already made my workflow so much simpler than before.
This isn't meant to be a replacement for VTFEdit though, it's still very useful for previewing VTFs and setting some arcane settings.
If you found a bug or have a suggestion you can create an issue
If you want to be sure that there is nothing malicious, take a look at the source code and compile it, and download/compile the external dependencies yourself.