Open kpreid opened 3 years ago
I took a stab at visualizing the conversion of the view angle to sort direction, and it definitely seems suspicious. However, that might just be because of its intrinsic coarseness.
Note that DepthOrdering
does have a thorough test for its conversion from a direction vector. Therefore, either something is going wrong after that point, or there is something wrong with the premise of the algorithm.
Another note on troubleshooting: it's easy to change mesh generation to count all vertices as “transparent” vertices, thus causing depth sorting instead of depth buffer testing to be used. This doesn't enlighten us about what the problem is, but it'll help check when it's fixed. A quick test seems to indicate that things aren't going severely wrong with lots of sorted geometry — just a little bit.
My best guess is that the sorting is correct and the direction-to-sort-order conversion is not, but I haven't investigated yet. A possible next step would be to add debug drawing that indicates what ordering is being used for each nonempty chunk.