- Timestamp:
- 07/12/06 15:44:01 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreIlluminationManager.cpp
r1103 r1125 512 512 globalSharedRuns.addRun(ILLUMRUN_SCENE_CAMERA_DEPTH, run); 513 513 } 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 } 514 525 break; 515 526 } … … 520 531 RenderingRun* OgreIlluminationManager::getGlobalRun(RenderingRunType runType) 521 532 { 533 if(globalSharedRuns.getRun(runType) == 0) 534 createGlobalRun(runType); 522 535 return globalSharedRuns.getRun(runType); 523 536 } … … 565 578 lightName + "DEPTH_SHADOW_MAP", 566 579 sm->getLight(lightName), 567 512, //TODO568 512, //TODO580 128, //TODO 581 128, //TODO 569 582 "GameTools/ShadowMapDepth" //TODO 570 583 ); 571 584 runs->addRun(ILLUMRUN_DEPTH_SHADOWMAP, run); 572 585 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 } 608 587 break; 609 588 }
Note: See TracChangeset
for help on using the changeset viewer.