Game Development Community

White outlines around trees

by Weston Elliott · in Torque Game Engine Advanced · 04/22/2009 (4:56 pm) · 3 replies

I am having an issue with the Sticks and Twigs pack trees. Whenever I put a tree into a fresh install of TGEA 1.8.1 the tree seems to have a white outline around every limb when looking up into it toward the sky. Also, the palm trees have black rectangles around every leaf. How might I solve these two issues?

www.xcomhome.com/GAL/ddd.jpg

#1
04/22/2009 (5:36 pm)
the palm trees have black rectangles around every leaf
Alpha channel issue, maybe doesn't have one. Are teh textures listed on a material.cs with transparency values?

If you have the material file soted then try this - if the file is png format try erasing the black area (obviously only do this on a backup of the texture - don't mess with the original).

white outline around every limb when looking up into it toward the sky
I think that's the sky colour showing as a border on the alpha channel of a texture. Like this? It may be something to do with transparency sorting in the model itself. Have a good read about alpha channel and Z buffer in the TGEA docs.

To be honest I'm not fully comprehending all of the Z buffer sorting stuff or how to do it correctly or whether there ever was a fix for this transparency issue with TGEA.

edit
Try this.
new Material(your _texture_name)
{
   mapTo = "your _texture_name";
   basetex[0] = "your _texture_name";
//   bumptex[0] = "your _texture_name_nm";
   emissive[0] = false;
   translucent = true;
   translucentBlendOp = none;
   translucentZWrite = true;
   alphaRef = 255;
};
#2
04/22/2009 (6:11 pm)
Wouldn't you want LerpAlpha instead of none? As well, you should play around with alphaRef - The default is 20, which is way too low. But 255 will make everything look blocky.

new Material(your _texture_name)
{
mapTo = "your _texture_name";
basetex[0] = "your _texture_name";
// bumptex[0] = "your _texture_name_nm";
emissive[0] = false;
translucent = true;
translucentBlendOp = LerpAlpha;
translucentZWrite = false; // Don't want invisible things to write
alphaRef = 192;
};

#3
04/22/2009 (6:36 pm)
I found ZWrite off causes issues with textures not displaying correctly in order of visible distance - things as the back of an object displayed in front of other transparent parts at the front. It looks bad and gives me motion sickness.

I might have turned BlendOp off for a reason too, but can't remember right now. Just put it back on with Zwrite true and everything seems fine.

And yeah, alphaRef 192 is much nicer.