Lightwave transparency sorted mesh order workaround
by Proto · in Artist Corner · 08/09/2007 (7:20 pm) · 11 replies
Is there a way to export transparent polys so that their sorted mesh order displays correctly?
I have had mesh order difficulties with transparent shapes in a few models - the latest being a glass dome which goes a bit crazy in Showtool when the camera passes through both sides.
I don't believe the 06-07-04 DTS exporter supports mesh sorting. Any ideas for workarounds?
I have had mesh order difficulties with transparent shapes in a few models - the latest being a glass dome which goes a bit crazy in Showtool when the camera passes through both sides.
I don't believe the 06-07-04 DTS exporter supports mesh sorting. Any ideas for workarounds?
#2
08/10/2007 (5:00 am)
For the Skeleton Pack I cut the rib cage just before export, and pasted it, and then rib cage was sorted in the right order. I believe this organised the polys in index buffer correctly.
#3
i tried cutting and pasting the glass, so that it shows up first.
i tried using an alpha channel. and i tried it without one.
i tried semi-opaque via photoshop.
i tried .png and .tga
but it still doesn't work.
the glass looks fine in showtoolpro, but not in the engine.
there doesn't seem to be a transparency section in the materials.cs files, either.
could you point me in the right direction, please ?
cheers..
08/11/2007 (7:31 am)
Any hints you could pass on, Proto? i'm having difficulties with transparency.i tried cutting and pasting the glass, so that it shows up first.
i tried using an alpha channel. and i tried it without one.
i tried semi-opaque via photoshop.
i tried .png and .tga
but it still doesn't work.
the glass looks fine in showtoolpro, but not in the engine.
there doesn't seem to be a transparency section in the materials.cs files, either.
could you point me in the right direction, please ?
cheers..
#4
Just a thought, did you give the glass double sides or copy, flip and paste the glass as double sided doesn't seem to work.
I could send you my mesh if you want to see what the differences are.
08/11/2007 (8:18 am)
@ Ken - You might have to use the SORT:: name in the 2nd tab (objects) of the LW2DTS exporter. I just checked my Harvester from BRAVE and that has a transparent section without using the SORT:: command, that renders correctly in TGEA.Just a thought, did you give the glass double sides or copy, flip and paste the glass as double sided doesn't seem to work.
I could send you my mesh if you want to see what the differences are.
#5
the glass sections are cut/paste/flipped.
appreciate the quick response. thanks.
08/11/2007 (10:10 am)
Ahhh.. cheers Andy.. i hadn't tried that.the glass sections are cut/paste/flipped.
appreciate the quick response. thanks.
#6
The problem I had was with a glass dome (for a a plane cockpit) that would not export correctly. The glass had it's own surface material with a transparency value, a reflection value, a 24 bit png without alpha for texture and was part of the main model (i.e. all polys joined in one mesh).
I cut the glass out of the main layer and pasted back into two separate dome hemisphere layers (so 3 layers in all - plane, dome West, dome East). The transparent polys are now ordered correctly in Showtool.
08/11/2007 (3:40 pm)
Hi Ken,The problem I had was with a glass dome (for a a plane cockpit) that would not export correctly. The glass had it's own surface material with a transparency value, a reflection value, a 24 bit png without alpha for texture and was part of the main model (i.e. all polys joined in one mesh).
I cut the glass out of the main layer and pasted back into two separate dome hemisphere layers (so 3 layers in all - plane, dome West, dome East). The transparent polys are now ordered correctly in Showtool.
#7
I figured it was something to do with the need for a materials.cs file, but
the various flavours of those i tried, didn't seem to work either...
until i found this one (posted by J.C.Smith, in another thread). thanks J.C
no need for SORT, or alpha channel.
so simple. so painless.
thought i would post it here, in case anybody has the same problem.
regards.
08/15/2007 (7:59 pm)
Hi guys... thanks for the replies.. alpha... SORT... nothing seemed to work.I figured it was something to do with the need for a materials.cs file, but
the various flavours of those i tried, didn't seem to work either...
until i found this one (posted by J.C.Smith, in another thread). thanks J.C
new Material(uniquenameformymaterial)
{
baseTex[0] = "mytexturename";
translucent = true;
};no need for SORT, or alpha channel.
so simple. so painless.
thought i would post it here, in case anybody has the same problem.
regards.
#8
08/16/2007 (1:00 am)
Ahh well I didn't think to mention that - yeah I didn't get transparencies until I set my material.cs. Here's how I did the dome in the Harvester. Note I did two material in the file so the dome could have a different reflectivity / specularity on the chassis.new Material(Harvester_Proto1Trans)
{
baseTex[0] = "Harvester_Proto1Trans";
translucent = true;
translucentBlendOp = LerpAlpha; // this is the best for glass
pixelSpecular[0] = true;
specular[0] = "0.1 0.1 0.1 1.0";
specularPower[0] = 32.0;
};
new Material(Harvester_Proto1)
{
baseTex[0] = "Harvester_Proto1";
pixelSpecular[0] = true;
specular[0] = "1.0 1.0 1.0 0.1";
specularPower[0] = 10.0;
};
#9
and it's great to be able to see where i'm flying.. lol..

