Hi Ben,

There really isn't enough info to know what the problem might be in your setup.

What version of the OSG are you using?

Camera support in 2.x is much more rounded and complete than it was in
1.x so perhaps this is the source of the problem.

Robert.

On Dec 7, 2007 8:39 PM, Ben Cain <[EMAIL PROTECTED]> wrote:
> 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
> [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

Reply via email to