Z-Order clipping

Miscellaneous Forums/Content Creation Tools/Z-Order clipping

when i used texture with alpha-check for a tree or something (especially using B3D pipeline), the thing previewed in my game looks like something not right in z-order clipping... how to prevent this?

Alphablended polygons are NOT z-sorted; this is not a bug. You can see this in other games as well... some game engines sort alphablended polygons with code but that is quite slow.

http://www.rockstargames.com/maxpayne/tutorials/MaxED/texturing_adv.htm

The biggest problem with alpha blending is that they can not be sorted with Z-buffer. Instead, a separate sorting algorithm has to be applied to alpha polygons and this is very slow, a single alpha blended polygon can take as much time as drawing hundreds of normal polygons. Furthermore, the sorting algorithm is not perfect. Especially when alpha blended polygons "cross" it might make wrong decisions and the polygons would be drawn in incorrect order, bringing something that is supposed to be behind to "pop" in front of something else.


This sorts them for you, and it isn't slow:
http://www.blitzbasic.com/codearcs/codearcs.php?code=850

But, it might not be the right solution for you. You might want to use masking instead.

yup... i used mask instead - but my tree not looks so well though

Anthony Flack devised a really cool trick for Cletus in which he could get super accurate masking without increasing the image resolution.

hah... how?