I noticed that the sun shines through the model's geometry, even the solid stuff... is that right?
do i have to put all of the model textures into the materials.cs file ? will that stop it happening ?
or is this a known behaviour ?
nice harvester.
cheers for the advice..
08/16/2007 (6:25 am)
Quote:I didn't get transparencies until I set my material.cs.cheers Andy.... i'm embarrassingly new.... but it's working fine now, thankyou.
and it's great to be able to see where i'm flying.. lol..

I noticed that the sun shines through the model's geometry, even the solid stuff... is that right?
do i have to put all of the model textures into the materials.cs file ? will that stop it happening ?
or is this a known behaviour ?
nice harvester.
cheers for the advice..
#10
The sun is a attribute of the way the sun is handled in torque, it to simulate a kind of bloom next to objects in a scene...it render in the foreground until the center is completely obscure... If you are still seeing this happen, again, keep your opaque parts as a separate image than your transparent, combining the two into one image (opaque parts, and transparent) make the engine treat all surfaces as transparent according to rendering, and the sun flair is another transparent images, and torque has no brain for sorting them. Even between completely unrelated objects.
EDIT: This is all TGE stuff, i do not know what your options are with TGEA, i would assume all that i have said works, and more TGEA options.
11/12/2007 (8:25 am)
You CAN use the models hierarchy to force rendering order...and as far as i know, SORT is not supported by the exporter, thats a max only thing. But using the hierarchy has worked for me. And always keep opaque portions of an object as a separate image file than transparent ones...and in photoshop, don't forget to uses masks or alpha channels, don't just leaving the image transparent (Creates a transparency flag, not an alpha).The sun is a attribute of the way the sun is handled in torque, it to simulate a kind of bloom next to objects in a scene...it render in the foreground until the center is completely obscure... If you are still seeing this happen, again, keep your opaque parts as a separate image than your transparent, combining the two into one image (opaque parts, and transparent) make the engine treat all surfaces as transparent according to rendering, and the sun flair is another transparent images, and torque has no brain for sorting them. Even between completely unrelated objects.
EDIT: This is all TGE stuff, i do not know what your options are with TGEA, i would assume all that i have said works, and more TGEA options.
#11
i do always keep the glass seperate, as you suggested. i'll try putting everything transparent on
layers 1 & 2 to enforce hierarchy. maybe that could be it.. the sun still shines through the wings,
and shapenames are visible where they shouldn't be. cheers for the advice.
11/13/2007 (11:00 am)
Thanks Allyn. i solved most of my transparency problems by using "save for web" from photoshop.i do always keep the glass seperate, as you suggested. i'll try putting everything transparent on
layers 1 & 2 to enforce hierarchy. maybe that could be it.. the sun still shines through the wings,
and shapenames are visible where they shouldn't be. cheers for the advice.
Torque Owner Proto