Hello,

I'm having trouble getting culling to work for a CameraNode that's used with
RTT.  Is there anything inherently wrong with trying to do this?  I'm
assuming cull/node masks still apply with RTT.

Without having to send too much code, I'm using RTT with post-filtering to
emulate a sensor scene.  The first stage is the one that actually traverses
the root scene graph ... the following stages just work off of the RTT image
from the previous stage ... applying image shader functions.

Anyways, it's the first stage that sets the cullmask.  Any idea why not
working?

   // Some node to render ...
   osg::ref_ptr<osg::Node> node =
osgDB::readNodeFile(mMission->getEnvSpec().terrainFile);
   node ->setNodeMask(NODE_MASK_IR);
   scene->addChild(node .get());

   //...

   // Render-to-texture stage
   {
   mNightvisionStage0 = boost::shared_ptr<cRtt>(
      new cRtt(root, scene, mMsl->getSensor()->getRes(),
mMsl->getSensor()->getRes(),
         osg::Vec4(1.0, 1.0, 1.0, 1.0)));
   mNightvisionStage0->setName("SensorNightVision");
   mNightvisionStage0->setCullMask(CULL_MASK_SENSOR_NIGHTVISION);
   mNightvisionStage0->setInheritanceMask(osg::CameraNode::ALL_VARIABLES &
~osg::CameraNode::CULL_MASK);
   }

   // Color amplification stage
   {
   std::vector<osg::ref_ptr<osg::Uniform>> uniformVars1;
   uniformVars1.push_back(new osg::Uniform("tex", 0));
   uniformVars1.push_back(new osg::Uniform("fAmp", 2.0f));
   mNightvisionStage1 = boost::shared_ptr<cRttPostfilterStage>(
      new cRttPostfilterStage(root, mMsl->getSensor()->getRes(),
mMsl->getSensor()->getRes(),
         mNightvisionStage0->getTexture(), osg::ref_ptr<osg::Texture2D>(),
         "amplifier", "./resources/models/amplifier.vert",
"./resources/models/amplifier.frag", uniformVars1));
   }

   // Color amplification stage
   // Bright pass stage
   // Horizontal smoothing stage
   // Vertical smoothing stage
   // Composition stage
   // ...

Thanks,
  Ben


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.17/1177 - Release Date: 12/7/2007
1:11 PM
 

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to