Login or Signup

Z-Order clipping

Community Forums/Software Tools/Z-Order clipping

Akat(Posted 1+ years ago) #1
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?

Mustang(Posted 1+ years ago) #2
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.


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.

Beaker(Posted 1+ years ago) #3
This sorts them for you, and it isn't slow:

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

Akat(Posted 1+ years ago) #4
yup... i used mask instead - but my tree not looks so well though

jhocking(Posted 1+ years ago) #5
Anthony Flack devised a really cool trick for Cletus in which he could get super accurate masking without increasing the image resolution.

Akat(Posted 1+ years ago) #6
hah... how?

Frosty Beverage Fund