How to make high quality sprays for Source games.

Don't know how to get out of spawn? HLSS plays sounds really slowly? Or you need a dispenser? Come here!

Postby DrJones » Mon Oct 26, 2009 9:04 pm

This short tutorial is an explanation how to make transparent sprays for all Source games that support sprays.

EDIT 9 Sep 2013: Updated all image links to a new location as the old ones were no longer available.

UPDATE NOTE: If you know what you're doing, you can also use transparent (alpha channel) PNG images! Since this tutorial was made, TF2 gained support for larger 512x512 images, that being the maximum size allowed today (2013). This makes the sprays larger and allows for more detail. The creation process is still the same, however.

If you wish to make a non-transparent spray, you can skip steps 9 and 10 when you get to them and just continue with step 11.

In this tutorial Paint.NET is used as the graphics program because it is free and easy to use. Most of the other editors have the same features that Paint.NET has and more, and can easily be used with this tutorial.

Things needed:
1. The image you want to make into a spray.
2. A graphics editor.
You can get several free ones that are suitable, such as Paint.NET, or use a commercial editor that you might have such as Paint Shop Pro or Photoshop (note: If using Photoshop, the required free Targa plug-in is here)
3. VTFEdit, a program by Nem that allows you to create the needed VMT and VTF files. Get it here: http://nemesis.thewavelength.net/index.php?p=41


Preparing your image:

1. Open up the image in Paint.NET
Image

2. This image is 581 by 746 pixels, thusly not a perfect box shape. All Source games demand that sprays are sized in powers of two with a maximum of 512. So, we need to make sure that even shrunken down, we will get a good looking image of 256 by 256 pixels. (NOTE: You can also make a 512x512 image, see note at the beginning.)
Image

3. Go to Image and choose Resize.
Image

4.Because the image is taller than it is wide, we enter 256 as the Height and let Paint.NET calculate the width for us, which results in 199. Make sure you choose Best Quality in Resampling.
Image

Now the image is much smaller. You can see that Paint.NET lists it as a 199 by 256 image now.
Image

5. Now we need to make it a perfect 256 by 256. To do this, go to Image and choose Canvas Size.
Image

6. Here, type in 256 for Height and press OK.
Image

Now you will see the image gained borders on the left and right.
Image

7. Click on the Magic Wand tool.
Image

Adjust Tolerance to about 7%
Image

While holding Shift, click on the two borders. They will be selected like in the image below.
Image

8. Next, go to Edit and choose Invert Selection.
Image

This will select the picture precisely and leave the borders unselected.
Image

9. This part is very Paint.NET specific, but might work in other editors as well.
Click on Edit and choose Copy.
Image

Then, click on Edit again and choose Paste Into New Layer.
Image

The image won't change visually, but it will gain a new Layer.
Image
Layers are quite a straightforward concept. Imagine cutting an onion into thin slices. So thin you can see through them. If you put something under such a thin onion slice, you can see what's under it. Same applies for Layers, although the effect of transparency can be controlled greatly.

10. In the Layer window, click on the Background layer, then press CTRL+A to select the entire background. Then, press DEL on your keyboard.
ImageImage
With the background deleted, our copied picture from step 9 floats ontop of an empty background, creating the transparent effect needed for the game.

At this point it is a good idea to save the image as the editor's native format for backup purposes, you can skip this step if you want.

11. Now it's time to save the image into a format that VTFEdit will understand. Go to File and click on Save.
Image
Choose a name for your spray, choose TGA as format and click on Save.

12. When you click on Save, Paint.NET will show you this window. Here is where the make-or-break settings happen for the TGA format.
Choose 24-bit and uncheck Compress (RLE).
Image

Choose Flatten when Paint.NET asks you. This is needed because the TGA format does not support layers. However, the transparency will be converted so that it can be used later.
Image

13. You're done with editing your image. It's now ready to be made into a spray with VTFEdit.
-Jonesy
Steam: DrJones
Live: Bloobunni
FA and LJ: jonesybunny
Image
User avatar
DrJones
 
Posts: 308
Joined: Fri Aug 08, 2008 9:33 pm

Postby DrJones » Mon Oct 26, 2009 9:04 pm

And now for part 2 of this tutorial: How to convert your TGA image into a proper spray.

Edit 9 Sep 2013: Updated all image links to a new location as the old ones were no longer available.

1. Open up VTFEdit and click on File and then Import.
Image
Choose the .TGA file you made earlier.

2. You will get a screen with several options. Set them exactly as you see in the screenshots below.
Image
Image

When you've set everything, click on OK.

The image will now show up in VTFEdit, probably with black borders. This is normal.

3. Now, in the flags area, scroll down and choose No Level Of Detail. This will keep the spray at a high resolution even if you have low graphics settings in your Source game, making them easy to view.
Image

4. Click on Options and check Auto Create VMT File.
Image

5. Now click on File and Save and give the spray a name, then click on Save.
Image

