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
  • Creating a texture
  • Converting the texture
  • General settings
  • Mipmap settings
  • Normal map settings
  • Configuring & saving
  • Creating a material
  • Syntax
  • Parameters
  • Source & reference

Was this helpful?

  1. Documentation
  2. Textures
  3. Valve Texture Format - VTF

Creating a Material

This tutorial is a step-by-step guide to creating a brand new material, including the creation of the material's texture.

PreviousValve Texture Format - VTFNextCreating Animated Particles

Last updated 5 years ago

Was this helpful?

This tutorial is a step-by-step guide to creating a brand new , including the creation of the material's .

Creating a texture

Any image file can be used as a texture, so long as both of its dimensions (height and width) are a power of two: 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048 and so on. To decide which to use, examine existing textures that fill the same role as yours. Higher resolutions lower performance but make an image sharper when viewed up close.

Different classes of object have different standard resolutions (e.g. character models' are very high). Check Valve's choices in source materials.gcf with if you are ever confused. ****

**Note:**Texture source files should be saved in a lossless format like pre-compile, to prevent unnecessary loss in quality.

Converting the texture

Textures must be converted to the before Source can use them. The tool Valve provides for this is . It's a tool with quite a few limitations, so the third-party tool is preferable: it provides a graphical user interface, allows you to change a texture's properties without re-compiling it from scratch, accepts a wide range of image formats, and doesn't require the creation of script files for each and every texture. There are a handful of situations where you'll need to fall back on VTEX... but only a handful (Animate texture with ).

Also, if you have textures that use transparency, it is recommended that you save in TIFF format before importing to VTFEdit as PNG transparency tends to have problems. (There are VTF plug-ins that let you save to the format directly from , and , but this tutorial will not cover them as not everyone uses those tools).

To import your texture with VTFEdit, use File > Import or press Ctrl+I. Select your image and you will be presented with the import screen:

General settings

There settings are the most important. There are three:

  • Normal format

    • The color/compression format that should be used if the texture is opaque.

  • Alpha format

    • The color/compression format that should be used if the texture has an alpha channel.

  • Texture type

Mipmap settings

Normal map settings

Configuring & saving

Finally, save the file somewhere under your game or mod's \materials folder.

Creating a material

Syntax

A material file looks like this:

<shader>
{
	<parameter> <value>
	...
}
LightmappedGeneric
{
	$basetexture coast\shingle_01
	$surfaceprop gravel
}

Parameters

With a shader chosen you're onto parameters (also called commands). There are hundreds of options for what to put in a material so this article will only cover the most common, which are accepted by more or less all shaders. They are:

Tip: If you ever need to use a space or tab character in a parameter value, you must wrap the while value with "quote marks". You'll often see absolutely everything wrapped like this - save yourself some typing, as that's unnecessary.

Tip: To refresh materials in-game - use this console command: mat_reloadallmaterials, this will reload every single material. It's recommended to use this command to prevent game from freezing and some other weird artifacts: mat_reloadmaterial "vmt_name without .vmt". Example: mat_reloadmaterial "monitor_screen". Mat_reloadtextures is presented too.

Source & reference



If you imported more than one image, this determines what they will be used as (animation frames/faces/depth slices).

If you're making a plain and simple world texture you won't need to change any of these. If you're making a texture with fine gradient detail however, you'll need to choose a.

are low-resolution versions of a texture that swap in when a surface is far away from the camera. They greatly reduce the amount of texture resizing needed, improving both performance and image quality. Mips are required for texture to work.

**Tip:**Textures that will appear in the 3D world should have . To conserve memory, textures that will only be used in a 2D interface should not.

The following images demonstrate the various filters available in :

These (mis-labelled) settings allow you to automatically generate a from your input image. You'll want to do this properly with an image editor for the material you ship, but the automated option is there is you want quick results or a base to work from.

When you hit OK the input file is converted (there may be quite a lengthy pause for large images) and the output VTF appears. Now all that is left is configuring the texture with the options in the checkbox list on the left-hand side of the screen. See for descriptions of each.

Source doesn't access textures directly. Everything goes through a .

are script files that can be created in any text editor, but it's recommended that you use one of the in conjunction with the community-made . For your material to be detected, you must save it under your game or mod's \materials folder with the extension .vmt.

Note: If you are creating materials and textures exclusively for a map for a existing mod, consider using \\\ to package the material and texture files within the map file itself. This will avoid them ever becoming lost.

There are many to choose from, but most materials will use either () or (). The third most common shader is , which is used for materials and the occasional .

For a list of all documented shader parameters, see .

Source:

Reference:

cubemap
Mipmaps
LOD
mipmaps
bump map
material
BSPZIP
Packbsp
Pakrat
Compile Pal
shaders
LightmappedGeneric
brushes
VertexLitGeneric
models
UnlitGeneric
UI
tool texture
Category:List of Shader Parameters
$basetexture
$surfaceprop
$envmap
$bumpmap
$detail
$selfillum
$model
https://developer.valvesoftware.com/wiki/Creating_a_Material
https://en.wikipedia.org/wiki/Level_of_detail
material
texture
GCFScape
TGA
Valve Texture Format (VTF)
VTEX
command line
spritesheet technique
mipmap
Materials
syntax highlighting rules
VTFEdit
software listed
VTFEdit
Photoshop
GIMP
Paint.net
Sharpen filters
Mip filters #1
Mip filters #2
Mip filters #3
Mip filters #4
non-lossy compression mode
Valve Texture Format image_flags