Game Development Community

Transparancy of tree-foliage not working

by Holger · in Torque Game Engine Advanced · 04/12/2007 (4:10 am) · 2 replies

I am sure I am doing something wrong, but

I can't get a transparancy on the foliageimage for the trees.

The transparancy sections are shown green of black.


Could somebody show me a working material.cs for trees?


The ones I tested from the latest TSE port of starter.fps or starter.racing

don't work.

thanks fro help!

#1
04/12/2007 (7:43 am)
Find your texture that has the transparency in it. If you haven't already, create a materials.cs file in that folder. Set the baseTex[0] entry to the name of your texture file (no extension), then add these two lines
translucent = true;
translucentBlendOp = LerpAlpha;

When you're all done it should look like this (texture name is "Blade_14" here):
new Material(Blade_14)
{
   baseTex[0] = "Blade_14";
   translucent = true;
   translucentBlendOp = LerpAlpha;
};

The "LerpAlpha" is a basic translucency blend, you can experiment with others if it doesn't give you the results you want. Do a search in the engine code for "LerpAlpha" and you should find your other choices.
#2
04/12/2007 (7:53 am)
Mark,

thanks!

Will try it immediatly.