- Timestamp:
- 11/07/06 14:29:38 (18 years ago)
- Location:
- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
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,
Note: See TracChangeset
for help on using the changeset viewer.