Octree question
Octree question
Hey all.
I have a scene (level) where i create ~~7000 unique ISceneNodes each with its own custom geometry (auto generated, not loaded from a file). At any moment i can remove/modify any of them.
So every frame, the engine has to check every node if it is in the frustum? That makes a lot of checking...?
Is there a way to throw all this nodes into octree? (nodes are "static" they don't change position and the bbox is constant). I've been looking at the addOctTreeSceneNode and it only receives the Mesh param, not the ISceneNodes...
I have a scene (level) where i create ~~7000 unique ISceneNodes each with its own custom geometry (auto generated, not loaded from a file). At any moment i can remove/modify any of them.
So every frame, the engine has to check every node if it is in the frustum? That makes a lot of checking...?
Is there a way to throw all this nodes into octree? (nodes are "static" they don't change position and the bbox is constant). I've been looking at the addOctTreeSceneNode and it only receives the Mesh param, not the ISceneNodes...
No such class exists in irrlicht. Ogre has that type of octree, but no dice for irrlicht.
You could make one though
You wouldn't even have to do it from scratch. I saw someone had made a Quadtree Scene Node for irrlicht. If you didn't need fully 3 dimensional you could use the Quadtree scene node, but if you needed to cull based on all 3 dimensions you would have to modify it to make it an octree.
http://br.geocities.com/paulo_cmv/
You could make one though
http://br.geocities.com/paulo_cmv/
-
rogerborg
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
It's do-able, but non-trivial. We'd have to deal with shifting objects around the oct-tree as they move / rotate / scale, as well as taking into account the descendants of the oct tree's scene node children (including when nodes get reparented), so it's not a lunchtime job.ikslm wrote:Yes, in my case the quadtree would be better. I guess i'll have to make it myself. But i guess something like that would be a nice addition to the engine.
That said, patches are always very welcome, particularly if they come with test apps. I'm still working through the bug backlog, but do intend to get around to the feature requests after 1.5 is cut.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Well for my scenario the things are simpler:
1. i would use quadtree
2. i'd use quadtree only for static objects (by static i mean that they have constant position and bbox), so this quadtree would receive a vector of nodes it should contain and some quadtree params
3. for other objects (animated, movable... in my case there are ~~ 100 of them) i'd use normal frustum culling
1. i would use quadtree
2. i'd use quadtree only for static objects (by static i mean that they have constant position and bbox), so this quadtree would receive a vector of nodes it should contain and some quadtree params
3. for other objects (animated, movable... in my case there are ~~ 100 of them) i'd use normal frustum culling
-
rogerborg
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Swipe the culling code from source/Irrlicht/CSceneManager::isCulled().
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Anyone have code like this to share?
Has anyone implemented anything like this, that they have already shared or are willing to share, please?
It would be very helpful.
It would be very helpful.
