Environment mapping controlled by gloss map?

I’m creating models for use in a panda game.
The models have a diffuse, gloss, glow and normal maps.
Since some of the characters will wear metallic armour and so on, I want to be able to use simple environment mapping to get a nice, shiny, reflective effect.
But I only want that effect where the metal armour is, not on the flesh/cloth/leather/whatever areas of the model, which will be defined by the textures.
I’ve found that by using the “normal_gloss” type mapping I can free up a texture slot in the model that can be assigned to an environment map like so:

<Texture> Tex2 {
  <Scalar> format { rgba }
  <Scalar> tex-gen { EYE_NORMAL }  
  <Scalar> wrapu { repeat }
  <Scalar> wrapv { repeat }
  <Scalar> minfilter { linear_mipmap_linear }
  <Scalar> magfilter { linear }
  <Scalar> combine-rgb { modulate }
  <Scalar> combine-alpha { add }
  <Scalar> combine-rgb-source0 { Tex4 }
  <Scalar> combine-rgb-operand0 { src-color }
  <Scalar> combine-alpha-source0 { Tex4 }
  <Scalar> combine-alpha-operand0 { SRC-ALPHA }

So far so good, but that places the env-map on the whole model, and I would like it to only appear on those areas set as “glossy” by the gloss map, if you follow me.
Is there a way to link the environment-map to the gloss map so that the former is only present when the latter defines a part of the model as having a glossy surface?
As you can see, I’m trying to use the “combine” scalars, is that the right approach or am I yet again completely misunderstanding everything?

Thanks in advance for any info or help.

Sooo…nobody has ever used environment maps and wanted to limit them to certain parts of the model using the placement of gloss textures, then?
Just me?

It might not be the case here, but this kind of stuff usually requires custom shaders in Panda.

I thought that this might be the case, but since I’m so rubbish at writing them, I hoped there might be another solution.
Thanks for the info, though.

I have a friend that actually faked that effect… It turned out well too. What he did was use several gloss maps and textures maps, in which he rotated in a certain way as his character moved through the environment.

He wasn’t using P3D, so maybe he could get away with that.

That can be done with P3D, but I personally feel something like that using P3D would drink down too much fps because of regularly manipulated texture stages.

Sorry I don’t have full detail on what my buddy did.

Oh well… It was just a thought. :slight_smile:

It’s just weird that I can do this with models in the 10 year old netimmerse engine, but can’t in a much more up to date engine.
I suppose most people simply use different model pieces with different materials to do this sort of thing.
I wanted to be able to do it via textures because one of the things we are bending over backwards to do is give the end user/player as much freedom as possible to create any type of character they want.
So we’ve set up a choice of hundreds of model parts to choose from as “costumes”, and if those could all be textured differently as well, you get a lot of potential choices.
I don’t want to limit the player to only being able to have certain pre-defined parts shiny with env-mapping, nor do I intend to make 2 versions of every single part, (one env-mappped, one not).
I guess I’ve got to go back to struggling with shaders again, which I never get very far with, or just give up on it.
The latter of which, to be honest, I’m more inclined to do at the moment.

Anyway, thanks for the responses, people who did.

You can use another stage with your gloss map to modulate your envmap stage to only be applied to a certain section of the model.

Well, that certainly sounds like what I want to do.
However, I’m concerned that I may be misunderstanding and/or mis-using terms like “stage”.

The way I currently have the model set up is with the maximum 4 texture stages that the auto-shader will support:
diffuse, env-map, glow, and normal_gloss.
Till, now I’d been using diffuse, gloss, glow and normal, but I put in env_map and made normal into normal_gloss.
If I add any other texture stages, the auto-shader does not work, so I either have to have 4 stages and the ease of the auto shader, or wade back into the unfriendly swamp of writing my own shaders for gloss, glow, normal and env-map, as the auto shader wont work with more than 4 stages.

Am I missing something terribly obvious, or misunderstanding stages completely, or is that about right?

That would definitely be handy. If you can’t get it to work using texture stages and the shader generator, I’d go ahead and write a shader. It shouldn’t be too hard, those are all pretty standard techniques; I’m sure you could get a hand here if you get stuck.