Custom Overlay???

Avatar
JoeyGuy917
146 Posts
Posted Nov 29, 2013
I have two requests.

1) Can someone tell me how to create a custom overlay???
2) If someone does, can you please explain it well, I don't think I'm too good with the stuff that I've looked up for this. topic.

Also, I should mention*, I have tried, but it ended up black in the game. Purple and black in the hammer editor.

Advertisement
Registered users don’t see ads! Register now!
Avatar
Arachnaphob
412 Posts
Posted Nov 29, 2013
Replied 59 minutes later

First, you will need an application that can save images with transparency. If you have photoshop, great. Otherwise, try GIMP. It's free, and is very powerful.

Link to GIMP:

http://www.gimp.org/

Next, open VTFedit and then open your image. Form there, save it as a VTF file in the folder C:/program files (sometimes 'program files (86)')/steam/steamapps/common/Portal 2/portal2/materials/(custom folder name).

Finally, in VTFedit, click File>New and then you should see some text area. replace whatever's in there with
"LightmappedGeneric"

{
   "$basetexture" "[Folder]\[overlayname]"
   "$decal" 1
   "$decalscale" 0.25
   "$translucent" 1
}

(I probably screwed something up in that code because I copy/pasted that from a Counter-Strike forum. It works for me, though.)

Under $basetexture, change [folder] to the folder you created and [overlayname] to the name of the .VTF. Save that as a .VMT in the same folder as your texture and you should be good to go! Be sure to Pack your texture into the BSP before releasing the map, though.

EDIT: Oops, Need to put a link to VTFedit. http://nemesis.thewavelength.net/index.php?c=178

Avatar
JoeyGuy917
146 Posts
Posted Nov 30, 2013
Replied 10 hours later
If I have transparency in my picture, should it be coming up black (the transparent parts) in VTFedit?
Avatar
Lpfreaky90
2,842 Posts
Posted Nov 30, 2013
Replied 18 minutes later

JoeyGuy917 wrote:
If I have transparency in my picture, should it be coming up black (the transparent parts) in VTFedit?

yep

Avatar
JoeyGuy917
146 Posts
Posted Nov 30, 2013
Replied 1 hour later
Okay, now in hammer it shows up white, but in game it is still black. Any help?

Edit: I should say, in the hammer 3d view it shows up white. In the texture selection window it has the actual texture, and in game it is still black.

Avatar
Gemarakup
1,183 Posts
Posted Nov 30, 2013
Replied 2 hours later
What about the LightMap generic? Aren't you meant to add that to the VMT too?
Avatar
JoeyGuy917
146 Posts
Posted Nov 30, 2013
Replied 2 hours later
How/where would I add it into the vmt?
Avatar
Lpfreaky90
2,842 Posts
Posted Nov 30, 2013
Replied 1 hour later

JoeyGuy917 wrote:
How/where would I add it into the vmt?

before the {

Avatar
JoeyGuy917
146 Posts
Posted Nov 30, 2013
Replied 5 minutes later
Should this be what I have in the VMF

"LightmappedGeneric"
{
   "$basetexture" "[CustomFolder]\[Pig]"
   "$decal" 1
   "$decalscale" 0.25
   "$translucent" 1
}

Should I have the quotes around "LightmappedGeneric? Or should I have something else there?

Avatar
Arachnaphob
412 Posts
Posted Nov 30, 2013
Replied 4 minutes later
The problem is probably the fact I copied a decal tutorial from a Counter Strike forum. Maybe, because why not, set $translucent to 0 instead of 1

Avatar
JoeyGuy917
146 Posts
Posted Nov 30, 2013
Replied 8 minutes later

Quote:
set $translucent to 0 instead of 1

Nope, still not working, and LOL at that picture

Avatar
Ultiman9711
118 Posts
Posted Nov 30, 2013
Replied 2 hours later

Just use the "Auto-Create Vmt" feature in vtfedit, and add the line $translucent 1 to the area in between the { and }.

Also, I'm not sure if you are using translucency right with the image. You need to have a completely blank bottom layer, and everything else that is opaque should be on top. Saving as a .tga works best, in my opinion.

Finally, in order to make it look right, make sure that "Correct Gamma" in the "Advanced" tab when you import the image to VtfEdit is turned off[I've found that images can become washed out if that's used].

Here's a sample vmt that works fine as an overlay:

"LightmappedGeneric"
{
   "$basetexture" "[path]"
   $translucent 1
}

Avatar
JoeyGuy917
146 Posts
Posted Nov 30, 2013
Replied 51 minutes later

Quote:
Also, I'm not sure if you are using translucency right with the image. You need to have a completely blank bottom layer, and everything else that is opaque should be on top. Saving as a .tga works best, in my opinion.

Can you please show me an example of this. I am drawing a blank here.

Avatar
Skotty
671 Posts
Posted Dec 01, 2013
Replied 12 hours later
For having transparency, you need to add an alpha-channel to your picture and save it as 32bit .tga file.
How to do this? Probably use Google, im absolutely sure it's explained somewhere.
Avatar
Arachnaphob
412 Posts
Posted Dec 01, 2013
Replied 7 hours later
Or use a .png file. They work fine for me.
Avatar
Ultiman9711
118 Posts
Posted Dec 01, 2013
Replied 10 minutes later

Arachnaphob wrote:
Or use a .png file. They work fine for me.

Maybe for overlays without transparency; as far as I know .png can't save alpha.

JoeyGuy917 wrote:
Can you please show me an example of this. I am drawing a blank here.

If you are using paint.net [be careful when downloading - the website is getpaint.net and there is many
ads with download buttons on it
], it's simply a matter of having the very bottom layer completely empty; everything else is on top. Then, you save as a .tga, not a regular image format.

If you want, I can pm you the installer file for paint.net to save you the hassle of finding the right download button.

Avatar
Arachnaphob
412 Posts
Posted Dec 01, 2013
Replied 7 minutes later

Ultiman9711 wrote:
Arachnaphob wrote:

Or use a .png file. They work fine for me.

Maybe for overlays without transparency; as far as I know .png can't save alpha.

They do support transparency, but I would go with the tga for now.

Advertisement
Registered users don’t see ads! Register now!
Avatar
Skotty
671 Posts
Posted Dec 01, 2013
Replied 1 hour later
Their transparency is different to .tga's. And VTF Edit needs the special Alpha channel provided by .tga.