Show
Ignore:
Timestamp:
10/29/04 20:24:26 (10 years ago)
Author:
robert
Message:

Added useage of TexEnvCombine?

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgplanets/osgplanets.cpp

    r3562 r3563  
    559559        { 
    560560            osg::StateSet* stateset = geodePlanet->getOrCreateStateSet(); 
    561             stateset->setTextureAttribute( 1, new osg::TexEnv(osg::TexEnv::ADD)); 
     561             
     562            osg::TexEnvCombine* texenv = new osg::TexEnvCombine; 
     563             
     564            texenv->setCombine_RGB(osg::TexEnvCombine::INTERPOLATE); 
     565            texenv->setSource0_RGB(osg::TexEnvCombine::PREVIOUS); 
     566            texenv->setOperand0_RGB(osg::TexEnvCombine::SRC_COLOR); 
     567            texenv->setSource1_RGB(osg::TexEnvCombine::TEXTURE); 
     568            texenv->setOperand1_RGB(osg::TexEnvCombine::SRC_COLOR); 
     569            texenv->setSource2_RGB(osg::TexEnvCombine::PRIMARY_COLOR); 
     570            texenv->setOperand2_RGB(osg::TexEnvCombine::SRC_COLOR); 
     571/* 
     572            texenv->setCombine_Alpha(osg::TexEnvCombine::INTERPOLATE); 
     573            texenv->setSource0_Alpha(osg::TexEnvCombine::PREVIOUS); 
     574            texenv->setOperand0_Alpha(osg::TexEnvCombine::SRC_ALPHA); 
     575            texenv->setSource1_Alpha(osg::TexEnvCombine::TEXTURE); 
     576            texenv->setOperand1_Alpha(osg::TexEnvCombine::ONE_MINUS_SRC_ALPHA); 
     577            texenv->setSource2_RGB(osg::TexEnvCombine::PRIMARY_COLOR); 
     578            texenv->setOperand2_RGB(osg::TexEnvCombine::SRC_ALPHA); 
     579*/ 
     580            stateset->setTextureAttribute( 1, texenv ); 
    562581            stateset->setTextureAttributeAndModes( 1, new osg::Texture2D( image ), osg::StateAttribute::ON ); 
    563582        }