Changeset 14014

Show
Ignore:
Timestamp:
08/20/14 16:15:36 (20 hours ago)
Author:
robert
Message:

Reordered method implemenations to make it easier to compare similar methods

Location:
OpenSceneGraph/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/include/osgVolume/MultipassTechnique

    r13995 r14014  
    6262        enum ShaderMask 
    6363        { 
    64             FRONT_SHADERS = 1, 
    65             BACK_SHADERS = 2, 
    66             STANDARD_SHADERS = 4, 
    67             LIT_SHADERS = 8, 
    68             ISO_SHADERS = 16, 
    69             MIP_SHADERS = 32, 
    70             TF_SHADERS = 64 
     64            BACK_SHADERS = 1, 
     65            STANDARD_SHADERS = 2, 
     66            LIT_SHADERS = 4, 
     67            ISO_SHADERS = 8, 
     68            MIP_SHADERS = 16, 
     69            TF_SHADERS = 32 
    7170        }; 
    7271 
  • OpenSceneGraph/trunk/src/osgVolume/MultipassTechnique.cpp

    r14012 r14014  
    463463#endif 
    464464 
    465     osg::ref_ptr<osg::Shader> front_main_fragmentShader = osgDB::readRefShaderFile(osg::Shader::FRAGMENT, "shaders/volume_multipass_front.frag"); 
    466 #if 0 
    467     if (!front_main_fragmentShader) 
    468     { 
    469         #include "Shaders/volume_multipass_front_frag.cpp" 
    470         front_main_fragmentShader = new osg::Shader(osg::Shader::VERTEX, volume_multipass_front_frag)); 
    471     } 
    472 #endif 
    473  
    474465 
    475466    osg::ref_ptr<osg::Shader> back_main_fragmentShader = osgDB::readRefShaderFile(osg::Shader::FRAGMENT, "shaders/volume_multipass_back_with_front_depthtexture.frag");; 
     
    486477    _stateSetMap.clear(); 
    487478 
    488     osg::ref_ptr<osg::StateSet> front_stateset_prototype = new osg::StateSet; 
    489     osg::ref_ptr<osg::Program> front_program_prototype = new osg::Program; 
    490     { 
    491         front_stateset_prototype->setAttributeAndModes(front_CullFace.get(), osg::StateAttribute::ON|osg::StateAttribute::OVERRIDE); 
    492  
    493         front_program_prototype->addShader(main_vertexShader.get()); 
    494         front_program_prototype->addShader(front_main_fragmentShader.get()); 
    495         front_program_prototype->addShader(computeRayColorShader.get()); 
    496     } 
    497  
    498479    osg::ref_ptr<osg::StateSet> back_stateset_prototype = new osg::StateSet; 
    499480    osg::ref_ptr<osg::Program> back_program_prototype = new osg::Program; 
     
    534515            #endif 
    535516 
    536             // front 
    537             _stateSetMap[STANDARD_SHADERS|FRONT_SHADERS] = createStateSet(front_stateset_prototype.get(), front_program_prototype.get(), accumulateSamplesShader.get()); 
    538  
    539517            // back 
    540518            _stateSetMap[STANDARD_SHADERS|BACK_SHADERS] = createStateSet(back_stateset_prototype.get(), back_program_prototype.get(), accumulateSamplesShader.get()); 
     
    553531            #endif 
    554532 
    555  
    556             // front 
    557             _stateSetMap[STANDARD_SHADERS|FRONT_SHADERS|TF_SHADERS] = createStateSet(front_stateset_prototype.get(), front_program_prototype.get(), accumulateSamplesShader.get()); 
    558  
    559533            // back 
    560534            _stateSetMap[STANDARD_SHADERS|BACK_SHADERS|TF_SHADERS] = createStateSet(back_stateset_prototype.get(), back_program_prototype.get(), accumulateSamplesShader.get()); 
     
    576550            #endif 
    577551 
    578             // front 
    579             _stateSetMap[ISO_SHADERS|FRONT_SHADERS] = createStateSet(front_stateset_prototype.get(), front_program_prototype.get(), accumulateSamplesShader.get()); 
    580  
    581552            // back 
    582553            _stateSetMap[ISO_SHADERS|BACK_SHADERS] = createStateSet(back_stateset_prototype.get(), back_program_prototype.get(), accumulateSamplesShader.get()); 
     
    595566            #endif 
    596567 
    597  
    598             // front 
    599             _stateSetMap[ISO_SHADERS|FRONT_SHADERS|TF_SHADERS] = createStateSet(front_stateset_prototype.get(), front_program_prototype.get(), accumulateSamplesShader.get()); 
    600  
    601568            // back 
    602569            _stateSetMap[ISO_SHADERS|BACK_SHADERS|TF_SHADERS] = createStateSet(back_stateset_prototype.get(), back_program_prototype.get(), accumulateSamplesShader.get()); 
     
    618585            #endif 
    619586 
    620             // front 
    621             _stateSetMap[MIP_SHADERS|FRONT_SHADERS] = createStateSet(front_stateset_prototype.get(), front_program_prototype.get(), accumulateSamplesShader.get()); 
    622  
    623587            // back 
    624588            _stateSetMap[MIP_SHADERS|BACK_SHADERS] = createStateSet(back_stateset_prototype.get(), back_program_prototype.get(), accumulateSamplesShader.get()); 
     
    637601            #endif 
    638602 
    639  
    640             // front 
    641             _stateSetMap[MIP_SHADERS|FRONT_SHADERS|TF_SHADERS] = createStateSet(front_stateset_prototype.get(), front_program_prototype.get(), accumulateSamplesShader.get()); 
    642  
    643603            // back 
    644604            _stateSetMap[MIP_SHADERS|BACK_SHADERS|TF_SHADERS] = createStateSet(back_stateset_prototype.get(), back_program_prototype.get(), accumulateSamplesShader.get()); 
     
    660620            #endif 
    661621 
    662             // front 
    663             _stateSetMap[LIT_SHADERS|FRONT_SHADERS] = createStateSet(front_stateset_prototype.get(), front_program_prototype.get(), accumulateSamplesShader.get()); 
    664  
    665622            // back 
    666623            _stateSetMap[LIT_SHADERS|BACK_SHADERS] = createStateSet(back_stateset_prototype.get(), back_program_prototype.get(), accumulateSamplesShader.get()); 
     
    678635            } 
    679636            #endif 
    680  
    681  
    682             // front 
    683             _stateSetMap[LIT_SHADERS|FRONT_SHADERS|TF_SHADERS] = createStateSet(front_stateset_prototype.get(), front_program_prototype.get(), accumulateSamplesShader.get()); 
    684637 
    685638            // back 
     
    816769        } 
    817770 
    818         //int shaderMaskFront = shaderMask | FRONT_SHADERS; 
    819771        int shaderMaskBack = shaderMask | BACK_SHADERS; 
    820772 
    821         // OSG_NOTICE<<"shaderMaskFront "<<shaderMaskFront<<std::endl; 
    822773        // OSG_NOTICE<<"shaderMaskBack  "<<shaderMaskBack<<std::endl; 
    823774 
     
    836787 
    837788 
    838         //osg::ref_ptr<osg::StateSet> front_stateset = _stateSetMap[shaderMaskFront]; 
    839789        osg::ref_ptr<osg::StateSet> back_stateset = _stateSetMap[shaderMaskBack]; 
    840790        osg::ref_ptr<osg::StateSet> moving_stateset = (_whenMovingStateSet.valid() && isMoving(cv)) ? _whenMovingStateSet : 0; 
     
    846796        } 
    847797 
    848 #if 0 
    849         if (front_stateset.valid()) 
    850         { 
    851             // OSG_NOTICE<<"Have front stateset"<<std::endl; 
    852             cv->pushStateSet(front_stateset.get()); 
    853             _transform->accept(*cv); 
    854             cv->popStateSet(); 
    855         } 
    856 #endif 
    857798        if (back_stateset.valid()) 
    858799        {