Game Development Community

Translucency issues with trees

by QSquid · in Torque Game Engine Advanced · 04/17/2007 (12:53 pm) · 1 replies

I'm having some trouble getting transparency correct when using it for trees. I'm assuming it's something to do with the z-buffer. I can get the leaves transparent, and two sided, but when viewed from a low angle (anything below straight on) there is a halo of transparency around each set of leaves. This halo allows you to see through any other leaves behind it. When viewed from a top-down view, everything looks fine. I'm using TGEA and here's my material code:

new Material(firbranch)
{
mapTo = "firbranch.png";
baseTex[0] = "~/data/textures/color/firbranch256.png";
translucent = true;
translucentBlendOp = LerpAlpha;
translucentZWrite = true;
alphaRef = 1;
};

Any help you could offer would be appreciated. Thanks.

#1
04/18/2007 (10:15 am)
This is because your using blending with the alpha test... if you disable blending, but leave alpha test you won't get the halo. Look at this post for a fix which allows alpha test without blending.