Changeset 1722 for GTP/trunk/Lib/Illum
- Timestamp:
- 11/07/06 14:29:38 (18 years ago)
- Location:
- GTP/trunk/Lib/Illum/IllumModule
- Files:
-
- 4 added
- 8 deleted
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/ColorCubeMapRenderTechnique.h
r1711 r1722 33 33 bool updateAllFace, 34 34 bool renderSelf, 35 bool renderEnvironment, 35 36 ElementaryRenderable* parentRenderable, 36 37 TechniqueGroup* parentTechniqueGroup … … 50 51 protected: 51 52 52 virtual void colorCubeMapRunChanged(RenderingRun* run) = 0; 53 /** 54 @brief Creates a ColorCubeMapRenderingRun. 55 56 @return the new ColorCubeMapRenderingRun instance. 57 */ 58 virtual RenderingRun* createColorCubeMapRun() = 0; 53 virtual void colorCubeMapRunChanged(RenderingRun* run) = 0; 59 54 }; -
GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/ConvolvedCubeMapRenderTechnique.h
r1711 r1722 37 37 bool updateAllFace, 38 38 bool renderSelf, 39 bool renderEnvironment, 39 40 ElementaryRenderable* parentRenderable, 40 41 TechniqueGroup* parentTechniqueGroup … … 72 73 @return the new ColorCubeMapRenderingRun instance. 73 74 */ 74 virtual RenderingRun* createColorCubeMapRun() = 0;75 /**76 @brief Creates a ColorCubeMapRenderingRun.77 78 @return the new ColorCubeMapRenderingRun instance.79 */80 75 virtual RenderingRun* createReducedCubeMapRun() = 0; 81 76 }; -
GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/CubeMapRenderTechnique.h
r1711 r1722 33 33 bool updateAllFace, 34 34 bool renderSelf, 35 bool renderEnvironment, 35 36 ElementaryRenderable* parentRenderable, 36 37 TechniqueGroup* parentTechniqueGroup … … 38 39 ~CubeMapRenderTechnique(); 39 40 41 void runChanged(RenderingRunType runType, RenderingRun* run); 42 40 43 protected: 41 44 /** … … 79 82 */ 80 83 unsigned long startFrame; 81 bool renderSelf; 84 bool renderSelf; 85 bool renderEnvironment; 86 virtual RenderingRun* createCubeMapRun() = 0; 87 virtual void cubeMapRunChanged(RenderingRun* run) = 0; 82 88 }; -
GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/DistanceCubeMapRenderTechnique.h
r1711 r1722 33 33 bool updateAllFace, 34 34 bool renderSelf, 35 bool renderEnvironment, 35 36 ElementaryRenderable* parentRenderable, 36 37 TechniqueGroup* parentTechniqueGroup … … 63 64 */ 64 65 virtual void distanceCubeMapRunUpdated(RenderingRun* run) = 0; 65 /** 66 @brief Creates a ColorCubeMapRenderingRun. 67 68 @return the new ColorCubeMapRenderingRun instance. 69 */ 70 virtual RenderingRun* createDistanceCubeMapRun() = 0; 66 71 67 }; -
GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRun.h
r1125 r1722 44 44 */ 45 45 virtual class OgreRenderingRun* asOgreRenderingRun(){return 0;} 46 47 virtual bool canJoin(RenderingRun* run){return true;} 46 48 47 49 protected: -
GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/SharedRuns.h
r1491 r1722 5 5 6 6 7 #define RUN_TYPE_COUNT 117 #define RUN_TYPE_COUNT 24 8 8 /** 9 9 @brief Enum of RenderingRun types. … … 14 14 enum RenderingRunType 15 15 { 16 ILLUMRUN_CUBEMAP, 16 17 ILLUMRUN_COLOR_CUBEMAP, 18 ILLUMRUN_COLOR_CUBEMAP_L1, 19 ILLUMRUN_COLOR_CUBEMAP_L2, 20 ILLUMRUN_COLOR_CUBEMAP_L3, 21 ILLUMRUN_COLOR_CUBEMAP_L4, 22 ILLUMRUN_COLOR_CUBEMAP_L5, 23 ILLUMRUN_COLOR_CUBEMAP_L6, 17 24 ILLUMRUN_DISTANCE_CUBEMAP, 25 ILLUMRUN_DISTANCE_CUBEMAP_L1, 26 ILLUMRUN_DISTANCE_CUBEMAP_L2, 27 ILLUMRUN_DISTANCE_CUBEMAP_L3, 28 ILLUMRUN_DISTANCE_CUBEMAP_L4, 29 ILLUMRUN_DISTANCE_CUBEMAP_L5, 30 ILLUMRUN_DISTANCE_CUBEMAP_L6, 18 31 ILLUMRUN_CAUSTIC_CUBEMAP, 19 32 ILLUMRUN_REDUCED_CUBEMAP, -
GTP/trunk/Lib/Illum/IllumModule/IllumModule/scripts/illummodule.vcproj
r1711 r1722 241 241 </File> 242 242 <File 243 RelativePath="..\src\RenderingRuns\C olorCubeMapRenderingRun.cpp"243 RelativePath="..\src\RenderingRuns\CubeMapRenderingRun.cpp" 244 244 > 245 245 </File> 246 246 <File 247 247 RelativePath="..\src\RenderingRuns\DepthShadowMapRenderingRun.cpp" 248 >249 </File>250 <File251 RelativePath="..\src\RenderingRuns\DistanceCubeMapRenderingRun.cpp"252 248 > 253 249 </File> … … 358 354 </File> 359 355 <File 360 RelativePath="..\include\RenderingRuns\C olorCubeMapRenderingRun.h"356 RelativePath="..\include\RenderingRuns\CubeMapRenderingRun.h" 361 357 > 362 358 </File> 363 359 <File 364 360 RelativePath="..\include\RenderingRuns\DepthShadowMapRenderingRun.h" 365 >366 </File>367 <File368 RelativePath="..\include\RenderingRuns\DistanceCubeMapRenderingRun.h"369 361 > 370 362 </File> -
GTP/trunk/Lib/Illum/IllumModule/IllumModule/src/RenderTechniques/ColorCubeMapRenderTechnique.cpp
r1711 r1722 11 11 bool updateAllFace, 12 12 bool renderSelf, 13 bool renderEnvironment, 13 14 ElementaryRenderable* parentRenderable, 14 15 TechniqueGroup* parentTechniqueGroup) … … 16 17 :CubeMapRenderTechnique( startFrame, cubeMapUpdateInterval, cubeMapResolution, 17 18 useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, 18 updateAllFace, renderSelf, 19 updateAllFace, renderSelf, renderEnvironment, 19 20 parentRenderable, parentTechniqueGroup), 20 21 RenderTechnique(parentRenderable, parentTechniqueGroup) -
GTP/trunk/Lib/Illum/IllumModule/IllumModule/src/RenderTechniques/ConvolvedCubeMapRenderTechnique.cpp
r1711 r1722 12 12 bool updateAllFace, 13 13 bool renderSelf, 14 bool renderEnvironment, 14 15 ElementaryRenderable* parentRenderable, 15 16 TechniqueGroup* parentTechniqueGroup) … … 17 18 :CubeMapRenderTechnique( startFrame, cubeMapUpdateInterval, cubeMapResolution, 18 19 useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, 19 updateAllFace, renderSelf, 20 updateAllFace, renderSelf, renderEnvironment, 20 21 parentRenderable, parentTechniqueGroup), 21 22 RenderTechnique(parentRenderable, parentTechniqueGroup) -
GTP/trunk/Lib/Illum/IllumModule/IllumModule/src/RenderTechniques/CubeMapRenderTechnique.cpp
r1711 r1722 11 11 bool updateAllFace, 12 12 bool renderSelf, 13 bool renderEnvironment, 13 14 ElementaryRenderable* parentRenderable, 14 15 TechniqueGroup* parentTechniqueGroup) … … 24 25 this->updateAllFace = updateAllFace; 25 26 this->renderSelf = renderSelf; 27 this->renderEnvironment = renderEnvironment; 28 } 29 30 void CubeMapRenderTechnique::runChanged(RenderingRunType runType, RenderingRun* run) 31 { 32 if(runType == ILLUMRUN_CUBEMAP) 33 cubeMapRunChanged(run); 26 34 } 27 35 -
GTP/trunk/Lib/Illum/IllumModule/IllumModule/src/RenderTechniques/DistanceCubeMapRenderTechnique.cpp
r1711 r1722 11 11 bool updateAllFace, 12 12 bool renderSelf, 13 bool renderEnvironment, 13 14 ElementaryRenderable* parentRenderable, 14 15 TechniqueGroup* parentTechniqueGroup) … … 16 17 :CubeMapRenderTechnique( startFrame, cubeMapUpdateInterval, cubeMapResolution, 17 18 useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, 18 updateAllFace, renderSelf, 19 updateAllFace, renderSelf, renderEnvironment, 19 20 parentRenderable, parentTechniqueGroup), 20 21 RenderTechnique(parentRenderable, parentTechniqueGroup) -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreRenderingRun.h
r1644 r1722 32 32 OgreRenderingRun* asOgreRenderingRun(){return this;} 33 33 34 virtual bool canJoin(OgreRenderingRun* run){return true;} 35 34 36 35 protected: 37 36 -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreSharedRuns.h
r1425 r1722 186 186 void runChanged(RenderingRunType runType, RenderingRun* run); 187 187 virtual void addTechniqueGroup(TechniqueGroup* group){childTechniqueGroups.push_back(group);} 188 188 void setMaterial(String materialName); 189 void restoreMaterial(); 190 189 191 protected: 190 192 /** … … 206 208 */ 207 209 std::map<OgreRenderable*, bool> renderables; 210 std::map<OgreRenderable*, String> renderableMaterials; 208 211 /** 209 212 @brief the bounding sphere of all the objects connected to this node. -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreColorCubeMapRenderTechnique.h
r1711 r1722 48 48 bool updateAllFace, 49 49 bool renderSelf, 50 bool renderEnvironment, 51 String selfMaterial, 52 String environmentMaterial, 50 53 Pass* pass, 51 54 OgreRenderable* parentRenderable, … … 63 66 64 67 //inherited 65 void colorCubeMapRunChanged(RenderingRun* run); 66 //inherited 67 RenderingRun* createColorCubeMapRun(); 68 69 68 void colorCubeMapRunChanged(RenderingRun* run); 70 69 }; 71 70 -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreConvolvedCubeMapRenderTechnique.h
r1711 r1722 50 50 bool updateAllFace, 51 51 bool renderSelf, 52 bool renderEnvironment, 53 String selfMaterial, 54 String environmentMaterial, 52 55 Pass* pass, 53 56 OgreRenderable* parentRenderable, … … 68 71 //inherited 69 72 void colorCubeMapRunChanged(RenderingRun* run); 70 //inherited71 RenderingRun* createColorCubeMapRun();72 73 //inherited 73 74 RenderingRun* createReducedCubeMapRun(); -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreCubeMapRenderTechnique.h
r1711 r1722 48 48 bool updateAllFace, 49 49 bool renderSelf, 50 bool renderEnvironment, 51 String selfMaterial, 52 String environmentMaterial, 50 53 Pass* pass, 51 54 OgreRenderable* parentRenderable, 52 OgreTechniqueGroup* parentTechniqueGroup 55 OgreTechniqueGroup* parentTechniqueGroup, 56 bool createCubeRun = false 53 57 ); 54 58 /** … … 56 60 */ 57 61 ~OgreCubeMapRenderTechnique(); 62 58 63 59 64 protected: … … 62 67 @brief the id of the texture unit state the resulting cubemap should be bound to 63 68 */ 64 unsigned char texID; 69 unsigned char texID; 70 String selfMaterial; 71 String environmentMaterial; 72 String texturePostFix; 73 74 RenderingRun* createCubeMapRun(); 75 void cubeMapRunChanged(RenderingRun* run); 65 76 }; 66 77 … … 70 81 71 82 OgreCubeMapRenderTechniqueFactory(); 83 84 OgreRenderTechnique* createInstance(IllumTechniqueParams* params, 85 Pass* pass, 86 OgreRenderable* parentRenderable, 87 OgreTechniqueGroup* parentTechniqueGroup); 88 89 void resetParams(); 72 90 73 91 unsigned long startFrame; … … 81 99 bool updateAllFace; 82 100 bool renderSelf; 83 84 void resetParams();85 101 bool renderEnvironment; 102 String selfMaterial; 103 String environmentMaterial; 86 104 }; -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreDistanceCubeMapRenderTechnique.h
r1711 r1722 48 48 bool updateAllFace, 49 49 bool renderSelf, 50 bool renderEnvironment, 51 String selfMaterial, 52 String environmentMaterial, 50 53 Pass* pass, 51 54 OgreRenderable* parentRenderable, … … 64 67 //inherited 65 68 void distanceCubeMapRunChanged(RenderingRun* run); 66 //inherited67 RenderingRun* createDistanceCubeMapRun();68 69 //inherited 69 70 void distanceCubeMapRunUpdated(RenderingRun* run); -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreCausticCubeMapRenderingRun.h
r1688 r1722 60 60 float getAttenuation(){return attenuation;} 61 61 62 bool canJoin( OgreRenderingRun* run)62 bool canJoin(RenderingRun* run) 63 63 { 64 OgreCausticCubeMapRenderingRun* r = (OgreCausticCubeMapRenderingRun*) run ;64 OgreCausticCubeMapRenderingRun* r = (OgreCausticCubeMapRenderingRun*) run->asOgreRenderingRun(); 65 65 if(r->materialName == materialName) 66 66 return true; -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreChildPSystemRenderingRun.h
r1330 r1722 46 46 String getImpostorTextureName(){return name;} 47 47 48 bool canJoin( OgreRenderingRun* run)48 bool canJoin(RenderingRun* run) 49 49 { 50 50 -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgrePhotonMapRenderingRun.h
r1055 r1722 48 48 void refreshLight(); 49 49 50 bool canJoin( OgreRenderingRun* run)50 bool canJoin(RenderingRun* run) 51 51 { 52 OgrePhotonMapRenderingRun* r = (OgrePhotonMapRenderingRun*) run ;52 OgrePhotonMapRenderingRun* r = (OgrePhotonMapRenderingRun*) run->asOgreRenderingRun(); 53 53 if(r->materialName == materialName) 54 54 return true; -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/scripts/OgreIllumModule.vcproj
r1711 r1722 249 249 </File> 250 250 <File 251 RelativePath="..\src\RenderingRuns\OgreC olorCubeMapRenderingRun.cpp"251 RelativePath="..\src\RenderingRuns\OgreCubeMapRenderingRun.cpp" 252 252 > 253 253 </File> 254 254 <File 255 255 RelativePath="..\src\RenderingRuns\OgreDepthShadowMapRenderingRun.cpp" 256 >257 </File>258 <File259 RelativePath="..\src\RenderingRuns\OgreDistanceCubeMapRenderingRun.cpp"260 256 > 261 257 </File> … … 379 375 </File> 380 376 <File 381 RelativePath="..\include\RenderingRuns\OgreC olorCubeMapRenderingRun.h"377 RelativePath="..\include\RenderingRuns\OgreCubeMapRenderingRun.h" 382 378 > 383 379 </File> 384 380 <File 385 381 RelativePath="..\include\RenderingRuns\OgreDepthShadowMapRenderingRun.h" 386 >387 </File>388 <File389 RelativePath="..\include\RenderingRuns\OgreDistanceCubeMapRenderingRun.h"390 382 > 391 383 </File> -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreSharedRuns.cpp
r1425 r1722 294 294 ((OgreSharedRuns*)child2)->findSharedRootsForType(runType, roots); 295 295 } 296 297 void OgreSharedRuns::setMaterial(String materialName) 298 { 299 renderableMaterials.clear(); 300 std::map<OgreRenderable*, bool>::iterator it = renderables.begin(); 301 std::map<OgreRenderable*, bool>::iterator itend = renderables.end(); 302 while(it != itend) 303 { 304 renderableMaterials[(*it).first] = (*it).first->getMaterialName(); 305 (*it).first->setMaterialName(materialName); 306 it++; 307 } 308 309 if(child1 != 0) 310 ((OgreSharedRuns*)child1)->setMaterial(materialName); 311 if(child2 != 0) 312 ((OgreSharedRuns*)child2)->setMaterial(materialName); 313 } 314 315 void OgreSharedRuns::restoreMaterial() 316 { 317 std::map<OgreRenderable*, String>::iterator it = renderableMaterials.begin(); 318 std::map<OgreRenderable*, String>::iterator itend = renderableMaterials.end(); 319 while(it != itend) 320 { 321 (*it).first->setMaterialName((*it).second); 322 it++; 323 } 324 325 if(child1 != 0) 326 ((OgreSharedRuns*)child1)->restoreMaterial(); 327 if(child2 != 0) 328 ((OgreSharedRuns*)child2)->restoreMaterial(); 329 } -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCausticCasterRenderTechnique.cpp
r1688 r1722 3 3 #include "OgreCausticCubeMapRenderingRun.h" 4 4 #include "OgrePhotonMapRenderingRun.h" 5 #include "Ogre DistanceCubeMapRenderingRun.h"5 #include "OgreCubeMapRenderingRun.h" 6 6 7 7 … … 119 119 RenderingRun* OgreCausticCasterRenderTechnique::createDistanceCubeMapRun() 120 120 { 121 return new OgreDistanceCubeMapRenderingRun((OgreSharedRuns*) sharedRuns, 122 parentOgreRenderable->getName() + "_DISTANCECUBEMAP", 123 startFrame, 124 photonMapUpdateInterval, 125 causticCubeMapResolution, 126 0, 127 0, 128 0, 129 0, 130 updateAllFace 131 ); 121 return new OgreCubeMapRenderingRun((OgreSharedRuns*) sharedRuns, 122 parentOgreRenderable->getName() + "_DISTANCECUBEMAP", 123 startFrame, 124 photonMapUpdateInterval, 125 causticCubeMapResolution, 126 0, 127 0, 128 0, 129 0, 130 updateAllFace, 131 false, 132 true, 133 "", 134 "GameTools/DistanceShader"); 132 135 133 136 } -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCausticRecieverRenderTechnique.cpp
r1518 r1722 3 3 #include "OgreIlluminationManager.h" 4 4 #include "OgreCausticCubeMapRenderingRun.h" 5 #include "Ogre DistanceCubeMapRenderingRun.h"5 #include "OgreCubeMapRenderingRun.h" 6 6 7 7 OgreCausticRecieverRenderTechnique::OgreCausticRecieverRenderTechnique( … … 97 97 cauCubeRun->getCausticCubeMapTextureName()); 98 98 99 Ogre DistanceCubeMapRenderingRun* cauPhotonRun =100 (Ogre DistanceCubeMapRenderingRun*) causticCasters.at(i)->99 OgreCubeMapRenderingRun* distCubeRun = 100 (OgreCubeMapRenderingRun*) causticCasters.at(i)-> 101 101 getRun(ILLUMRUN_DISTANCE_CUBEMAP)->asOgreRenderingRun(); 102 102 passes.at(i)->getTextureUnitState(1)->setTextureName( 103 cauPhotonRun->getDistanceCubeMapTextureName());103 distCubeRun->getCubeMapTextureName()); 104 104 105 105 //set caster position -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreColorCubeMapRenderTechnique.cpp
r1711 r1722 1 1 #include "OgreColorCubeMapRenderTechnique.h" 2 2 #include "OgreTechniqueGroup.h" 3 #include "OgreC olorCubeMapRenderingRun.h"3 #include "OgreCubeMapRenderingRun.h" 4 4 5 5 OgreColorCubeMapRenderTechnique::OgreColorCubeMapRenderTechnique(unsigned long startFrame, … … 13 13 bool updateAllFace, 14 14 bool renderSelf, 15 bool renderEnvironment, 16 String selfMaterial, 17 String environmentMaterial, 15 18 Pass* pass, 16 19 OgreRenderable* parentRenderable, 17 20 OgreTechniqueGroup* parentTechniqueGroup) 18 :OgreCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, texID, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, pass, parentRenderable, parentTechniqueGroup),19 ColorCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, parentRenderable, parentTechniqueGroup),20 CubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, parentRenderable, parentTechniqueGroup),21 RenderTechnique(parentRenderable, parentTechniqueGroup)21 :OgreCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, texID, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, selfMaterial, environmentMaterial, pass, parentRenderable, parentTechniqueGroup), 22 ColorCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, parentRenderable, parentTechniqueGroup), 23 CubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, parentRenderable, parentTechniqueGroup), 24 RenderTechnique(parentRenderable, parentTechniqueGroup) 22 25 { 23 26 texturePostFix = "_COLORCUBEMAP"; 27 24 28 if(sharedRuns->getRun(ILLUMRUN_COLOR_CUBEMAP) == 0) 25 sharedRuns->addRun(ILLUMRUN_COLOR_CUBEMAP, createC olorCubeMapRun());29 sharedRuns->addRun(ILLUMRUN_COLOR_CUBEMAP, createCubeMapRun()); 26 30 27 31 colorCubeMapRunChanged(sharedRuns->getRun(ILLUMRUN_COLOR_CUBEMAP)); … … 47 51 void OgreColorCubeMapRenderTechnique::colorCubeMapRunChanged(RenderingRun* run) 48 52 { 49 OgreC olorCubeMapRenderingRun* cuberun =(OgreColorCubeMapRenderingRun*) (run->asOgreRenderingRun());50 String cubemapname = cuberun->getC olorCubeMapTextureName();53 OgreCubeMapRenderingRun* cuberun =(OgreCubeMapRenderingRun*) (run->asOgreRenderingRun()); 54 String cubemapname = cuberun->getCubeMapTextureName(); 51 55 52 56 pass->getTextureUnitState(texID)->setTextureName(cubemapname); 53 57 } 54 58 55 RenderingRun* OgreColorCubeMapRenderTechnique::createColorCubeMapRun() 56 { 57 return new OgreColorCubeMapRenderingRun( (OgreSharedRuns*) parentTechniqueGroup->getSharedRuns(), 58 parentOgreRenderable->getName() + "_COLORCUBEMAP", 59 startFrame, 60 cubeMapUpdateInterval, 61 cubeMapResolution, 62 useDistCalc, 63 useFaceAngleCalc, 64 distTolerance, 65 angleTolerance, 66 updateAllFace); 67 } 59 68 60 69 61 … … 96 88 updateAllFace, 97 89 renderSelf, 90 renderEnvironment, 91 selfMaterial, 92 environmentMaterial, 98 93 pass, 99 94 parentRenderable, -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreConvolvedCubeMapRenderTechnique.cpp
r1711 r1722 2 2 #include "OgreTechniqueGroup.h" 3 3 #include "OgreReducedCubeMapRenderingRun.h" 4 #include "OgreC olorCubeMapRenderingRun.h"4 #include "OgreCubeMapRenderingRun.h" 5 5 6 6 OgreConvolvedCubeMapRenderTechnique::OgreConvolvedCubeMapRenderTechnique(unsigned long startFrame, … … 15 15 bool updateAllFace, 16 16 bool renderSelf, 17 bool renderEnvironment, 18 String selfMaterial, 19 String environmentMaterial, 17 20 Pass* pass, 18 21 OgreRenderable* parentRenderable, 19 22 OgreTechniqueGroup* parentTechniqueGroup) 20 23 : 21 OgreCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, texID, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, pass, parentRenderable, parentTechniqueGroup),22 CubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, parentRenderable, parentTechniqueGroup),23 ConvolvedCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, reducedCubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, parentRenderable, parentTechniqueGroup),24 OgreCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, texID, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, selfMaterial, environmentMaterial, pass, parentRenderable, parentTechniqueGroup), 25 CubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, parentRenderable, parentTechniqueGroup), 26 ConvolvedCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, reducedCubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, parentRenderable, parentTechniqueGroup), 24 27 RenderTechnique(parentRenderable, parentTechniqueGroup) 25 28 { 29 texturePostFix = "_COLORCUBEMAP"; 30 26 31 if(sharedRuns->getRun(ILLUMRUN_COLOR_CUBEMAP) == 0) 27 sharedRuns->addRun(ILLUMRUN_COLOR_CUBEMAP, createC olorCubeMapRun());32 sharedRuns->addRun(ILLUMRUN_COLOR_CUBEMAP, createCubeMapRun()); 28 33 29 34 if(sharedRuns->getRun(ILLUMRUN_REDUCED_CUBEMAP) == 0) … … 55 60 void OgreConvolvedCubeMapRenderTechnique::colorCubeMapRunChanged(RenderingRun* run) 56 61 { 57 58 OgreColorCubeMapRenderingRun* cuberun =(OgreColorCubeMapRenderingRun*) (run->asOgreRenderingRun()); 59 String cubemapname = cuberun->getColorCubeMapTextureName(); 62 OgreCubeMapRenderingRun* cuberun =(OgreCubeMapRenderingRun*) (run->asOgreRenderingRun()); 63 String cubemapname = cuberun->getCubeMapTextureName(); 60 64 61 65 OgreReducedCubeMapRenderingRun* rr = (OgreReducedCubeMapRenderingRun*) sharedRuns->getRun(ILLUMRUN_REDUCED_CUBEMAP)->asOgreRenderingRun(); 62 66 rr->colorCubeMapChanged(cubemapname); 63 67 64 }65 66 RenderingRun* OgreConvolvedCubeMapRenderTechnique::createColorCubeMapRun()67 {68 return new OgreColorCubeMapRenderingRun( (OgreSharedRuns*) parentTechniqueGroup->getSharedRuns(),69 parentOgreRenderable->getName() + "_COLORCUBEMAP",70 startFrame,71 cubeMapUpdateInterval,72 cubeMapResolution,73 useDistCalc,74 useFaceAngleCalc,75 distTolerance,76 angleTolerance,77 updateAllFace);78 68 } 79 69 … … 134 124 updateAllFace, 135 125 renderSelf, 126 renderEnvironment, 127 selfMaterial, 128 environmentMaterial, 136 129 pass, 137 130 parentRenderable, -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCubeMapRenderTechnique.cpp
r1711 r1722 1 1 #include "OgreCubeMapRenderTechnique.h" 2 2 #include "OgreTechniqueGroup.h" 3 #include "OgreC olorCubeMapRenderingRun.h"3 #include "OgreCubeMapRenderingRun.h" 4 4 5 5 OgreCubeMapRenderTechnique::OgreCubeMapRenderTechnique(unsigned long startFrame, … … 13 13 bool updateAllFace, 14 14 bool renderSelf, 15 bool renderEnvironment, 16 String selfMaterial, 17 String environmentMaterial, 15 18 Pass* pass, 16 19 OgreRenderable* parentRenderable, 17 OgreTechniqueGroup* parentTechniqueGroup) 20 OgreTechniqueGroup* parentTechniqueGroup, 21 bool createCubeRun) 18 22 :OgreRenderTechnique( pass, parentRenderable, parentTechniqueGroup), 19 CubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, parentRenderable, parentTechniqueGroup),23 CubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, parentRenderable, parentTechniqueGroup), 20 24 RenderTechnique(parentRenderable, parentTechniqueGroup) 21 25 { 22 this->texID = texID; 26 this->texID = texID; 27 this->selfMaterial = selfMaterial; 28 this->environmentMaterial = environmentMaterial; 29 texturePostFix = "_CUBEMAP"; 30 31 if(createCubeRun) 32 { 33 if(sharedRuns->getRun(ILLUMRUN_CUBEMAP) == 0) 34 sharedRuns->addRun(ILLUMRUN_CUBEMAP, createCubeMapRun()); 35 36 cubeMapRunChanged(sharedRuns->getRun(ILLUMRUN_CUBEMAP)); 37 } 23 38 } 24 39 … … 27 42 { 28 43 44 } 45 46 void OgreCubeMapRenderTechnique::cubeMapRunChanged(RenderingRun* run) 47 { 48 OgreCubeMapRenderingRun* cuberun =(OgreCubeMapRenderingRun*) (run->asOgreRenderingRun()); 49 String cubemapname = cuberun->getCubeMapTextureName(); 50 51 pass->getTextureUnitState(texID)->setTextureName(cubemapname); 52 } 53 54 RenderingRun* OgreCubeMapRenderTechnique::createCubeMapRun() 55 { 56 return new OgreCubeMapRenderingRun( (OgreSharedRuns*) parentTechniqueGroup->getSharedRuns(), 57 parentOgreRenderable->getName() + texturePostFix, 58 startFrame, 59 cubeMapUpdateInterval, 60 cubeMapResolution, 61 useDistCalc, 62 useFaceAngleCalc, 63 distTolerance, 64 angleTolerance, 65 updateAllFace, 66 renderSelf, 67 renderEnvironment, 68 selfMaterial, 69 environmentMaterial); 29 70 } 30 71 … … 107 148 OgreCubeMapRenderTechniqueFactory* f = (OgreCubeMapRenderTechniqueFactory*) factory; 108 149 f->renderSelf = StringConverter::parseBool(params); 150 } 151 152 void parseRenderEnv(String& params, RenderTechniqueFactory* factory) 153 { 154 OgreCubeMapRenderTechniqueFactory* f = (OgreCubeMapRenderTechniqueFactory*) factory; 155 f->renderEnvironment = StringConverter::parseBool(params); 156 } 157 158 void parseSelfMaterial(String& params, RenderTechniqueFactory* factory) 159 { 160 OgreCubeMapRenderTechniqueFactory* f = (OgreCubeMapRenderTechniqueFactory*) factory; 161 f->selfMaterial = params; 162 } 163 164 void parseEnvMaterial(String& params, RenderTechniqueFactory* factory) 165 { 166 OgreCubeMapRenderTechniqueFactory* f = (OgreCubeMapRenderTechniqueFactory*) factory; 167 f->environmentMaterial = params; 109 168 } 110 169 } … … 123 182 this->attributeParsers.insert(AttribParserList::value_type("face_angle_calc", (ILLUM_ATTRIBUTE_PARSER) parseUseFaceAngleCalc)); 124 183 this->attributeParsers.insert(AttribParserList::value_type("update_all_face", (ILLUM_ATTRIBUTE_PARSER) parseUpdateAllFace)); 125 this->attributeParsers.insert(AttribParserList::value_type("render_self", (ILLUM_ATTRIBUTE_PARSER) parseUpdateAllFace)); 184 this->attributeParsers.insert(AttribParserList::value_type("render_self", (ILLUM_ATTRIBUTE_PARSER) parseRenderSelf)); 185 this->attributeParsers.insert(AttribParserList::value_type("render_env", (ILLUM_ATTRIBUTE_PARSER) parseRenderEnv)); 186 this->attributeParsers.insert(AttribParserList::value_type("self_material", (ILLUM_ATTRIBUTE_PARSER) parseSelfMaterial)); 187 this->attributeParsers.insert(AttribParserList::value_type("env_material", (ILLUM_ATTRIBUTE_PARSER) parseEnvMaterial)); 126 188 127 189 } … … 139 201 updateAllFace = false; 140 202 renderSelf = false; 141 } 203 renderEnvironment = true; 204 selfMaterial = ""; 205 environmentMaterial = ""; 206 } 207 208 OgreRenderTechnique* OgreCubeMapRenderTechniqueFactory::createInstance( 209 IllumTechniqueParams* params, 210 Pass* pass, 211 OgreRenderable* parentRenderable, 212 OgreTechniqueGroup* parentTechniqueGroup) 213 { 214 resetParams(); 215 parseParams(params); 216 217 OgreCubeMapRenderTechnique* result = new OgreCubeMapRenderTechnique( 218 startFrame, 219 cubeMapUpdateInterval, 220 cubeMapResolution, 221 texID, 222 useDistCalc, 223 useFaceAngleCalc, 224 distTolerance, 225 angleTolerance, 226 updateAllFace, 227 renderSelf, 228 renderEnvironment, 229 selfMaterial, 230 environmentMaterial, 231 pass, 232 parentRenderable, 233 parentTechniqueGroup, 234 true); 235 236 return result; 237 } -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreDistanceCubeMapRenderTechnique.cpp
r1711 r1722 1 1 #include "OgreDistanceCubeMapRenderTechnique.h" 2 2 #include "OgreTechniqueGroup.h" 3 #include "Ogre DistanceCubeMapRenderingRun.h"3 #include "OgreCubeMapRenderingRun.h" 4 4 5 5 OgreDistanceCubeMapRenderTechnique::OgreDistanceCubeMapRenderTechnique(unsigned long startFrame, … … 13 13 bool updateAllFace, 14 14 bool renderSelf, 15 bool renderEnvironment, 16 String selfMaterial, 17 String environmentMaterial, 15 18 Pass* pass, 16 19 OgreRenderable* parentRenderable, 17 20 OgreTechniqueGroup* parentTechniqueGroup) 18 21 : 19 OgreCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, texID, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, pass, parentRenderable, parentTechniqueGroup),20 CubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, parentRenderable, parentTechniqueGroup),21 DistanceCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, parentRenderable, parentTechniqueGroup),22 OgreCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, texID, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, selfMaterial, environmentMaterial, pass, parentRenderable, parentTechniqueGroup), 23 CubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, parentRenderable, parentTechniqueGroup), 24 DistanceCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, parentRenderable, parentTechniqueGroup), 22 25 RenderTechnique(parentRenderable, parentTechniqueGroup) 23 26 { 27 texturePostFix = "_DISTANCECUBEMAP"; 28 24 29 if(sharedRuns->getRun(ILLUMRUN_DISTANCE_CUBEMAP) == 0) 25 sharedRuns->addRun(ILLUMRUN_DISTANCE_CUBEMAP, create DistanceCubeMapRun());30 sharedRuns->addRun(ILLUMRUN_DISTANCE_CUBEMAP, createCubeMapRun()); 26 31 27 32 distanceCubeMapRunChanged(sharedRuns->getRun(ILLUMRUN_DISTANCE_CUBEMAP)); … … 41 46 void OgreDistanceCubeMapRenderTechnique::distanceCubeMapRunChanged(RenderingRun* run) 42 47 { 43 Ogre DistanceCubeMapRenderingRun* cuberun =(OgreDistanceCubeMapRenderingRun*) (run->asOgreRenderingRun());44 String cubemapname = cuberun->get DistanceCubeMapTextureName();48 OgreCubeMapRenderingRun* cuberun =(OgreCubeMapRenderingRun*) (run->asOgreRenderingRun()); 49 String cubemapname = cuberun->getCubeMapTextureName(); 45 50 46 51 pass->getTextureUnitState(texID)->setTextureName(cubemapname); … … 54 59 } 55 60 56 RenderingRun* OgreDistanceCubeMapRenderTechnique::createDistanceCubeMapRun() 57 { 58 return new OgreDistanceCubeMapRenderingRun( (OgreSharedRuns*) parentTechniqueGroup->getSharedRuns(), 59 parentOgreRenderable->getName() + "_DISTANCECUBEMAP", 60 startFrame, 61 cubeMapUpdateInterval, 62 cubeMapResolution, 63 useDistCalc, 64 useFaceAngleCalc, 65 distTolerance, 66 angleTolerance, 67 updateAllFace); 68 } 61 69 62 70 63 ///Technique factory … … 82 75 OgreCubeMapRenderTechniqueFactory::resetParams(); 83 76 texID = 1; 77 environmentMaterial = "GameTools/DistanceShader"; 78 selfMaterial = "GameTools/DistanceShader"; 84 79 OgreCubeMapRenderTechniqueFactory::parseParams(params); 85 80 parseParams(params); … … 96 91 updateAllFace, 97 92 renderSelf, 93 renderEnvironment, 94 selfMaterial, 95 environmentMaterial, 98 96 pass, 99 97 parentRenderable, -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreChildParticlesystemRenderingRun.cpp
r1425 r1722 1 1 #include "OgreChildPSystemRenderingRun.h" 2 2 #include "OgreIlluminationManager.h" 3 #include "OgreDistanceCubeMapRenderingRun.h"4 5 6 3 7 4 OgreChildPSystemRenderingRun::OgreChildPSystemRenderingRun(OgreSharedRuns* sharedRuns, -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreLightVolumeRenderingRun.cpp
r1425 r1722 1 1 #include "OgreLightVolumeRenderingRun.h" 2 2 #include "OgreIlluminationManager.h" 3 #include "OgreDistanceCubeMapRenderingRun.h"4 3 #include "OgreChildPSystemRenderingRun.h" 5 4 -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgrePhotonMapRenderingRun.cpp
r1628 r1722 1 1 #include "OgrePhotonMapRenderingRun.h" 2 2 //#include "OgreIlluminationManager.h" 3 #include "OgreDistanceCubeMapRenderingRun.h" 4 3 #include "OgreCubeMapRenderingRun.h" 5 4 6 5 … … 139 138 { 140 139 Material* mat = (Material*) MaterialManager::getSingleton().getByName(materialName).getPointer(); 141 Ogre DistanceCubeMapRenderingRun* cuberun =(OgreDistanceCubeMapRenderingRun*) (run->asOgreRenderingRun());142 String cubemapname = cuberun->get DistanceCubeMapTextureName();140 OgreCubeMapRenderingRun* cuberun =(OgreCubeMapRenderingRun*) (run->asOgreRenderingRun()); 141 String cubemapname = cuberun->getCubeMapTextureName(); 143 142 mat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName(cubemapname); 144 143 } … … 147 146 { 148 147 Material* mat = (Material*) MaterialManager::getSingleton().getByName(materialName).getPointer(); 149 Ogre DistanceCubeMapRenderingRun* cuberun =(OgreDistanceCubeMapRenderingRun*) (run->asOgreRenderingRun());150 String cubemapname = cuberun->get DistanceCubeMapTextureName();148 OgreCubeMapRenderingRun* cuberun =(OgreCubeMapRenderingRun*) (run->asOgreRenderingRun()); 149 String cubemapname = cuberun->getCubeMapTextureName(); 151 150 GpuProgramParametersSharedPtr fpParams = mat->getTechnique(0)->getPass(0)->getFragmentProgramParameters(); 152 151 Vector3 center = ((OgreSharedRuns*) sharedRuns)->getRootPosition(ILLUMRUN_DISTANCE_CUBEMAP);
Note: See TracChangeset
for help on using the changeset viewer.