144 ratings
Creating Distance Faded Sprays
By Jimo
I will explain how to create a distance faded spray in Team Fortress 2 which disappears the closer you get to it. For this guide you will require a few pieces of software which are listed within the guide.
Rate  
Favorite
Favorited
Unfavorite
Introduction
This guide will explain how to create a distance faded spray in Team Fortress 2 which disappears the closer you get to it.

What You Will Need
Before we get started you are going to need a few tools so you can follow along with the guide.

You will need some form of image editor. In the guide I will be using Adobe Photoshop CS5 but other versions of the program should work just fine. You can use GIMP as a free alternative to Photoshop as well. We are also going to need to download a plugin which allows us to save our work in to a DirectX image format.

Additionally we are going to need another piece of software called DirectxSDK by Microsoft which will allow us to edit our DirectX image once it's saved from Photoshop.

We will also need the Quick & Dirty Bloodlines Tools which will convert the DirectX image to a VTF.

And of course, VTFEdit (Valve Texture File Editor) which is a tool used to convert your image in to the game world. I have provided links to all of the required software below.


Getting Started
Before we start we will need a set of images we want to use. Fading sprays can hold a number of separate images so you can make the transition as gradual or as sudden as you like. Keep in mind that they still need to be one of the following resolutions.

  • 512 by 512 pixels
  • 256 by 256 pixels
  • 128 by 128 pixels

For this tutorial I will be using this image of the Haunted Halloween gift which I found on the TF2 wiki here[wiki.teamfortress.com]. The idea is that if you are far away, you will see the gift. The closer you get to it however, it will disappear from sight.

Feel free to use the same image as I do.

Creating the Far Away Image
First of all we need to go ahead and open up the image in Photoshop. To do this go to File > Open and pull up the picture of the present. We want the present to appear when you are far away, and disappear as you get closer.

With the present open, go to Image > Canvas Size and change the Height and Width to 256 by 256 pixels.



You will now end up with something like this.



Because I would like the present to appear closer to the ground when it's sprayed I'm going to adjust it so the bottom corner of the present touches the bottom of the canvas.



When we are creating fading sprays we do things slightly differently from normal. The far away image is handled differently from the one you will see when you are close up. Because the image we used is already transparent, the only thing we needed to do was change the canvas size so it matched the games size requirement.

Go to File > Save As and choose D3D/DDS (*.DDS) as the image format. You will only have this as an option if you have installed the Nvidia plugin installed. If you don't have it already you can get it here[developer.nvidia.com].



When you click on Save you will get an options box popup. The only thing you need to change from default is the top bar, and it needs to be set to "DXT5 ARGB 8bpp | interpolated alpha". Below is what it should look like.



Click on Save again and you are now done with your Far Away Image.
Creating the Close Up Image
Next we are going to create the close up image. The close up image is handled just like any other spray would be, so the use of Alpha channels is required if we are using transparency.

Because the present is going to disappear from sight, I'm simply going to create a blank canvas and make the entire thing transparent.

Open up Photoshop again and go to File > New. Make the size the same as we did for our Far Away Image, in my case, that would be 256 by 256 pixels.



Navigate to the Channels tab, this is usually located right next to Layers. If you somehow closed it you can get it back by going to Window > Channels.

With the Channels tab open click on the Create New Channel button at the bottom. Once you've clicked on that the entire canvas should turn black.



Go to File > Save As and this time you want to choose Targa (*.TGA).



You are now done with the Close Up Image.

If you would like a more in depth guide on how to create transparent sprays you can check out my complete guide on Creating Transparent Sprays below.


Using the DirectX Texture Tool
Next we need to open up the DirectX Texture Tool. If you missed the link for that you can download it here[www.microsoft.com].

With the Texture Tool open, go to File > Open and navigate to the DDS file you saved in the Far Away Image section.

Once you have the image imported it should look something like this:



The texture is split up by multiple Mipmaps. The largest is what you will see when you are closer to it. You can cycle through every Mipmap on our texture by going to View > Smaller Mip Level or View > Larger Mip Level. By default the program will open up the largest first. If you're curious you can learn more about Mipmaps through Wikipedia here[en.wikipedia.org].

Because I want to make the present disappear the closer you get to it, I'm going to import our TGA we saved in the Close Up Image section on the largest Mipmap. To do this select the largest Mipmap and go to File > Open Onto This Surface.

Your Mipmap layers should look like the following now:







The final thing we need to do in the DirectX Texture Tool is save our work. Go to File > Save As . Be sure to save it somewhere you will remember it as we will be using it in the next section.
Converting the DDS to a VTF
The next thing we need to do is open up our DDS file so we can convert it to a VTF. To do this you will need the Quick and Dirty Bloodlines Tools. You can get that for free here.

