Menu

A question about octrees

2003-06-27
2003-08-07
  • Torsten Damberg

    Torsten Damberg - 2003-06-27

    Hi,

    I want to understand how the octree works within irrlicht.

    Can I load a very big and complex (many groups and materials) 3DS file and let it seperate to an octree to make fast culling?

     
    • Nikolaus Gebhardt

      yes, that's right.
      The octree copies the geometry of the 3ds file (or what mesh every) and reorganizes it in lots of bounding boxes for doing fast culling.

       
    • Torsten Damberg

      Torsten Damberg - 2003-06-27

      Is it possible to fill an octree with a mesh I generate at runtime? (Thinking about terrain generation and putting the triangles into an octree)

       
    • Nikolaus Gebhardt

      Yes, that's no problem. Create your mesh and just make if accessible with a IMesh interace. There are already some implemented frameworks for that, just take a look at SMesh and SMeshbuffer.

       
    • Charles Morton

      Charles Morton - 2003-07-01

      The above is how I did my test terrain node. It works fairly well, altho I kinda felt irrlciht's octtree wasn't aggressive enough about culling polys. ie When I knew I could only see about 200, and I was rendering 3000. This is most likely dependent on the minmum leaf size in the octtree or some suhc. Wasn't a big enoguh deal for me to further investigate.

       
    • Nikolaus Gebhardt

      Maybe it would be a good idea to make the minimum amount of polys per node conigurateable.

       
    • Nobody/Anonymous

      octree culling is not about what you see, it's about what you CAN see (if you could see thru other polygons).
      you can only see 200, but there 200 block your view to another 2800 polys, which are still in the viewing frustrum, so they are not culled.

       
    • Torsten Damberg

      Torsten Damberg - 2003-08-05

      Yes, what you are taling about is called occlusion culling which is very hard to implement. An octree will  do it for terrain.
      Using indoor scenes, portals would be a good thing to use.

       
    • Julio Gorge Frochoso

      I thought of an easy way to customize the octree generation:

      e.i.:

      smgr->addOctTreeSceneNode(mesh->getMesh(0), 10);

      The new 2nd parameter would be the number of subdivisions(cubes) in wich is subdivided every side of the mesh's bounding box.
      It would let the programmer test some values, to choose the most appropiate according to his game.

       
    • Julio Gorge Frochoso

      thinking twice, it doesnt make sense. excuse me for my temporal mental insanity :)

       
    • Nikolaus Gebhardt

      hehe, np :)