Ignore:
Timestamp:
07/12/06 15:44:01 (18 years ago)
Author:
szirmay
Message:
 
File:
1 edited

Legend:

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

    r1103 r1125  
    512512                        globalSharedRuns.addRun(ILLUMRUN_SCENE_CAMERA_DEPTH, run); 
    513513                } 
     514                case ILLUMRUN_FOCUSING_MAP: 
     515                if(globalSharedRuns.getRun(ILLUMRUN_FOCUSING_MAP) == 0) 
     516                { 
     517                        OgreFocusingMapRenderingRun* run  = new OgreFocusingMapRenderingRun( 
     518                                "LIGHT_FOCUSING_MAP",                            
     519                                Matrix4::IDENTITY, 
     520                                focusingMapSize 
     521                                ); 
     522                        globalSharedRuns.addRun(ILLUMRUN_FOCUSING_MAP, run); 
     523                         
     524                } 
    514525                break; 
    515526        } 
     
    520531RenderingRun* OgreIlluminationManager::getGlobalRun(RenderingRunType runType) 
    521532{ 
     533        if(globalSharedRuns.getRun(runType) == 0) 
     534                createGlobalRun(runType); 
    522535        return globalSharedRuns.getRun(runType); 
    523536} 
     
    565578                                lightName + "DEPTH_SHADOW_MAP", 
    566579                                sm->getLight(lightName), 
    567                                 512, //TODO 
    568                                 512, //TODO 
     580                                128, //TODO 
     581                                128, //TODO 
    569582                                "GameTools/ShadowMapDepth" //TODO 
    570583                                ); 
    571584                        runs->addRun(ILLUMRUN_DEPTH_SHADOWMAP, run); 
    572585                         
    573                 } 
    574                 case ILLUMRUN_FOCUSING_MAP: 
    575                 if(runs->getRun(ILLUMRUN_FOCUSING_MAP) == 0) 
    576                 { 
    577                         SceneManager* sm = Root::getSingleton()._getCurrentSceneManager(); 
    578                         Light* light = sm->getLight(lightName); 
    579                         Vector3 position = light->getPosition(); 
    580                         Vector3 direction = light->getDirection(); 
    581                         Matrix4 transMatrix; 
    582                         Camera cam("tempCamera", sm); 
    583                         cam.setPosition(position); 
    584                         cam.setDirection(direction); 
    585                         transMatrix = cam.getViewMatrix(); 
    586  
    587                         if(light->getType() == Light::LT_SPOTLIGHT) 
    588                         { 
    589                                 Radian fov = light->getSpotlightOuterAngle(); 
    590                                 float far = light->getAttenuationRange(); 
    591                                 cam.setNearClipDistance(0.1); 
    592                                 cam.setFarClipDistance(far); 
    593                                 cam.setFOVy(fov); 
    594                                 Matrix4 proj = cam.getProjectionMatrix(); 
    595                                 transMatrix = transMatrix * proj; 
    596                         }                        
    597                         sm->destroyCamera("tempCamera"); 
    598  
    599                         OgreFocusingMapRenderingRun* run  = new OgreFocusingMapRenderingRun( 
    600                                 lightName + "FOCUSING_MAP", 
    601                                 mainViewport, 
    602                                 transMatrix, 
    603                                 focusingMapSize 
    604                                 ); 
    605                         runs->addRun(ILLUMRUN_FOCUSING_MAP, run); 
    606                          
    607                 } 
     586                }                
    608587                break; 
    609588        }        
Note: See TracChangeset for help on using the changeset viewer.