BSP trees

I woke up this morning and suddenly realised how a BSP would be faster for z-sorting in 3D. I was thinking of it in terms of collisions, not really in terms of depth sorting and assumed that for z-sorting, it would be more accurate yet slower than the basic painter’s algorithm.

But of course, a pre built tree, splitting the polygons into convex groups, there would be no per poly sorting at all. Sorted into convex groups, and rendered in batches, with no per poly sorting, it would be quicker without a doubt. Well, a fair few polys are going to need to be spliced together, resulting in more polygons, but I think it would still be significantly quicker.

Sorting a renderlist of 2 or 3 thousand polygons by depth is actually pretty slow, and has a big impact on performance, like 25%, compared to unsorted.

The question is, how would you go about integrating enemies/moving objects into a BSP tree without it nullifying the performance gained by not sorting per poly?

For any of you that have experience of BSP trees, and perhaps 3D on other platforms, do you have an idea? I think on other platforms they might use a z-buffer to sort moving objects with static BSP polygons. But that’s with scanline rendering and pixel level control, in Flash this wouldn’t really be possible, or if it is, it would be obscenely slow.

Does anyone with experience in this area have an idea then, of how this could be approached in AS3?

Cheers,
RumbleSushi