Source SDK

Source SDK

Nexo Jul 13, 2014 @ 10:04am
Custom overlays
I tried everything I know, but I'm unable to create custom overlays with a transparent background. No matter what I do, it all ends up with a black square instead of the overlay ingame.

I think I have to define an alpha channel for the background. I tried this with PhotoShop, but as I usually do not use this program for my graphic work, and as I don't really know what I'm doing concerning alpha channels, I am quite lost. Maybe I also messed something up with the flags in VTFEdit.

Could anyone give me a short tutorial on how to define an alpha channel for a picture background and transform it to VTF?

Thanks, newnexo
< >
Showing 1-6 of 6 comments
The easier way to make transparent textures is to save the pictures as .png, the only type preserving the alpha channel. Of course, if you want to write some words it will be sufficient write them in a new image with transparent background, if you want a picture you must select it in the original photo, following exactly the contour, copy and paste in a new transparent image. Save as .png, in allowed size (512x512, 256x256 etc.). Import your .png in VtEdit, and the game is done. :) You don't need Photoshop, Paint is more than sufficient...
Last edited by [B.n.B] AlcyToronto; Jul 13, 2014 @ 3:40pm
Nexo Jul 25, 2014 @ 5:50am 
That's exactly the thing that does NOT work! I usually create my graphics with Fireworks, as its proprietary format is PNG. I create a new 512 x 512 file with transparent background and a text and save it as PNG. After creating the VTF with VTFEdit (are we speaking of the same program?) and putting it on a map's surface as an overlay, it still appears opaque with a white background. Maybe there is something with the VTFEdit flags I have to pay attention to?
Yes, we are talking of the same program, the F was lost in typing, sorry. I never check any flag in the vtf, you probably must correct your vmt, giving it translucency. This is a typical VMT file, usable also as decal:

"LightmappedGeneric"
{
"$basetexture" "your folder/eventual subfolder/vtf name"
"$translucent" 1
"$decal" "1"
"$decalscale" "0.25"
}

Replacing "LightmappedGeneric" with "UnlitGeneric" you'll have a texture shining in the dark.

You may also create other VMT's of the same VTF changing only the decalscale, to have available decals with different size. No problem using them as overlays, being these stretchable directly in Hammer. I hope this can help you, cheers.
Aids 1/5 Jul 26, 2014 @ 2:55am 
Hi, so heres the deal
you create your transparent image in photoshop, or GIMP doesnt matter (Save as .png)
Open VTFEdit( go to options and check autocreate VMT File), go File > Import; find your image, then go to Save as, and save it in your materials folder or where ever it

Go into your folder, Right click on the VMT File > Edit,
You will see this:

"LightmappedGeneric" { "$basetexture" "your folder/vtf name" }

Now add $translucent 1

"LightmappedGeneric" { "$basetexture" "your folder/vtf name" $translucent 1 }

NOTE NOTE NOTE
The transparent texture in VTF will appear WEIRD,but dont worry
The texture in HAMMER will appear WEIRD, but when you place it as a block it should work fine

IF you are creating a DECAL your code should look like this

"LightmappedGeneric" { "$basetexture" "your folder/vtf name" "$translucent" 1 "$decal" "1" "$decalscale" "0.25" }


Let me know if i helped
If you want to make it easier, add me on steam and i will help you for sure.
Last edited by Aids 1/5; Jul 26, 2014 @ 2:57am
...not so different from what I had said... :)
Nexo Aug 8, 2014 @ 3:01am 
Sorry for the delay ... that did the trick! Thank you, Alcy and syN !
< >
Showing 1-6 of 6 comments
Per page: 1530 50

Date Posted: Jul 13, 2014 @ 10:04am
Posts: 6