Transparency issues
by Gustavo Munoz · in Artist Corner · 07/06/2007 (8:00 am) · 22 replies
I am having problems exporting a model with transparency. The model consist of two meshes UVmapped to the same PNG with alpha channel. But I need a mesh to be one-sided and the other two-sided. That's why I need it to be splited in two meshes.
I have exported similar models before with no problems, but this I just cannot get it working. I cannot use two materials, as they would need both to be named as the same image file. Or duplicate the texture and change his name, which is another nonsense. And with only one material, if I mark it as translucent I get the transparency working but also the rest of the model looks like if it had inverted normals (wich is no the case). And if I don't mark the material as translucent, the transparency in the alpha of the texture does not work at all.
I have tryed with parenting the meshes and with all the alpha setings in Blender, but I cannot find what am I doing wrong. Any advice will be very wellcome.
I have exported similar models before with no problems, but this I just cannot get it working. I cannot use two materials, as they would need both to be named as the same image file. Or duplicate the texture and change his name, which is another nonsense. And with only one material, if I mark it as translucent I get the transparency working but also the rest of the model looks like if it had inverted normals (wich is no the case). And if I don't mark the material as translucent, the transparency in the alpha of the texture does not work at all.
I have tryed with parenting the meshes and with all the alpha setings in Blender, but I cannot find what am I doing wrong. Any advice will be very wellcome.
About the author
#2
07/07/2007 (1:59 am)
Sent, thank you in advance Joseph.
#3
I think you can achieve what you want by making two materials. Have each one call to the same texture. Make only one material 'translucent'... you should be good to go.
Jondo
07/07/2007 (8:27 am)
Gus,I think you can achieve what you want by making two materials. Have each one call to the same texture. Make only one material 'translucent'... you should be good to go.
Jondo
#4
I have tryed with a simpler model (a cube and a plane) and got it working right, but I just cannot get my more complex model working right. And once again, if I use the 094 version of the exporter, my model works just fine so I doubt it is a modelling failure.
07/07/2007 (9:07 am)
I cannot make two different materials calling the same texture, because both need to have the same name. And this is not allowed. With the new materials system in the exporter you don't need to use Blender materials, but if the two meshes uses the same texture, the exporter will only create one material. And that's where I have a problem with my model, because this way one or the two meshes (depending on perenting between them) exports as if they had inverted normals.I have tryed with a simpler model (a cube and a plane) and got it working right, but I just cannot get my more complex model working right. And once again, if I use the 094 version of the exporter, my model works just fine so I doubt it is a modelling failure.
#5
07/07/2007 (9:25 am)
...
#6
I have just tryed again, and I have found that if I use two copies of the same texture file but changing the name of one of them, and then I use two materials -each one referencing one of the textures, and then I parent the transparent mesh to the opaque one, then it works just fine with both versions (094 and 0947). Maybe this is the only way to get this looking fine. But this duplicates the textures needed, so it is not the best solution.
The only workaround I can think of, if this is actually the only solution to get this kind of model working right, would be to build it up of two separate UV spaces, referencing two smaller and diferent textures.
The model will be used in TGE, why?
Maybe with TGEA shaders this would not be so a problem?
07/07/2007 (10:03 am)
Joseph:I have just tryed again, and I have found that if I use two copies of the same texture file but changing the name of one of them, and then I use two materials -each one referencing one of the textures, and then I parent the transparent mesh to the opaque one, then it works just fine with both versions (094 and 0947). Maybe this is the only way to get this looking fine. But this duplicates the textures needed, so it is not the best solution.
The only workaround I can think of, if this is actually the only solution to get this kind of model working right, would be to build it up of two separate UV spaces, referencing two smaller and diferent textures.
The model will be used in TGE, why?
Maybe with TGEA shaders this would not be so a problem?
#7
If not, you could try an alpha mask on the PNG and remap it so that one section is not transparent and an another area is transparent.
or
If you can get your file into Milkshape it will handle 2 materials (or many more) of the same name on the list. Each can call the same texture and have different properties. The DTSPLUS exporter by ChrisR for MS works great. Highly recommended.
07/07/2007 (10:06 am)
Sounds like an issue with the new version of the exporter. Can't you just use the .94 one?If not, you could try an alpha mask on the PNG and remap it so that one section is not transparent and an another area is transparent.
or
If you can get your file into Milkshape it will handle 2 materials (or many more) of the same name on the list. Each can call the same texture and have different properties. The DTSPLUS exporter by ChrisR for MS works great. Highly recommended.
#8
07/07/2007 (10:06 am)
...
#9
Maybe this is a special-enough case to mention this setup at the TGE materials docs (never use transparent and opaque materials with the same texture, allways build up a transparent material and a diferent opaque material). I guess a lot of modellers would love to know this issue beforehand ;)
07/07/2007 (10:26 am)
Thanks for the clarification, it helped me a lot for understanding the issue. And yes, it works just fine with two materials, with both versions of the exporter. But note in my last mail that I was allready using also the parenting trick. If you don't the wings still shows the same problem.Maybe this is a special-enough case to mention this setup at the TGE materials docs (never use transparent and opaque materials with the same texture, allways build up a transparent material and a diferent opaque material). I guess a lot of modellers would love to know this issue beforehand ;)
#10
07/07/2007 (10:33 am)
...
#11
07/07/2007 (11:33 am)
I think having this ability would be great. I was just thinking of having this ability a few days ago when trying to tweak one of my models. I ended up splitting my texture to separate the opaque and transparent parts.
#12
Also, maybe you can separate a transparency and a translucency section in the exporter, specially if it is the translucency tag the one that messes up the export. I know that Blender has two separate buttons, one for transparency and another for translucency, and being those two diferent visual characteristics as they are.
07/07/2007 (11:36 am)
Sounds good to me, my only doubt would be if TGE can handle two materials with the same name.Also, maybe you can separate a transparency and a translucency section in the exporter, specially if it is the translucency tag the one that messes up the export. I know that Blender has two separate buttons, one for transparency and another for translucency, and being those two diferent visual characteristics as they are.
#13
07/07/2007 (11:49 am)
...
#14
07/07/2007 (11:52 am)
...
#15
07/07/2007 (11:57 am)
...
#16
It sounds perfect to me, thank you so much. I will try it right now.
07/07/2007 (12:16 pm)
Wow, Joseph, you alone are one of the best GG resources out there ;)It sounds perfect to me, thank you so much. I will try it right now.
#17
Dumping output to file '/Documentos/DESARME/gryphon/models/gryphon/gryphonObj.log'
Exporting...
Dumping traceback to log...
Traceback (most recent call last):
File "/Applications/blender-2.44-darwin-8.9.1-i386/scripts/Common_Gui.py", line 1162, in button_event
c.onAction(evt, curMousePos, -1)
File "/Applications/blender-2.44-darwin-8.9.1-i386/scripts/Common_Gui.py", line 509, in onAction
control.onAction(evt, newpos, value)
File "/Applications/blender-2.44-darwin-8.9.1-i386/scripts/Common_Gui.py", line 152, in onAction
if self.callback: self.callback(self)
File "", line 1323, in guiBaseCallback
File "", line 834, in export
File "", line 494, in process
File "", line 759, in process
AttributeError: 'module' object has no attribute 'format_exc'
Maybe I edited wrong the Dts_Shape.py file...?
07/07/2007 (11:42 pm)
I get an exporting error. Console mesage:Dumping output to file '/Documentos/DESARME/gryphon/models/gryphon/gryphonObj.log'
Exporting...
Dumping traceback to log...
Traceback (most recent call last):
File "/Applications/blender-2.44-darwin-8.9.1-i386/scripts/Common_Gui.py", line 1162, in button_event
c.onAction(evt, curMousePos, -1)
File "/Applications/blender-2.44-darwin-8.9.1-i386/scripts/Common_Gui.py", line 509, in onAction
control.onAction(evt, newpos, value)
File "/Applications/blender-2.44-darwin-8.9.1-i386/scripts/Common_Gui.py", line 152, in onAction
if self.callback: self.callback(self)
File "
File "
File "
File "
AttributeError: 'module' object has no attribute 'format_exc'
Maybe I edited wrong the Dts_Shape.py file...?
#18
07/07/2007 (11:56 pm)
...
#19
07/08/2007 (1:25 am)
Cool, I will better wait for next release, as I really don't know what am doing while editting code ;)
#20
07/08/2007 (4:35 pm)
...
Torque Owner Redacted