Hi, I have couple of questions regarding how JMonkey engine 3 is using these spatial data structures.
First of all, I understand the concepts of Bounding Volume Hierarchy, BSP, Octrees etc… And I know bounding volumes are being used in view frustum culling and collision detection. Does JME3 actually uses bounding volume hierarchy for its data structures? And I read somewhere in the documentation that JME3 also uses Octrees but under “Usage” it says “coming soon” https://wiki.jmonkeyengine.org/legacy/doku.php/jme2:octree (I can see that it’s JME2 but there is no documentation on it for JME3).
Can you choose between the two spatial data structures? Or does it handles it transparently?
Thanks in advanced!
jME3 uses Bounding Volumes and a BIH tree for collision detection. For your own applications you can implement any tree structure you want, you will probably want to track objects beyond the scope of the scene graph structure anyway.
There’s an implementation of octrees but it is not core. In my tests it usually lowered performance rather than improve it, unless you have really huge indoor scenes.
How about old and good(?) portal system ? Is it slower or faster than octree? Maybe nobody havent even coded it because it is old (but cant remember what are its downsides).
Thanks, so octrees are not being used at all for JME3. So by default, which spatial data structure is it using?
silveon said:
Thanks, so octrees are not being used at all for JME3. So by default, which spatial data structure is it using?
The scene graph uses bounding volume hierarchy (because it is a scene graph after all). You have to arrange the graph in an efficient way though, the engine won't do it for you. For most GPUs its better to render less objects with more triangles vs. more objects with less triangles and based on that its preferable not to use spatial partitioning in most cases unless we are talking about large indoor scenes with many rooms, etc.
1 Like