Adding Custom Textures

Tutorial collection, comprehensive listings on main site.

Adding Custom Textures

Postby Tutorial on Mon Mar 07, 2005 10:14 pm

In this tutorial I will explain you what you need to make so you can use your custom textures(materials) in hammer, and in game.

1. Okay so first you need your texture. In source the textures need to be in TGA format, you can easily save it in that format if you use Photoshop. The image size follows the same rules as before, sizes like 8, 16, 32, 64, 128, 256, 512, 1024, etc. are allowed, they are all powers of 2, and there isn't really a limit for how big they are, but I guess 1024x1024 is more then enough.

2. Now in order to use your texture you need to create a folder in Valve\Steam\Steamapps\username\sourcesdk_content\cstrike\materialsrc
give the folder any name you want and put all your .tga files in there. You can also have a txt file with the same name as your texture with some commands, which will be executed when you compile the texture. The commands are:

$nolod Do not use lower quality versions of this texture in lower Direct X versions
$nomip Do not make mip-levels for this texture
$clamps / $clampt Do not allow the texture to wrap in the S or T coordinate space, respectively. This is most often used for sprites that are not tiled
$skybox Used for compiling skyboxes. This assures the edges match between each facet
$startframe (integer) / $endframe (integer) Used for animated textures. Textures must be named as texture000, texture001, texture002, etc. The $startframe defines the beginning frame and the $endframe defines the ending frame.
$nocompress Do not use compression on this texture. Useful for textures with fine gradation (like light halos)
$nonice Do not use NICE filtering on this texture’s lower mip-levels
$dxt5 Use DXT5 compression instead of full compression


3. Now comes the hard part although it's not that hard. Go to Valve\Steam\SteamApps\username\sourcesdk\bin\ and you'll find in there a exe called VTEX. Now right click on it and select the "create shortcut" option. This will create a shortcut to that program in which we can add several command options, so open the shortcut properties and in the end of the target field add the following commands:

-mkdir -shader LightmappedGeneric C:\Valve\Steam\SteamApps\username\sourcesdk_content\cstrike\materialsrc\texturedir\*.tga

So what this does is, create a new folder, then tells the program which shader your using, in this case lightmappedGeneric, but you can use whatever shader you want, then it picks up all the TGA files in the folder you pointed, and converts them in to VTF and VMF, which are your materials files.
If you go to Valve\Steam\Steamapps\usename\counter-strike source\cstrike\materials
you'll see your materials folder in there, and if you open it you will see a VMF, and a VTF, with your texture name.

4. The last thing to do it's to edit the VMT files so that they act like they are supposed to, basically we are going to say to the engine that this is wood, this is metal, this is concrete etc. So open a VMT file in notepad, you will see something like:

"LightmappedGeneric"
{
"$baseTexture" "yourfolder/yourtexturename"
}

After the "$basetexture" line add "$surfaceprop" "materialname" in wich you replace the materialname for the type of material your texture is. The following names are the some types of materials you can add:

Image

CONCRETE/ROCK TYPES:
baserock
boulder
brick
concrete
concrete_block
gravel
rock

LIQUID TYPES:
slime
water
wade

METAL TYPES:
chain
chainlink
metal
metalbox
metalgrate
metalpanel
metalvent
slipperymetal
solidmetal

MISC TYPES:
computer
default
glass
ladder

ORGANIC TYPES
alienflesh
bloodyflesh
flesh
watermelon

SNOW TYPES:
ice
snow

TERRAIN TYPES:
antlionsand
quicksand
dirt
mud
slipperyslime
grass
tile

gravel

WOOD TYPES:
wood
woodbox
woodcrate
wood_furniture
wood_lowdensity
wood_plank
wood_panel
wood_solid

I didn't test all of this materials so some may not work, or need some specific settings.

5. Last thing to do is to copy the folder containing the VTM and VTF files to \counter-strike source\cstrike\materials, copy the folder not the files.

BaRRaKID
- Don't send PM's to this user -
Tutorial
Not A Real User
 
Joined: Sun Mar 06, 2005 11:00 pm

Re: Adding Custom Textures

Postby snufflez on Sun Mar 13, 2005 4:04 am

2. Now in order to use your texture you need to create a folder in Valve\Steam\SteamApps\username\sourcesdk\cstrike_sample_content\materialsrc
give the folder any name you want and put all your .tga files in there.


after patch folder path should be:
Valve\Steam\Steamapps\username\sourcesdk_content\cstrike\materialsrc

3. Now comes the hard part although it's not that hard. Go to Valve\Steam\SteamApps\username\sourcesdk\bin\ and you'll find in there a exe called VTEX. Now right click on it and select the "create shortcut" option. This will create a shortcut to that program in which we can add several command options, so open the shortcut properties and in the end of the target field add the following commands:

-mkdir -shader LightmappedGeneric

C:\Valve\Steam\SteamApps\username\sourcesdk\cstrike_sample_content\materialsrc\texturedir\*.tga.


should be changed to:

-mkdir -shader LightmappedGeneric C:\Valve\Steam\SteamApps\username\sourcesdk_content\cstrike\materialsrc\texturedir\*.tga

