osg qt场景中节点的透明属性消除
{ osg::ref_ptr<osg::StateSet> stateState = north_wall_geode->getOrCreateStateSet(); stateState->setMode(GL_BLEND, osg::StateAttribute::ON); stateState->setMode(GL_DEPTH_TEST, osg::StateAttribute::ON); stateState->setRenderingHint(osg::StateSet::TRANSPARENT_BIN); stateState->setAttributeAndModes(wall_material2, osg::StateAttribute::ON); osg::ref_ptr<osg::BlendColor> blendColor = new osg::BlendColor(osg::Vec4(1.0f, 1.0f, 1.0f, 0.0f)); osg::ref_ptr<osg::BlendFunc> blendFunc = new osg::BlendFunc(); stateState->setAttributeAndModes(blendFunc, osg::StateAttribute::ON); stateState->setAttributeAndModes(blendColor, osg::StateAttribute::ON); blendFunc->setSource(osg::BlendFunc::CONSTANT_ALPHA); blendFunc->setDestination(osg::BlendFunc::ONE_MINUS_CONSTANT_ALPHA); blendColor->setConstantColor(osg::Vec4(1.0f, 1.0f, 1.0f, 0.999f)); }
##############################
标签:blendFunc,1.0,qt,stateState,blendColor,StateAttribute,节点,osg From: https://www.cnblogs.com/herd/p/17923660.html