Ignore:
Timestamp:
10/17/06 09:21:50 (18 years ago)
Author:
szirmay
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreDepthShadowRecieverRenderTechnique.cpp

    r1130 r1628  
    5151                 
    5252                TextureUnitState* st = newpass->createTextureUnitState();                
    53                 st->setTextureFiltering(TFO_ANISOTROPIC);                                                
     53                st->setTextureFiltering(TFO_ANISOTROPIC); 
     54                st->setTextureAddressingMode(TextureUnitState::TAM_BORDER); 
     55                st->setTextureBorderColour(ColourValue::White); 
    5456 
    5557                newpass->setSceneBlending(SBT_MODULATE); 
     
    7375                                                        100000.0, 
    7476                                                        lights); 
    75          
     77 
    7678        //fill passes 
     79        unsigned int l = 0; 
    7780        for(unsigned int i = 0; i < passes.size(); i++) 
    7881        { 
    79                 if(lights.size() > i) 
     82                while(lights.size() != l && !lights.at(l)->getCastShadows()) 
     83                 l++; 
     84 
     85                if(lights.size() > l) 
    8086                { 
    81                         //create run if not exists 
    82                         OgreIlluminationManager::getSingleton().createPerLightRun(lights.at(i)->getName(), 
    83                                                                                                                                                 ILLUMRUN_DEPTH_SHADOWMAP); 
    84                         //update light depth map 
    85                         OgreIlluminationManager::getSingleton().updatePerLightRun(lights.at(i)->getName(), 
    86                                                                                                                                                 ILLUMRUN_DEPTH_SHADOWMAP, 
    87                                                                                                                                                 frameNum); 
    8887                         
    89                         //set texture to pass 
    90                         OgreDepthShadowMapRenderingRun* depthRun =  
    91                                 (OgreDepthShadowMapRenderingRun*) OgreIlluminationManager::getSingleton() 
    92                                                                                                         .getPerLightRun(lights.at(i)->getName(),  
    93                                                                                                         ILLUMRUN_DEPTH_SHADOWMAP)->asOgreRenderingRun(); 
    94                                          
    95                         passes.at(i)->getTextureUnitState(0)->setTextureName( 
    96                                 depthRun->getDepthMapTextureName()); 
    97                  
    98                         //TODO: set matrices 
    99                         GpuProgramParametersSharedPtr fpParams = passes.at(i)->getFragmentProgramParameters(); 
    100                         GpuProgramParametersSharedPtr vpParams = passes.at(i)->getVertexProgramParameters(); 
    101                  
    102                         //fpParams->setNamedConstant("lightViewProj", depthRun->getLightViewProjMatrix());  
    103                         vpParams->setNamedConstant("lightViewProj", depthRun->getLightViewProjMatrix()); 
     88                                //create run if not exists 
     89                                OgreIlluminationManager::getSingleton().createPerLightRun(lights.at(l)->getName(), 
     90                                                                                                                                                        ILLUMRUN_DEPTH_SHADOWMAP); 
     91                                //update light depth map 
     92                                OgreIlluminationManager::getSingleton().updatePerLightRun(lights.at(l)->getName(), 
     93                                                                                                                                                        ILLUMRUN_DEPTH_SHADOWMAP, 
     94                                                                                                                                                        frameNum); 
     95                                 
     96                                //set texture to pass 
     97                                OgreDepthShadowMapRenderingRun* depthRun =  
     98                                        (OgreDepthShadowMapRenderingRun*) OgreIlluminationManager::getSingleton() 
     99                                                                                                                .getPerLightRun(lights.at(l)->getName(),  
     100                                                                                                                ILLUMRUN_DEPTH_SHADOWMAP)->asOgreRenderingRun(); 
     101                                                 
     102                                passes.at(i)->getTextureUnitState(0)->setTextureName( 
     103                                        depthRun->getDepthMapTextureName()); 
    104104                         
    105                         passes.at(i)->setActive(true); 
     105                                //TODO: set matrices 
     106                                GpuProgramParametersSharedPtr fpParams = passes.at(i)->getFragmentProgramParameters(); 
     107                                GpuProgramParametersSharedPtr vpParams = passes.at(i)->getVertexProgramParameters(); 
     108                         
     109                                //fpParams->setNamedConstant("lightViewProj", depthRun->getLightViewProjMatrix());  
     110                                vpParams->setNamedConstant("lightViewProj", depthRun->getLightViewProjMatrix()); 
     111                                 
     112                                passes.at(i)->setActive(true); 
     113                         
    106114                }        
    107115                else 
Note: See TracChangeset for help on using the changeset viewer.