Try adding this at line 999
{
std::cout<<"Creating double quad based forest...";
osg::Group* group = new osg::Group;
group->addChild(createXGraph(cell.get(),dstate));
group->addChild(createHUDWithText("Using double quads to create a
forest\n\nPress left cursor key to select osg::Billboard based forest\nPress
right cursor key to select osg::MatrixTransform based forest\n"));
_techniqueSwitch->addChild(group);
group->getOrCreateStateSet()->setMode(GL_ALPHA_TEST,
osg::StateAttribute::ON);
group->getOrCreateStateSet()->setAttributeAndModes( new osg::BlendFunc,
osg::StateAttribute::ON );
osg::AlphaFunc* alphaFunc = new osg::AlphaFunc;
alphaFunc->setFunction(osg::AlphaFunc::GEQUAL,0.05f);
group->getOrCreateStateSet()->setAttributeAndModes( alphaFunc,
osg::StateAttribute::ON );
group->getOrCreateStateSet()->setRenderingHint(
osg::StateSet::TRANSPARENT_BIN );
std::cout<<"done."<<std::endl;
}
should fix it
-Nick
On Fri, Feb 5, 2010 at 5:15 AM, LAO Wenhao <[email protected]> wrote:
> Hi,
>
> Why transparent edges are appeard when we use transparent textures? For
> example, in the osgforest example program, when a billboard tree is closer
> to another billbard tree, we will find a transparent edge in the front tree.
> We should see the back tree from the edge, but we see the ground. In the
> mode of "quads" or "osg::MatrixTransforms", these edges are even more
> apparent. Please see the picture.:(
>
> Thank you!
>
> Cheers,
> laowenhao
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=23707#23707
>
>
>
>
> Attachments:
> http://forum.openscenegraph.org//files/question_458.jpg
>
>
> _______________________________________________
> 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