Garry's Mod
Оценок: 265
Gmod Hammer - Custom Textures
От LASER ACE
Everything you wanted to know about custom textures, along with clear definitions and examples.
2
3
   
Наградить
В избранное
В избранном
Удалить
Things you need before you start
Before you start making custom textures for your maps, make sure you have the following tools (these are the tools I use when making custom textures) to create custom textures. Although you wont need all of them, having them can make your life and dreams a lot more achievable.
  1. VTFEdit [nemesis.thewavelength.net]
  2. GIMP (optional)[www.gimp.org]
  3. GCFScape (optional)[nemesis.thewavelength.net]
  4. SSbump Generator (optional)[sourceforge.net]
VTFEdit will be used for viewing and editing the .vtf and .vmt files
Gimp will be used to easily modify .png files we make (although you can use any image editing program that you're comftorable with.)
GCFScape will be used to extract textures from source games so we can modify them
SSbump Generator will help us generate Normal Maps, and also Height maps.

Once you have all of these, you can continue to the next part of the guide.
Creating your first texture
Say I wanted to make this full orange color into a texture



So to start, I open up VTFEdit. Click "File", then click "Import". For me, I'm going to go to where my orange color is located on my PC, and then double click it.
Make sure your texture is a size that can be divided by a power of 2 Sizes like 512x512 and 256x128 images will work, but 292x600 or something like 48x72 won't work.

You'll get these list of settings that pop up. For now, we'll just click "OK".


Since we aren't going to change our texture, we're just going to save it. Click "File", then click "Save As". I'll name my file "orange", then click "Save".
We aren't done yet though, custom textures require a .vtf (Valve Texture File) and a .vmt (Valve Material File). Click "Tools" and then click "Create VMT". A menu should pop up.


We won't change much, but the one thing we do want to change is the "Base Texture" parameter. We want to remove everything before the file name, in this case, orange. So our base texture should just be "orange". Now click on "Options".


Here we can change certain values. For my orange texture, we'll be checking off "Translucent" as our texture isn't translucent. We'll also be changing our "Surface 1" parameter to "Concrete". Then click "Create". So now we should have both our .vmt and .vtf files.


To make sure our .vmt is going to work, double click it, and open it up in either VTFEdit or Notepad, or any other text editor.


Since I put a spare version of my files in a different folder, and not the game folders, it gave me the directory from my "Users" all the way down to my "colour" folder. Since hammer will base your texture origin file location off of the materials folder, we're going to get rid of everything except the "orange" part of our $basetexture value.

So now we want to drag both our .vmt and .vtf into our game's "materials" folder.

After all this, now we can go into hammer and create a map using our new texture. For me, +my custom orange texture looked like this in game:


It doesn't look too great, but we're going to do some things to make it look better.
Transparent Textures, Decals
Say I wanted to spray this on a wall.

To start, import the texture into VTFEdit. You'll want to make sure your texture has some sort of transpoarency or an alpha layer.

You'll notice this white and grey checker-board formation where there isn't anything. This is the part of the texture that's translucent. Save the file as a .vtf file.
Now we're going to create the .vmt file. Click "Tools" and then click "Create VMT". Check the translucent box and create.
We'll want to add a few more things to get the texture to work as a decal. to do this, we're going to create some extra lines.
"LightmappedGeneric" { "$basetexture" "lol" "$surfacetexture" "concrete" "$translucent" 1 "$decal" 1 "$decalscale" 0.25 }
This is what our .vmt file will look like. Now that we have that ready, simply put it in your materials folder of your game, and create a map using it. Note that textures with translucency do NOT block off leaks in your map. This is what my texture looks like in game:
Blend Textures
Blend textures a relatively easy to make. The first thing you need are 2 textures you would like to blend together. Here, I'm using a grass texture and a dry grass texture.


To start, we're going to transform these into .vmf files. Then, we're going to create 1 single .vmt file which is going to be for our blend texture. What we should add is something like this:
"WorldVertexTransition" { "$basetexture" "abstract/blendgrass_test" "$basetexture2" "abstract/blenddrygrass_test" "$surfaceprop" "grass" }

Note: your texture won't appear to blend when using the Texture Browser.

You can add different surface props using "$surfaceprop2", but for our case, we don't need one since both our textures are grass.
Now, to properly use our custom blend texture, we're going to load up hammer, and use our texture on a displacement. Then, we want to choose the option "Paint Alpha", and it should blend one of our basetexture textures with the other. Our texture looks like this in game:
Glowing Textures
Lava textures look better when they glow.


It's actually really simple to make a glowing texture. Simply create the .vmt and .vmf file of your texture, but instead of adding parameters to our .vmt file, we're going to go to the .rad file of our game folder.


Open the file up and you'll see a few lines of code.
lights/fluorescentcool001a 189 231 232 350 lights/fluorescentcool001b 236 255 182 350 lights/fluorescentcool002a 189 231 232 400 . . .
The first 3 numbers represent the RGB (red, green, blue) values. The fourth value represents brightness. So we're going to insert our lava texture along with these other textures. It's the same location as our $basetexture value.
abstract/generic_lava 232 152 2 400
Now, when we load up our game, our lava texture should be glowing.

(Notice how everything around the lava is glowing orange, yet the lava itself isn't glowing)
Editing HL2 textures
You'll need GIMP for this part of the guide

Say I wanted to edit this dev texture from HL2 to be a different color.


We're going to be using GCFScape to extract the texture from a .vpk file in the HL2 folders. We can do this for any source games with .vpk files. To start, open up the .exe of GCFScape.


You'll want to search your game files (in this case, the HL2 files), and find the .vpk files. The ones you're looking for are the files with "_dir" at the end of them. The thing is hl2_textures_dir will give us the .vmf files, and the hl2_misc_dir will give us the .vmt files. W'ere just going to have to manually extract both of them. Double click the files with _dir at the end.


Now that we have all of the texture files extracted,we're now going to open up the .vtf and open up our dev texture we extracted. We're going to click "File" and then "Export". We're going to export it as a.png file. Then we're going to open this file up in GIMP.
We aren't going to do much here. Click "Colors" and then click "Hue Saturation". Here we can change the color of our .png file easily. Here, I've changed it to a blue color. Now we're going to save our new changed texture.
We're going to go through the same processof making a texture. This is how our modified texture looks in game:
Creating a Normal Map
A normal map creates the illusion that a texture is 3D but isn't. A comparison of a texture with a normal and one without is massive, especially when viewed with a flashlight or sideways.
Here's an example for a marble floor I generated with SSbump Generator:


VTFEdit can create normal maps, but they usually don't create the best looking or most realistic normal maps. We're going to be using SSbump Generator [sourceforge.net] for creating our normal maps.

If you're using VTFEdit, read this part of the guide
To start, open up VTFEdit and then import an image. You'll want to save this image as a .vtf for now, because you'll need a regular .vtf file and a .vtf file that's a normal map. It's relatively simple to make a normal map, when you import a file, there should be an option to "Generate Normal Map". You'll want to check "Wrap Normal Map", which means that your normal map can be tiled. Once you're happy with your settings, click "OK".
Now you'll want to save your normal map as a .vtf file.

If you're using SSBump generator for this part of the guide, read this part of the guide
To start, open the .exe file in SSBump.


Looking at the top of the program, you'll want to add an image, in this case, the image file for our custom texture. You'll want to make sure it only generates a normal map in the settings. Next, you'll want to build a normal map with it. At the top of the screen, there should be a button to generate a normal map. Click that.


A new set of settings will appear. We'll want to select our image file, and add a layer. A layer can be either Default, Fine Detail, Medium or Large Detail. You can have multiple layers. For us though, we're going to be using Large Detail. Now you'll want to click "Save Height Map". You'll need to save it as either a .jpeg, a .png or a .tga file (Those are the few compatible imports we can do in VTFEDit). And then you want to transform your normal map into a .vtf file.

When you have finished making your normal map, jump to here
Once you have the .vtf file for your normal map and your base texture, create a .vmt file. We'll be adding these parameters to our marble floor texture.
"LightmappedGeneric" { "$basetexture" "abstract/marble_floor" "$surfaceprop" "Tile" "$envmap" "env_cubemap" "$bumpmap" "abstract/marble_floor_normal" }

The "$bumpmap" parameter defines the normal map it'll use on our texture. In game, our marble floor looks like this:


(Notice how the reflections on the texture are handled)
Detail Textures
Detail textures are used when a player views your texture up close, and the texture seamlessly gets a higher resolution. A good explanation of what it does can be found here. Usually, it's a grayscale image that doesn't really tile. Here's an example of the noise_detail_01 texture from the VDC:


The left texture uses a blend texture, the right texture doesn't.

And to make it useable with a texture, you'll need to add the "$detail" parameters to your texture. A vmt with a working detail texture looks like this:

"LightmappedGeneric" { $basetexture "abstract/generic_lava" $detail detail/noise_detail_01 $detailscale 7 $detailblendfactor .8 $detailblendmode 0 }

The $detail parameter says what detail texture should be used.

The $detailscale scales the detail texture to a certain size before it gets tiled again.

The $detailblendfactor specifies the alpha value of you detail texture. usually, 0.8 is a good starting value.

And the $detailblendmode species the way your detail texture should be used with your $basetexture. In this case, 0 is just the normal way of using a detail texture.

Creating a detail texture is very easy. You simply make a grayscale image of something, and then use that texture in your .vmt parameters.
Creating a scrolling texture
I have a nice Lava texture that we made glowing, but I want it to be scrolling.


To start, we're going to go in the .vmt file and change it. We're going to be adding a "Proxies" tab. There a literal metric ton of Proxies we could add, but we're just going to be adding "TextureScroll" to the Proxies list. Our .vmt file should look like this:
"Lightmappedgeneric" { "$basetexture" "abstract/generic_lava" "$bumpmap" "abstract/generic_lava_normal" "Proxies" { "TextureScroll" { "Texturescrollvar" "$Basetexturetransform" "Texturescrollrate" 0.5 "texturescrollangle" 90 } } }

TextureScroll has 2 different things we can change. The texture scroll rate, and the texture scroll angle. The texture scroll rate means how fast our texture scrolls, so the smaller the number, the slower the scroll (values above 2 are still quite fast, so try to stick to 1 or a lower, decimal value). Texture scroll angle means the angle it scrolls at. 90 degrees is sideways.
Rotating Textures
Sometimes you just need a little rotation. Here's an example of a texture that rotates:
"LightmappedGeneric" { "$basetexture" "models/props_c17/bladeblur" "$angle" 0.0 "$translate" "[0.0 0.0]" "$center" "[-0.5 -0.5]" "Proxies" { "LinearRamp" { "rate" 45 "initialValue" 0.0 "resultVar" "$angle" } "TextureTransform" { "translateVar" "$translate" "rotateVar" "$angle" "centerVar" "$center" "resultVar" "$basetexturetransform" } } }

That texture is the helicopter blade on the Hunter Chopper NPC. You might notice we're using texture variables, more on that later.

The LinearRamp proxy makes the value that constantly increases.

And since there is no proxy for defining rotation, like we had with TextureScroll and AnimatedTexture, we're forced to use the "TextureTransform" proxy.
Creating an animated texture
Here's a rainbow texture I want to be animated in game:


Make sure you have all the frames of your animated texture
To start, you'll want to open up VTFEdit. We're going to be importing multiple images at once. To import multiple images, click the "Import" button, and then click all the frames (in order from first to last) holding CTRL on your keyboard. Once you have all your frames selected, you can import them into VTFEdit.
Now save the file as a .vtf file, and then create a .vmt file. We'll be adding these lines of code to the file:
"LightmappedGeneric" { "$basetexture" "rainbow" "$selfillum" 1 "$selfillummask" "rainbow" "Proxies" { "AnimatedTexture" { "animatedTextureVar" "$basetexture" "animatedTextureFrameNumVar" "$frame" "animatedTextureFrameRate" "3" } } }

We're using the "$selfillum" parameter because if our rainbow texture we're to be affected by light, it would look pretty ugly. Animated texture frame rate means how fast our textures cycles between frames. 2 is a good starting value. Higher values cycle through frames faster. For example, a value of 10 will mean that the texture cycles to the next frame every 10 frames per second.
Skybox Textures
Skyboxes are simply the sky that surrounds your level.



Skybox textures consist of 6 different textures, the BK (back), the DN (down), the FT (front), the LF (left), the RT (right) and the UP (top). We just add those two letters at the end of our texture.
"UnlitGeneric" { "$basetexture" "skybox/starfieldBK" "$hdrcompressedtexture" "skybox/starfieldBK" "$nofog" 1 "$ignorez" 1 }

Note: that your texture must be in a folder called "skybox".
Note: you'll need to add all the directions across six .vmt files to make the skybox work.


The parameter $ignorez means that your texture will always be in front of anything 3D and behind anything that's part of the skybox. A short explanation can be found here.

The parameter $nofog simply means our texture doesn't get affected by any fog in our map, which is pretty important, believe it or not for making sure your skybox is rendered without fog covering it.

The parameter $hdrcompressedtexture is explained here. In short, it means the
skybox is brighter and has a higher high dynamic range.

And since skyboxes don't have light rendered on top of them, they use the "UnlitGeneric" shader parameter.
Texture Variables
Textures can have variables. You simply define something that doesn't do anything by default, for example:
"LightmappedGeneric" { "$ten" 10 }

What did we do there? We essentially told source that our texture has something called "$ten" and that has a value of 10. But the thing is, $ten isn't a normal parameter, so it's essentially a variable now.

Now, you might ask: "Why are these even useful?" Here's an example:

"LightmappedGeneric" { "$basetexture" "jmp/neon/transparent_break" "$alpha" 0.75 "$translucent" 1 "$envmap" "env_cubemap" "$surfaceprop" "computer" "$nocull" 1 "$offset" "0" // The texture variable gets defined as 0 "Proxies" { "EntityRandom" { "scale" "12" "resultVar" "$offset" } "AnimatedTexture" { "animatedTextureVar" "$basetexture" "animatedTextureFrameNumVar" "$frame" "animatedTextureFrameRate" "$offset" } } }

What all of this stuff does is that it creates a random number with a scale of 12 to be the frame rate of the texture. The "EntityRandom" proxy generates a random number, so it's useful for creating random things for your texture.

There are many other proxies that can be used for number generation as well.
Custom Sprites
Custom sprites are like regular textures, except they're used with the env_sprite entity and the env_sprite_oriented entity in hammer. Here's an example of a sprite texture I found with some modifications using GIMP.


Here's what the .vmt file would look like.

"Sprite" { "$basetexture" "jmp/neon/sprite_example" "$spriteorientation" "vp_parallel" "$spriteorigin" "[ 0.50 0.50 ]" "$translucent" 1 "$nocull" 1 "$vertexcolor" 1 "$vertexalpha" 1 }

What happens in this .vmt file is that we're creating a very flat, inexpenisve 2D texture. You should be able to add or tweak any parameters to your needs. I couldn't figure out what the $spriteorigin parameter does, so you should just leave it to what I made it be.
Note: the paramaters $vertexcolor and $vertexalpha do not work in CS:GO.

Here's a table with all the possible $spriteorientation parameters with descriptions on what they do.
Paramater
Function
facing_upright
Doesn't do anything? All I could find about this is that it's unused and probably non functional.
vp_parallel
Make the sprite always face the player. Usuaully you would use this.
vp_parallel_oriented
If the sprite is orientated, the sprite will match the orientation given.
oriented
The sprite is orinted to the world, and does not constantly face the player.
Compile Parameters
Compile parameters are essentially parameters that start with a % instead of a $. According to the VDC, compile parameters change the vbsp compile behavior of materials. I've created a full table to all or most of the compile paramters and what they do. If the exclusive flag is yes, then it means that only one of the flags can be set on any material. Most of these compile parameters are booleans, which means they can only have a 0 or a 1 as a given parameter.
Compile Parameter
Function
Exclusive Flag?
%compileclip
Makes your material have the same properties as the Clip material.
Yes
%compilenochop
Prevents 'subdiving patches' on the surface. According to the VDC, it presumably affects how the face is converted to triangles.
Yes
%compilenpcclip
Makes your material have the same properties as the NPC clip material.
Yes
%compileorigin
Makes your material have the same properties as the origin material, which sets the origin of a brush entity. Does not work in source.
Yes
%compiletrigger
Makes your material have the same properties as the trigger material.
Yes
%compileskip
Makes your material have the same properties as the skip material.
Yes
%compilesky
Makes your material show the 3D skybox, as well as emitting light_environment lights. Has the same properties as the sky material
Yes
%compile2dsky
Makes your material show only the 2D skybox, as well as emitting light_environment light. Has tge same properties as the sky2d material
Yes
%playerclip
Makes your material have the same properties as the player clip material.
Yes
%compileblocklos
Makes the brush block the line of sight of NPCs.
No
%compiledetail
Forces the brush to not cut visleafs, similarly to func_detail.
No
%compilehint
Makes the face cut visleafs in the way the hint material does.
No
%compileinvisible
Makes a surface invisible like nodraw, but allows bullets to pass through. Makes it similar to the invisible material.
No
%compileladder
Makes the brush usable with the func_ladder entity. Also similar to the ladder material.
No
%compilenodraw
Makes a brush behave exactly like the nodraw material.
No
%compilenonsolid
Makes the brush not solid to anything.
No
%compilenoshadows
Prevents shadows from being cast onto the texture.
No
%compilepassbullets
Allows bullets to pass through a brush. Good for any materials with large holes in it.
No
%compilewater
Makes the brush have the properties of water.
No
%compileslime
A varient of the %compilewater parameter, makes the brush behave exactly like water except has green splashes.
No
%compilekeeplight
Used with %compilewater and %compileslime, allows the material to keep lighting data.
No
%detailtype
Allows details (like grass) to be used on the texture. This parameter is not a boolean!
No
Creating a water texture
This is probably one of the most painful things I have ever created. For the sake of preserving my sanity, we're going to use our custom lava texture again.


Water is seperated into 2 catagories, expensive and cheap. Expensive water has real time reflectures, but is very costly to run. Cheap water, uses cheaper reflection (env_cubemaps), which are pretty ugly on water, but require a lot less to run.

The thing is, we're going to need a beneath texture for our water. Usually, it's very similar to the regular texture. It can be an entirely seperate texture to the water itself, and have it's own .vmt file (unlike normal maps). For the sake of time and again, preserving my sanity, we're just going to use the same surface texture.

There's going to be a nightmare of editing the .vmt file.
I'll do my best to explain what each does.
"LightmappedGeneric" { "$basetexture" "abstract/generic_lava" "$translucent" 1 "$forceexpensive" 1 // This will force the water to use the expensive texture, no matter what "$forcecheap" 1 // This will force the water to use the cheap texture, no matter what "$reflectentities" 1 // This will make the water reflect entities "%tooltexture" "dev/water_normal" // Changes the icon of the water in hammer. Useful for weird .vtf files "$refracttexture" "_rt_WaterRefraction" // This will enable real time reflections. You MUST use this exact refract texture "$refractamount" 3.0 // This is how much the refractions will be warped "$refracttint" "%compilewater" 1 // This will tell source that your texture is water "$surfaceprop" "water" // You NEED this for your water texture. Source will freak out if you don't "$bottommaterial" "abstract/generic_lava" // This is our normal map that will be used for the water "$bumpframe" 1 // "$fogenable" 1 // This enables the fog when you're inside the water "$fogcolor" "{232 152 2}" // This is the color of the water underwater. In this case, we're using the glow texture of our lava "$fogstart" 0 // The distance, in inches, where the fog starts. 1 inch = 0.75 hammer units "$fogend" 100 // The distance, in inches, to where the fog ends "$abovewater" 1 // Just something you need for the texture to work "$texoffset" "[0 0]" // Water can look better if you offset and scale it down a little, although this is entirely optional "$texscale" 1 "Proxies" { "AnimatedTexture" { "animatedTextureVar" "$basetexture" "animatedTextureFrameNumVar" "$frame" "animatedTextureFrameRate" "2" } // If your texture is animated, it'll need this to work "TextureScroll" { "Texturescrollvar" "$basetexturetransform" "Texturescrollrate" 1 "texturescrollangle" 90 } // Pretty much all water textures will use this, the texture will simply scroll "WaterLod" { } // I have basically no idea to what this does, but it's needed for your water texture to work with the water_lod entity in hammer (which determines when your water uses the cheap texture or the more expensive texture).

That's a lot of info to take in. We're going to adapt this to our lava texture we made earlier. We won't be needing the refracting parts of the texture, and simply need water physics and water fog.
It'll look something like this:
"Lightmappedgeneric" { "$basetexture" "abstract/generic_lava" "%compilewater" 1 "$surfaceprop" "water" "$bottommaterial" "abstract/generic_lava" "$bumpframe" 0 "$fogenable" 1 "$fogcolor" "{232 152 2}" "$fogstart" 0.00 "$fogend" 100.00 "$abovewater" 1 "Proxies" { "TextureScroll" { "Texturescrollvar" "$Basetexturetransform" "Texturescrollrate" 0.5 "texturescrollangle" 90 } "AnimatedTexture" { "animatedTextureVar" "$basetexture" "animatedTextureFrameNumVar" "$frame" "animatedTextureFrameRate" "2" } } }
Now that that's complete, we're going to copy and paste this into our .vmt file and boot it up in game. The underwater part of our lava texture looks like this:


The thing is, this isn't really a water texture. Yes, source does consider it water, but it simply uses the water properties. To make it truly water, we would have to use the "Water" shader parameter. This will change the effect to something way more realistic. Textures using the "Water" shader don't need a $basetexture if it's an orange box game or older. We're simply going to change our "LightmappedGeneric" to "Water" to change how it looks in game. This will add the realistic wave effect.
Mirrors
A mirror is essentially a super-reflective texture. They are put on func_reflective_glass entities in hammer.
Here is what our .vmt parameters would look like:
"lightmappedreflective" { "$basetexture" "abstract/mirror_test" "$refracttexture" "_rt_WaterRefraction" "$refractamount" "0" "$refracttint" "[.5 .5 .6]" "$reflecttexture" "_rt_WaterReflection" "$reflectamount" "0" "$reflecttint" "[1 1 1]" "$fresnelpower" "0" "$minreflectivity" "0.8" "$maxreflectivity" "1.0" "$normalmap" "dev/flat_normal" "$surfaceprop" "glass" "$bumpframe" "0" }

What we're essentially doing here is making our regular texture use the refract and reflect water parameters. This creates the mirror effect we want. We could also change the tint parameters to change the colors reflected if we really wanted to. Our texture in game looks like this:



Note: the texture will appear as a missing texture in the level editor in hammer. The texture will properly load ingame.
Note: don't stack 2 mirrors where they see each other. You'll be unable to compile your map.
Creating a monitor texture
Since no one has ever made any remarks about custom monitor textures, I'll take the step forward and figure it out. Here's a scan line image I'll be using for this:


To start, we're going to make this a .vtf file. Then we're going to make one hell of a .vmt file. The first thing we MUST add to our texture is:
"Unlittwotexture" { "$basetexture" "_rt_Camera" "$translucent" 1 "$surfaceprop" "glass" "$additive" 1 "$texture2" "abstract/scan_lines" }

This tells source that our texture is compatible with the func_monitor entity (meaning that it doesn't produce a missing texture when used). We also don't need to the "$texture2" parameter, if we just wanted our camera without any sort of overlay. Same goes for "%tooltexture", but that's just to help us know if it's a monitor texture in hammer.

Our full texture should look something like this:
"UnlitTwoTexture" { "$basetexture" "_rt_Camera" "%tooltexture" "dev/dev_monitor" "$surfaceprop" "glass" "$additive" "1" "$texture2" "PerfTest/scan_lines" "Proxies" { "Sine" { "resultVar" "$color[0]" "sineperiod" 1 "sinemin" .1 "sinemax" 0 } "Sine" { "resultVar" "$color[2]" "sineperiod" .01 "sinemin" .1 "sinemax" 0 } "TextureScroll" { "texturescrollvar" "$texture2transform" "texturescrollrate" .06 "texturescrollangle" -90 } } }

This is simply some parameters pasted over from other monitor textures in source. The "Sine" proxy adds the wave effect you sometimes see on monitors. Most monitor textures in source use the same texture, but have variations due to the .vmt parameters. Our monitor texture in game looks like this:


(Notice how Gmod makes a mess out of the camera angles, but the texture does work.)
A list of some texture parameters
A list of some parameters you can put in a .vmt file. A full list an be found Here.

"LightmappedGeneric"

"$basetexture" "TEXTURE_NAME"
// This is the name of your texture

"$surfacetexture" "Watermelon"
// This is the surface texture, which defines stuff as what bullet decals look like and surface properties

"$translucent" 1
// This means it will use the alpha channel (transparency) of the texture

"$basetexture2" "TEXTURE_NAME2"
"$surfacetexture2" "Concrete"
// These are used with blend textures to define the other material's parameters

"$decal" 1
"$decalscale" 0.25
// This means that the texture is a decal, decal scale is the scale of the texture

"$nodecal" 1
// This makes your texture not show bullet decals when shot

"$alpha" 0.5
// Makes your texture have a defined alpha (transparency), which is useful for glass textures. Can only be a value between 0 and 1

"$envmap" "env_cubemap"
// This means that the texture will use reflections created by cubemaps

"$bumpmap" "TEXTURE_NAME_normal"
// This means it will use the normal map of a texture. The name of the normal can be anything, but is usually the name of the texture follow by _normal

"%compilepassbullets" 1
// This will make it so bullets go through the texture

"%notooltexture" 1
// This will make your texture not able to be found in the hammer texture browser

"%keywords" "KEYWORD"
// This will use the keyword function in the hammer texture browser

"Proxies"
// This will enable Proxies to be used on the texture (stuff like animated textures)


"TextureScroll"
{
"Texturescrollvar" "$Basetexturetransform"
"Texturescrollrate" 2
"texturescrollangle" 90
}
// This will make your texture scrolling, texturescrollrate changes how fast the texture scrolls, texturescrollangle changes the direction it scrolls (90 is sideways)

"AnimatedTexture"
{
"animatedTextureVar" "$basetexture"
"animatedTextureFrameNumVar" "$frame"
"animatedTextureFrameRate" 2
}
// This will make your texture animated, animatedTextureFrameRate changes how fast it changes between frames (2 is default)
Shaders and Proxies
Shader types are essentially the first line in your .vmt file.
"LightmappedGeneric"

That was an example of a shader you can use for your textures. There are many different types of shaders, all of which can be found here if you're really curious.
I've created a table of most shader parameters you'll use and what they do. This also covers some more abstract texture shaders.

Shader Name
Description
LightmappedGeneric
The base texture shader. Used on most regular textures.
VertexlitGeneric
Used as the default shader for models.
WorldVertexTransition
Used with blend textures. Should ALWAYS be used, since without it, blend textures can create weird lighting issues.
UnlitGeneric
Simply doesn't render light on your textures. Not used with models.
LightmappedReflective
Used by mirrors to make textures reflective.
Refract
Distorts objects behind the texture. More info here.
DecalModulate
Allows decals to be able to spawn on both models and textures.
Patch
It's a little difficult to explain, more info here.
SpriteCard
Used with particles. More info here.
ShatteredGlass
Used on textures that can be used with the func_breakable_surf. (The proper glas breaking texture)
Water
Is used with water textures. It creates the wave effects and such. You can create water without the need of having the "Water" shader parameter. More info here.
UnlitTwoTexture
Simple allows 2 textures to be used in 1 .vmt file, and can be transformed independantly. Not to be confused with WorldVertexTransition.
LightmappedTwotTexture
Simply a lit version of the TwoTexture.
Sprite
Used with sprite materials.
Cable
Used for textures that uses the rope entities in hammer.

Essentially, DX values are used on PCs with lower specs, to improve performance. It'll only be activated when

Since there are actually a metric ton of proxies that exist (excpet most of them are just used for very specific circumstances), I'm just going to leave a link here, so you can explore on your own time.
A list of all sources and useful websites
These are all the webistes and articles I used to help me make this guide. If you think the guide didn't explain certain elements very well, you can use the sources below for more help:

If you want to download all the .png, .vtf and .vmt files I used in this tutorial, you can download it here with dropbox.[www.dropbox.com] To use them properly, extract the files from the .zip, and put them in your game's "materials" folder.
Thanks for reading!
If you enjoyed the guide and want to support me, you can positively rate this guide.

If you have any suggestions / questions, you can post them in the comment section. I'll try to read them or answer them as fast as I can.

Комментариев: 64
TOMorrowIsAH 17 апр. 2024 г. в 18:16 
I tried it but all it does is just give me a blank texture with no name that's just white
Metabloxer 4 мар. 2024 г. в 23:05 
I came across a tutorial on gamebanana, and it says to do that exact thing, The only thing you can do better is to pack the textures with the map with a postcompiler, but I personally won't bother.
Metabloxer 4 мар. 2024 г. в 22:25 
@ttmso I'm using Hammer++, following the tutorial provided on their website. This method doesn't work, possibly because it's set up through SDK Multiplayer. What I found that works for me is putting the VMT and VTF in "\steamapps\common\Source SDK Base 2013 Multiplayer\hl2\custom\[anyname]\materials". It will appear in the editor, but not in-game. If you use this method, you also have to put that materials folder with your addon. If anyone knows a better way, please let me know.
Mihacappy 17 фев. 2024 г. в 15:29 
@seanoneal2013 You should use VTFEditReloaded. Unlike VTFEdit, it is being constantly updated.
seanoneal2013 2 июл. 2023 г. в 7:20 
The site for VTFEdit is down
ttmso 23 апр. 2023 г. в 2:10 
cant get it to work in hammer++ ):
OrangeKRUSH 3 янв. 2023 г. в 18:01 
You are great
Kjaer18 5 дек. 2022 г. в 16:40 
Well, after much testing it seems that the pumpmap test worked relatively fine, gonna have to do more tests to see if I am getting it properly right.
AmusingIdiot 5 сен. 2022 г. в 17:27 
Quick question, I'm not sure if this is answered but I was wondering how I could make a totally opaque texture more transparent, in order to create almost 'tinted' glass. I created the texture, added the translucent line, and while bots can see me through it, the texture is still totally opaque.
KubuśYT 12 июн. 2022 г. в 1:43 
Alright, for all of us that it didn't work, follow the tutorial (if you need just normal texture like me, the first one) it worked for me. But if you want it on your workshop map (so anyone that subscribes to it sees it) you have to use VIDE (VALVE INTEGRATED DEVELOPMENT ENVIRONMENT) you will find tutorials to it on youtube