How to create a fading spray

dRastic1337

Forum Fiend
Joined
Mar 11, 2011
Messages
583
I searched for something like this on the forums, but no results turned up, so I thought I'd write a tutorial on...

How to Create a Fading Spray​

A fading spray is, as the name implies, a spray that fades between two or more images. You see one image when close to the spray, and other images when you move away from it. So far I've only tested this in Counter-Strike: Source, but I'm sure they work in other Source games as well.

I think that covers about everything. Let's get on to the tutorial!

Step 1: Gather your tools

There are several programs that we will need in order to create a fading spray. Please download and install (if required) all of the following before continuing on with the tutorial.

Paint.NET
DirectX Texture Tool, which can be found in the DirectX Software Development Kit
VPKTool.exe

Step 2: Gather and prepare your images

Now that we have all of our programs ready to go, let's choose some images for our spray. You can use whatever images you like.

a. Open your images in Paint.NET.

We must now resize them, since Source games restrict sprays to 256x256-pixel images.

b. Press Ctrl+R to open the Resize dialog box.
c. Make sure the "Maintain aspect ratio" check box is checked.
d. Look at the width and height. Change whichever is larger to 256 (unless the number is dramatically smaller than 256 [200 or less]; you may choose to skip this step, unless you want your spray to look blurry).
e. Click OK.


Now our image is sized correctly one way, but it's still not 256x256. Let's fix that really fast.

f. Press Ctrl+Shift+R to open the Canvas Size dialog box.
g. Make sure the "Maintain aspect ratio" check box is NOT checked.
h. Under the Anchor section, make sure Middle is selected
(you can change this if you like, but I prefer Middle).
i. Replace the width or height that is not 256 with 256.

Now our image is correctly sized. You'll probably see white bars at the top and bottom of the image. You can leave these if you'd like, but I prefer to make them transparent so that they don't show up on the spray. Let's do that now.

j. Click on the Magic Wand tool in the Tools window (or just press S).
k. Next to Tolerance (near the top of the window), make sure the number is set to 0%.
l. Click on the top white bar; hold Ctrl and click on the bottom white bar.
m. Press Delete.
n. Repeat steps b through m for your other image or images.


Our images are ready to go! Now we just have to save them.

o. Go to File > Save As... (or press Ctrl+Shift+S).
p. Choose a location on your computer that is easy for you to find.
q. Next to Save as type:, select DirectDraw Surface (DDS) (*.dds)
r. Name the image something that you can easily identify, such as fadingspray1.dds.
s. Click Save.


Now the Save Configuration window has popped up.

t. Use the following settings to save your image with:
- FileFormat: DXT5 (Interpolated Alpha)
- CompressorType: Cluster fit (Slow/HQ)
- ErrorMetric: Uniform
- Weight Color By Alpha: NOT checked
- Generate Mip Maps: checked
- Choose Super Sampling from the drop-down box.
u. Click OK.
v. Repeat steps o through u for your other image or images.


You may now close Paint.NET.

Step 3: Combine the images into a single DDS file

Now that our images have been saved as DDS files, we can combine them into one DDS file so that we can convert them to a single, fading spray.

a. Open DirectX Texture Tool.
b. Go to File > Open... (or press Ctrl+O).
c. Select the DDS file containing the image that you would like to have appear when you are distant from the spray.
d. Go to File > Open Onto This Surface....
e. Select the DDS file containing the image that you would like to have appear when you are near the spray.
f. Repeat steps d and e for any other images that you would like to use with the spray.


The first image should now be replaced by the second image. Press Page Down and Page Up to see that the images change.

g. Go to File > Save as....
h. Choose a location to save the file that is easy for you to get to.
i. Choose a file name that is easy for you to identify, such as fadingspray_final.dds.
j. Click Save.


You may now close DirectX Texture Tool.

Step 4: Convert the DDS file to a VTF (spray) file

Now that our two DDS files have been combined, we can convert them to a file that can be used as a spray in Source games.

a. Open VPKTool.exe.
b. Click on the Texture tools tab.
c. Click on Open file and locate the single DDS file that you just saved.
d. Click Convert DDS to VTF.


The converted VTF has been saved in the same location that the single DDS file was saved in.

You may now close VPKTool.

Step 5: Move the spray file to the appropriate folder

This step may not be necessary, but in my experiences, I have problems if I do omit this step. It does not take long and I highly recommend doing it.

a. Open Windows Explorer.
b. Navigate to the location where your new VTF file is located.
c. Open a new Windows Explorer window.
d. Navigate to C:/Program Files/Steam/steamapps/YOUR_USER_NAME/counter-strike source/cstrike/materials/vgui/logos in the new Explorer window.
e. Click and drag the VTF file to the logos folder.


Now all you have to do is open up Counter-Strike: Source and select the spray that you just saved in the logos folder. Of course, if you're trying to do this in a different Source game, just move the VTF file into the appropriate folder.

I only learned how to create fading sprays a couple of days ago, so I don't have a whole lot of experience, and it's possible that I could have made a mistake or skipped a vital step on accident, so if you experience any problems, feel free to post a reply to this thread or PM me.

Also, if you'd like a fading spray, but don't want to bother downloading the tools or doing it yourself, feel free to PM me with your images, and I'll do my best to create a fading spray for you. :)

Have fun!

dRastic
 
Last edited:
Too many words not enough pictures! Nice tutorial though.
 
Sorry about the no-pictures thing. :P I'll definitely add some when I find the time! Thanks for all of the positive feedback so far, guys. :)
 

Latest posts

Back
Top