Contagion
Mad Filter May 14, 2015 @ 6:21am
Custom decals in hammer editor texture browser.
Does someone know which file format the hammer editor use for custom decals with transparency? It works with png and tga but it looks ugly in the texture browser. I haven't tested the tga with an alpha mask yet. It looks like a lot of work so I think it's better to ask someone first who know this stuff.
< >
Showing 1-7 of 7 comments
Darb Dude May 14, 2015 @ 12:16pm 
I have a decal with masked transparency (a cutout sign).
the alpha channel in your editing program (Photoshop,GIMP,etc) hold the key information the shader needs. Create your cutout in black and white, or apply a variety of different strengths with different values of grey ranging from 0-255. Save the image after satisfied with the base and alpha layer. Make sure the layers are checked visible, and export it(save as) a vtf directly from Photoshop, or GIMP. I use Photoshop CS2, its free and allows me to export vtfs with different compression and settings. I recall my custom decals looking warped in the texture browser, and lower quality once placed in the level, but they appeared fine ingame.

vmt info

"lightmappedgeneric"
{
"$basetexture" "filepath"
"$decal" "1"
"$translucent" 1
}

Rectus May 14, 2015 @ 12:21pm 
I usually use tga for importing, at least for Photoshop you can get better results by putting the transparency in an alpha mask, and extending the decal colors over the transparent area will improve the edges. Also make sure to scale the image to powers of 2 in the image editor.

What kind of quality problems do the decals have?
Rectus May 14, 2015 @ 12:27pm 
Also, for some simple decals like graffiti, you can use the DecalModulate shader instead with neutral grey areas as transparent, without any alpha channel at all.
Mad Filter May 14, 2015 @ 1:11pm 
Hi Darb Dude and Rectus! Thx for the help :) I'm using adobe photoshop for this and tested it with png and tga. It is a quick and dirty solution but it works fine ingame. The only problem is that it looks ugly in the texture browser. Well, it look like this[i274.photobucket.com]

I want it to look like on the left side. So I have to create a black/white alpha mask after all, ok. Will look into the DecalModulate first! Thx guys :3
Last edited by Mad Filter; May 14, 2015 @ 1:28pm
Mad Filter May 14, 2015 @ 1:17pm 
Originally posted by Rectus:
Also, for some simple decals like graffiti, you can use the DecalModulate shader instead with neutral grey areas as transparent, without any alpha channel at all.

I saw a lot of decals from Contagion with grey background. Does it means that most of them are using the DecalModulate?

@Update: Ok, I looked into it and some of them are. There are even some with yellow backgrounds but still have transparency. How did they do that? O.o Is there a way to change the background color? Just curious :P
Last edited by Mad Filter; May 14, 2015 @ 1:32pm
Rectus May 15, 2015 @ 12:34am 
Originally posted by CCL sama:
Hi Darb Dude and Rectus! Thx for the help :) I'm using adobe photoshop for this and tested it with png and tga. It is a quick and dirty solution but it works fine ingame. The only problem is that it looks ugly in the texture browser. Well, it look like this[i274.photobucket.com]

The white parts are from the PNG compression removing areas that are completely transparent to save space. Using TGA or directly converting with a Photoshop plugin will help with that.



Originally posted by CCL sama:
@Update: Ok, I looked into it and some of them are. There are even some with yellow backgrounds but still have transparency. How did they do that? O.o Is there a way to change the background color? Just curious :P

Hmm, I'm not sure how a yellow background would work. The DecalModulate shader works by darkening or lightening the texture behind it, so the more difference from the neutral grey, the less transparent it becomes.
Mad Filter May 15, 2015 @ 3:12am 
The DecalModulate shader seems to be very useful! Thx again Rectus :)
< >
Showing 1-7 of 7 comments
Per page: 1530 50