LogoLogo
English
LogoLogo
English
  • Titanfall 2 Modding Guide
  • Contact & Help
  • Contributing
  • Credits
  • Wiki 101 - How to start ?
    • Modding introduction
      • How to backup, extract & repack
      • How to setup a modding environment
      • Modding tools
        • How to use RSPNVPK
        • Source
          • Game Directory
          • BSP
            • BSPSource
            • BSP Viewer
            • BSP2MAP
            • BSPZIP
            • EntEd
            • Entspy
            • Map Analyst
            • PackBsp
            • Pakrat
            • VBSP_h4xed
            • VIDE
            • VMEX
            • WinBSPC
            • WinBSPZip
          • Hammer
            • Displacement Luxel Density
          • VTF & VMT
            • VTFEdit
            • Vtex
              • Vtex - Compile Parameters
              • Vtex - Troubleshooting
    • FAQ
  • Documentation
    • Textures
      • Valve Texture Format - VTF
        • Creating a Material
        • Creating Animated Particles
      • Valve Material Type - VMT
      • Texture & Colors
        • Color & Texture info
      • Shader
        • $basetexture
        • $color
        • $reflectivity
        • Material Flags
      • Albedo
      • Bump map
        • $bumpmap
        • $ssbump
      • Cube Mapping
      • Skybox Basics
        • 2D Skybox
      • Lightmap
      • Material Vector
      • MIP Mapping
      • Missing content
    • Scripts
      • KeyValues
        • Gameinfo.txt
        • WeaponConfig.txt
      • VScript
    • File Format
      • NUT & GNUT - Squirrel
      • PSD - Photoshop Document
      • TGA - Truevision Graphics Adapter
      • TXT - Text file
      • VPK - Valve Pak file
    • File Location
      • VPK list
      • Weapon
        • Weapon model
        • Weapon script
        • Weapon config
      • 3D Models
        • Model - Skyboxes
        • Pilot
          • Models - Pilot Ability
          • Models - Pilot Weapons
        • Titan
        • Model - Beacon
        • Model - Containers
        • Model - Fixtures
        • Model - imc_base
        • Model - Industrial
        • Model - kodai_live_fire
        • Model - NPC
        • Model - Frontier Defense
  • Modding
    • Weapons
      • Crosshair modding
        • Batch crosshair modding
        • Crosshair example
      • Weapon Positioning
      • Weapon FOV
      • Hipfire zoom
      • Special/Unique weapon mods
        • Charge Rifle - Arc Rifle
        • Charge rifle - Heat color
        • LSTAR - Heat color
    • Pilots
      • Models - Pilot class
    • Titans
      • Titan Domeshield
      • Northstar
        • Cable - Grapple & Tether Trap
        • Railgun - Heat color
        • Northstar - Gravity
        • Northstar - Thermite
      • Ronin
        • Sword block color
      • Legion
        • Power shot heat color
      • Ion
        • Splitter Rifle - Heat effect
        • Vortex shield color
    • Custom Skins
      • Formats
      • Installing
        • DDS Format (tool)
        • VTF Format (manual)
      • Making
      • Info
        • Getting a Model into Blender
        • 2D Wireframes
    • Maps
      • Maps - Skyboxes
      • Maps - Cube Map
      • War Games
        • Holographic wall color
    • User Interface
      • Text modding r1_language
      • In Game
        • Scoreboard colors
      • Menus
        • Pause Menu Blur
        • Menu Background
        • Network - Menus
        • Whats new and Spotlight
        • Settings
          • Controls
          • Key Bindings
    • Sounds
      • Killsound
      • Lobby music
    • Misc
      • FF ID Color change
      • Remove Sun Flares
      • Cable - Zipline
      • Marvin - Chest screen
      • Pulse Effect
      • Sonar Detected
      • Ticks - Model
      • Nessie- Frag Model
  • Script Values
    • Effect (FX)
    • FX
      • FX - Pilot
        • FX - Pilot Weapon
          • FX - Assault Rifle
          • FX - SMG
          • FX - LMG
          • FX - Sniper
          • FX - Shotgun
          • FX - Grenadier
          • FX - Secondary & Pistols
          • FX - Anti-Titan
          • FX - Arc Tool
        • FX - Pilot Ordnance
          • FX - Arc Trap
          • FX - Firestar
          • FX - Gravity Star
        • FX - Pilot Ability
      • FX - Titans
        • FX - Ion
        • FX - Tone
        • FX - Northstar
          • FX - Railgun
          • FX - Holo Railgun
          • FX - Viper
        • FX - Monarch
          • FX - Monarch Beam
        • FX - Ronin
        • FX - Scorch
          • FX - Thermite Launcher
          • FX - Meteor First
          • FX - Firewall
        • FX - Legion
      • FX - NPC & Turret
        • FX - NPC
          • FX - Drone
          • FX - Drone Cloak
          • FX - Drone Frag
          • FX - MRVN
          • FX - Mortar
          • FX - Holo Spectre
        • FX - Turret
      • FX - Misc & Unknown
        • FX - Holo Map
        • FX - Beacon
        • FX - Skybox
          • FX - Skybox 1K
          • FX - Skybox Carrier
          • FX - Skybox Creature
          • FX - Skybox Nuke
          • FX - Skybox Station Traffic
        • FX - Skyway
        • FX - Dev
          • FX - Bug Repro
        • FX - Droppod
        • FX - Scan
      • FX - Raw Data
        • FX - EMP
        • FX - Env
        • FX - Grenade
        • FX - Harvester
          • FX - Coop Harvester FX
        • FX - HUD
          • FX - HUD AR FX
          • FX - HUD AR Impacts
          • FX - HUD AR Lines
          • FX - HUD AR Ordinance
          • FX - HUD AR Pings
          • FX - HUD AR Titandroppoint
        • FX - Impact
          • FX - Impact FX EXP Cutom
        • FX - Light
        • FX - Orbital Strike
        • FX - Projectile Plasma
        • FX - Reload
        • FX - Shell Eject
        • FX - Smoke
        • FX - Tracers
        • FX - Weapon
          • FX - Arc Cannon
          • FX - Dragonbreath
          • FX - Flamethrower
          • FX - Malta Gun
          • FX - Triple Threat
    • Sound
      • Sound - Voiceline
      • Sound - Pilot
        • Pilot Weapon
          • Assault Rifle
          • SMG
          • LMG
          • Sniper
          • Shotgun
          • Grenadier
          • Secondary & Pistol
          • Anti-Titan
        • Pilot Ordnance
        • Pilot Ability
      • Sound - Titans
        • Sound - Ion
        • Sound - Tone
        • Sound - Northstar
        • Sound - Monarch
        • Sound - Ronin
        • Sound - Scorch
        • Sound - Legion
      • Sound - Drone & NPC
        • Sound - MegaTurret
      • Sound - Misc & Unknown
        • Sound - Arc Cannon
        • Sound - Arc Tool
        • Sound - Flamethrower
        • Sound - Triplethreat
    • UI & HUD
      • Menu
        • Loadscreen
        • Private match
        • Scoreboard
  • Mods
    • Plastic Mode
    • No-HUD Mod
  • Exporting Assets
    • Exporting Maps
    • Exporting using Legion
    • Exporting Models
  • Assets
    • Texture library