You're done with VTFEdit!
-Jonesy
Steam: DrJones
Live: Bloobunni
FA and LJ: jonesybunny
Image
User avatar
DrJones
 
Posts: 308
Joined: Fri Aug 08, 2008 9:33 pm

Postby DrJones » Mon Oct 26, 2009 9:04 pm

Since this is mostly a TF2 forum, I'll use TF2 as an example on how to put the sprays into the game properly.

EDIT 9 Sep 2013: Updated all image links to a new location as the old ones were no longer available. Also updated the path to the materials folder as this has changed when Valve introduced SteamPipe.

1. Grab the two files VTFEdit created and copy them to your TF2 Materials folder.
This is usually located at \Steam\steamapps\common\Team Fortress 2\tf\materials\VGUI\logos
Image

2. Start TF2 and click on Options.
Image

3. Go to the Multiplayer tab and look for your spray in the list. You do NOT need to Import the spray from the game because you already did that in step 1.
Image
This is where you can see if your spray works as intended. You can see the game recognizes the transparency.

4. Click on OK to use the spray and join a game!
Image


Hope this tutorial was useful to you. If you have any questions, feel free to ask.
-Jonesy
Steam: DrJones
Live: Bloobunni
FA and LJ: jonesybunny
Image
User avatar
DrJones
 
Posts: 308
Joined: Fri Aug 08, 2008 9:33 pm

Postby NikkyVix » Mon Oct 26, 2009 9:43 pm

This one 'ere gets my sticky of approval!
User avatar
NikkyVix
Site Admin
 
Posts: 1296
Joined: Thu Aug 07, 2008 9:14 pm
Location: Behind a doorway. Setting traps.

Postby STrRedWolf » Mon Oct 26, 2009 10:53 pm

I've found that you do not need to run it through VFEdit; just pick the TGA for the spray in TF2, and it works beautifully.
Steam on Linux Native: "PENGUIN TOUCH MY GUN!" "THAT PENGUIN IS A SPY!"
"This is going to be a real piece of piss, you bloody Steam Linux player!"
User avatar
STrRedWolf
 
Posts: 413
Joined: Fri Aug 08, 2008 9:47 pm

Postby NikkyVix » Tue Oct 27, 2009 1:31 am

STrRedWolf wrote:I've found that you do not need to run it through VFEdit; just pick the TGA for the spray in TF2, and it works beautifully.


I've done both methods, particularly the VTF plug-in before VTF edit.

Quality and versatility-wise, VTF Edit is the preferred output.

What's more, it's Jonesy's thread and Jonesy's method; No chopblocking someone else's tutorial. :p
User avatar
NikkyVix
Site Admin
 
Posts: 1296
Joined: Thu Aug 07, 2008 9:14 pm
Location: Behind a doorway. Setting traps.

Postby Tehrasha » Tue Oct 27, 2009 1:48 am

Encouraging the VTFEdit method also allows for the next step.... animated sprays!

Image

Something that cannot be done with the 'import' method.
Image
Everything I've learned in TF2, I've learned from watching Doom kick my ass!
User avatar
Tehrasha
 
Posts: 218
Joined: Tue Dec 16, 2008 11:37 pm
Location: Iowa

Postby DrJones » Tue Oct 27, 2009 8:00 am

STrRedWolf wrote:I've found that you do not need to run it through VFEdit; just pick the TGA for the spray in TF2, and it works beautifully.


Running it through VTFEdit with the No Level Of Detail option preserves quality of the image, even if people have low graphics settings. This prevents washed out and blurry sprays. The game doesn't do this on import, hence why the VTFEdit method is preferred.
-Jonesy
Steam: DrJones
Live: Bloobunni
FA and LJ: jonesybunny
Image
User avatar
DrJones
 
Posts: 308
Joined: Fri Aug 08, 2008 9:33 pm

Postby Makaze » Wed Nov 25, 2009 9:43 pm

Tehrasha wrote:Encouraging the VTFEdit method also allows for the next step.... animated sprays!

Image

Something that cannot be done with the 'import' method.



So will there be a tutorial for animated sprays?
Image

Image
User avatar
Makaze
 
Posts: 243
Joined: Wed Oct 15, 2008 6:52 am
Location: Merriam, Kansas

Postby Tehrasha » Fri Dec 04, 2009 1:32 am

Makaze wrote:So will there be a tutorial for animated sprays?


Seriously, the only difference is that during the 'Import' you select multiple image files. Each file == one frame of the animation.
Keep in mind that the max-file-size is still the same as it is for a single image, so optimization of the individual frames is very important.

Now we need to have someone tell how to do the sprays that fade as you get closer.
Image
Everything I've learned in TF2, I've learned from watching Doom kick my ass!
User avatar
Tehrasha
 
Posts: 218
Joined: Tue Dec 16, 2008 11:37 pm
Location: Iowa

Next

Return to Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron