Tutorial adressing custom texturing

Nostradamus

Newbie
Joined
May 17, 2003
Messages
980
Reaction score
0
Well, I guess a lot of people have got this figured out, but I thought I would adress a few points which has not been given that much attention.

First off you need to have your tga files, which can be any bitrate, but keep the size in mind. the sides has to one of these lenghts:
64, 128, 256, 512, 1024 or 2048.
you can use those lenghts any way you want of course... you can make it 64x2048 if you want to.

Second, you need to place your tga files in the correct folder:
\SteamApps\username\sourcesdk\cstrike_sample_content\materialsrc

Note: before you move on to compiling the textures, you might want to crate a .txt file for the tga files. For example if you are making a skybox you have to make a txt file for each of the extures with $skybox in it. For more cmds go here.

Now for the compiling you should go into the sourcesdk\bin\ where you should look for the vtex.exe file. Usually you would have to go through cmd promt to compile the textures, but an easier way is to make a shortcut for the vtex.exe and go into the file properties and add something like this to the line with the file info:

-mkdir -shader LightmappedGeneric d:\program files\Steam\SteamApps\user\sourcesdk\cstrike_sample_content\materialsrc\subfolder\filename.tga

Of course you will have to change the tga filename every time you run the shortcut, but overall it's easier.

