Game Development Community

Z Passes and Transparencies

by Florian Ross · in Torque Game Engine Advanced · 06/29/2005 (1:48 am) · 2 replies

Hi,

As far as i know TSE doesnt write any Z-values for materials that are marked as Transparent (materialwise) unless i say to do so.

Would it be possible to use the TEXKILL Instruction on completely transparent fragments (with a threshold maybe) to discard fragments along with their Z-value. This would make post effects like depth of field alot easier to do as it would have the real z values stored in the Depth buffer.

perfect example would be a tree with texture mapped leafes. Those Leafes would either have no own Z Value or the Space around them (which could be terrain in the distance) would have Leaf Z-values.

In both cases Depth of Field wouldnt be able to produce correct results in one pass.

#1
06/29/2005 (5:55 pm)
I'm going to add some alpha test flags/variables to materials so you can turn that on or off, which should help with these situations. Ie. you want the leaves to write to the zbuffer, but not the other pixels in the leaf texture.
#2
07/05/2005 (3:09 pm)
Looking forward to it! There are a lot of issues with transparencies that a bit of alpha testing should clear up nicely.