With the software open go to the Texture Tools tab located at the very top. Click on where it says Open File and open up your newly saved DDS we just created in the last section.



Click on Convert DDS to VTF. There is no need to check anything else. Below is a screenshot of my settings right before I hit convert:



Once the conversion is done you should get a confirmation in the text box at the bottom.



Navigate to the same directory you saved your DDS file, and you should now have a VTF with the same name sitting right next to it.



We're almost done!
Finishing Up With VTFEdit
If you don't have VTFEdit yet, you can download it for free here[nemesis.thewavelength.net]. For those wondering, VTF stands for Valve Texture File.

Open up VTFEdit and select File > Open and navigate to the VTF we just created with the Quick & Dirty Bloodline Tools.

This is what it looked like when I opened up mine in VTFEdit.



In order to ensure that the entire process went smoothly, we can confirm our work at this point by increasing the Mipmap value on the left hand side. Anything higher then zero should show the present, and it will get smaller the higher the value goes.



In my other tutorials I ask you to check No Mipmap under Flags on the left. In this case this need to be unchecked. You will also want to make sure you check No Level Of Detail. Below is how your flags window should look before we save our work.



Set the Mipmap value on the left back to 0.

All you need to do now is File > Save As.

You will also want to do Tools > Create VMT. Simply choose the defaults when you get the options window for this, and select Create. VMT stands for Valve Material File.
Importing Into TF2
You have now finished creating your spray, and the only thing left to do is try it out. All you need to do is paste your VTF and VMT file in to your TF2 directory. For most people this is located here:

VTF: C:/Program Files/Steam/steamapps/common/team fortress 2/tf/materials/VGUI/logos
VMT: C:/Program Files/Steam/steamapps/common/team fortress 2/tf/materials/VGUI/logos/UI

If you are missing any of those folders, simply create them.

Once you have everything in the correct directory, load up TF2 and go to Options > Multiplayer. Underneath the Spraypaint Image tab you should now see your brand new spray.

If it's not on the drop down menu you will need to choose Import Spray and navigate to it within the Steam directory. If the preview of the spray appears to be either flashing, or black, that doesn't exactly mean it's not working, you'll need to try it in game to find out.



Apply your changes and join a server, if everything was done correctly you should now be finished. Keep in mind that some servers disable sprays as part of their config.

I've created a short YouTube video showcasing how my spray turned out. Because my spray fades to nothing the closer you get to it, I had to move backwards before I started to see anything.


If you would like to download my Present Box Spray you can do so by clicking here.[jimo.co.uk]
Closing Notes
If you have any questions or comments regarding this guide please feel free to leave a comment below or get in touch with me on Steam or through my website[www.Jimo.co.uk].

You can also check out all of my other Steam Guides here.

http://steamcommunity.com/sharedfiles/filedetails/?id=121115553
http://steamcommunity.com/sharedfiles/filedetails/?id=121269706
46 Comments
< >
AvianGaming Nov 26 @ 4:27pm 
The one thing Jimo didn't mention on this guide is this. http://tfsprays.com/Create/Fading
There ya go. No hassle, just make the images and upload!
[Christmas break~ <3] Oct 8 @ 12:43am 
can you make multiple fade layers that will transition in between one another? i have an idea to make a spray that is completely invisible at long range, but when you get close to it suddenly a spy decloaks in front of you on the wall, and for it to work right it'd need to play like a gif when you get close. not just "boom. spy here."
Thu Sep 14 @ 11:09am 
how to make an animated distance fading spray with transparent background?
Can anyone suggest another than buggy "Quick & Dirty Bloodlines Tools" aka vpktool to convert dds to vtf? Please, please, please!
sp8ers Aug 25 @ 8:01pm 
@Jimo, I've tried reinstalling the complete package and restarting, I sill get the same error as BaseKillerWolf
sp8ers Aug 25 @ 7:59pm 
@Joel, Thank you so much for this. I've been trying to get the DXT tool to work on windows 8.1, but have been getting the same error as BaseKillerWolf. This site also creates the sprays with transparency. Awesome. Only feature I'd like to see implemented is using more than 2 images for fading sprays, which can be done with DXT tool
Fitne Por Jun 1 @ 6:21pm 
@Reggie well I did this all for naught then
door # May 31 @ 1:07pm 
After about 600MB of downloading, this finally worked. For one spray.
Also, the TfSprays[tfsprays.com] was down earlier, so it pisses me off now that it's back up. GG.
Joel Mar 16 @ 8:07am 
Guys, Easiest way to make a fading spray. http://tfsprays.com/Create/Fading
Jimo  [author] Mar 16 @ 12:21am 
Jewlander: I'm more familiar with Photoshop and it's the most commonly used software. You'll need to use Google to find out the equivalents in GIMP.

BaseKillerWolf: Have you tried reinstalling?