[osg-users] Problem with Camera::inheritCullSettings

Robert Osfield robert.osfield at gmail.com
Thu Nov 26 05:44:39 PST 2009

HI Paul,

My inclination would be to add an extra CullSettings inheritance mask
value for inheriting the ClearMask - as this would fit the way that
other variables are inherited down.

As for the naming of inheritCullSettings, I do also feel that it's not
perfect for conveying what it does, as ordinarily we would think of
cull to do just with scene graph traversal, rather than traversal of
the topmost Camera.  However, in implementation these settings control
what happens in the cull phase, and this does encompass traversal of
cameras as well as the scene graph. Given this I think it's not too
bad a naming.


On Wed, Nov 25, 2009 at 5:13 PM, Paul Martz <pmartz at skew-matrix.com> wrote:
> Hi Robert -- I've encountered a problem with how parent Camera values
> inherit down to slave Cameras, and wanted to discuss it before I launched
> into coding a fix.
> Quick summary: master Camera clear mask doesn't inherit down to slave
> Cameras. As a workaround, I can loop over slave Cameras and set the clear
> mask manually.
> Example use case: On a multidisplay system, create a Viewer configured to
> setUpViewAcrossAllDisplays. Get the Viewer's Camera, set the clear color to
> blue and set the clear mask to 0. Then call run. The windows incorrectly
> clear to blue -- they shouldn't clear at all, because the clear mask is set
> to 0.
> I managed to divine that slave Cameras get their clear colors set in
> Camera::inheritCullSettings, if the CLEAR_COLOR bit is set. If I modify this
> code to also copy the master Camera clear mask down to the slave Camera,
> then I get the expected result (no clearing occurs).
> It seems like there are two ways to fix this: One is to just piggyback clear
> mask onto the CLEAR_COLOR bit, or we could also add another bit specifically
> for clear mask.
> The second way, I'm not sure about. But the name "inheritCullSettings" fails
> to imply that clear color, possibly clear mask, read buffer, and draw buffer
> are all set in that function. So I wonder if inheritCullSettings is the
> right place to inherit these values? Or should master-to-slave value setting
> be done somewhere else?
> I'd appreciate your input on this, and I'd be glad to code a solution if you
> can provide some direction. Thanks.
> --
> Paul Martz
> Skew Matrix Software LLC
> _http://www.skew-matrix.com_ <http://www.skew-matrix.com/>
> +1 303 859 9466
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

More information about the osg-users mailing list