Keeping Alpha(?) Info When Editting .VTF


bazooka
10-19-2005, 01:00 PM
I'm trying to edit the dod_weapons01.vtf file which has the weapon pictures for class selection menu and also the current weapon indicator on the HUD. I export it from VTFEdit as a .TGA, then edit it in the GIMP. I don't have Photoshop.

The dod_weapons01.vtf file uses a green as it's alpha color (tell me if I'm using that terminology wrong. What I mean is that it does not show up in DOD as green -- it's transparent.). Here (http://img388.imageshack.us/img388/9553/dodweapons016jt.jpg)'s the file in jpg form. I edit the file, using the exact same green as background.

I then import the file back into VTFEdit, where it asks for parameters for the file. I think this is where the problem may be...I'm not sure what to set the parameters to. I try to match what the default dod_weapons' properties are, but I don't get exactly the same results.

Anyhow, the problem is that I end up with no transparency ingame. Even more odd is that the background color isn't consistent for each weapon -- different shades of green for each one.

So, does anyone know how to set it so that the green color will remain transparent ingame after editting it?

Trp. Jed
10-19-2005, 01:27 PM
The VTF should have an alpha channel - check the channels in GIMP and you should see it. White in an alpha channel means opaque, black transparent and the grey shades between various levels of transparency.

To retain the alpha channel in a VTF you have to save as DXT1a, DXT3 or DXT5. DXT1a uses one but alpha so you only get black/white transparency with no subtle levels. DXT3 and DXT5 retain the levels.

bazooka
10-19-2005, 02:15 PM
Well, there's no alpha channel visible in GIMP. So I added one, then Layer>Transparency>Color to Alpha. Chose the green. Doesn't do exactly what's desired though. I don't know what each of the channels is supposed to look like at this point, but there certainly isn't any of the green (until I open the image in some other program). Made it into a VTF. Loaded it ingame. Good news is the background green is gone. Bad news is the weapons themselves are a bit transparent. :confused:

Edit: Learned that I can adjust the alpha threshold. Unfortunately, that just gives me weapon images with a greenish tint. I just need the default alpha channel...wish GIMP would recognize it.

Trp. Jed
10-19-2005, 02:39 PM
Well I exported the VTF from VTFEdit myself as a TGA and opened it up in photoshop and its got an alpha channel just fine so I don't know what exactly whats going wrong with GIMP reading it.

Basically if you can sort out your alpha channel generation you'll be O.K.

Note the original was saved as DXT5 which is what you you should use but also don't forget to set the "No MipMap" and "No Level of Detail" flags as its a HUD sprite and set "Nice Filtering"

bazooka
10-19-2005, 02:46 PM
Thanks! I'll try a different program. Yea, I did have those flags set, but thanks for mentioning it.

Someth|ngW|cked
10-22-2005, 03:40 PM
Get PS Elements, i believe its a free download and the PS VTF plugin should work with it

INsane_dod
10-30-2005, 01:59 AM
Originally posted by Someth|ngW|cked
Get PS Elements, i believe its a free download and the PS VTF plugin should work with it

Can you work with alpha channels in PhotoShop Elements 4 ?

My son has PS Elements 2 and it doesn't seem to work with alpha channels.

Anyone know? sick of him on my PC :)

bazooka
10-30-2005, 03:14 AM
In PS Elements, you can select the alpha channel by Select>Load Selection and choosing the channel. I don't know much beyond that.

Trp. Jed
10-30-2005, 05:11 AM
Look in the "Channels" tab. You need to make an alpha channel first for it to appear, there isn't one by default. You can do this by making a selection and saving it as a new channel or pressing the "new channel" icon at the bottom of the channels toolbar.

INsane_dod
10-30-2005, 05:56 AM
I can load it ok.. but there is no channels tab :)

Oh well might give the PS Elements 4 demo a go see if it's different to ver 2.

Thanks.

Watchtower
10-30-2005, 01:21 PM
if you dont see a tab anywhere, go to "window" --> "channels"

Pretty sure that would be there.

INsane_dod
11-02-2005, 04:22 AM
Nup, definitely not there in PS Elements 3 and 2.

Very easy to find in Photoshop CS... and the Gimp, elements is a no go for channels info.

Cpl. Entek
11-11-2005, 06:19 AM
Dont suppose anyone knows how to retain the alpha channel info for Paintshop Pro 8?
Dont have access to Photoshop, been tryin to do custom xhairs for a little while now and i can get them ingame with no transparency.

Using VTFTOOl, i can extract a custom xhair to a tga (no alpha info) edit it, and re-import into game again - with solid color background.

I can add a rastar layer or vertex layer in psp8 - and the crosshair shows ingame as a square which is transparent all over with a faded black bar at top - no xhair in it :S

Just need some kinda tutorial or brief explanation of how to get the alpha info to stay when converting it through all the proggys.

Day of Defeat Forum Archive created by Neil Jedrzejewski.

This in an partial archive of the old Day of Defeat forums orignally hosted by Valve Software LLC.
Material has been archived for the purpose of creating a knowledge base from messages posted between 2003 and 2008.