help with my bsp tree

I have my bsp tree working fine, but i have one problem… it’s slower!
If i draw my world that has around 760 polys with linked lists, i have a bigger fps rate than using the bsp tree code, and the bsp tree is actually drawing around 280 polys while the linked list is drawing all the polys!
Could someone that understands how bsp trees work, check my code to see what am i doing wrong?

you can send it to me at

What it means is that the overhead incurred by your BSP code is more than the overhead of drawing 500 extra polys. 760 polys for an entire scene is not much at all, so you probably do not need to go to great lengths to worry about culling.

Thanks for the replys.
It’s on the way frogger


Well, BSPs are great but I don’t think it’s the best way to optimize rendering… Use PVS or Portals or things like that instead…

I believe the same… your bsp code is just about the same as mine…

it must be harder computationaly to compute the side of the plane then just rendering the polys… (i will look into it more)

Frogger: So, do you think everything is working just fine?
I still think it’s weird that the bsp tree computes 250 polys slower than the linked list with 750 polys.
How do you guys calculate the portals?
Do you define the portal in an editor, or made some algorithm that gets the entire list of polys, and arrange them in the portal structure???



Could you try to display something like 50000 faces instead of 760 ? I mean, in this case, your BSP should be useful ! Then you would know if it is working or not !

Try something like an equivalent of a DOOM level (that’s where BSPs are REALLY efficient).

Mind you, if you are using a GeForce, I am not surprised that your scene is slower using the BSP than without it (and that is because of you low-poly count).