BSPs?

Blitz3D Forums/Blitz3D Programming/BSPs?

John Blackledge(Posted 2004) [#1]
I'm currently using the usual method of a Blitz terrain plus entities, but as my level gets bigger and bigger it began to occur to me that my method of showing/hiding entities to speed up framerate may not be the best.
Then I read a description of how BSPs work and thought I'd pose a general question:
If BSPs are so efficient (yes, they are, check out Wolfenstien) shouldn't we all be using this method?


Neochrome(Posted 2004) [#2]
we should, but mark is writing something like that in BlitzMAX (this is my understanding anyhow)

I had this problem once so i cam up with only hiding and show entities at a set frame rate, say ever 10 frames, or so, that way you can keep some of you CPU speed and the unessery hiding and show entities, its not pretty but its what we get with BB3D


Techlord(Posted 2004) [#3]
we all be using this method?

NO! It really depends on your needs. BSP is ideally designed for Indoor Levels and its very good for solving occlusion and collision. However, there are other rendering techniques for Occlusion and Level Of Detail(LOD): Portals, Cubic Space Partitioning(for lack of better name), Mesh Switching, Mesh Blending.

BSP is whats known as a precalculated potential visible set (PVS). A list of the possibly visible sectors stored in every sector. BSP also manages the order in which polygons are rendered.

Cubic Space Partitioning determines PVS based on location. Unlike BSP it has no control over the order of polygons. Just imagine a single floor level map in which and invisible grid divides the map into small cubes. Each cube contains a list of polygons visible in any directions within that cube. When the player moves from one cube to another the old cube's polygons are hidden and the new cube's polygons are shown.

A Portal is just an object that defines a window in which an area can "see" another area. They serve as a viewport and unlike BSP or CSP they are performed realtime rather than preprocessed.

Level Of Detail is a rendering technique ideal for Outdoor Levels. The basic concept is that Meshes further from the camera require less detail (polygons) then closer ones. Thus, you increase a mesh's polygon count as it gets closer and decrease the polygon count as it gets further away. LOD can be achieved either by manipulating the polygons realtime or switching between meshes with hi-lo polygon count.

I'm personally in favor of using both CSP and Mesh Switching LOD which can be implemented in blitz rather easily.


Rook Zimbabwe(Posted 2004) [#4]
Wow... learn so much here... I say use em all! but I really don't know anything about most of them!!! : )
-RZ


poopla(Posted 2004) [#5]
BSP is whats known as a precalculated potential visible set (PVS).


No, BSP is whats known as binary space partitioning, since thats exactly what your doing, breaking the map into a binary partition tree of geometric hulls. Dont confuse the boy :).

(That and the fact that thats what BSP stands for) ;)


Techlord(Posted 2004) [#6]
ShatteredReality,

Oops, thats is correct. I should of stated, 'BSP is a type of precalculated potential visible set (PVS).'


John Blackledge(Posted 2004) [#7]
'Cubic Space Partitioning' sounds like what I am using already - the concept of leaving and entering sectors (since I work mainly outdoors at the moment), so go round a hill, enter a new sector, hide all objects in other sectors, show all objects in entered sector. Crude but effective in terms of fps.

LOD - I think Blitz already implements this (?) judging by the change in the terrain when viewed as wireframe.

All in all, brilliant answers, and thanks for taking the time to explain. I guess I won't be using BSPs then, I'll wait fot BlitzMax (groan - not that phrase again).


Physt(Posted 2004) [#8]
'BSP is a type of precalculated potential visible set (PVS).'

The two concepts are different. A BSP tree is used to draw polgons in order (front to back, back to front). A simple BSP does not have to contain any visible set information. Leaf of the tree usually contain pointers to other leaves that are visible from within that leaf.

It is also possible to use PVCS techniques without a BSP.


Techlord(Posted 2004) [#9]
John,

It sounds like you are using CSP. CSP can be implemented in many ways, but the 'functionality' is the same. I believe the technique is relatively new in the sense of it being utilized in a game, as its a high level preprocessed occlusion technique relying on Z ordering. Or perhaps its has been used and noone gave it a label:) IMO, its interesting that the complex BSP and Portal algos ave dominated the Occlusion arena for this long.

Physt,

Thanks for elaborating, however, what is PV'C'S?


John Blackledge(Posted 2004) [#10]
Der.... no, sorry Frank. Thanks for the compliment, but all I do is hide all the entities in the sector(s) I'm leaving, and show all the entities in the sector I've just entered.