Now once you have run the shortcut, you will propably get a new folder called materials in the sourcesdk\cstrike_sample_content\materialsrc\subfolder folder called materials.(If it's not at that excact location, take a look at the compiler history and look where it has put the vmt file).

Once you have located the vmt and vtf files you should move them(and the subfolder theyre in) to the \counter-strike source\cstrike\materials folder, so that hammer will note that theyre there.

Note: If you are making a skybox, it is vital that you name the subfolder in which the vtf and vmt files are in: skybox.

Now open the vmt file with notepad and change the abse texture to something like this: "$baseTexture" "subfolder/filename"

Now the subfolder should be the one the vtf and vmt files are in, and the filename should be the name of the corrosponding vtf file WITHOUT the tga extension.
Now if you have a metal material you will want it to look like you are firing at metal, so you will need to add a surfaceprop.
So look here for a list of the surface properties and names.
Now you add the metal surface prop to the vmt file so it looks something like this:

"LightmappedGeneric"
{
"$baseTexture" "subfolder/filename"
"$surfaceprop" "metal"
}

Note: I _think_ that the prop for skymaps should be default_silent but as I have experienced some flickering with my sky map, I can not be 100% sure.


Now you should be done and be ready to load up hammer.

However if you cantfind the texture in hammer the reason is that the config guide in the sdk makes hammer look in the sdk dir. for the textures(which cs:S doesnt!). So you will need to go into options>tools and set the Game directory to \SteamApps\username\counter-strike source\cstrike.
Dont remember to copy the gameinfo.txt from
\SteamApps\username\sourcesdk\cstrike_sample_content over to the cstrike dir aswell.

That should do it! :D
 
stickied :p

Now write about parallax mapping, normal maps and the other cool tricks before the millions of HL1:S texture replacing teams go and finish doing their basic single texture maps and defeat the point of "improving" anything :rolleyes:
 
For those who doesn't like the command prompt, i've made a small GUI for the VTEX program. I need to add some functions but it works. Post your comments please.

Readme.txt
--------------------------

-------------------------
| VTEXGUI By Ti133700N |
|------------------------|


--------------------------
INSTALLATION
--------------------------

You need Microsoft Framework 1.1 for VTEXGUI to work.
Extract the content of the vtexgui.zip file into X:\Program Files\Valve\Steam\SteamApps\[email protected]\sourcesdk or anywhere
on your hard drive.

--------------------------
HOW TO
--------------------------

Open Steam
Double click on VTEXGUI.exe to open the program
Enter your username in the first field. This will automatically change the path that points to the location of the VTEXGUI
utility. If you put VTEXGUI in X:\Program Files\Valve\Steam\SteamApps\[email protected]\sourcesdk, the path for the location of
VTEXGUI will be set correctly by default. You can also click on the ... to browse the folder where you installed VTEXGUI or
enter it manually (don't forget to put a '\' at the end of the path if it's not there.
In the location of TGA field, you can manually type the folder and the name of the file you want to convert or use the browse
file dialog box by clicking on the ... Don't forget that the dimensions of the image needs to be a power of 2.
In the Folder to sort texture into type in the name of the folder your want the VTEXGUI to copy the texture into. Usually you
use the name of your MOD or the type of surface your picture represents (concrete).
You can set the shader name in the last field if you are an experienced user or leave it to the default value.
Press the Make texture! button to convert your texture.

VTEXGUI will copy your tga file to the folder you specified in the "Folder to sort texture into" field. If that folder
doesn't exists, VTEXGUI will create it. Next, it will run VTEX with the required parameters.

All the files that are in the folder you specified will be converted to vtf files in a new folder that will have the same
name as the one you specified previously in the materials directory.

Copy the .vmt and .vtf files in the materials\yourdirectory to counter-strike source\cstrike\materials (you have to put the
folder, not just the files in materials)

Start Hammer
Apply your new texture
Compile
Start CS:S
Play you map
 

Attachments

  • vtexgui.zip
    73.5 KB · Views: 508
What am I doing wrong??

I’ve spent way too much time trying to figure out how to make custom textures for counter strike source using hammer on my own... I need some additional help.

First off., I have read the above tutorial, as well as a number of others. Including this one:

http://www.*************/wiki/index.php/Texture_Introduction

This is what I have done so far:

1. I made a TGA file using the correct parameters (I also used one from a previous sample .tga)
2. I made a folder in my cstrike_sample_content\materialsrc directory and placed my TGA there.
3. I made a shortcut of the VTEX.exe on my desktop.
4. I have tried both dragging and dropping my subfolder (containing the TGA file) into the VTEX icon, as well as adding on to the target line of the VTEX.exe with this:

-mkdir -shader LightmappedGeneric C:\Program Files\Valve\Steam\SteamApps\joehadenuf\sourcesdk\cstrike_sample_content\materialsrc\test\*.tga

Combined, the target looks like this:

"C:\Program Files\Valve\Steam\SteamApps\joehadenuf\sourcesdk\bin\vtex.exe" -mkdir -shader LightmappedGeneric C:\Program Files\Valve\Steam\SteamApps\joehadenuf\sourcesdk\cstrike_sample_content\materialsrc\test\*.tga

Each method results in an error wile running the VTEX.exe

the drag and drop method results in a message saying:

INPUT FILE: (directory)
OUTPUT FILE: (directory)
Can’t Open: (directory)

The The target add-on method results in:

Unable to find gameinfo.txt relative to ‘c:\programs’. Solutions:
1. Set environment variable ‘UPROJECT’ to the path where gameinfo.txt is.
2. Place ‘c:\program’ below the path where gameinfo.txt is.
3. Add -game <path> on the command line where <path> is the directory that gameinfo.txt is in.
Hit a key to continue

After this, I look in the materials directory, and no new folders or files are made.

Most of these tutorials seem fairly simple, but I can’t seem to get past the conversion of TGA to VTF. Does anyone see what Im doing wrong? Advice would be appreciated.
 
Hmm, so wait a second...we have to do this process for each texture? What if someone has a couple thousand textures?

...Like me
 
Joehadenuf:

1st of all make sure you have the GameInfo.txt in your sourcesdk\cstrike_sample_content folder.

Second(this might be a typo)
look at "C:\Program Files\Valve\Steam\SteamApps\jo ehadenuf\sourcesdk\bin\vtex.ex e" -mkdir -shader LightmappedGeneric C:\Program Files\Valve\Steam\SteamApps\jo ehadenuf\sourcesdk\cstrike_sam ple_content\materialsrc\test\* .tga

the vtex.exe and cample content isn't typed corretly... maybe you have pasted this, so that might be the reason.

Also I noticed a few typos in my own tut, so to correct that of course it is the materialsrc folder you are to put te files into and not a new one.

Not sure if that helps you :D

Doctor: Just compile each and then move them afterwards.... not that big of a problem... but as far as I can see you can just but a "," without the "'s and then type in the sir of the next texture and so on... and then you should be able to just load the vtex once... I'm sure that programs will be made so that you can do that via a nicer interface.
 
Thank you for the reply Nostradamus, but I seem to still have some loose ends... I'm new at this...

1. The Gameinfo.txt IS in my sourcesdk\cstrike_sample_content folder...
2. I don't see the typo you have pointed out... besides some bad spacing (generated by this forum I think) not in my original
3. Im kind of confused about the materialsrc\subfolder[/U]\filename .tga
4. Im also confused about where I place the TGA file in the first place..

--- I'm not suppose to make a folder inside the "materialsrc" folder and put my TGA in it? I have tried putting the TGA loose in the materialsrc folder without it's own "new" folder... and it still didnt work. Doesn't the "subfolder" mean I make my own folder for the TGA file and place it in there? Using the information that I have in the previous post, can you show me what my VTEX's target should look like? including the (vtex directory)\(.tga directory)

I'm pulling my hair out over this... lol
 
OK... this is really getting to me. I even used the program provided by Ti133700N, I downloaded Microsoft Framework 1.1, ran the VTEXGUI, filled out the correct information. or so I think.. and when I hit [make texture] the black text window came up blank. all it said was "Hit a key to continue" there were no files added to the folder I designated .......... Everything I have tried in the past 2 days have failed... there has to be some way to do this... lil help plz...

(EDIT)

This is what the VTEXGUE shows undet status when I hit [make texture] :

Copying TGA file test.tga
The file test.tga has been copied succesfully
Executing VTEX...
C:\Program Files\Valve\Steam\SteamApps\joehadenuf\sourcesdk\bin\vtex.exe -mkdir -shader LightmappedGeneric "C:\Program Files\Valve\Steam\SteamApps\joehadenuf\sourcesdk\cstrike_sample_content\materialsrc\C:\Program Files\Valve\Steam\SteamApps\joehadenuf\sourcesdk\cstrike_sample_content\materials\*.tga"
Operation successful!
-------------------------
Even though it says "Operation successful" I don't get any new files on the other end... and like I said, the black window Is blank...
 
Sounds pretty wierd... but i'm confused by the fact that it says it's executing *.tga
It should be the complete filename... is that something you editied or does the compiler say this?
 
I believe the * means it convers any TGA in the folder

what I find wierd is that is says its successful.. but it isn't.... go figure...

*keep in mind that this is using the VTEXGUI*
 
1. Put VTEXGUI in C:\Program Files\Valve\Steam\SteamApps\your@username\sourcesdk
2. Open VTEXGUI
3. Don't type anything in the Username field, we're gonna put the directory manually.
4. In the location of VTEXGUI folder, put this: C:\Program Files\Valve\Steam\SteamApps\[email protected]\sourcesdk\
5. In location of TGA, use the browse button to find your TGA file. In this case, we'll assume we want to copy the file bob.tga that is in the C:\ directory. In the field we're gonna type in: C:\bob.tga
6. In the Folder to sort texture into, type this: zzz

Click on the Make texture button.

The software will copy the file bob.tga that is in the c:\ folder to the C:\Program Files\Valve\Steam\SteamApps\your@username\sourcesdk\cstrike_sample_content\materialsrc\zzz folder
It will then run the VTEX program with the appropriate command line arguments.
Now if you look in your C:\Program files\Valve\Steam\SteamApps\your@username\sourcesdk\cstrike_sample_content\materials folder, you'll find a directory named zzz. If you look in the zzz folder, you'll find two files (or more if you had more than one texture in the materialsrc\zzz folder). One is bob.vtf and the other is bob.vmt.
Now if you run Hammer, it's gonna find your bob texture and displays it correctly in Hammer. But CS:S won't. So you have to copy the whole folder zzz in cstrike_sample_content\materials to counter-strike source\cstrike\materials. You'll now have counter-strike source\cstrike\materials\zzz with 2 files in that folder (or more if you have more textures).
 
odd solution...

Thanks for the reply Ti133700N.. It seems I found a solution other than this... what you just posted is about 99% of what I was doing...

My solution seems odd... one of the times I filled out the information (around # 32455) I became lazy and decided not to put anything under the box [sort textures into] (I left it blank), ran the [make texture button] and it worked!! the files were send to my materials folder... and I started making my very first custom textured models! I'm still wondering why none of the other methods worke for me... but I can't complain... it works now...
 
Well i'm glad it's finaly working, if you have suggestions just give them to me and i'll update my program. Hum... You just gave me an idea, I'll put a save button so you won't have to type the same information over and over again. Also, I think i'll add a checkbox that would let you select if you wish to compile all the textures or only one texture. Cuz for now, it always compile all the textures in the folder you specify.
 
Wah! I cant do it...

I have a JPEG I want to use as a texture. I save it as a .tga file in Paint Shop Pro and try using your VtexGUI (which is cool) but I get 'Error initialising texture' in the dos window.

The funny thing is, I got it to work before on a texture I downloaded. Could my using Paint Shop Pro be at fault?
 
maybe you guys can help me as no-one answered my thread about it..

i made some custom textures, and managed to get them to show up in Hammer when i'm in the texture browser, but when i apply them, the face turns a semi-tranparent red shade with a white lining running diagonally from corner to corner.. thoughts?
 
I don't know what could cause the "Error initialising texture" problem. Keep in mind that the size of your texture has to be a power of two (32x32, 64x64, 128x128, 256x256, and 512x512) and save it as a 32 bits tga file. Maybe you could send me your texture so I could tell you if the problem is the texture or something else. Polypod, it's the first tiem I hear of that problem. Does it look alright when you play the map or only in Hammer?
 
here's a pic of my problem in the game:

texturetest00006nj.jpg


I get the same white line in the hammer editor(in 3d/textured view) but i can see the texture fine in the texture browser.. i've used the generic shader from the tutorials.. and it's 512x512, vtex handles it fine and i've created a .vmt file that looks fine..

previously i couldn't get the texture to show up in the browser until i realized the my .vmt file wasn't 'right', that is, it looked like a text file even though i renamed it.. so i ended up opening an existing .vmt file and selected new>file from there, saved it with the generic shader and folder names etc.. and it then showed up in the browser.. so the white diagonal means "error initializing texture"?
 
Nostradamus said:
Odd....what surfaceprop does it have?

actually this is just a quick box i made to demonstrate.. i didn't figure changing the brush type would have an effect..
*edit* oh if you meant what shader i used the generic one in the tutorials..
i even used a stone texture in one of the tutorials(you might know which one i'm talking about) but it still gives me diagonal white lines..
well i've got plenty to learn besides custom textures but it would be nice to nip this in the bizzud..
:imu:
 
I think if you did everything after the book it is a system/grafics card problem.... maybe contact valve and ask if they had a similar problem...
 
YEAH !!!!!!!
Thanks Nostradamus, your VTEXGUI is very simple to use !
Very thanks man!
 
"Now for the compiling you should go into the sourcesdk\bin\ where you should look for the vtex.exe file. Usually you would have to go through cmd promt to compile the textures, but an easier way is to make a shortcut for the vtex.exe and go into the file properties and add something like this to the line with the file info:

-mkdir -shader LightmappedGeneric d:\program files\Steam\SteamApps\user\sourcesdk\cstrike_sample_content\materialsrc\subfolder\filename.tgake_sample_content\materialsrc\gallon\test.tga"

I don't get this... where do I write the info? ...

I must have some custom textures for my map or my whole idea will fall.... If all else fails... can someone of you guys just compile them for me? Would be very appreiciated (spelling there hhaha)
 
what surfaceprop is fences?

(maybe someone should make a list or give me a link to such a page..;))
 
My Vtexgui wont work..."the applictaion failed to initialize properly (0xc0000135)."
 
respect to Ti133700N!

thanks Ti133700N for this app... this is the only fricken thing out there that i can find that helps with useing custom textures. which is crazy!!! and it's driving me crazy! because i spent two full days worth of work figuring this stuff out! following links with directions that didnt work for me...

and i finally got your app to work. but now i cant see the textures... and i think it's just a matter of hammer not being able to get to that directory.

C:\Games\Valve\Steam\SteamApps\myusername\counter-strike source\cstrike\materials\zzz\

that is where my .vmt and .vtf files are.
the image is 64x64

and ... hammer cannot get to them. ive clicked many things.. and i still cannot browse to the file.. .i cannot find it in my textures list inside hammer... .. ... .. and... there are no more forum posts to read about how to do this. please help!

how do i get hammer to access the custom textures?
-bueno
 
Thanks for the nice comments buenothebear. I'll look into it tonight, but this version of VTEXGUI uses old paths system (like cstrike_sdk_content). I plan on releasing a new version soon. It seems that people are getting more interested in my proggy so it's a good thing, i'll update it.
 
Another issue regarding custom textures. I need to find a solution to: (Maybe someone can sum this whole thread up after a while and make a real good tut on custom textures).

All custom textures works fine after compiling and in-game. After setting up a dedicated hl2-DM server, the custom textures are gone. I presume the bsp file is not the only file I need to copy to the dir-three:

Code:
XX:\Valve\Steam\SteamApps\USER\source dedicated server\hl2mp

So.. Do I copy all the .vmt / .vtf files somewhere too? where? or did hammer compile me a nice gfx file for them which I have to put somewhere.

Any suggestions?
 
... im wondering if it's just because i am useing steam.
in hammer i have these options... look .. i took snapshots! weee!

hammerhelp1.jpg


after i've done all the texture converting and moving around to the proper folders.. i open up hammer and in the texture shonk on the right i see this stuff.. and i can look at all the half life textures.. and then i switch it over to "Materials"... which i assume means i'm switching it over to read the materials folder.

hammerhelp2.jpg

all i can see is this models folder: C:\Games\Valve\Steam\SteamApps\buenothebear\counter-strike source\cstrike\models\ShaderTest

so i went ahead and stuck the textures in there and i cant see them.. ive stuck the textures i made everywhere.. in their own folder of course.

and when i click on browse i cant .. browse for the folder.. or under options there is no option to select the folder i want to see textures in.

i guess i will try makeing a wad file? but i think i'm s.o.l. for the moment. i will just have to wait a few months maybe for valve to figure this out... or.. .. i dont even know.

are you useing steam Ti133700N?
 
You can't use WAD with Source games.
Yes I use Steam because I have to use it.

I'll make an update of my program tonight and... hum, if I make a video tutorial, would you watch it?
 
I'll make a bigger update than I thought so I guess it won't be out tonight but I will give you a screenshot of the new version. If you want additionnal features, just ask them. :)
 
Last edited:
I would watch the video tut if you made it on how to make custom textures for cs:s.. i get my jpegs into wad's using wally... but i dunno how to make the wad's vtf's in hammer?
 
File>Convert WAD to vtf
dunno how it works other than it does it on its own
 
I finally managed to finish VtexGUI Version .02 !!! Yea! I'm really impressed with the result. I’m pretty sure this will help a lot of people to get custom textures into Source games.

Give me your comments, happy modding :)

Edit: oh and geno, if you still have your jpegs, you can use irfanview to batch convert your jpegs to tga and then convert those tga to vtf/vmt with my vtexgui utility. If you don't have them anymore (only in a wad file), you can extract them with wally by opening the wad file, selecting all the textures and save them to a directory (I believe you can save them in tga format right away).
 
Back
Top