Re: [osg-users] osg::Sequence boundingsphere

2012-10-30 Thread Marc-André Labrie
Finally, I have done some investigation regarding this subject: returning
the active child bounding sphere when the getBound() method of an
osg::Sequence is called can increase considerably the renderingTraversal
execution time (2x for my complex scene). This is probably due to the
invalidation of bounds (dirtyBound) and all the necessary bounds
recalculation ...

Most of the time, I think each child of an osg::Sequence probably have the
same bounding sphere size: thus recomputing the bounds during each
traversal is unnecessary (the current mechanism is then  appropriate in
this context).

But for an osg::Sequence like mine (where children sizes vary a lot), there
should be a "mode" indicating which strategy the getBound() method shall
use (active child or all of them).

Marc-Andre

On Thu, Oct 18, 2012 at 8:05 PM, Ulrich Hertlein wrote:

> Hi Marc-Andre,
>
> On 19/10/12 2:01, Marc-André Labrie wrote:
> > But I still do not understand why non-visible geodes should take part to
> the
> > boundingsphere calculation.
> >
> > In my case, in my osg::Sequence, frame1 is way much smaller than frame15
> ...
>
> I'm not saying that they should (quite the opposite), osg::Sequence
> *should* only use the
> currently active child (like osg::Switch is doing).
>
> Maybe you can submit a patch for that?
>
> Cheers,
> /ulrich
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osg::Sequence boundingsphere

2012-10-18 Thread Marc-André Labrie
Ok, thanks for the info.

But I still do not understand why non-visible geodes should take part to
the boundingsphere calculation.

In my case, in my osg::Sequence, frame1 is way much smaller than frame15 ...

Marc-Andre



On Thu, Oct 18, 2012 at 3:26 AM, Ulrich Hertlein wrote:

> Hi Marc-Andre,
>
> On 18/10/12 14:49, Marc-Andre Labrie wrote:
> > I guess you are referring to a node visitor when you wrote about
> > TRAVERSE_ACTIVE_CHILDREN. I have inspected the code but could not find
> this mechanism
> > for computing the bounding sphere: I thought computebound was called
> sequentially on
> > every children after getbound is called on a node.
>
> Yes, you are right, my mistake.  I was only looking at the traversal
> function.
>
> The Sequence::combuteBound() is inherited from Group and indeed checks
> every child -
> unlike Switch for example, which only looks at active children.
>
> /ulrich
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osg::Sequence boundingsphere

2012-10-18 Thread Marc-André Labrie
Ok, thanks for the info.

But I still do not understand why non-visible geodes should take part to
the boundingsphere calculation.

In my case, in my osg::Sequence, frame1 is way much smaller than frame15 ...

Marc-Andre



On Thu, Oct 18, 2012 at 3:26 AM, Ulrich Hertlein wrote:

> Hi Marc-Andre,
>
> On 18/10/12 14:49, Marc-Andre Labrie wrote:
> > I guess you are referring to a node visitor when you wrote about
> > TRAVERSE_ACTIVE_CHILDREN. I have inspected the code but could not find
> this mechanism
> > for computing the bounding sphere: I thought computebound was called
> sequentially on
> > every children after getbound is called on a node.
>
> Yes, you are right, my mistake.  I was only looking at the traversal
> function.
>
> The Sequence::combuteBound() is inherited from Group and indeed checks
> every child -
> unlike Switch for example, which only looks at active children.
>
> /ulrich
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osg::Sequence boundingsphere

2012-10-17 Thread Marc-André Labrie
Hi,

Is there a reason why an osg::Sequence does not calculates its
boundingsphere based only on its active child (rather than using all of
them)?

I can define my own Sequence and override the getBounds() method; but I
want to know why it is not the default behavior.

Thanks

Marc-Andre
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org