Binary Space Partitioning Trees

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
User avatar
Arce
Jealous Self-Righteous Prick
Jealous Self-Righteous Prick
Posts: 2153
Joined: Mon Jul 10, 2006 9:29 pm

Binary Space Partitioning Trees

Post by Arce »

Whilst pondering the wonders of the universe, I stumbled upon a master thesis by Samuel Renta for Upsala University in Sweden. Apparently he's a lead programmer of the Portal Engine, and in his paper he shows in-depth the complete algorithm used in the Portal Engine to create binary partitioning trees using pseudo-code and moron-proof explanations.

The entire purpose of a partitioning tree when applied to a game is to divide a complex 3d polygon into a binary tree of triangles. This is done during pre-process time, and allows for extremely heightened draw times. From what I understand, this method was at one point thought obsolete as hardware acceleration became available, but is now being revisited by game developers. The downside to implementing this is that with a small number of nodes, the overhead memory is an exponential figure. But as the number of nodes increases, the overhead memory levels out, and eventually becomes a very insignificant figure for the amount of nodes. The speed of accessing any given node using the new BSP method described by Renta is log(log(n)), which is un-fucking-godly fast.

This method was originally used in Doom...I wonder how our good friend Rand() is doing? ;P

Anyway, I thought it was interesting. Nothing I'd ever have a need for using (I'm not creating high enough poly-count games with lighting effects that would require this type of advanced structuring) but I found it to be a pretty badass idea non-the-less.

So, here's the original thesis I speak of:

http://www.gamedev.net/reference/progra ... ee/bsp.pdf

and here's another one I found, more technical, on Partitioning Trees.

http://sibgrapi.sid.inpe.br/col/sid.inp ... er-bsp.pdf

Lemme know if anybody else here is intrigued by this. ;P
<qpHalcy0n> decided to paint the office, now i'm high and my hands hurt
User avatar
MarauderIIC
Respected Programmer
Respected Programmer
Posts: 3406
Joined: Sat Jul 10, 2004 3:05 pm
Location: Maryland, USA

Re: Binary Space Partitioning Trees

Post by MarauderIIC »

I've heard about the original method(?) before. Didn't RTFA you posted, but the place I heard about it was some documentary on Tomb Raider =)
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
User avatar
sparda
Chaos Rift Junior
Chaos Rift Junior
Posts: 291
Joined: Tue Sep 23, 2008 3:54 pm

Re: Binary Space Partitioning Trees

Post by sparda »

Pretty fucking sweet indeed. I read a bit on BSP trees when I tried implementing a miniature ray-caster. I've yet to finish reading the whole thesis, but so far so good. Have you guys heard of sparse voxel octree? A little bastard by the name of John Carmack is inventing this data-structure. I just thought is was relevant, since the first user of BSP (in Doom) is at work again... Jesus, that guy is scary smart.
User avatar
avansc
Respected Programmer
Respected Programmer
Posts: 1708
Joined: Sun Nov 02, 2008 6:29 pm

Re: Binary Space Partitioning Trees

Post by avansc »

sparda wrote:Pretty fucking sweet indeed. I read a bit on BSP trees when I tried implementing a miniature ray-caster. I've yet to finish reading the whole thesis, but so far so good. Have you guys heard of sparse voxel octree? A little bastard by the name of John Carmack is inventing this data-structure. I just thought is was relevant, since the first user of BSP (in Doom) is at work again... Jesus, that guy is scary smart.
yeah, the man is a legend. although i dont know of he created it. well maybe... i think he just combimed sparse matricies idea with octrees.

you said you were doing a ray-caster??? i did a ray-traced with shading, reflection, global illumination and so on for my senior design project. remembered that was a bitch, and slow as cow.
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
Post Reply