Cubemap on weapons?
Post Reply
Quote
Re: Cubemap on weapons?
Posted by dagonal on Tue Jan 10th at 3:26pm 2006


I was just curious as to how to make a weapon that was somewhat reflectve.

I'm using XSI to create the model (which is already done), I've textured it accordingly and successfully exported it to Hammer and it's working...

But I have no clue how to make it reflective (obviously with a cubemap), but is it possible to tie it to the weapon? And how?

Or am I going at this all wrong? <img src=" SRC="images/smiles/sad.gif">

Thanks in advance!




Quote
Re: Cubemap on weapons?
Posted by SnarkSephiroth on Tue Jan 10th at 3:48pm 2006


I am very certain it is all in the parameters of the .vmf file for your textures .vtf file. For your texture to use cubemaps from your maps you need to put this in the .vmf:

$env_cubemap

If I remember correctly when I played with textures, this did it. Good luck.





Quote
Re: Cubemap on weapons?
Posted by Captain P on Tue Jan 10th at 4:54pm 2006


As an example, this is a model material I made a while ago:

"vertexlitgeneric"
{
"$basetexture" "models/mudanchee/metal_bar"
"$surfaceprop" "metal"
"$envmap" "env_cubemap"
"$envmapcontrast" 1
"$envmaptint" "[0.4 0.4 0.4]"
"$model" 1
}

The first orange line is essential for the cubemap effect, the others are just various other parameters you can give your texture's cubemap effect. And indeed, it all goes in the .vmt file. The nearest env_cubemap will be displayed on these materials now.






Quote
Re: Cubemap on weapons?
Posted by BlisTer on Tue Jan 10th at 6:16pm 2006


what cpt P says is absolutely true for nice equal reflections, which most weapons have (barrel etc).

however, for sake of completeness, here's how to implement "dirty" / unequal reflections (i.e. some parts dont reflect, or reflect to a lesser extent):

{
"$basetexture" "customtex/panel11"
"$envmap" "env_cubemap"
"$envmapmask" "customtex/specmask"
"$envmapcontrast" "1"
"$surfaceprop" "metal"
}

where you draw the "specmask" with black/white variations (more white =more reflective) according to your basetexture. you could also search the .gcf files for a close-matching one. it all takes a lot of time and trial/error, but the result is nice.

if you want to combine this with normalmaps (e.g. for small 3d weapon parts that you dont want to model), you have to use

{
"$basetexture" "customtex/panel12"
"$envmap" "env_cubemap"
"$bumpmap" "customtex/panel12_normal"
"$normalmapalphaenvmapmask" 1
"$envmapcontrast" "1"
"$surfaceprop" "metal"

}

instead, where you put the specmask in the alpha channel of panel12_normal (where the other 3 channels make up the normalmap)

as i said, this is just for the sake of completeness, you probably wont need it - just in case




These words are my diaries screaming out loud



Quote
Re: Cubemap on weapons?
Posted by dagonal on Tue Jan 10th at 10:05pm 2006


Oh my god...

You guys are awesome! That was exactly what I was looking for!! I dunno why I didn't think it would be there!

Thanks so much!!




Quote
Re: Cubemap on weapons?
Posted by Captain P on Tue Jan 10th at 10:26pm 2006


You can mark the right posts as correct, so this thread shows up as solved and it may help others that search the forums. Plus we get some Snarkmarks to boast our virtual ego's. <img src=" SRC="images/smiles/icon_smile.gif">

What sort of weapon are you creating, bytheway?






Quote
Re: Cubemap on weapons?
Posted by dagonal on Wed Jan 11th at 7:42pm 2006


? quote:
You can mark the right posts as correct, so this thread shows up as solved and it may help others that search the forums. Plus we get some Snarkmarks to boast our virtual ego's.

What sort of weapon are you creating, bytheway?


I'll do that right after I post this :P

Well I just started doing this so I only have one or two things...but mostly hand to hand combat. My first one was a sword from Warcraft (dunno which one cause I don't play it)



There it is, so far I'm not too good with texturing (in the past two months I've learnt like 5 programs (Hammer, XSI, Photoshop, etc), so I'm still a beginner. Perhaps I'll post stuff in the near future <img src=" SRC="images/smiles/icon_biggrin.gif">





Post Reply