Added AlphaFunc support into osgVolume::AlphaFuncProperty.

This commit is contained in:
Robert Osfield
2009-01-20 12:39:26 +00:00
parent 8a971d96d2
commit 87cd4530f5
11 changed files with 51 additions and 19 deletions

View File

@@ -183,7 +183,15 @@ void FixedFunctionTechnique::init()
stateset->setMode(GL_LIGHTING,osg::StateAttribute::ON);
stateset->setMode(GL_BLEND,osg::StateAttribute::ON);
stateset->setAttributeAndModes(new osg::AlphaFunc(osg::AlphaFunc::GREATER,alphaFuncValue), osg::StateAttribute::ON);
if (cpv._afProperty.valid())
{
stateset->setAttributeAndModes(cpv._afProperty->getAlphaFunc(), osg::StateAttribute::ON);
}
else
{
stateset->setAttributeAndModes(new osg::AlphaFunc(osg::AlphaFunc::GREATER,alphaFuncValue), osg::StateAttribute::ON);
}
osg::Material* material = new osg::Material;
material->setDiffuse(osg::Material::FRONT_AND_BACK,osg::Vec4(1.0f,1.0f,1.0f,1.0f));