Re: [osg-users] AutoTransform and small feature culling again

2008-09-18 Thread Robert Osfield
Hi Fabien,

Another workaround would be to set the culling off for the affected
AutoTransform - by doing:

  transform->setCullingActive(false);

This would have an small impact on cull traversal speed, but would at
least ensure that the node is always traversed.

Robert.

On Thu, Sep 18, 2008 at 9:38 AM, Fabien Lavignotte
<[EMAIL PROTECTED]> wrote:
> I have been through an issue that has been discussed previously on the
> osg-users mailing list. I have put the previous discussion below (it was
> end of august).
> The culling traversal was never called on an AutoTransform with auto
> scale because of small feature culling.
>
> So Robert answers with three solutions :
> 1) Switch off small feature culling :
>i don't want to do that because other node needs it for best
> performance
> 2) Override the computeBound() of the AutoTransform so that it returns
> an invalid bounding sphere for the first frame :
>the AutoTransform::computeBound() is already doing that !
> 3) Override the computeBound() of the AutoTransform so that it returns
> an large default bounding sphere for the first frame
>i try that and it works quite well
>
> In fact, solution 2) does not work when the AutoTransform has a parent
> with multiple children.
> In this case, the parent is equals to valid bound of its children. So
> solution 3) works quite well, except when there is a "huge" camera
> movement.
> More precisily, when you look closely at the AutoTransform nodes, and
> then go back instantly to a very far distance.
> Culling traversal will not be called again because the AutoTransform
> bound will be too small... Not sure how to handle this case at the
> AutoTransform level or if it is possible.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] AutoTransform and small feature culling again

2008-09-18 Thread Fabien Lavignotte
I have been through an issue that has been discussed previously on the
osg-users mailing list. I have put the previous discussion below (it was
end of august).
The culling traversal was never called on an AutoTransform with auto
scale because of small feature culling.

So Robert answers with three solutions :
1) Switch off small feature culling :
i don't want to do that because other node needs it for best
performance 
2) Override the computeBound() of the AutoTransform so that it returns
an invalid bounding sphere for the first frame :
the AutoTransform::computeBound() is already doing that !
3) Override the computeBound() of the AutoTransform so that it returns
an large default bounding sphere for the first frame
i try that and it works quite well

In fact, solution 2) does not work when the AutoTransform has a parent
with multiple children.
In this case, the parent is equals to valid bound of its children. So
solution 3) works quite well, except when there is a "huge" camera
movement.
More precisily, when you look closely at the AutoTransform nodes, and
then go back instantly to a very far distance.
Culling traversal will not be called again because the AutoTransform
bound will be too small... Not sure how to handle this case at the
AutoTransform level or if it is possible.

Thanks,
Fabien


--
Hi Sherman,

I don't think your code is in error, nor that AutoTransform or small
feature culling is in error, rather it's unfortunately chicken and the
egg "which came first?" type dependency.

The ways to break the culling of custom node in the first frame would
be:

   To switch off small feature culling or set its value very low.

   To override the computeBound() of the AutoTransform so that it
returns an invalid bounding sphere for
   the first frame till its been through the cull traversal once, once
its been set correct then let the
   bounding sphere be computed correctly.

   To override the computeBound() of the AutoTransform so that it
returns an large default bounding sphere
   for the first frame till its been through the cull traversal once,
once its been set correct then let the
   bounding box be computed correctly.

The two later solutions could possibly be rolled into AutoTransform
itself.

Robert.

On Mon, Aug 25, 2008 at 2:53 AM, sherman wilcox
 wrote:
> I've attached a small demo app that illustrates an issue I've
> discovered (known?) with AutoTransform nodes and small feature
> culling. Briefly summarized, if I add a custom AutoTransform node (see
> code for trivial example) to the scenegraph just under the root node
> everything seems fine, with or without small feature culling enabled.
> However, if I add this AutoTransform node as a member of a osg::Group
> and then add the group to the scenegraph then this node's accept
> function no longer is called after the first traversal if small
> feature culling is enabled. However, if I disable small feature
> culling all is well.
>
> Is this a bug or am I doing something wrong?
>
> ___
> osg-users mailing list
> osg-users at lists.openscenegraph.org
>
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
>
>

__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org