Hi,
I still have problems with a rtt camera use for screenshot. Without
transparency it works fine, but when I try to save my screenshot in png
(GL_RGBA) format I have problems with the transparency particulary when I set
the diffuse of a material different to 1 I have a strange result only on the
screenshot
Here we have a texture (the sun) with a material :
Code:
osg::ref_ptr<osg::Material> mat =
(osg::Material*)billboard->getOrCreateStateSet()->getAttribute(osg::StateAttribute::MATERIAL);
if(!mat) {
mat = new osg::Material;
mat->setAmbient(osg::Material::FRONT_AND_BACK,osg::Vec4(1,1,1,opacity));
mat->setDiffuse(osg::Material::FRONT_AND_BACK,osg::Vec4(1,1,1,opacity));//with
opacity = 1 there is no problem
mat->setSpecular(osg::Material::FRONT_AND_BACK,osg::Vec4(1,1,1,opacity));
billboard->getOrCreateStateSet()->setAttributeAndModes(mat.get(),osg::StateAttribute::ON);
}
It's strange because the text is also a little transparent... Maybe a problem
of render order ?
take with the rtt camera :
here (http://img718.imageshack.us/img718/8936/screenshot4gg.png)
take with a simple print screen :
here (http://img31.imageshack.us/img31/8279/3demprt.jpg)
Thanks =)
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=27931#27931
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org