Changeset 1055 for GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgrePhotonMapRenderingRun.cpp
- Timestamp:
- 06/26/06 09:52:08 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgrePhotonMapRenderingRun.cpp
r949 r1055 103 103 Vector3 dir = light->getDirection(); 104 104 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); 107 113 } 108 114 else 109 { 110 photonMapCamera->setFarClipDistance(100000); 111 photonMapCamera->setNearClipDistance(0.1); 115 { 112 116 Vector3 pos = light->getParentSceneNode()->getPosition(); 113 117 Vector3 dir = sharedRuns->getRootPosition(ILLUMRUN_PHOTONMAP) - pos; … … 125 129 photonMapCamera->setFOVy(2*alfa); 126 130 photonMapCamera->setDirection( dir ); 131 132 photonMapCamera->setNearClipDistance(std::max(0.01f, d - r)); 133 photonMapCamera->setFarClipDistance(r + d); 127 134 } 128 135 }
Note: See TracChangeset
for help on using the changeset viewer.