View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# Octree World Partitioning

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

5 replies to this topic

### #1Alundra  Members

Posted 01 December 2012 - 08:43 PM

Hi,
When partitioning the world using an octree, we split leaf into 8 children.But one triangle can be in more than one leaf.
One method is to have dynamic index buffer by leaf and check each frame.Using this method, it's not static and need to be checked each frame who is not efficient.The check can store a boolean to say this face is already set in a leaf.We need to reset state each frame.

Is it possible to have a generation of octree who is static ?
Thanks

### #2TheChubu  Members

Posted 02 December 2012 - 03:25 AM

Store the triangle on the parent nodes instead of the leaves?

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

My journals: dustArtemis ECS framework and Making a Terrain Generator

### #3C0lumbo  Members

Posted 02 December 2012 - 03:43 AM

Cut up the triangle or put the triangle into multiple leaves?

### #4kauna  Members

Posted 02 December 2012 - 07:05 AM

Why are you cutting meshes in the first place? That may be highly inefficient.

You could store whole objects and use the tree for coarse culling. The logic could be "find a smallest leaf which bound is bigger than the meshes bound box, using the meshes center point", recalculate the leafs loose bound box used for culling.

Cheers!

### #5Alundra  Members

Posted 02 December 2012 - 09:12 AM

What you explain is "loose octree" who is nice for dynamic object.I have all my static geometry in one mesh file, it will never change.Dynamic object is added after.
The static geometry can be 250 000 triangles, all triangles don't need to be render. it's why octree comes here.
It's why the best way i have found is to have Octree for static geometry and Loose Octree for dynamic.
With Loose Octree object will be in one lead of the octree but in octree one triangle can be in 2 or more.
Puting triangle in multiple leafs can cause probleme for alpha blended material.
Is the best way to store the triangle in the parent ?

### #6kauna  Members

Posted 02 December 2012 - 09:17 AM

Well the octree I described can be used with triangles also.

Also, I made the definition pretty clear that the object or a triangle resides only in one leaf node. The loose part stands for the leaf loose bound which contains all the objects/triangles inside the node (and it's children) and it is at least as big as the leaf node bound.

Cheers!

Edited by kauna, 02 December 2012 - 02:17 PM.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.