[Help] - Transparency Problem
by Nicolai Dutka · in Artist Corner · 10/21/2009 (11:37 pm) · 7 replies
I'm trying to make a 'corner shower' with glass doors. I've got a diffuse, normal, and alpha map. This is how my object looks in Max:

Now when I export the mesh without any opacity/transparency (no alpha map), it looks like this in game:

And then when I add the alpha map:

I've also tried playing around with the materials.cs file. If I export the mesh with NO alpha and use:
Then it shows up like image 3 above, even though there is no alpha map...
If I comment out the last line 'translucent = true;', then it shows up like image 2 above.
I can't for the life of me figure out how to get my transparency to work...
I do have an object in my game right now that is 100% transparent, but it also has no diffuse or normal map, it's an invisible object...

Now when I export the mesh without any opacity/transparency (no alpha map), it looks like this in game:

And then when I add the alpha map:

I've also tried playing around with the materials.cs file. If I export the mesh with NO alpha and use:
new Material(shower){
baseTex[0] = "./shower_D";
bumpTex[0] = "./shower_N";
translucent = true;
};Then it shows up like image 3 above, even though there is no alpha map...
If I comment out the last line 'translucent = true;', then it shows up like image 2 above.
I can't for the life of me figure out how to get my transparency to work...
I do have an object in my game right now that is 100% transparent, but it also has no diffuse or normal map, it's an invisible object...
#2
I'm starting to think there is a problem with my exporter... I'm using Max 2010. I'm using this exporter: www.garagegames.com/community/resources/view/18261
10/22/2009 (11:49 am)
Already did try that... I did a 'detach' on the glass doors and applied a different texture and now the doors come in solid black while the rest of the mesh is fine...I'm starting to think there is a problem with my exporter... I'm using Max 2010. I'm using this exporter: www.garagegames.com/community/resources/view/18261
#3
I detached the glass from the rest of the shower as a separate object, then I made an exact copy of the texture i had been using and just renamed it. Then to get the normals to show up, I had to assign materials:
The first picture in the first post is now what the shower looks like in the game! :D
10/22/2009 (12:34 pm)
Ok, I did finally get this figured out!I detached the glass from the rest of the shower as a separate object, then I made an exact copy of the texture i had been using and just renamed it. Then to get the normals to show up, I had to assign materials:
new Material(shower){
baseTex[0] = "./shower_D";
bumpTex[0] = "./shower_N";
};
new Material(showerGlass){
baseTex[0] = "./showerGlass_D";
bumpTex[0] = "./showerGlass_N";
translucent = true;
};The first picture in the first post is now what the shower looks like in the game! :D
#4
1. new Material(shower){
2. baseTex[0] = "./shower_D";
3. bumpTex[1] = "./shower_N";
4. translucent = true;
5. };
or
1. new Material(shower){
2. baseTex[1] = "./shower_D";
3. bumpTex[2] = "./shower_N";
4. translucent = true;
5. };
10/22/2009 (12:37 pm)
In the datablock for the shader try a sequenced setup instead of numbering all the texture entries as 0. So it looks like this;1. new Material(shower){
2. baseTex[0] = "./shower_D";
3. bumpTex[1] = "./shower_N";
4. translucent = true;
5. };
or
1. new Material(shower){
2. baseTex[1] = "./shower_D";
3. bumpTex[2] = "./shower_N";
4. translucent = true;
5. };
#5
Look at post #3 though, I got it. ;)
10/22/2009 (12:45 pm)
Tried that and it didn't work at all... The whole object turned black.Look at post #3 though, I got it. ;)
#6
Something else you can try with the shader datablock is to use the complete name of the texture in the first line, like this; 1. newMaterial(shower_D){
I can't say for sure what effect this will have but in the past using the complete texture name has cleared up some errors I've experienced.
10/22/2009 (12:46 pm)
If the glass is showing transparent then your transparencies are working. If the problem is the darkening of the opaque geometry check your texture settings in the Material Editor of Max for errors. Check the light value setting, make sure its set to 100. Also check to see if the alpha channel settings got reset when you separated the glass from the opaque geometry. Sometimes, when you build a texture with an alpha channel and go back and separate out the geometry sets the original set still has the alpha channel setting working when they should be reset to zero values. Something else you can try with the shader datablock is to use the complete name of the texture in the first line, like this; 1. newMaterial(shower_D){
I can't say for sure what effect this will have but in the past using the complete texture name has cleared up some errors I've experienced.
#7
10/22/2009 (12:47 pm)
Again, please look at post #3................
#8
10/22/2009 (12:47 pm)
OK, cool!
Torque Owner N R Bharathae
Good luck.