From f97759405a6b3d19caeb745d6c16dbe87b2f9a50 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 2 Oct 2006 14:11:40 +0000 Subject: [PATCH] From Farshid Lashkari, "Here is the patch we discussed previously about adding a flag to CullSettings which allows CameraNode to inherit the clear color." --- include/osg/CullSettings | 1 + src/osgUtil/CullVisitor.cpp | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/osg/CullSettings b/include/osg/CullSettings index 63a509043..95bf9f108 100644 --- a/include/osg/CullSettings +++ b/include/osg/CullSettings @@ -70,6 +70,7 @@ class OSG_EXPORT CullSettings CULL_MASK = 0x0400, CULL_MASK_LEFT = 0x0800, CULL_MASK_RIGHT = 0x1000, + CLEAR_COLOR = 0x2000, NO_VARIABLES = 0x0000, ALL_VARIABLES = 0xFFFF diff --git a/src/osgUtil/CullVisitor.cpp b/src/osgUtil/CullVisitor.cpp index 1555523fc..666d51aea 100644 --- a/src/osgUtil/CullVisitor.cpp +++ b/src/osgUtil/CullVisitor.cpp @@ -1151,7 +1151,14 @@ void CullVisitor::apply(osg::CameraNode& camera) // set up the background color and clear mask. - rtts->setClearColor(camera.getClearColor()); + if (camera.getInheritanceMask() & CLEAR_COLOR) + { + rtts->setClearColor(camera.getClearColor()); + } + else + { + rtts->setClearColor(previous_stage->getClearColor()); + } rtts->setClearMask(camera.getClearMask()); // set the color mask.