void OceanCompositor::updateMasterStateSet(osg::StateSet* stateSet, const TextureLayout& layout ) const { VirtualProgram* vp = static_cast<VirtualProgram*>( stateSet->getAttribute(VirtualProgram::SA_TYPE) ); if ( !vp ) { vp = new VirtualProgram(); vp->setName("osgEarth OceanCompositor"); stateSet->setAttributeAndModes( vp, 1 ); } vp->installDefaultLightingShaders(); vp->setShader( "osgearth_vert_setupColoring", new osg::Shader(osg::Shader::VERTEX, source_setupColoring) ); vp->setShader( "osgearth_frag_applyColoring", new osg::Shader(osg::Shader::FRAGMENT, source_applyColoring ) ); }