Powered by GitBook
On this page
  • Basic usage
  • The drag-and-drop method
  • Vtex CLI use
  • Basic Vtex usage
  • Vtex commands
  • Wildcards
  • Chaining

Was this helpful?

  1. Wiki 101 - How to start ?
  2. Modding introduction
  3. Modding tools
  4. Source
  5. VTF & VMT

Vtex

Vtex is the command-line tool to convert TGA/PSD files into VTF

PreviousVTFEditNextVtex - Compile Parameters

Last updated 5 years ago

Was this helpful?

Valve Texture Tool, or Vtex is the tool used to convert or (Orange box SDK) image files into for use in the Source engine. It takes a image and an optional list of compile parameters, and creates a from them.

**Note:**It is recommended that you use the third-party tool instead. VTFEdit boasts a user-friendly interface, a wider array of accepted formats, the ability to change most VTF's properties without recompiling, a standalone viewer, and direct GCF access.

VTFEdit will make your life so much easier but in certain cases, you have to use Vtex to do certain task. Modding or creating VTF files with spritesheet is a good example

Basic usage

  1. Make sure that is running.

  2. Place the targa image to be converted inside the SteamApps/common/gamefolder/materialsrc/ folder, where gamefolder is the game folder of the current game (cstrike/dod/hl2/hl2mp/tf). You can also place the image within a subfolder of this folder, to make Vtex compile the texture to the corresponding materials/ subfolder. (For instance, placing the image in a materialsrc/metal/ subfolder, will make Vtex compile the texture to the materials/metal/ subfolder.)

  3. If necessary, write a containing a set of . Give it the same name as the targa image (with the exception of the .txt extension) and put it in the same folder. If you choose to omit this list, Vtex will create an empty one for you during compilation.

  4. The Vtex executable (Vtex.exe) is located in the /Steam/SteamApps/common/gamefolder/bin/ folder, again where gamefolder is the folder that corresponds with the target game. It can be executed in one of two ways: Through the easy "drag-and-drop" method (described below), or the more advanced command prompt method, described . Steam must run while it is executed.

  5. The resulting Valve Texture File (.vtf) will be compiled to the materials/ folder of the current game by default. For instance, if the current game would be , the texture file would be compiled to the SteamApps/common/Half-Life 2/hl2/materials/ folder. If the targa image resided within a subfolder, Vtex will compile the texture file to the corresponding materials/ subfolder. If that subfolder doesn't exist, Vtex will create it automatically.

The drag-and-drop method

The drag-and-drop method is the easy way to use Vtex. Just drag the icon of either the targa image to be converted, or its list of compile parameters (from its materialsrc/ folder) on top of the icon of the Vtex executable (Vtex.exe) and let go, and Vtex will compile the texture file automatically.

Vtex CLI use

Apart from the drag-and-drop method, Vtex can also be executed via the command prompt in the Command Line Interface (MS-DOS). This will allow you to use its more advanced features. You can provide additional parameters to create a basic .vmt file when the texture is compiled, as well as other options.

