STAGE ONE COMPLETE

Published June 20, 2011
Advertisement
I found a very fast way to get the results I was looking for in terms of dealing with the 'closed, unreachable space' in the test model (ie, the space inside the inner box).

I modified the ChoosePartitioningPlane function so that it will always return a plane from the input geometry, as long as there is one that has not already been used before. It will prefer to divide the geometry evenly, however if it can't find a plane that partitions the geometry, it will just return a plane that hasn't been used yet.

The results are similar to before, but important differences exist... and the results are actually NOT what I expected.

We still get six convex leaf nodes, however they are now all closed convex hulls - they are correct !!
The tree contains geometry in all leaf nodes, INCLUDING the last leaf node - there are NO empty leaf nodes representing places we can't go - the empty space is not part of our bsp tree at all !!!

We now get 10 planes examined, instead of 5.
They are marked as being Used, but in fact only the 6 planes of the inner box are used to construct the tree, and of those, only 5 represent Portals.
The BSP Tree is not made unnecessarily complex.

GREAT STUFF !!! WOOHOO !!!
Now on to the Portalizer again :)

We are still only getting 5 Portals - this is correct.
The extra planes are generating a lot of extra portal polygons due to more 'shattering', however I have implemented code to Weld them together later, where I detect that they were split unnecessarily.. the current result is a grand total of 14 portal polygons connecting our 6 subspaces.

There are definitely some redundant portal polygons being generated, which are not being appropriately Clipped.
They are coincident with some of the visible faces in the leaves they connect... that is to say, they not only share the same plane as one or more triangles, they are likely to be overlapping with them on said plane - conceptually, we wish to use the triangles to 'mask out' parts of the polygons that are within their bounds.
My portal-poly clipping function ignores polygons which are behind or coplanar with the clipping plane, so they slipped through the net.
I was hoping to avoid clipping of coplanar polygons as this is non trivial and prone to error... and I've had enough trouble with polygonal splitting and merging operations as it stands.
However, maybe I can still avoid it.
I have a theory that, if all previous operations were correct, the redundant portal polygons coincide EXACTLY with some coplanar triangles in the leaf. I should be able to use a process of elimination to decimate each polygon against coplanar triangles, and do it from my existing clipping function. I know it will work for this example model, I THINK it will work generally... this is revisiting the concept that a convex subspace is completely closed by the planes of its faces and portals.
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement