A bug in the CullHint method? Children *always* inherit culling

Hello,

I’m having trouble with setting selective cullhinting. I have a large collection of objects divided into groups with parent nodes. I need to quickly show either all of them or just one of the parent nodes contents. The fastest way to do this would be to set the rootNode cullhint to Always, and the desired parent node of the objects as Dynamic (all other parent nodes disappear, only this one parent node remains visible).

The problem is that when i set ANY parent node culling to always, the children inherit it even when their own cullhint is NOT set as inherit! According to my logic this should not happen.

Why can’t i just switch the rootnode culling to always and enable specific children to be seen in the scene? This whould be SO easy.

Currently i have to loop through all the object parent nodes and switch their visibility individually as always or dynamic to get the desired result. This is very inefficient!

Is there a bug in the SDK 3.0RC2 or have I just understood the whole culling hierarchy incorrectly?

Thanks in advance!

Here is the BasicGame class with my test code:

http://pastebin.com/HEwExHdk

Culling doesn’t work the way you want. If you cull a node then all of its children are also culled. This way entire sections of the scene graph can trivially be removed from consideration.

1 Like

Ok, thanks for the clarification and super fast answer. I was suspecting this would be the reason.

So i’ll just loop through the parent nodes :slight_smile:

1 Like
@pspeed said: Culling doesn't work the way you want. If you cull a node then all of its children are also culled. This way entire sections of the scene graph can trivially be removed from consideration.

What would the point of ‘inherit’ be if it just inherits it anyway :)?

@avpeacock said: What would the point of 'inherit' be if it just inherits it anyway :)?

Inherit means that you no longer have a specific local hard-code cull always or cull never. Which means if your parent is cull never then you will be cull never and if your parent is cull inherit then you will use frustum culling like normal.

Cull Always and Cull Never are ways for the scene graph to trivially avoid doing frustum calculations on a whole section of the tree (or even cull traversing for that matter).

1 Like