Invisible Materials
by Scott Burns · in Torque Game Engine Advanced · 10/23/2006 (8:44 am) · 8 replies
So we've got this really great M16 model. It comes in fine as a static shape.

Pretty isn't it?
However, the trouble is that as a weapon it's materials seem to go invisible and the all we can see is wierd x-ray like view.

I get no errors in the console, I've triple checked my material definitions, it shows up in STP, it even won't show up with the no material texture on it.

We're on about the fifth export in the last hour and I'm stumped. Anybody have any idea what may be causing this?

Pretty isn't it?
However, the trouble is that as a weapon it's materials seem to go invisible and the all we can see is wierd x-ray like view.

I get no errors in the console, I've triple checked my material definitions, it shows up in STP, it even won't show up with the no material texture on it.

We're on about the fifth export in the last hour and I'm stumped. Anybody have any idea what may be causing this?
#2
10/23/2006 (12:40 pm)
Here's the definitions, they're just basic settings that I use across the board to be tweaked later.new Material(M16Material)
{
mapTo = "m16.png";
baseTex[0] = "~/data/shapes/weapons/M16/m16.png";
bumpTex[0] = "~/data/shapes/weapons/M16/m16_normal.png";
pixelSpecular[0] = true;
specular[0] = "0.1 0.1 0.1 0.1";
specularPower[0] = "8.0";
};
new Material(ACOG1Material)
{
mapTo = "acog1.png";
baseTex[0] = "~/data/shapes/weapons/M16/acog1.png";
bumpTex[0] = "~/data/shapes/weapons/M16/acog1_normal.png";
pixelSpecular[0] = true;
specular[0] = "0.1 0.1 0.1 0.1";
specularPower[0] = "8.0";
};
new Material(ACOGLensMaterial)
{
mapTo = "acoglens.png";
baseTex[0] = "~/data/shapes/weapons/M16/acoglens.png";
bumpTex[0] = "~/data/shapes/weapons/M16/acoglens_normal.png";
pixelSpecular[0] = true;
specular[0] = "0.1 0.1 0.1 0.1";
specularPower[0] = "8.0";
};
#3
It looks like the gun is translucent in the lower screenshots. Since your Materials don't have translucency turned on, I'm betting some other Material is somehow getting mapped to the gun.
You are using Maya? If not then you probably don't need to specify the ".png" extension in the mapTo parameter. You probably wouldn't even need the mapTo parameter unless the model was exported with Maya.
Are there any Materials in your app that are marked as translucent? One of them might be the one getting mapped to the gun. Try and turn off translucency in those Materials and see if you can find the one getting mapped.
The gun renders properly when used as a static model, but not when it is mounted? Is it the exact same model? Does it render properly in stock TSE?
10/23/2006 (3:34 pm)
There could be a number of problems here. I'm guessing that some Materials are overwriting others, or multiple Materials are mapping to the same texture tag.It looks like the gun is translucent in the lower screenshots. Since your Materials don't have translucency turned on, I'm betting some other Material is somehow getting mapped to the gun.
You are using Maya? If not then you probably don't need to specify the ".png" extension in the mapTo parameter. You probably wouldn't even need the mapTo parameter unless the model was exported with Maya.
Are there any Materials in your app that are marked as translucent? One of them might be the one getting mapped to the gun. Try and turn off translucency in those Materials and see if you can find the one getting mapped.
The gun renders properly when used as a static model, but not when it is mounted? Is it the exact same model? Does it render properly in stock TSE?
#4
10/24/2006 (12:31 am)
I know I need the mapto param if I export from MS3D. But I don't ever use extensions on any of the texture params (base, bump etc.).
#5
We are indeed using Maya. I actually didn't know about the translucency parameter until after this bug, so at the time I posted this there were no defined translucents. The gun does render as a static shape but not when it's mounted and it is the same model. I checked it with a clean TSE and it does the same thing.
10/24/2006 (6:27 am)
I thought it could be Materials overwriting each other as well, but even without the Material definitions I get the same result. So far I haven't found any that are overwriting each other.We are indeed using Maya. I actually didn't know about the translucency parameter until after this bug, so at the time I posted this there were no defined translucents. The gun does render as a static shape but not when it's mounted and it is the same model. I checked it with a clean TSE and it does the same thing.
#6
10/25/2006 (5:13 pm)
This sounds like a bug. Scott, if you could email me the gun, textures, and material file you are using, I'll take a look at it.
#7
10/26/2006 (7:54 am)
Email sent.
#8
10/26/2006 (3:29 pm)
OK, found it, fixed it, thanks again Scott.
Torque Owner Brian Ramage
Black Jacket Games