Ignore:
Timestamp:
06/26/06 09:52:08 (18 years ago)
Author:
szirmay
Message:
 
File:
1 edited

Legend:

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

    r949 r1055  
    103103                        Vector3 dir = light->getDirection(); 
    104104                        photonMapCamera->setDirection( dir ); 
    105                         photonMapCamera->setPosition( sharedRuns->getRootPosition(ILLUMRUN_PHOTONMAP) - dir ); 
    106                         photonMapCamera->setProjectionType(PT_ORTHOGRAPHIC);             
     105                        Real r = sharedRuns->getRootBoundingSphere(ILLUMRUN_PHOTONMAP).getRadius(); 
     106                        photonMapCamera->setPosition( sharedRuns->getRootPosition(ILLUMRUN_PHOTONMAP) - dir * r); 
     107                        photonMapCamera->setProjectionType(PT_ORTHOGRAPHIC); 
     108                        Matrix4 proj; 
     109                        proj = Matrix4::IDENTITY; 
     110                        proj.setScale(Vector3(1.0/r, 1.0/r, -1.0/r)); 
     111                        proj.setTrans(Vector3(0,0,-1)); 
     112                        photonMapCamera->setCustomProjectionMatrix(true,proj); 
    107113                } 
    108114                else 
    109                 { 
    110                         photonMapCamera->setFarClipDistance(100000); 
    111                         photonMapCamera->setNearClipDistance(0.1); 
     115                {                        
    112116                        Vector3 pos = light->getParentSceneNode()->getPosition(); 
    113117                        Vector3 dir = sharedRuns->getRootPosition(ILLUMRUN_PHOTONMAP) - pos; 
     
    125129                        photonMapCamera->setFOVy(2*alfa); 
    126130                        photonMapCamera->setDirection( dir ); 
     131 
     132                        photonMapCamera->setNearClipDistance(std::max(0.01f, d - r)); 
     133                        photonMapCamera->setFarClipDistance(r + d);      
    127134                } 
    128135        } 
Note: See TracChangeset for help on using the changeset viewer.