[osg-users] Problem rendering Overlay node

Rahul Jain rahulj at vizexperts.com
Wed Sep 10 10:33:08 PDT 2008


Hi all,
I am trying to use overlay node to overlay a sphere on top of a 
cylinder, but  i am getting the black area(Clear color) around the 
sphere as shown in the snapshot. Ideally i want to have just sphere on 
top of cylinder. My code for  setting the overlay is

// Create overlay node
    osg::ref_ptr<osgSim::OverlayNode> olNode =
    new 
osgSim::OverlayNode(osgSim::OverlayNode::OBJECT_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY);

    olNode->setOverlaySubgraph(sphNode);
    olNode->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER);
    olNode->setOverlayTextureSizeHint(1024);
    olNode->setOverlayBaseHeight(0.0);
    olNode->setTexEnvMode(GL_BLEND);
    olNode->setOverlayClearColor(osg::Vec4(1.0, 0.0, 0.0, 0.0));

    osg::ref_ptr<osg::Group> grpNode = new osg::Group;
  
    olNode->addChild(cylNode);

Can someone tell me what am i doing wrong ?

-- 
Rahul Jain,
Member of Technical Staff,
Visualization Experts Limited.
www.vizexperts.com
+91-98109-83697 (M) 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ov.png
Type: image/png
Size: 6626 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080910/6a378768/attachment-0002.png>


More information about the osg-users mailing list