The idea behind colourable textures is pretty simple, it's just an alpha mask where visible parts (white) can be coloured and invisible parts (black) keep their original colour. Both .VTF and .PNG (up to 1K) textures support alpha masks.
Below you'll find a tutorial on how to make such texture using Paint.NET
Before you start you'll have to download some tools.
Paint.NET - free image editing software
Paint.NET VTF Plug-in - VTF file support for Paint.NET
Paint.NET Alpha Mask Import Plug-in - lets you use any image as an alpha mask.
First, download Paint.NET and install it following the instructions on screen. Once done, you will have to install downloaded plug-ins. Head over to your installation folder, by default C:\Program Files\Paint.NET
, then:
..\Paint.NET\FileTypes\
..\Paint.NET\Effects\
Once that's done you can start working on your texture.
For this tutorial I'll be using in-game .VTF textures but you can follow the same steps for .PNG files.
File
> Open
and select your file or drag & drop your file onto the program window and select Open
. Since there is no way to edit existing alpha channel data (or I don't know about it) we'll have to reset all alpha information.
Effects
> Alpha Mask
, uncheck Paste from Clipboard
and press OK
. That should leave you with the original non-transparent image. At this point you're free to paint your own alpha mask. Because an alpha mask is fully white by default we only need to add the black (non-colourable) data.
Press F7
to open the layers panel and add a new layer, then press F5
to open the tools panel and F4
to open the colour palette.
Pick the Paintbrush tool and set the colour to black.
Now your goal is to cover everything that you do NOT want to be colourable in black (on the new layer). Once you're done:
Ctrl
+ A
to select the entire black layer.Ctrl
+ C
to copy it to clipboard.Effects
> Alpha Mask
, check Paste from Clipboard
and press OK
.Now all the black parts should become transparent. That's it, your alpha mask is done.
File
> Save as
Save
OK
File
> Save as
Save
DXT5
and click OK
Upload your texture and be happy. :)
A quick example on how to use an colourable texture in PAC. I decided to make colourable pants for Alyx.
models/player/alyx.mdl
in my case)material override
to the material that you want to replace (plyr_sheet
in my case)envmap
fieldbasetexture
fieldtint by base alpha
color2
to whatever colour you wantDownload this example: colourable_texture.txt
Textures can't be colourable and transparent at the same time.