Alpha Maps not working with custom model

Adamtehgreat

Newbie
Joined
Oct 20, 2004
Messages
61
Reaction score
0
Hey all. I have just spent the last day trying to get alpha maps working with a tree model I have created for my map.

AAAAnnnnyway, I created a 24 bit TGA with Alpha Channel, run vtex with the command "vtex.exe -mkdir -shader C:\Program Files\Valve\Steam\SteamApps\XXXXXX\sourcesdk_content\cstrike\materialsrc\testtexture\tree.tga" and then compiled the map with

"C:\Program Files\Valve\Steam\SteamApps\XXXXXX\sourcesdk\bin\studiomdl.exe" "C:\Program Files\Valve\Steam\SteamApps\XXXXXX\sourcesdk_content\cstrike\modelsrc\my_custom_models\jtree.qc"

To my Knowledge the tree.vmt file seems correct:
"VertexLitGeneric" { "$basetexture" "testtexture/tree" }

qc file:

// Output .MDL
$modelname custom_models/jtree.mdl

// refers to "D:\Program Files\Valve\Steam\SteamApps\XXXXXX\sourcesdk_content\cstrike\materialsrc\"
// this will be saying where yer texture is and in it should be in "sourcesdk_content\cstrike\materialsrc\models\
$cdmaterials testtexture

$staticprop

$scale 1.0

// it's just ./(name of model)
$body studio "./jtree"

// sequences: all sequences are in $cd must have an animation sequence if theres animation or not
$sequence idle "jtree" loop fps 15

// you can make a seperate model for colisions if it's a realy complicated model and put name of it here
// otherwise just use the same model
$collisionmodel "jtree.smd"
{
// Mass in kilograms for when model is used as a prop_phys
$Mass 400
$concave
}


Is there something wrong with my commands? Am I missing Alpha Map scripting commands? (are there any?) The model is all 1 static mesh, with just this texture map.

pstga.jpg

TGA and Alpha Channels

hammer-alpha.jpg

What it looks like in Hammer (and ingame :frown: )​
 
try making it a 32-bit tga? (I don't know for sure though)
 
tried using 32 bit. Didn't seem to fix anything. I was told to use 24 bit targa in the Tutorial, but I'm presuming 32 bit is fine also.
Cheers anyway man.
 
The 16 extra bits are for the Alpha channel so you HAVE TO save it as a 32 bits tga if you want transparency. And like thereisaspoon said, to tell the engine to use that alpha channel on this texture you must specify it in the vmt with the line $translucent 1. It works, I did it for a lantern I modeled.
 
Woot! Thanks alot guys! Now to go back and make a propper texture ... ;)
 
Back
Top