[Papervision3D] Papervision3D will get BSP built in.
r.hauwert at gmail.com
Tue Jul 8 13:22:31 PDT 2008
In following to Tim's thread on FloorPlanner, I'd like to clarify on
the development status of BSP (read, good Z-Sorting) for Papervision3D.
With Tim's guidance, I've created a portable BSP renderer for
Papervision3D a couple of months back. Lately I have been recreating
that, based upon real world experiences, and am now in the testing and
debugging phases of that renderer.
The thing about developing Papervision3D API features, or almost
anything for a generic engine, is that your are not developing for 1
project, but have to keep in mind many use cases, and many users.
Thus, many different implementations might lead to many different
I'm trying to embed all the needed functionality inside the engine, so
it becomes a transparent part of it. Consider it a rendering switch,
but in the case of bsp there's an additional consideration; the
initial creation of the most optimized BSP tree. It's a challenge to
keep both the original rendering seperate from BSP rendering AND keep
an easy API for both, without doing any concessions in performance on
Now, some of you might have noticed the QuadTree classes in the data
namespace. These classes are for a different type of renderer which
will utilize Warnock's algorithm to do runtime triangle sorting and
clipping. A form of this algorithm is alread implemented in Away3D.
With all respect to the amazing piece of work that is, I feel that for
fast sorting, this is definitely a heavy algorithm for full-scene
renders and certainly not the 1 stop solution to the issue of not
having control over your rasterizer (which is flash), or lack of speed
to do more brute force algorithm.
In that light, I'm looking into ways to combine different types of
algorithms to allow for dynamically correct sorted triangles with
dynamic objects. A good example of such an algorithm implementation is
the Quake 1 engine, where it used BSP for the world, and used Z-
Buffering for the moving objects. Z-Buffering is a whole different
beast, at probably the most bruteforce way. It's certainly possible,
but it will, again, come at a huge speed cost. Warnock's + BSP could
be a possibility too.
Ideally we'd have a couple of these algorithms implemented, and would
allow you to mix and match for your use case. That's a massive effort
though; to keep that both fast and flexible with multiple sorting and
clipping algorithms is a huge effort on it's own, considering the API
would still need to be simple and flexible.
Alternativa3D's approach too a dynamic BSP is great work, but it comes
with the baseline limitations of bsp. lot's of triangles under an
angle in a dynamic object will slow it down to a crawl. The two mind-
blowing Alternativa demo's are a great showcase of BSP, but I would
love to see performance with 2+ dynamic objects inside those geometry.
Mind you, in their demo's nothing but the textures move.
The holy grail of good sorting has been an issue which was around long
before Flash, and is now mainly solved by both bruteforce and smart
optimisation in those engines. Flash just comes with a specific set of
challenges. Flash 10 will certainly help solve some of those issues
(and will create some new challenges too), but right now we are all
going to be stuck with targeting Flash 9 for a while still. Thus, we
still need to deal with the challenges this player offers us.
To conclude what I was saying; BSP is definetly coming to
Papervision3D. Soon, which depends mostly on me to sort it out and get
it fully integrated in the best way. In it's first phase it will be
primarily be static, and later on I hope mix and match with another
sorting strategy will be possible. Also another goal to be met is the
pre-processing of a scene and exporting it to binary, to take out the
initial (long and heavy) pre-processing of the scene to BSP. This
effect can be seen in Alternativa, where a relatively small scene
seems to take very long to load....that's the actual BSP pre-
processing. As far as I have seen that's also the only data structure
it supports for 3D rendering, so it's an inherent part of that engine.
Something I'd certainly not like to see happen to Papervision3D.
More information about the Papervision3D