Team Fortress 2

Team Fortress 2

221 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.
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[]. 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[].

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[].

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[].

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[]. 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.[]
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[].

You can also check out all of my other Steam Guides here.
< >
Fucken Turducken Aug 24 @ 7:52am 
How do you separate the images after making the spray?
Brogrammist Jul 23 @ 9:02pm 
Thanks for the guide! However from my end, putting the VMT into /logos/UI made it so that the game didn't even register the spray. I put the the VMT in /logos/ beside the VTF and found that the game auto-generated another VMT in the /logos/UI folder after I added it into the game.

Perhaps it is this way as a result of some update in 2017? Posting this in-case others have the same issue or an explanation.
Rullisi Nov 7, 2016 @ 5:31pm 
suddenly there is a file called so I made 2 separate textures with gimp and now you suddenly have those 2 combined? wat...
ashrac -44- Aug 10, 2016 @ 5:54am 
Graru1 Aug 9, 2016 @ 12:03am 
Hey Lads and Lords, I was going to create a fading spray with more than two pictures.
Well I followed all the steps in this guide. The only difference is that a opened multiple and different .tga file onto the .dds Mipmaps. All went good I created the spray and installed it. But now when I spray it now in-game it only show the near image. So I am wondering now is it even possible? Or have I done something wrong? Or do you need to use different options when you create something like this?

Thanks for the help in near future and Great Greetings
мяFunreal Jul 9, 2016 @ 7:09am 
You do know that the Photoshop dds plugin can import pictures with all mipmaps, so the direct x tool is not needed.
NothingExpert Feb 23, 2016 @ 4:58am 
morgun mememan Sep 3, 2015 @ 3:39am 
i have also tried to run the DirectX Texture Tool as Administrator both the 32 bit version and the 64 bit version but still no luck :(

also i'm using Windows 10 so i think that's a compatibility problem

for the current time i'm gonna be using to create my sprays but i still prefer making them my self if somebody find the fix
morgun mememan Sep 3, 2015 @ 3:24am 

So i just installed DirectXSDK and when i try to open DirectX Texture Tool it give me this error:

" Unable to create Direct3D Device. Please make sure your desktop color depth is 16 or 32 bit, and that d3dref.dll is installed. "


Then i tried to check my color depth and it was 32 bit


After that i searched for d3dref.dll in the program dictionary and all i find was some files named [h1] d3dref9.pdb [/h1]


i tried to make a clean reinstall then reboot but nothing changed it seems that i miss the file [h1] d3dref.dll [/h1] so please if someone can give me the file and tell where i should put it or if there is another solution please tell me
[TDE]Footsoldier51 (Poonda Bear) Jul 13, 2015 @ 2:46pm 
Best. Spray. Ever