Changeset 2379 for GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule
- Timestamp:
- 05/16/07 08:37:09 (18 years ago)
- Location:
- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreIlluminationManager.h
r2333 r2379 4 4 #include "OgreTechniqueGroup.h" 5 5 #include "OgreRenderable.h" 6 #include "OgreColorCubeMapRenderTechnique.h"7 #include "OgreDistanceCubeMapRenderTechnique.h"8 #include "OgreConvolvedCubeMapRenderTechnique.h"9 #include "OgreCausticCasterRenderTechnique.h"10 #include "OgreCausticReceiverRenderTechnique.h"11 #include "OgreSceneCameraDepthRenderingRun.h"12 #include "OgreSBBRenderTechnique.h"13 #include "OgreDepthShadowMapRenderingRun.h"14 #include "OgreDepthShadowReceiverRenderTechnique.h"15 #include "OgreFireRenderTechnique.h"16 #include "OgreHierarchicalParticleSystemTechnique.h"17 #include "OgreIllumVolumeRenderTechnique.h"18 #include "OgrePhaseTextureRenderingRun.h"19 #include "OgrePathMapRenderTechnique.h"20 6 21 7 … … 680 666 @brief Sets the fire rendertarget - frame buffer resolution ratio 681 667 */ 682 void setFireRenderTargetSize(int size){FireRenderTarget::targetsize = size;}668 inline void setFireRenderTargetSize(int size); 683 669 684 670 void freeAllResources(); -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreRenderingRun.h
r2375 r2379 9 9 @brief Base class of a RenderingRun in an OGRE environment. 10 10 */ 11 class OgreRenderingRun : virtual public RenderingRun 11 class OgreRenderingRun : virtual public RenderingRun, public RenderQueue::RenderableListener 12 12 { 13 13 friend class OgreIlluminationManager; … … 33 33 */ 34 34 OgreRenderingRun* asOgreRenderingRun(){return this;} 35 //inherited 36 bool renderableQueued (Renderable *rend, uint8 groupID, ushort priority, Technique **ppTech){return true;} 35 37 36 38 protected: -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreDepthShadowMapRenderingRun.h
r2320 r2379 66 66 void freeAllResources(); 67 67 68 bool renderableQueued (Renderable *rend, uint8 groupID, ushort priority, Technique **ppTech); 69 68 70 protected: 69 71 /** … … 100 102 Texture* blurredDepthMapTexture; 101 103 Real lightFarPlane; 104 String triggerName; 102 105 103 106 //inherited -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreSceneCameraDepthRenderingRun.h
r2320 r2379 40 40 41 41 void freeAllResources(); 42 43 bool renderableQueued (Renderable *rend, uint8 groupID, ushort priority, Technique **ppTech); 44 42 45 43 46 protected: -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreIlluminationManager.cpp
r2366 r2379 6 6 #include "OgrePMWeightComputeRenderingRun.h" 7 7 #include "OgreTriggersRenderTechnique.h" 8 #include "OgreColorCubeMapRenderTechnique.h" 9 #include "OgreDistanceCubeMapRenderTechnique.h" 10 #include "OgreConvolvedCubeMapRenderTechnique.h" 11 #include "OgreCausticCasterRenderTechnique.h" 12 #include "OgreCausticReceiverRenderTechnique.h" 13 #include "OgreSceneCameraDepthRenderingRun.h" 14 #include "OgreSBBRenderTechnique.h" 15 #include "OgreDepthShadowMapRenderingRun.h" 16 #include "OgreDepthShadowReceiverRenderTechnique.h" 17 #include "OgreFireRenderTechnique.h" 18 #include "OgreHierarchicalParticleSystemTechnique.h" 19 #include "OgreIllumVolumeRenderTechnique.h" 20 #include "OgrePhaseTextureRenderingRun.h" 21 #include "OgrePathMapRenderTechnique.h" 22 8 23 9 24 OgreIlluminationManager* OgreIlluminationManager::instance = NULL; … … 787 802 } 788 803 804 void OgreIlluminationManager::setFireRenderTargetSize(int size) 805 { 806 FireRenderTarget::targetsize = size; 807 } 808 -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreRenderingRun.cpp
r2375 r2379 43 43 if(triggerName != "")//we have a trigger here 44 44 { 45 OgreTechniqueGroup* tg= (OgreTechniqueGroup*)rend->getRenderTechniqueGroup();46 if( tg)45 OgreTechniqueGroup* TG = (OgreTechniqueGroup*)rend->getRenderTechniqueGroup(); 46 if(TG) 47 47 { 48 String triggeredMaterial = tg->getMaterialNameForTrigger(triggerName);48 String triggeredMaterial = TG->getMaterialNameForTrigger(triggerName); 49 49 if(triggeredMaterial != "")//a trigger is associated 50 50 materialToSet = triggeredMaterial; … … 69 69 if(triggerName != "")//we have a trigger here 70 70 { 71 String triggeredMaterial = 72 ((OgreTechniqueGroup*)rend->getRenderTechniqueGroup()) 73 ->getMaterialNameForTrigger(triggerName); 74 if(triggeredMaterial != "")//a trigger is associated 75 materialToSet = triggeredMaterial; 71 OgreTechniqueGroup* TG = (OgreTechniqueGroup*)rend->getRenderTechniqueGroup(); 72 if(TG) 73 { 74 String triggeredMaterial = TG->getMaterialNameForTrigger(triggerName); 75 if(triggeredMaterial != "")//a trigger is associated 76 materialToSet = triggeredMaterial; 77 } 76 78 } 77 79 rend->setMaterialName(materialToSet); -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreSharedRuns.cpp
r2320 r2379 1 1 #include "..\include\OgreSharedRuns.h" 2 2 #include "OgreIlluminationManager.h" 3 #include "OgreRenderingRun.h" 3 4 4 5 void OgreSharedRuns::freeAllResources() -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreFireRenderTechnique.cpp
r2320 r2379 2 2 #include "OgreTechniqueGroup.h" 3 3 #include "OgreIlluminationManager.h" 4 #include "OgreSceneCameraDepthRenderingRun.h" 4 5 5 6 int FireRenderTarget::targetsize = 2; -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreSBBRenderTechnique.cpp
r1055 r2379 2 2 #include "OgreTechniqueGroup.h" 3 3 #include "OgreIlluminationManager.h" 4 #include "OgreSceneCameraDepthRenderingRun.h" 4 5 5 6 -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreDepthShadowMapRenderingRun.cpp
r2375 r2379 75 75 } 76 76 77 bool OgreDepthShadowMapRenderingRun::renderableQueued (Renderable *rend, uint8 groupID, ushort priority, Technique **ppTech) 78 { 79 OgreTechniqueGroup* TG = (OgreTechniqueGroup*) rend->getRenderTechniqueGroup(); 80 if(TG) 81 { 82 String materialToSet = materialName; 83 String triggeredMaterial = TG->getMaterialNameForTrigger(triggerName); 84 if(triggeredMaterial != "")//a trigger is associated 85 materialToSet = triggeredMaterial; 86 Technique* techn = ((Material*)MaterialManager::getSingleton().getByName( materialToSet ).getPointer())->getTechnique(0); 87 *ppTech = techn; 88 } 89 return true; 90 } 91 77 92 void OgreDepthShadowMapRenderingRun::updateFrame(unsigned long frameNum) 78 93 { 79 94 refreshLight(frameNum); 80 95 96 RenderQueue* rq = Root::getSingleton()._getCurrentSceneManager()->getRenderQueue(); 97 rq->setRenderableListener(this); 98 81 99 if(light->getType() == Light::LT_POINT) 82 { 83 //static int currentFace = 0; 84 //updateDepthCubeFace(currentFace); 85 //currentFace = (currentFace+1)%6; 100 { 86 101 87 88 //Timer* t = Root::getSingleton().getTimer();89 //unsigned long start = t->getMicroseconds();90 //setMaterialForRenderables(materialName, true);91 //unsigned long end = t->getMicroseconds();92 //double elapsed = (double) (end - start) / 1000.0;93 //LogManager::getSingleton().logMessage(String("MaterialSetTime: ") + name + " : " + StringConverter::toString(Real(elapsed)) + " ms");94 //visibleObjects.clear();95 96 102 for(int i = 0; i < 6 ; i++) 97 updateDepthCubeFace(i); 98 99 //start = t->getMicroseconds(); 100 101 restoreMaterials(); 102 103 //end = t->getMicroseconds(); 104 //elapsed = (double) (end - start) / 1000000.0; 105 //LogManager::getSingleton().logMessage(String("MaterialRestoreTime: ") + name + " : " + StringConverter::toString(Real(elapsed)) + " ms"); 103 updateDepthCubeFace(i); 104 105 //restoreMaterials(); 106 106 } 107 107 else … … 109 109 updateDepthMap(); 110 110 } 111 112 rq->setRenderableListener(0); 111 113 } 112 114 … … 114 116 { 115 117 Vector3 lightpos = light->getDerivedPosition(); 116 String triggerName = "ILLUM_TRIGGER_SM_POINT";117 118 118 119 RenderTarget* rt = depthMapTexture->getBuffer(facenum, 0).getPointer()->getRenderTarget(); … … 122 123 123 124 124 setMaterialForVisibles(materialName, cam, true, false, triggerName);125 //setMaterialForVisibles(materialName, cam, true, false, triggerName); 125 126 126 127 rt->update(); … … 144 145 void OgreDepthShadowMapRenderingRun::updateDepthMap() 145 146 { 146 String triggerName; 147 switch(light->getType()) 148 { 149 case Light::LT_DIRECTIONAL: 150 triggerName = "ILLUM_TRIGGER_SM_DIRECTIONAL"; 151 break; 152 case Light::LT_SPOTLIGHT: 153 triggerName = "ILLUM_TRIGGER_SM_SPOT"; 154 break; 155 } 156 setMaterialForVisibles(materialName, depthMapCamera, true, false, triggerName); 147 157 148 RenderTarget* rt = depthMapTexture->getBuffer().getPointer()->getRenderTarget(); 158 149 Viewport* vp = rt->getViewport(0); 159 150 151 //setMaterialForVisibles(materialName, depthMapCamera, true, false, triggerName); 152 160 153 rt->update(); 161 restoreMaterials(); 154 155 //restoreMaterials(); 162 156 163 157 if(OgreIlluminationManager::getSingleton().getBlurShadowMap(light->getType())) … … 184 178 void OgreDepthShadowMapRenderingRun::refreshLight(unsigned long frameNum) 185 179 { 186 187 180 if(light!= 0) 188 181 { … … 191 184 if(light->getType() == Light::LT_DIRECTIONAL) 192 185 { 186 triggerName = "ILLUM_TRIGGER_SM_DIRECTIONAL"; 193 187 Camera* viewcam = OgreIlluminationManager::getSingleton().getMainCamera(); 194 188 … … 296 290 else if(light->getType() == Light::LT_SPOTLIGHT) 297 291 { 292 triggerName = "ILLUM_TRIGGER_SM_SPOT"; 298 293 Camera* viewcam = OgreIlluminationManager::getSingleton().getMainCamera(); 299 294 … … 428 423 { 429 424 lightFarPlane = light->getAttenuationRange(); 425 triggerName = "ILLUM_TRIGGER_SM_POINT"; 430 426 //no other adjustment needed 431 427 } -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreSceneCameraDepthRenderingRun.cpp
r2355 r2379 1 1 #include "OgreSceneCameraDepthRenderingRun.h" 2 #include "OgreTechniqueGroup.h" 2 3 3 4 … … 40 41 } 41 42 43 bool OgreSceneCameraDepthRenderingRun::renderableQueued (Renderable *rend, uint8 groupID, ushort priority, Technique **ppTech) 44 { 45 if((*ppTech)->isTransparent()) 46 return false; 47 48 OgreTechniqueGroup* TG = (OgreTechniqueGroup*) rend->getRenderTechniqueGroup(); 49 if(TG) 50 { 51 String materialToSet = String("GTP/Basic/CameraDepth"); 52 String triggeredMaterial = TG->getMaterialNameForTrigger("ILLUM_TRIGGER_CAMERADEPTH"); 53 if(triggeredMaterial != "")//a trigger is associated 54 materialToSet = triggeredMaterial; 55 Technique* techn = ((Material*)MaterialManager::getSingleton().getByName( materialToSet ).getPointer())->getTechnique(0); 56 *ppTech = techn; 57 } 58 return true; 59 } 60 42 61 void OgreSceneCameraDepthRenderingRun::updateFrame(unsigned long frameNum) 43 62 { 44 63 45 setMaterialForVisibles(String("GTP/Basic/CameraDepth"), playerCamera, false, true, "ILLUM_TRIGGER_CAMERADEPTH"); 46 64 //setMaterialForVisibles(String("GTP/Basic/CameraDepth"), playerCamera, false, true, "ILLUM_TRIGGER_CAMERADEPTH"); 65 RenderQueue* rq = Root::getSingleton()._getCurrentSceneManager()->getRenderQueue(); 66 rq->setRenderableListener(this); 67 47 68 RenderTarget* rt = depthTexture->getBuffer().getPointer()->getRenderTarget(); 48 69 … … 60 81 //rt->writeContentsToFile("cameraDepth.bmp"); 61 82 62 restoreMaterials();83 //restoreMaterials(); 63 84 64 85 sharedRuns->getRoot()->restoreVisibility(); 86 rq->setRenderableListener(0); 65 87 } 66 88
Note: See TracChangeset
for help on using the changeset viewer.