Compulsory sorting of triangles in an index- buffe

Community Forums/Showcase/Compulsory sorting of triangles in an index- buffe

Maxus(Posted 2005) [#1]
http://amt-lab.com/svalka/SortTrianglMesh.rar

This DLL solves a problem of sorting of triangles for objects with an alpha, having one surface.
Works quickly in realtime.
It is the fastest than similar tools.


jfk EO-11110(Posted 2005) [#2]
you mean the alpha z-sorting issue? Theres also a solution written by Masterbeaker IIRC. It is part of the Grass demo posted by elias_t in the fx archives. Although, I don't know if it has the same speed as the DLL you mentioned. BTW thanks for the link.


AdrianT(Posted 2005) [#3]
From what I was told beakers z sorting is only really useful for billboard type quads with alpha rather than more complex surfaces with alpha. Wonder how this works


sswift(Posted 2005) [#4]
Sometimes you can sort properly, sometimes you can't. If there are any polygons which are both in front of and behind another polygon, then you may not be able to sort them properly.

For example, if you have a car with four windows in it, you can sort those windows properly because every window's front and back, is completely on one side or the other of all the other polygons that make up the windows.

But if you have two quads crossing to make a tree, there is no way to sort them that they will always draw in the correct order, unless you have a vertex where they cross and split one or both of the quads.

Thisi is basically the same problem as building a BSP tree. In fact, that's what you're doing. You try to pick the next polygon to insert into the tree which results in the fewest splits, and when you're done you have some new polygons, but you can also draw everything without using a zbuffer and it will all draw correctly.


jfk EO-11110(Posted 2005) [#5]
This is why I use a surface for every alpha object and all the alpha objects are very flat things only, like quads, or doublesided quads. In the case of a car they would be a number of individual quads, parented to the car chassis.