So what this does is, create a new folder, then tells the program which shader your using, in this case lightmappedGeneric, but you can use whatever shader you want, then it picks up all the TGA files in the folder you pointed, and converts them in to VTF and VMF, which are your materials files.
If you go to Valve\Steam\SteamApps\username\sourcesdk\cstrike_sample_content\materials you'll see your materials folder in there, and if you open it you will see a VMF, and a VTF, with your texture name.


changed to:

If you go to Valve\Steam\Steamapps\usename\counter-strike source\cstrike\materials
Dongs.
User avatar
snufflez
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Mon Oct 11, 2004 3:08 pm
Location: HoME

Postby [REG-A] Black Hawk on Sun Mar 13, 2005 5:42 am

there might be an easy way to do this... I noticed that if you add a cutom spray in game, you'll also see it in the texture in hammer 4.0, so I assume by adding the spary it automatically converts it to a .vmf. I just have not idea where the file is although it's probablyynnot hard to find.
[REG-A] Black Hawk
Regular
Regular
 
Joined: Tue Nov 09, 2004 3:08 am
Location: Redmond, WA

Postby [REG-A] Black Hawk on Tue Mar 15, 2005 1:30 am

yeah the way I said above is sooooo much easyier.
[REG-A] Black Hawk
Regular
Regular
 
Joined: Tue Nov 09, 2004 3:08 am
Location: Redmond, WA

Postby Charron on Tue Mar 15, 2005 1:39 am

But, there is a problem in that it wouldn't give it any surface properties, like water or ice or rock. I haven't tried it, personally, but I don't think it would be able to do that.
Image
User avatar
Charron
Regular
Regular
 
Joined: Fri Mar 11, 2005 2:02 am

Postby slayera on Tue Mar 15, 2005 2:19 am

[REG-A] Black Hawk wrote:yeah the way I said above is sooooo much easyier.


Not really. I use a folder name and usually am making more that one texture, so vtex will move the all the new textures in the folder of the same name with the correct path in the vmf file. When you try to zip and send your map, you will end up with some bad paths or storing materials where they do no belong. You cannot use move materials a back forth with editting the file for the correct path. Plus, most of the time you still need to add extra, like surface props, blends, scaling and so on. If you have to manage a lot of texture, then that is not the way to do it. Plus Barrakids method is getting to be a little dated now that there are programs that will do this for you, even though I still use it.
Image


"When one person suffers from a delusion it is called insanity. When many people suffer from a delusion it is called religion." -Robert Pirsig
User avatar
slayera
Veteran
Veteran
 
Joined: Wed Dec 08, 2004 3:15 am
Location: Near the world's only super volcano.

Postby snufflez on Tue Mar 15, 2005 2:41 am

[REG-A] Black Hawk wrote:yeah the way I said above is sooooo much easyier.
only for single texes, vtex is batched. u can do as many as u want at a time with vtex
Dongs.
User avatar
snufflez
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Mon Oct 11, 2004 3:08 pm
Location: HoME

Postby BaRRaKID on Tue Mar 15, 2005 10:48 am

textured for the win.. it's much more easier.. altough it let's me down many times :(
I've no sign
BaRRaKID
Veteran
Veteran
 
Joined: Sun Oct 10, 2004 1:46 pm
Location: PORTUGAL!!!

Postby Blink on Tue Mar 15, 2005 10:56 am

Edited the tutorial with the new paths
User avatar
Blink
Cool 'n that
Cool 'n that
 
Joined: Fri Oct 08, 2004 4:16 pm
Location: UK

Postby BaRRaKID on Tue Mar 15, 2005 12:14 pm

also i'm sory for the lack of images in this tut to make it easier to understand, but my windows version is in portuguese, so you wouldn't understand anything :P
I've no sign
BaRRaKID
Veteran
Veteran
 
Joined: Sun Oct 10, 2004 1:46 pm
Location: PORTUGAL!!!

Postby wiggle987 on Tue Mar 15, 2005 3:25 pm

i use the exterior vtex to make my textures

much more hassle free
Image
User avatar
wiggle987
Veteran
Veteran
 
Joined: Mon Nov 22, 2004 8:54 pm
Location: O RLY?

Postby BaRRaKID on Tue Mar 15, 2005 6:00 pm

wiggle987 wrote:exterior vtex
wath's that? :-)
I've no sign
BaRRaKID
Veteran
Veteran
 
Joined: Sun Oct 10, 2004 1:46 pm
Location: PORTUGAL!!!

Postby wiggle987 on Tue Mar 15, 2005 6:12 pm

was taken from the beta i think, just a vtex of its own
Image
User avatar
wiggle987
Veteran
Veteran
 
Joined: Mon Nov 22, 2004 8:54 pm
Location: O RLY?

Postby BaRRaKID on Tue Mar 15, 2005 9:25 pm

that's really nice.. do you have a link?
I've no sign
BaRRaKID
Veteran
Veteran
 
Joined: Sun Oct 10, 2004 1:46 pm
Location: PORTUGAL!!!

Postby YokaI on Sat Mar 19, 2005 2:18 am

guess not x.x
YokaI
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 03, 2004 12:38 am
Next

Return to Tutorials

Who is online

Users browsing this forum: No registered users