Cubemap on weapons?

Cubemap on weapons?

Re: Cubemap on weapons? Posted by dagonal on Tue Jan 10th 2006 at 3:26pm
dagonal
11 posts
Posted 2006-01-10 3:26pm
dagonal
member
11 posts 1 snarkmarks Registered: Jan 10th 2006 Location: Canada
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? :sad:

Thanks in advance!
Re: Cubemap on weapons? Posted by SnarkSephiroth on Tue Jan 10th 2006 at 3:48pm
SnarkSephiroth
206 posts
Posted 2006-01-10 3:48pm
206 posts 31 snarkmarks Registered: Sep 10th 2003 Occupation: Automotive Tech Student Location: Phoenix, Arizona
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.
Re: Cubemap on weapons? Posted by Captain P on Tue Jan 10th 2006 at 4:54pm
Captain P
1370 posts
Posted 2006-01-10 4:54pm
1370 posts 1995 snarkmarks Registered: Nov 6th 2003 Occupation: Game-programmer Location: Netherlands
As an example, this is a model material I made a while ago:

"vertexlitgeneric"

{

"$basetexture" "models/mudanchee/metal_bar"

"$surfaceprop" "metal"

"$envmap" "env_cubemap"<br style="color: orange;">
"$envmapcontrast" 1<br style="color: orange;">
"$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.
Create-ivity - a game development blog
Re: Cubemap on weapons? Posted by BlisTer on Tue Jan 10th 2006 at 6:16pm
BlisTer
801 posts
Posted 2006-01-10 6:16pm
BlisTer
member
801 posts 1304 snarkmarks Registered: Jun 10th 2004 Location: Belgium
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
Re: Cubemap on weapons? Posted by dagonal on Tue Jan 10th 2006 at 10:05pm
dagonal
11 posts
Posted 2006-01-10 10:05pm
dagonal
member
11 posts 1 snarkmarks Registered: Jan 10th 2006 Location: Canada
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!!
Re: Cubemap on weapons? Posted by Captain P on Tue Jan 10th 2006 at 10:26pm
Captain P
1370 posts
Posted 2006-01-10 10:26pm
1370 posts 1995 snarkmarks Registered: Nov 6th 2003 Occupation: Game-programmer Location: Netherlands
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. :smile:

What sort of weapon are you creating, bytheway?
Create-ivity - a game development blog
Re: Cubemap on weapons? Posted by dagonal on Wed Jan 11th 2006 at 7:42pm
dagonal
11 posts
Posted 2006-01-11 7:42pm
dagonal
member
11 posts 1 snarkmarks Registered: Jan 10th 2006 Location: Canada
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. :smile:

What sort of weapon are you creating, bytheway?
I'll do that right after I post this :razz:

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)

User posted image

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 :biggrin: