Thanks.
I see now, after posting, that my Group node actually acts like a leaf node in
the case where it adds the Drawable for query, as it doesn't bother to traverse
the children in that case. So, what I've really got here is a Group node that
can dynamically switch its behavior from a Group with children to a Geode with
Drawables.
If I wanted to actually create Groups with Drawables, the class would support
both adding the Drawables to the render graph _and_ traversing the children. But
I realize now that this is not what I want to do in my code.
Anyhow, thanks again for the info, I'll keep it in mind as I proceed.
-Paul
On 7/26/2011 1:18 PM, Robert Osfield wrote:
Hi Paul,
I'm considering making a Drawable a Node, and would still need to be a
leaf node, but this would make it possible to add it to add Group node
in the scene graph. There are quite a few knock effects to this
change, especially on backwards compatibility so it's not a trivial
change to make. It's one of these changes that outwardly looks like
it might be straight forward, but once you start digging it ends up
being rather more involved.
The Drawable and Geode relationship was original inspired by
Performer's pfGeode and pfGeoSet. I think it makes sense for Drawable
to be a special leaf on the scene graph, but in hinsight it would have
been better to not mirror's Peformer in this particular way. In fact
there were more similarities to Performer naming of classes that
existed in Don's earliest incarnation of the SG, before became the
OSG, as time went on I replaced more and more elements that mirror
Performer, replacing them with extensible classes and making them far
more C++ aware and friendly. However, the sgGeode and sgGeoSet didn't
change too much other than sg->osg:: and sgGeoSet becoming
osg::Geometry, with a Geode aggregating the new osg::Drawable base
class that made the rendering side extensible. This relationship
stuck and while not ideal has never been such a painful restriction
that I haven't yet been forced to rewrite it.
Robert.
On Tue, Jul 26, 2011 at 6:46 PM, Paul Martz<[email protected]> wrote:
Hi Robert (and all) --
Robert, back when we met face-to-face some 5 years back, I recall a brief
discussion about possibly enhancing OSG so that Drawables did not need to be
attached only to the Geode container node, but instead could be attached to
any Group or Group-derived node.
I'm currently working out an improved occlusion query system that could
benefit from such a feature. During cull, a cull callback attached to a
Group executes as follows:
if we think we should do a query:
add a Drawable that performs a query on its geometry
return without traversing the Group's children
else
traverse the Group's children
When the Group cull callback adds the Drawable (to do the query), it does so
just as if the CullVisitor had encountered the Drawable attached to a Geode
(by calling addDrawableAndDepth). This seems to work fine, and in essence,
my code is supporting Drawables attached to a Group (via a Group cull
callback).
If you have a few minutes, I'd love to get your input on this. I wondered
what your current thoughts were with regards to such functionality, why it
was never pursued, what was the thinking behind the original Geode concept
(restricting Drawables to leaf nodes), any other thoughts you might have on
this topic, warnings, etc.
Thanks for any info,
--
-Paul Martz Skew Matrix Software
http://www.skew-matrix.com/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
--
-Paul Martz Skew Matrix Software
http://www.skew-matrix.com/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org