The syntax for vtex.exe is as follows:

vtex [-quiet] [-nopause] [-mkdir] [-shader ShaderName] [-vmtparam Param Value] texture1 texture2 ...

Any file extentions are ignored. (You can refer to the non-existant texture1.asd without problems, as long as the tga image is still present.)

Basic Vtex usage

The Windows environment variable "%sourcesdk%" can be utilized to locate vtex.exe easily in a command-line statement. This variable contains the location of the Source SDK installation directory.

For example, to compile a Half-Life 2 material called "sample_material.tga" in the directory "sourcesdk_content/hl2/materialsrc/metal", you would open a command prompt, change to the directory to "sourcesdk_content/hl2/materialsrc/metal" and type this at the command-line:

"%sourcesdk%\bin\vtex" sample_material.tga

The compiled .vtf file would be compiled to this folder (assuming you had set Half-Life 2 as your current game directory):

SteamApps\username\half-life 2\hl2\materials\metal

**Note:**It is very important that you set the Current Game in either the SDK Launcher or VConfig to the correct game directory before you open a command prompt to compile textures. Changing the Current Game will not affect any command prompt windows that are already open. This is due to how Windows uses environment variables.

Vtex commands

-mkdir

You can add the -mkdir command to vtex, and it will add the destination directory if it does not exist. For example, if you had a .tga at /sourcesdk_content/hl2/materialsrc/sample/sample_material.tga you would type this at the command-line:

"%sourcesdk%\bin\vtex" -mkdir sample_material.tga

This would create a new directory called "sample" in your Half-Life 2/hl2/materials directory, if it didn't already exist, and then place the compiled .VTF file in that new location. If the directory already exists, the -mkdir parameter is ignored.

-shader

"%sourcesdk%\bin\vtex" -shader LightmappedGeneric sample_material.tga

This would compile the material sample_material.vtf in half-life 2/hl2/materials/metal as well as create a new material file sample_material.vmt in the same location, using the LightmappedGeneric shader, like this:

"LightmappedGeneric"
{
	"$baseTexture" "sample/lightmappedgeneric"
}

-vmtparam

You can use the -vmtparam <parameter> <value> command to additional material parameters to the created .vmt file. If a .vmt already exists in the same location, any new parameters will not be added. For example, to make a material translucent, you would type the following:

"%sourcesdk%\bin\vtex" -shader LightmappedGeneric -vmtparam $translucent 1 sample_material.tga

Which would create the following sample_material.vmt:

"LightmappedGeneric"
{
	"$baseTexture" "sample/lightmappedgeneric"
	"$translucent" 1
}

You can add multiple -vmtparam statements in the same Vtex command, like this:

"%sourcesdk%\bin\vtex" -shader LightmappedGeneric -vmtparam "$bumpmap" "sdk/bumpspecular_normal" -vmtparam "$envmap" "env_cubemap" sample_material.tga

This would create the following sample_material.vmt specifying parameters for a bumpmapped specular material:

 "LightmappedGeneric"
 {
 	"$baseTexture" "sample/sample_material"
 	"$bumpmap" "sdk/bumpspecular_normal"
 	"$envmap" "env_cubemap"
 }

-quiet

When added, this commands will cause Vtex to do its work without producing any output to the console and will not pause when finished.

-nopause

Removes the "Hit a key to continue" message that appears when Vtex has finished working.

-outdir

You can use the -outdir <parameter> <value> command to override the output directory out the VTF file.

-quickconvert

Used to quickly convert an older VTF file format to a newer VTF file format.

-dontusegamedir

Puts output files in same folder as input files. Best used with -quickconvert

Wildcards

Command-line wildcards can also be used with Vtex. This command-line would compile all .tga files in the current directory:

"%sourcesdk%\bin\vtex" *.tga

This command-line would compile all .tga files in the current directory with names than begin with "sample":

"%sourcesdk%\bin\vtex" sample*.tga

In this case, the files "sample_metal" and "sample3" would be compiled, but not "samp_metal" or "sampl_2".

Chaining

Vtex can compile multiple materials from the same command-line. Simply add the name of each .tga after the first, like this:

"%sourcesdk%\bin\vtex" sample_material1.tga sample_material2.tga sample_material3.tga

If a .vmt is generated on the command-line using the -shader command, a unique .vmt will be created for each .tga in the chain, all with the same parameters specified by the -shader and -vmtparam commands. If you need more individual control of the shader parameters of each .tga, use a batch (.bat) file to run vtex multiple times instead.

Source:

may explain this better.

You can use the -shader <shadername> command to have Vtex create a .VMT for the new material with the specified. For example, to create a basic LightmappedGeneric material, use the -shader command like this:

Command-line
shader
https://developer.valvesoftware.com/wiki/Vtex
https://developer.valvesoftware.com/wiki/Vtex_CLI_use
command-line
targa (.tga)
Photoshop (.psd)
Valve Texture Files (.vtf)
targa (.tga)
Valve Texture File (.vtf)
VTFEdit
Creating Animated Particles
Steam
text (.txt) file
Vtex compile parameters
Half-Life 2
here