Try adding:

geometry->getOrCreateStateSet()->setRenderingHint(
osg::StateSet::TRANSPARENT_BIN );

Also, I believe you don't need the first setMode(GL_BLEND) because the
setAttributeAndModes() call will do this automatically. -gw

Glenn Waldron : Pelican Mapping : http://pelicanmapping.com :
+1.703.652.4791


On Thu, Nov 13, 2008 at 2:19 AM, YangXiao <[EMAIL PROTECTED]> wrote:

> Hi everyone:
>  How to achieve blend funtion in osg. I means  by alpha(0.0~1.0)  value to
> set my geometry color,
> I use follows code
>
>  geometry->getOrCreateStateSet()->setMode(GL_BLEND,
> osg::StateAttribute::ON);
>  osg::BlendFunc *fn = new osg::BlendFunc();
>
>   
> fn->setFunction(osg::BlendFunc::SRC_ALPHA,osg::BlendFunc::ONE_MINUS_SRC_ALPHA);
>
>     geometry->getOrCreateStateSet()->setAttributeAndModes(fn,
> osg::StateAttribute::ON);
> Best regards
> YangXiao
>
> ------------------------------
> 雅虎邮箱,您的终生邮箱! <http://cn.mail.yahoo.com/>
> _______________________________________________
> 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