Team Fortress 2

Team Fortress 2

338 évaluations
Creating Distance Faded Sprays
De 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.
2
   
Récompenser
Ajouter aux favoris
Favoris
Retirer des favoris
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. 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.
http://steamcommunity.com/sharedfiles/filedetails/?id=121115553#-1

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]
68 commentaires
Aerodynamic Kerbal #savetf2 17 juin 2023 à 8h31 
What the FUCK do I do when I cant download the DirectX texture tool?!?
Skillet 13 juil. 2021 à 22h25 
how do you actually make a fading spray with spray converter tho? i've tried but it just makes two flickering images
paul elstak gaming 24 juin 2021 à 19h51 
sprays.tk no longer works, i think this is an alternative
https://rafradek.github.io/Mishcatt/
Nididak 9 févr. 2021 à 2h05 
First of all, this process is automated now (sprays.tk)
2nd of all, directx sdk is no more on official Microsoft site you have to use archive.org backup ( https://archive.org/details/dxsdk_2010 )
「 joker 」 2 mars 2020 à 0h15 
guys, all automated, just use this: sprays .tk
Murphy my Beloved 24 déc. 2019 à 11h59 
THIS IS NOW ALL 100% AUTOMATED.

HERE IS A LINK TO IT.

https://www.teamfortress.tv/45666/spraymaker5000
To make fading sprays make 5 mipmaps, make the images 512x512 and put the image you want far away in the bottom 3, and the one you want up close put that in the top 2.

to make an animated spray, add as many frames as you please, and place the images in the respective spots. Make sure the background is invisible if you want it to be transparent
Murphy my Beloved 24 déc. 2019 à 11h59 
THIS IS NOW ALL 100% AUTOMATED.

HERE IS A LINK TO IT.

https://www.teamfortress.tv/45666/spraymaker5000
To make fading sprays make 5 mipmaps, make the images 512x512 and put the image you want far away in the bottom 3, and the one you want up close put that in the top 2.

to make an animated spray, add as many frames as you please, and place the images in the respective spots. Make sure the background is invisible if you want it to be transparent
Pluck The Dragon 17 févr. 2019 à 14h15 
Both DXSDK 2008 and 2009 are outdated. I can't make my own faded sprays.
ButterBro 2 févr. 2019 à 20h44 
Well THAT was a process and a half. Thanks for doing this for us.
Joseph_AssCrack 19 nov. 2018 à 0h27 
that SDK doesnt work on win10, max to win7