Game Development Community

Objs w/ translucent materials not rendering correctly u/ water

by Andy Schatz · in Torque Game Engine · 09/09/2005 (4:16 pm) · 3 replies

One of my models has two materials applied to it, the second of which is marked as Translucent (TSMaterialList::Translucent). The model does not render correctly when it is in water -- it renders in front of the water all the time; the water plane does not correctly z sort.

If I comment out the following lines in tsShape.cc, the water renders correctly, but of course, the translucent material does not render translucently:

if (flags & TSMaterialList::Translucent)
               {
                  mFlags |= HasTranslucency;
                  subShapeFirstTranslucentObject[ss] = i;
                  break;
               }

Here are the material descriptions as displayed in ShowTool:
#0 zebra.png
Flags: S Wrap, T Wrap

#1 zebra_hair.png
Flags: S Wrap, T Wrap, Translucent, Never Env Map

This also happens with another model. Here are the material descriptions:
#0 wildebeest.png
Flags: S Wrap, T Wrap, Never Env Map

#1 wildebeest_hair.png
Flags: S Wrap, T Wrap, Translucent, Never Env Map


I noticed this documentation on sorting problems with partially translucent objects, but the solution only seems to work for sorting correctly within the model. Has this been solved for sorting between two different models?

Is this a bug in Torque or has the model been exported incorrectly?

On a side note, if anyone can comment on the speed/graphics memory hit I take from a partially translucent model, that would be great too...

#1
09/09/2005 (7:31 pm)
Hmm, wild. It ought to sort correctly against the water.
#2
09/09/2005 (9:13 pm)
Hi Ben... sorry to trouble your already busy work day :) Do you have any ideas of what kinds of tests I should do or what I need to ask my artists? The turnaround time on models is pretty slow for me at this point, so it's hard to do rapid iteration. Thanks in advance for any help anyone can offer.
#3
09/09/2005 (9:22 pm)
Compare it to shapes which do sort properly? I don't have enough experience troubleshooting models to be much use. Make sure your shape is registering a translucent render image (if it's custom code)?