Octrees and polygons that belong to more than one nodes

Started by
8 comments, last by Godlike 14 years, 8 months ago
I've recently tried to find more info about space partitioning and especially octrees. I've understand all the aspects but I didn't found information about a certain problem. Imagine that we have a triangle that belongs to two octree nodes. What happens in the case I have to render both the nodes? Will this triangle be rendered twice? Or I have to split it in two new triangles? Am I missing something or these are the only 2 ways of dealing with this kind of polygons? Thanks in advance!
-----------------------My Page: † AncienT RituaL †
Advertisement
Could do with some more information about what you are trying to do/achieve, but I'll try to make some suggestions anyways:

1) Could clip the triangles that overlap - giving you perfect boundings at the cost of more geometry.

2) Could just use the centre of the triangles to determine the node they belong to, and just increase the bounding box size of the node they belong to, but that does give overlap to the neighbours nodes.
Adventures of a Pro & Hobby Games Programmer - http://neilo-gd.blogspot.com/Twitter - http://twitter.com/neilogd
I slice up my polygons sometimes and sometimes I just leave them in the node above.

If you havce objects that can't be sliced up then I think the only option is to leave it in the smallest node that it will fit in.

Each of my nodes has a container of objects directly in it (not in any of its child nodes too) and it can also has 8 children. When I check syay, view frustum culling. I check if that node is visible, if it is I render everyhting in that nodes list, thenn I check child nodes and do the same.

I don't think theres anyhting saying objects have to be in leaf nodes only.

Interested in Fractals? Check out my App, Fractal Scout, free on the Google Play store.

Quote:Original post by Nanoha
I slice up my polygons sometimes and sometimes I just leave them in the node above.


3) Leave them in the node above, rather than slice them, if they overlap so far into a neighbouring node, ie - only go into, on one or more axis, 1/2 way into it.
Adventures of a Pro & Hobby Games Programmer - http://neilo-gd.blogspot.com/Twitter - http://twitter.com/neilogd
You can use what's called a 'Loose Octree' (created by Thatcher Ulrich). Essentially each node in the tree is 'enlarged' a by certain amount (for example 50% in each direction). This allows nodes to overlap (so it makes the tree less efficient), but it also lets you avoid object slicing if object is straddling the partition plane. If object is still straddling, you leave it in a parent node, if not, just pick one of the children which can accommodate it.

You can find an article on Loose Octrees in Game Programming Gems 1.

ttvd
use mailboxing. each triangle keeps information about number of frame it was last drawn. so then you just compare those values with current frame, and if it's different you draw triangle and update value. it will also work if you don't do per triangle but per object octree/kd-tree
Quote:Original post by Richy2k
3) Leave them in the node above, rather than slice them


ftw!
Quote:Original post by RobTheBloke
ftw!


not really, what if a lot of geometry intersects split plane of the root node?
I just go through + mark everything to be rendered first, thus if it gets marked again then theres no change
+ then render everything afterward. i.e. first see what you need to redner before the rendering
Thank you all for your answers. You gave me a few great ideas!
-----------------------My Page: † AncienT RituaL †

This topic is closed to new replies.

Advertisement