Thanks, this sounds reasonable.
Sebastian Messerschmidt wrote:
> The callback will be called if the bounds are marked as dirty. (i.e. if
> a new PrimitiveSet is added).
> In my use case I simple set the callback, called getBounds once on the
> parent and then removed the callback after loading and before attaching
> the node to the scenegraph. I can do this safely as I know that the
> instanced geometry set is not changed in any way.
>
> cheers
> Sebastian
>
One more point. I really don't care about culling on the Drawable-instances level.
Can I setup the bboxes just for the parent grouping nodes and have nothing at the drawable level, is it possible?
>Can I use some cull-callback to prevent the culling visitor to go deeper to the single Drawables and cull based only on the group node bbox?
there are problem: cullvisitor grabbing drawables for later drawing, and if you dont go deeper, nothing would be drawed
Cheers.
24.08.2012, 17:24, "Alexej Fink" <dk...@gmx.net>:
> http://github.com/gwaldron/osgearth/blob/master/src/osgEarth/DrawInstanced (https://github.com/gwaldron/osgearth/blob/master/src/osgEarth/DrawInstanced.cpp)
gwaldron wrote:
>
> No, you need to apply it on the drawables, otherwise they will still get culled.
>
>
> I created some utilities to support DrawInstanced usage in osgEarth, including a visitor that will apply the static bounding box to drawables. Perhaps it would be useful to you:
>
>
> http://github.com/gwaldron/osgearth/blob/master/src/osgEarth/DrawInstanced.cpp (https://github.com/gwaldron/osgearth/blob/master/src/osgEarth/DrawInstanced.cpp)
>
Do I understand your approach right: That you set the same "static" bbox for each drawable by setting the same calcBBox callback for a group of Drawable instances?
If so. Although this is an other interesting work around. It still does not reduce the culling effort visiting each Drawable instance, which I would like to avoid, since it is meaningless in my setup -- culling on the parent group node would be sufficient. Can I use some cull-callback to prevent the culling visitor to go deeper to the single Drawables and cull based only on the group node bbox?