Archived

This topic is now archived and is closed to further replies.

FrankBlack

bsp ( ala quake ) vs octree for indoor rendering

Recommended Posts

FrankBlack    122
Hey guys, i''m going to update my bsp scene manager for more dynamic stuff ( using some hacks for destroyable walls etc. ), but thats a lot of work, so i''m concerned about octree vs. bsp for indoor rendering on todays gfx cards. Everyone knows that pvs + bsp is the fastest way ever for culling our soup of convex-polygons, but it is realy such a performance boost on a high-end machine ? imagine an octree, just cull against the frustum, some operations more and not perfect without pvs, but ~100 polies more or less, it is really that much difference ? Octrees for indoor rendering would be really cool, destroying walls or whole buildings, ultra-big levels, no problem. We could use CLod and so on ... So guys whats up ? No theoretic stuff please, somebody here who tested a well-designed octree vs. a bsp-tree for quake/ut like levels ? Would be great to get some more infos about real-world apps/performance-tests. Greetz Frank Black

Share this post


Link to post
Share on other sites
FrankBlack    122
Its me again.
Just checked out the harmless algos, i think theres one idea, using an octree and creating for every leaf of this tree a bsp ( ~50 polygons per leaf ).

Somebody here who implemented this idea or can tell more about this ?

I think its for using the features of an octree in combination with bsp advantages like back/front front/back order, fast collision stuff and the ability for cbuffering/beamtree, is this right ? Whats about performance, we could cache these mini-bsps and just recalculating them on some geometry changes like blasting walls away, its accetable for 50 polygons and using primtiv csg wouldnt be too hard.

Or is it too much to recalculate the mini-bsp every 5 frames or so ?

Would be a nice system, octree and still ordered polygons, and everything is dynamic ... something must be wrong here, cause
its seems like nobody is implementing this ?!

Come on guys more action here please
Demos, links, ideas ...

Greetz
Frank Black


Share this post


Link to post
Share on other sites
FrankBlack    122
Okay, 2 hours searching with google for some octree apps i found this => http://www.thaigamedevx.com
and on this chinese (or so) forum if found this =>
http://www.thaigamedevx.com/Download/seniorprojectdemo.zip
tada, i tiny octree app rendering halflife/cs maps (q2),
without some pvs or something else, soooo much room for
optimising, theres no collision detection etc. buts
just a little not-optimised demo running with 200 fps,
my counterstrike is running in 150 fps ( timerrefresh command for real states ).

So what the hell is going on here ?
Some more research here with collision detection and the
octree-leaf-bsp idea wouldnt be a waste of time, i guess

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
I believe the Crystal space engine (http://crystal.linuxgames.com/) uses some kind of octree/bsp, and octree/portal.
It might be interesting to check its source code (LGPL :p)

Share this post


Link to post
Share on other sites
Countach    122
Efficiency is not always desired.
A videocard can render many triangles in a single pass (all in the same vertexbuffer/indexbuffer) way faster than in a 100 passes (with vertex data in systemmemory. Its easy to make an octree implementation that groups triangles whereas its much harder to make a BSP implementation that can do this.

Also, BSP''s produce split triangles. You can code an octree that doesn''t produce splits (by storing spanning tris in the parent node).



Reach out and torch someone.

Share this post


Link to post
Share on other sites
Countach    122
By the way, Harmless'' idea is great provided you render using the octree and do collisiondetection using the bsps. Its somewhat challenging to implement perhaps due to the different subdivision algorithms.



Reach out and torch someone.

Share this post


Link to post
Share on other sites
FrankBlack    122
quote:
Original post by Countach
By the way, Harmless'' idea is great provided you render using the octree and do collisiondetection using the bsps. Its somewhat challenging to implement perhaps due to the different subdivision algorithms.



Reach out and torch someone.


Nope, i think he generates a bsp for a leaf of the octree, isnt that right ? so generatiing a bsp for around 50 polies could be done in realtime ...



Share this post


Link to post
Share on other sites
FrankBlack    122
quote:
Original post by Countach
Efficiency is not always desired.
A videocard can render many triangles in a single pass (all in the same vertexbuffer/indexbuffer) way faster than in a 100 passes (with vertex data in systemmemory. Its easy to make an octree implementation that groups triangles whereas its much harder to make a BSP implementation that can do this.

Also, BSP''s produce split triangles. You can code an octree that doesn''t produce splits (by storing spanning tris in the parent node).



Reach out and torch someone.



Hehe, thats not new to me ...
Bsp is for the right back/front front/back order, so producing nearly zero overdraw, for culling you should use a pvs/portal-system.
But the idea is to have an octree, and creating for each
leaf of the octree a mini-bsp. So Collision-Detection ->
- Find Octree-Leaf we are in ( thats easy, cause we are using aabbs )
- Use the Bsp of this Leaf for per-polygon collison detection ( also easy, just use a distance of planes )

So cause we are using bsp for every octree leaf, we
are able to use some kind of cbuffer, i guess.
That would be damn fast and we could mix landscape + indoor,
creating really big indoor levels, cause using an octree.

Got it ?
But when 2 leafs of the octree are visible, we would
have 2 mini-bsp-trees, hmmmmm, just render the leaf we are
in first and afterwards the second leaf ?


Share this post


Link to post
Share on other sites