PDA

View Full Version : Tutorial #4: Making Custom Textures



Prez
25 Oct 2009, 12:37am
Hey, I thought I'd make a tutorial on making custom textures for maps using Source SDK. Today, I'll show you how to do this using "VTEX", a program built-in with steam. There is also VTFedit, which is a great program as well for this, but I'll show you VTEX today.



Okay. So you are making a map. Cool beans! Here's your map!

http://img200.imageshack.us/img200/4875/tutcustomtextures1.png


Booooring. Let's pimp up this map by adding custom textures!


What!? You don't know what those are!? Well, silly, they are textures that are made by YOU (or some other person), put straight into source sdk for map use!

How do you put them in, you say? Well, today, I'll show you how.



Custom textures!
A tutorial by Gen. Shadow.
What you'll need
-An Image editing program of your choice (GIMP, Photoshop, Paint.net)
-Hammer (Source SDK)
-VTEX
-A good pair of eyes and an attention span!

We're going to be using VTEX today for custom textures. VTEX is a built-in program, provided by Valve, whose purpose is to make custom textures for Source SDK. It's really quite easy to use, if you know how.

So, first things first. We want to have a place to put these textures. For this, we will need three folders: Texture Maker, Texture Folder, and VTEX Area.

What do these folders do, you say? Well, I'll show ya!


These three folders will actually be copies of three folders within your Source SDK folder.

So, first, navigate into your Source SDK folder by:


