osg开启透明度


  1. osg::StateSet* stateset = _geometryFeild->getOrCreateStateSet();
      //Alpha混合开启
      

  2. stateset->setMode(GL_BLEND,osg::StateAttribute::ON);
      //取消深度测试
       
  3. stateset->setMode( GL_DEPTH_TEST, osg::StateAttribute::OFF  );
     
  4.  
  5.  stateset->setMode( GL_LIGHTING, osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED ); 
  6.   stateset->setRenderBinDetails(11, "RenderBin");//设置渲染优先级------级别理论上来讲 比 背景的node 后就行,没设置过的是-1.
  7.  

你可能感兴趣的:(osg开启透明度)