Game Development Community

1.8 translucency sorting/blending foul-up

by Kirk Longendyke · in Torque Game Engine Advanced · 11/23/2008 (4:39 am) · 5 replies

Picture says it all:
http://img201.imageshack.us/img201/3681/wftxsk1.jpg :
img201.imageshack.us/img201/3681/wftxsk1.jpgfresh off the presses directx sdk just to be sure, and material setup for the planet off in the distance as follows:

new Material(land001)
{
baseTex[0] = "theta9";
bumpTex[0] = "theta9b";
pixelSpecular[0] = true;
specular[0] = "0.3 0.3 0.3 1.0";
specularPower[0] = 12.0;
animFlags[0] = $scroll;
scrollDir[0] = "-1.0 0.0";
scrollSpeed[0] = 0.00125;
//=============== pass 2 ===========
baseTex[1] = "theta9Clouds";
bumpTex[1] = "theta9Cloudsb";
//animFlags[1] = $scroll;
//scrollDir[1] = "-0.5 0.0";
glow[1] = true;
//pixelSpecular[1] = true;
//specularPower[1] = 8;
translucent[1] = true;
translucentBlendOp[1] = AddAlpha;
translucentZWrite[1] = true;
alphaRef[1] = 20;
};

#1
11/25/2008 (3:51 pm)
I think you may be experiencing this bug:
www.garagegames.com/mg/forums/result.thread.php?qt=81142

You may want to try the fix.
#2
11/28/2008 (4:47 am)
Neither http://www.garagegames.com/mg/forums/result.thread.php?qt=81142 nor http://www.garagegames.com/mg/forums/result.thread.php?qt=73786 seems to have helped unfortunately...
#3
11/28/2008 (6:42 am)
I noticed in the material posted above that you are treating the transparency related fields as if they are stage-specific. Specifically: translucent, translucentBlendOp, translucentZWrite, and alphaRef, are not array fields, meaning that they apply to the material as a whole and not on a per-stage basis.

For example, this assignment:
translucent[1] = true;

It is silently setting a dynamic field to true, but it will be invisible to the code and have no effect. This may be throwing off the rendering order.
#4
11/28/2008 (8:25 am)
That's very strange indeed. They must be checking translucency passes in a non-obvious spot... Here's one with the setup as suggested:



http://img135.imageshack.us/img135/3093/mygoditsfullofstarslq9.jpg:
img135.imageshack.us/img135/3093/mygoditsfullofstarslq9.jpg

new Material(land001)
{
baseTex[0] = "theta9";
bumpTex[0] = "theta9b";
pixelSpecular[0] = true;
specular[0] = "0.3 0.3 0.3 1.0";
specularPower[0] = 12.0;
animFlags[0] = $scroll;
scrollDir[0] = "-1.0 0.0";
scrollSpeed[0] = 0.00125;
//=============== pass 2 ===========
baseTex[1] = "theta9Clouds";
bumpTex[1] = "theta9Cloudsb";
//animFlags[1] = $scroll;
//scrollDir[1] = "-0.5 0.0";
glow[1] = true;
//pixelSpecular[1] = true;
//specularPower[1] = 8;
translucent = true;
translucentBlendOp = AddAlpha;
translucentZWrite = true;
alphaRef = 20;
};
#5
12/16/2008 (9:59 pm)
Issue extant with 1.8.0