.vtf export error

Apr 14, 2013
663
343
I made an overlay in photoshop, then extracted it to .vtf.
As all overlay signs, the overlay is rectangular, and it has two transperent (photoshop transperent) "lines" so it could be rectangular.

Code:
HERE:
@=opaque (actual sign)
*=transperent

************************************
************************************
@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@
************************************
************************************

The vmt is fine:
Code:
"LightmappedGeneric"
{
	"$baseTexture" "takabuschik/signs/sign_biohazard010b"
       	 "$decal" 1
	"$decalscale" 0.25
	"$alphatest" 1
 	"%keywords" "tf"
}

The problem is that in hammer, in vtfedit, and I assume that in game as well, it looks like this:
vtf010_zps69ebe72e.png

(marked what should be the edges with red)

How to make it transperent?
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
If I remember correctly, that is a result of the photoshop plugin handling transparency wrong. I would do it by making an alpha channel and exporting as TGA, then converting that to VTF with something else (vtex, vtfedit, etc).

Another reason to do this, is your color channels should actually be "filled in", that is the beige around the edge of the sign should extend beyond the visible area. Otherwise, due to compression, there will be a white bleed-over along the edge where the no-color area under the transparency is mixed with the visible area. (Same reason when you look at a model skin, everything is painted "outside the lines")
 

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,694
2,579
Making the transparency mask into an alpha channel should be enough to do the trick; the Photoshop plugin has always worked fine for me. But don't forget to export as "Compressed with Alpha" rather than just "Compressed" so it actually saves the alpha channel; that's probably what you were doing wrong before.
 

Idolon

they/them
aa
Feb 7, 2008
2,105
6,106
Another reason to do this, is your color channels should actually be "filled in", that is the beige around the edge of the sign should extend beyond the visible area. Otherwise, due to compression, there will be a white bleed-over along the edge where the no-color area under the transparency is mixed with the visible area. (Same reason when you look at a model skin, everything is painted "outside the lines")

I'd always wondered about those white bleeding edges. Thank you so much!
 

Freyja

aa
Jul 31, 2009
2,994
5,813
Making the transparency mask into an alpha channel should be enough to do the trick; the Photoshop plugin has always worked fine for me. But don't forget to export as "Compressed with Alpha" rather than just "Compressed" so it actually saves the alpha channel; that's probably what you were doing wrong before.

It's on and off for me. Sometimes it works, sometime it completely fails. Exporting to a targa is basically always safer
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
Which reminds me, I actually only use TGA for plain textures without anything fancy going on. One reason I use vtex (command line SDK tool) is it supports conversion direct from PSD, with special vtf parameters embedded in the file description field. Then if I have layers/effects/channels/whatever I can keep them intact and work from a single file.
 

wareya

L420: High Member
Jun 17, 2012
493
191
I thought the transparency bleed thing depended on whether the image editor was stupid enough to throw away the color values of adjacent transparent pixels.
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
In some cases, yeah. Whether it is the user or the program or the exporter/converter making the transparent pixels colorless, it is still the same thing.
 

Seba

DR. BIG FUCKER, PHD
aa
Jun 9, 2009
2,364
2,728
If you guys are talking about what I think you're talking about, the Clamp S/T flags fix the colored border
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
Clamp prevents the compression algorithm from considering tiled edges (and moreover, prevents the texture from tiling period) and creating edge-to-edge bleed. The problem here is a case of within-image bleed because of transparent areas.