Alright, so I'm trying to create a few items for TF2, but I'm currently encountering a problem with the material of one. The one I'm having trouble with consists of a diffuse map with an alpha channel (.vtf, 512x512) and a specular map (grayscale, .vtf), as well as the accompanying .vmt. The object was exported from 3ds map in .smd.
I managed to compile my model and all, but when I go to test it, I get this...
... Yeah, it's not supposed to have that weird pink and black texture.
This is my .vmt
"VertexLitGeneric"
{
"$basetexture" "Users/Brandon/Desktop/TF2 Models/Models/Metal Pipe/pipe_final/pipe_final.vmt"
"$model" 1
"$surfaceprop" "metal"
"$envmap" "env_cubemap"
"$envmapmask" "Users/Brandon/Desktop/TF2 Models/Models/Metal Pipe/pipe_final/pipe_final_spec.vmt"
"$envmaptint" "[0.5 0.5 0.5]"
"$envmapcontrast" .5
}
}
And my .qc
$modelname "custom\metal_pipe\pipe_final4.mdl"
$cdmaterials "C:\Users\Brandon\Desktop\TF2 Models\Models\Metal Pipe\pipe_final"
$body pipe_final "pipe_final.smd"
$scale 1
$sequence idle "pipe_final.smd"
$collisionmodel "pipe_final.smd"
{
$mass 1.0 // Mass in kilograms
$concave
}
I don't think it has to do with the unwrapping, since there is no pink in any of the maps, and the weapon looks perfect when rendered in 3ds max, which leads me to suspect the .vtf's and .vmt.
(On a second look, I should also move the model relative to the bone a bit. That's not hard to do, I don't need help with that part)
Replies
both the vmt and vtf should be stored in "STEAMDIR\USERDIR\team fortress 2\tf\materials\models\weapons"
and once there both there fix your qc to point to the vmt and recompile, and fix the vmt to point to the new vtf location.
you should be using relative paths too, the game automatically assumes materials will be stored in the tf/materials directory, so when you call a texture or call a material you can start from there in the path, since even if you do make it work somehow with the absolute paths, it will break again when you send it to someone else.
you also got the wrong extension on your textures too.
It still shows pink though, anything wrong? I tried looking through the valve wiki
and did you set the material name in your 3d package.
Also I assume you mean the material name in 3ds max. What am I supposed to set it to? (I'm a bit new to this)
well since you got the path right now, what you have to do is apply a material to it in max, and add a texture to that with the same name as your VMT material.
VMT
QC
Is that what you mean?
Anyways, I got the texture working somehow, but is there any way to fix this problem? I'm referring to the visible ring near the top
I tried using $alphatest, but the whole thing becomes opaque. Also, is there any way to make the ice translucent (not pure transparent) where it's seen over the pipe? It seems to be translucent at the edges, but transparent on the pipe (The alpha map grey isn't that dark, it's maybe about 75% white)