Changeset 2475 for GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreLightVolumeRenderingRun.cpp
- Timestamp:
- 07/02/07 04:12:36 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreLightVolumeRenderingRun.cpp
r2427 r2475 137 137 restoreMaterials(); 138 138 139 // rt->writeContentsToFile(name+"_lightVolume.bmp"); 139 140 //do blending 140 141 rt = lightVolumeTexture2->getBuffer().getPointer()->getRenderTarget(); … … 143 144 renderFullscreenQuad("GameTools/BlurLightVolume", rt); 144 145 145 146 // rt->writeContentsToFile(name+"_blurredlightVolume.bmp"); 146 147 /* 147 148 static int framecount = 0; … … 199 200 void OgreLightVolumeRenderingRun::refreshLight() 200 201 { 202 Vector3 center = sharedRuns->getRootPosition(ILLUMRUN_LIGHTVOLUME_MAP); 203 201 204 SceneManager* sm = Root::getSingleton()._getCurrentSceneManager(); 202 205 LightList list; 203 sm->_populateLightList( ((OgreSharedRuns*)sharedRuns)->getRootPosition(ILLUMRUN_LIGHTVOLUME_MAP),100000, list);206 sm->_populateLightList(center, 100000, list); 204 207 205 208 light = *(list.begin()); … … 226 229 lightVolumeCamera->setDirection( dir ); 227 230 Real r = sharedRuns->getRootBoundingSphere(ILLUMRUN_LIGHTVOLUME_MAP).getRadius(); 228 r += baseRad;231 //r += baseRad; 229 232 systemRadius = r; 230 233 lightVolumeCamera->setPosition( sharedRuns->getRootPosition(ILLUMRUN_LIGHTVOLUME_MAP) - dir * r); … … 239 242 { 240 243 Vector3 pos = light->getDerivedPosition(); 241 Vector3 dir = sharedRuns->getRootPosition(ILLUMRUN_LIGHTVOLUME_MAP) - pos; 244 Vector3 dir = center - pos; 245 Real r = sharedRuns->getRootBoundingSphere(ILLUMRUN_LIGHTVOLUME_MAP).getRadius(); 246 //r += baseRad; 247 Real d = dir.length(); 242 248 dir.normalise(); 243 Real r = sharedRuns->getRootBoundingSphere(ILLUMRUN_LIGHTVOLUME_MAP).getRadius(); 244 r += baseRad; 245 lightVolumeCamera->setPosition( sharedRuns->getRootPosition(ILLUMRUN_LIGHTVOLUME_MAP) - dir * r); 246 lightVolumeCamera->lookAt( sharedRuns->getRootPosition(ILLUMRUN_LIGHTVOLUME_MAP) ); 249 /*float mindist = 1.5 * r; 250 if(d < mindist) 251 { 252 pos -= dir * (mindist - d) ; 253 d = mindist; 254 }*/ 255 lightVolumeCamera->setPosition( center - dir * d); 256 lightVolumeCamera->lookAt( center ); 247 257 lightVolumeCamera->setProjectionType(PT_ORTHOGRAPHIC); 248 258 Matrix4 proj;
Note: See TracChangeset
for help on using the changeset viewer.