From: Yair Kurzion (yair++at++polygon.engr.sgi.com)
Date: 01/18/2000 14:43:15
Hello Dimi !
> although this question has been answered before here a this list I have
> problems making it work.
> My problem is that I am doing some dynamic geometry (changing vertices
> in a geoset at runtime)
> for a geometry node, and I would like to disable culling for this node
> only to avoid to recompute
> it bounding box dynamicaly.
> My scene graph is fairly simple on top is a scene node and attached to
> that node are 4 geometry nodes (one of them is the node which is
> dynamicaly updated) and some lighsources.
>
> The solutions given here so far were
>
> 1) To use a preCull callback func on ALL the nodes you want to be NOT
> culled
>
> pfNodeTravFuncs( node, PFTRAV_CULL, PreCullCb, NULL );
>
> int PreCullCb(pfTraverser *trav, void *data)
> {
>
> pfCullResult( PFIS_MAYBE | PFIS_TRUE | PFIS_ALL_IN );
>
> return PFTRAV_CONT;
> }
>
>
> 2) To instruct Performer to always accept a node (as visible) by
> calling:
>
> pfNodeTravMask(node, PFTRAV_CULL, 0, PFTRAV_DESCEND, PF_SET);
>
> Neither solution has worked for me, and I do not know why. I have
> managed to disable culling
> for all the scene by applying either of these two techniques to the top
> scene node, but I would
> like to disable culling only on one node and not on the others which
> cary expensive static geometry.
Here is how Performer culling works: Every node of the scene graph has a
bounding sphere. Performer checks if that bounding sphere intersects with the
viewing frustum. If the bounding sphere is completely outside the viewing
frustum, it rejects the entire scene graph under that node.
So, although you disable culling on your node, its parents probably get culled
out.
If you want Performer to always reach your node, you should disable culling on
all its parents - all the way to the root of the scene graph. This doesn't mean
that you have to disable culling for the entire scene graph. You can use:
pfNodeTravMask(node, PFTRAV_CULL, 0, PFTRAV_SELF, PF_SET);
(note the use of PFTRAV_SELF instead of PFTRAV_DESCEND) on every node on the
path from the scene graph root to the node in question.
-yair
--
\_________ \_____ \__ \__ \_____ Yair Kurzion
\_________ \_____ \__ \__ \_____ yair++at++sgi.com
\__ \__ \____\__ \__ http://reality.sgi.com/yair
\__ \__ \__ Work: (650) 933-6502
\__ \__ \__ Home: (408) 226-9771
\__ \__ \__
This archive was generated by hypermail 2b29 : Tue Jan 18 2000 - 14:43:23 PST