Clicking "Start"
Clicking "My Computer" or "Computer" for vista users (Mac users should be "Computer" as well, I think."
Clicking "Local Disk: C (Could be different)"
Clicking "Program Files"
Clicking "Steam"
Clicking "Steamapps"
Clicking "Your Steam Username Here (Mine would be Black_Shadow_Rider)"

Now, from here, you split off in three ways:

For "Texture Folder", you would:
Click "Counter-Strike: Source" (or whichever game you are making a map for).
Click "Cstrike"
Click "Materials"

For "Texture Maker", you would:

Click "sourcesdk_content"
Click "cstrike"
Click "materialsrc"

For "VTEX Area", you would:

Click "sourcesdk"
Click "bin"
Click "ep1"
Click "bin"

The three folders (materials, materialsrc, bin), are your folders for making custom textures. Copy and paste these three onto your desktop, and rename them accordingly (Texture Folder, Maker, VTEX Area).

http://img16.imageshack.us/img16/5391/tutcustomtextures3.png

Ok, so now we can get started!


Wait a second! We need a picture for the texture! Durr.

So. For your map, whatever it is, you have a theme (or should).

Depending on your theme, we will have pictures to coincide with it.

For your map, the theme is... the moon! So, the moon, eh? Let's see. So you have some buildings on your map, and a floor, and some walls. How about we add a moon floor, and some sort of building texture? Sounds good.

So now we need the image to use for this. You can either make your own, or get one off the internet. Let's use Google today. Find the picture first. Let's use this (http://i396.photobucket.com/albums/pp41/PossumRoadkill/Possum%20Art/slate2.jpg) one for the floor.

http://i396.photobucket.com/albums/pp41/PossumRoadkill/Possum%20Art/slate2.jpg


Ok. So we have the floor texture. Now what? Now, you load up any image-editing program you'd like (Good ones are paint.net, photoshop, GIMP). You can use any one that is good quality. I'm going to use GIMP.

So load up your program (GIMP). Now, since you have a blank screen, you need to make a new file! So hit "File>New", and set the dimensions to:
Width> 512 px
Height> 512 px

http://img32.imageshack.us/img32/6448/tutcustomtextures4.png

(px stands for pixels).


Alright, so we have a blank screen! Yay!

http://img12.imageshack.us/img12/5357/tutcustomtextures5.png

...

What now?


Ah, ok. First, right click your image, on the internet or wherever, and hit "Copy". Then, on your blank page, right click the page and hit "Paste". You may also just go to the "Edit" menu on the top bar, and hit paste (Ctrl+V).

http://img16.imageshack.us/img16/328/tutcustomtextures6.png

Ok, now your picture is in the blank page! Yay!

Oh wait, now we have the open space around it.


We need to fill it! So, select your picture, if not already. Then, select the "Scale" tool, or something like that, in your program.

http://img40.imageshack.us/img40/1647/tutcustomtextures7.png

Then, click your image. A box should pop up (mind that I'm using GIMP, so I'm not sure if this is the case in Photoshop or others). You then need to make it the same dimensions as the 512x512 box. Do so. Put 512x512, and hit "Scale".

Mind that when this occurs, you may need to move it to the middle. In GIMP, there is a tool called the "Alignment" tool, where you can align it perfectly. For this, you click the alignment tool, then your picture. There are buttons on the screen, for alignment. Left, right, center. There are two of each, for vertical and horizontal alignment. You must hit center for both, then it will be aligned! Yay!

http://img36.imageshack.us/img36/7696/tutcustomtextures8.png

Now, you may need to crop off the edges, just because it might have borders. Select the "crop" tool, and crop off the sides, if needed.

Note: After this, you'll have to use the scale tool again to get it back to 512x512.


When this is done, it's time to save! But wait! You must save it in the .TGA format, or targa, because this is the extension you'll need to make the texture!

So save it as a TGA to your desktop. Should be pretty straightforward.

http://img27.imageshack.us/img27/8523/tutcustomtextures9.png

Now then! Moving on. After this comes the sort-of tricky part.

Open up your "Texture Maker" folder, which you created earlier. In this, make a new folder called "_______stextures". Replace ________ with your name. This is where all .TGA files will be put for making into textures.

Now, with your moon texture you now have (.TGA file), place it in this new folder. Now that this is open, open up your "VTEX Area" folder in a new window. In this window, scroll down to the file named "VTEX". Ok, so here comes the hard-to-explain part. With your .TGA file, you must drag and drop it from your ______sTextures folder, into the "VTEX" file. Sounds tricky, I know. Once this is done, a command prompt window will pop up, telling you to hit a key to continue. Hit one, and bam! The texture file is made!

http://img36.imageshack.us/img36/7217/tutcustomtextures10.png
http://img27.imageshack.us/img27/6255/tutcustomtextures11.png


Go to your "Texture Folder" folder, and go to your newly made "_______sTextures" folder, which has magically appeared! You now have a shiny new .vtf (Valve Texture File) file named moon! Yay! But you're still not done!

For this to pop up in hammer, and to function properly, you need a .vmt file! (.vmt stands for Valve Material Type). To do this, go to your _______sTextures folder in the "Texture Folder" folder, and make a new notepad document (any text-editing program works). Then, enter this in:


LightmappedGeneric
{
$basetexture mytextures\Texture Name
$envmap env_cubemap
$surfaceprop brick

}

Where it says "Texture Name", replace it with the name of your texture (Moon). Then save the file as "Yourvtffilename.VMT". Make sure it is a .VMT file! Where it says "mytextures", replace it with "_______stextures", because this is where the file will be traced to when hammer looks for the custom file, so it must be named after your folder.

http://img2.imageshack.us/img2/9396/tutcustomtextures12.png

After that is saved, close those, and load up hammer, if you closed it. Open your map you're making, and click the "Toggle Texture Application" tool, on the left. Click "Browse", and type in "moon" or whatever you named your texture. It should pop up, all shiny and cool! Just apply it onto your floor, or whatever you're texturing, and voila!

http://img32.imageshack.us/img32/1898/tutcustomtextures2.png

Okay, so maybe the moon picture wasn't the greatest... but still! Now you know how to make custom textures using VTEX!

Now, next time you want to get a custom texture, you'll know just how to do it. The first time may seem lengthy, but you'll get used to doing it, and in no time, it'll be a breeze!

Good luck!


~Gen. Shadow


**Credits to 3kliksphilip for giving me some tips on this, and providing the VTEX method on youtube**

Link to his videos:
Part 1 (http://www.youtube.com/watch?v=PbEGj8kCLx4&feature=channel)
Part 2 (http://www.youtube.com/watch?v=dCwLLcyp_ZA)

SoulKeeper
25 Oct 2009, 10:06am
Very nice in depth tutorial. Very useful.

Prez
25 Oct 2009, 11:09am
Thank you. I may make one with VTFEdit if it is wanted.

Prez
25 Oct 2009, 02:42pm
Sticky? :)