Page 1 of 2

Difficulty with bump and environment maps

PostPosted: Thu Apr 30, 2009 4:50 pm
by mrprime
Hey guys,

I was wondering if anyone could shed any light on this for me, I'm trying to make a texture with a base, bump (normal map) and specular (envmapmask).

I followed the advice posted here but it simply doesn't work! I've added the specularity map to the alpha of the diffuse and added $basealphaenvmapmask to my VMT but it's not having any of it.

Image
Here's how it looks with the envmap and bump map turned on + $normalmapalphaenvmapmask, I increased the map saturation to show it clearer - obviously the map isn't working.

I exported the specular map as its own VTF to take a picture to make sure I wasn't going mad - this is what it should look like:

Image
That's with the $envmapmask enabled and pointing to the specular map, but now the $bump doesn't work !

Infuriating.

My VMT is:
Code: Select all
"VertexlitGeneric"
{
   "$basetexture" "models/lifering/Ring Tex"
   "$envmap"      env_cubemap
   $envmapsaturation 1
   "$normalmapalphaenvmapmask"  "models/lifering/Ring Tex_NRM"
   "$normalmap" "models/lifering/Ring Tex_NRM"
   "$surfaceprop" "Plastic"
   $phong   1
   $bumpmap   "models/lifering/Ring Tex_NRM"
   $phongexponent       5   
   $phongboost      100
   $phongfresnelranges   "[0 0 100]"
   $halflambert 1
}


I can't think why it isn't working! to get the Spec map on to the normalmap (in Photoshop CS4) I just cut it, create a new channel on the normalmap and paste the spec in, then I untick the eye so, I export it as a Normal with Alpha.

Anyone have any ideas? thanks!

Re: Difficulty with bump and environment maps

PostPosted: Thu Apr 30, 2009 9:05 pm
by ankhsethamon
have you tested it ingame? As far as I know, hlmv has some issues with specular maps.. But your model in a map and test it!... maybe is a model viewer problem..

Re: Difficulty with bump and environment maps

PostPosted: Thu Apr 30, 2009 9:13 pm
by dissonance
HLMV is utterly fucked when it comes to envmaps. Like ankhsethamon said, try it in-game.

Re: Difficulty with bump and environment maps

PostPosted: Thu Apr 30, 2009 9:49 pm
by mrprime
It has none of it in game either :(

Image

Does anyone have an example of an normalmapalphaenvmapmask and bump living happily together? I'm starting to think it's impossible! :(

Re: Difficulty with bump and environment maps

PostPosted: Thu Apr 30, 2009 10:09 pm
by dissonance
"$basetexture" "models/lifering/Ring Tex"
"$envmap" env_cubemap
$envmapsaturation 1
"$normalmapalphaenvmapmask" "models/lifering/Ring Tex_NRM" //this should be $normalmapalphaenvmapmask 1
"$normalmap" "models/lifering/Ring Tex_NRM" //use either $normalmap or $bumpmap, but not both.
"$surfaceprop" "Plastic"
$phong 1
$bumpmap "models/lifering/Ring Tex_NRM"
$phongexponent 5
$phongboost 100
$phongfresnelranges "[0 0 100]"
$halflambert 1

Re: Difficulty with bump and environment maps

PostPosted: Thu Apr 30, 2009 10:10 pm
by JakeB
Code: Select all
    "VertexlitGeneric"
    {
       "$basetexture" "models/lifering/Ring Tex"
       "$envmap"      env_cubemap
       $envmapsaturation 1
       "$normalmapalphaenvmapmask"  "1"
       "$surfaceprop" "Plastic"
       $phong   1
       $bumpmap   "models/lifering/Ring Tex_NRM"
       $phongexponent       5   
       $phongboost      100
       $phongfresnelranges   "[0 0 100]"
       $halflambert 1
    }


That should work..now where's my cookie..

Re: Difficulty with bump and environment maps

PostPosted: Thu Apr 30, 2009 10:28 pm
by dissonance
Beat ya by like 10 seconds =D

Re: Difficulty with bump and environment maps

PostPosted: Thu Apr 30, 2009 10:31 pm
by JakeB
dissonance wrote:Beat ya by like 10 seconds =D

Well you're a banana >_>

Re: Difficulty with bump and environment maps

PostPosted: Thu Apr 30, 2009 10:55 pm
by dissonance
A ba... na... what?

Re: Difficulty with bump and environment maps

PostPosted: Thu Apr 30, 2009 11:25 pm
by mrprime
You guys - scholars and gentlemen, thank you!

Out of curiosity what's the difference between $bumpmap and $normalmap? all I seem to get is that $normalmap is for DX9 :| -

Anyway back to the problem!

I went ahead fixed the VMT but it was still having none of it, so I opened my textures in VTFEdit and low and behold - THE ALPHA CHANNEL IS ALL WHITE!! boy is my face red.

Ok but here's the problem - I don't see where I'm going wrong :(

Here's how I've got it set up:

Image

Then I save it straight out of Photoshop as a VTF -

Format: BGRA8888
Mimap filter: Box
Sharpen Filter: Sharpen Soft

Mipmaps and thumb nail.

Trilinear
Normal Map
Eight bit alpha

From what I've read that should be correct but it still seems to lose the alpha along the way :( sad times.

Re: Difficulty with bump and environment maps

PostPosted: Fri May 01, 2009 1:01 am
by dissonance
mrprime wrote:Out of curiosity what's the difference between $bumpmap and $normalmap? all I seem to get is that $normalmap is for DX9 :| -
I have no idea whatsoever. I'm using $bumpmap, and it seems to work just fine for both ssbump and normal maps.

mrprime wrote:From what I've read that should be correct but it still seems to lose the alpha along the way :( sad times.
No idea what's going wrong here.
To be entirely honest, I use Gimp and Paint.net for this, so I'm not entirely sure how you'd get it done in Photoshop.
Lemmie see if I can whip up a tutorial for Gimp; showing you my technique might help.

Re: Difficulty with bump and environment maps

PostPosted: Fri May 01, 2009 1:14 am
by ankhsethamon
try exporting as a TGA and compile the old fashion way (with vtex.exe)

Re: Difficulty with bump and environment maps

PostPosted: Fri May 01, 2009 3:29 am
by dissonance
Image

Re: Difficulty with bump and environment maps

PostPosted: Fri May 01, 2009 10:49 am
by mrprime
You guys are beautiful animals, I thank you muchly! here's the final result:

Image

LESSONS LEARNED:

$normalmapalphaenvmapmask is either 0 or 1, it doesn't link to the texture. (THANKS!)

Photoshop is an idiot and cannot be trusted to do even BASIC tasks, if other people have similar issues always check that the alpha has exported correctly using VTFEdit ! I got around it by exporting the image first as a 32 bit TGA, opening that and THEN saving it as a VTF with the previous settings I mentioned.

Phew what a relief - right I've got a huge backlog of models to go and fix now..

Thanks and e-cookies to everyone in the thread.

Re: Difficulty with bump and environment maps

PostPosted: Sat Aug 24, 2013 5:02 pm
by Sarsour
I know this is ancient ...but in my process of learning source compiling for my animation in Source Filmmaker, this really came helpful as when I read that $envmapmask will not work with $bumpmap for my character I panicked, googled and came across this post. I imagine very similar to mrprime's problem. That Gimp tutorial did it for me. Thank you all!