Changeset 1725 for GTP/trunk/Lib/Illum
- Timestamp:
- 11/08/06 14:04:22 (18 years ago)
- Location:
- GTP/trunk/Lib/Illum/IllumModule
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/ColorCubeMapRenderTechnique.h
r1722 r1725 34 34 bool renderSelf, 35 35 bool renderEnvironment, 36 int layer, 36 37 ElementaryRenderable* parentRenderable, 37 38 TechniqueGroup* parentTechniqueGroup … … 50 51 51 52 protected: 52 53 53 virtual void colorCubeMapRunChanged(RenderingRun* run) = 0; 54 54 }; -
GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/CubeMapRenderTechnique.h
r1722 r1725 34 34 bool renderSelf, 35 35 bool renderEnvironment, 36 int layer, 36 37 ElementaryRenderable* parentRenderable, 37 38 TechniqueGroup* parentTechniqueGroup … … 84 85 bool renderSelf; 85 86 bool renderEnvironment; 87 int layer; 88 RenderingRunType cubemapLayer; 89 86 90 virtual RenderingRun* createCubeMapRun() = 0; 87 91 virtual void cubeMapRunChanged(RenderingRun* run) = 0; -
GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/DistanceCubeMapRenderTechnique.h
r1722 r1725 34 34 bool renderSelf, 35 35 bool renderEnvironment, 36 int layer, 36 37 ElementaryRenderable* parentRenderable, 37 38 TechniqueGroup* parentTechniqueGroup … … 52 53 53 54 protected: 55 54 56 /** 55 57 @brief Called if the changed run is a ColorCubeMapRenderingRun. -
GTP/trunk/Lib/Illum/IllumModule/IllumModule/src/RenderTechniques/ColorCubeMapRenderTechnique.cpp
r1722 r1725 12 12 bool renderSelf, 13 13 bool renderEnvironment, 14 int layer, 14 15 ElementaryRenderable* parentRenderable, 15 16 TechniqueGroup* parentTechniqueGroup) … … 17 18 :CubeMapRenderTechnique( startFrame, cubeMapUpdateInterval, cubeMapResolution, 18 19 useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, 19 updateAllFace, renderSelf, renderEnvironment, 20 updateAllFace, renderSelf, renderEnvironment, layer, 20 21 parentRenderable, parentTechniqueGroup), 21 22 RenderTechnique(parentRenderable, parentTechniqueGroup) 22 23 { 23 24 switch(layer) 25 { 26 case 0: 27 cubemapLayer = ILLUMRUN_COLOR_CUBEMAP; 28 break; 29 case 1: 30 cubemapLayer = ILLUMRUN_COLOR_CUBEMAP_L1; 31 break; 32 case 2: 33 cubemapLayer = ILLUMRUN_COLOR_CUBEMAP_L2; 34 break; 35 case 3: 36 cubemapLayer = ILLUMRUN_COLOR_CUBEMAP_L3; 37 break; 38 case 4: 39 cubemapLayer = ILLUMRUN_COLOR_CUBEMAP_L4; 40 break; 41 case 5: 42 cubemapLayer = ILLUMRUN_COLOR_CUBEMAP_L5; 43 break; 44 case 6: 45 cubemapLayer = ILLUMRUN_COLOR_CUBEMAP_L6; 46 break; 47 } 24 48 } 25 49 … … 31 55 void ColorCubeMapRenderTechnique::runChanged(RenderingRunType runType, RenderingRun* run) 32 56 { 33 if(runType == ILLUMRUN_COLOR_CUBEMAP)57 if(runType == cubemapLayer) 34 58 colorCubeMapRunChanged(run); 35 59 } … … 37 61 void ColorCubeMapRenderTechnique::update(unsigned long frameNum) 38 62 { 39 sharedRuns->updateRun( ILLUMRUN_COLOR_CUBEMAP, frameNum);63 sharedRuns->updateRun(cubemapLayer, frameNum); 40 64 } -
GTP/trunk/Lib/Illum/IllumModule/IllumModule/src/RenderTechniques/ConvolvedCubeMapRenderTechnique.cpp
r1722 r1725 18 18 :CubeMapRenderTechnique( startFrame, cubeMapUpdateInterval, cubeMapResolution, 19 19 useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, 20 updateAllFace, renderSelf, renderEnvironment, 20 updateAllFace, renderSelf, renderEnvironment, 0, 21 21 parentRenderable, parentTechniqueGroup), 22 22 RenderTechnique(parentRenderable, parentTechniqueGroup) -
GTP/trunk/Lib/Illum/IllumModule/IllumModule/src/RenderTechniques/CubeMapRenderTechnique.cpp
r1722 r1725 12 12 bool renderSelf, 13 13 bool renderEnvironment, 14 int layer, 14 15 ElementaryRenderable* parentRenderable, 15 16 TechniqueGroup* parentTechniqueGroup) 16 17 :RenderTechnique( parentRenderable, parentTechniqueGroup) 17 18 { 19 this->layer = layer; 20 cubemapLayer = ILLUMRUN_CUBEMAP; 21 18 22 this->useDistCalc = useDistCalc; 19 23 this->useFaceAngleCalc = useFaceAngleCalc; -
GTP/trunk/Lib/Illum/IllumModule/IllumModule/src/RenderTechniques/DistanceCubeMapRenderTechnique.cpp
r1722 r1725 12 12 bool renderSelf, 13 13 bool renderEnvironment, 14 int layer, 14 15 ElementaryRenderable* parentRenderable, 15 16 TechniqueGroup* parentTechniqueGroup) … … 17 18 :CubeMapRenderTechnique( startFrame, cubeMapUpdateInterval, cubeMapResolution, 18 19 useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, 19 updateAllFace, renderSelf, renderEnvironment, 20 updateAllFace, renderSelf, renderEnvironment, layer, 20 21 parentRenderable, parentTechniqueGroup), 21 22 RenderTechnique(parentRenderable, parentTechniqueGroup) 23 { 24 switch(layer) 25 { 26 case 0: 27 cubemapLayer = ILLUMRUN_DISTANCE_CUBEMAP; 28 break; 29 case 1: 30 cubemapLayer = ILLUMRUN_DISTANCE_CUBEMAP_L1; 31 break; 32 case 2: 33 cubemapLayer = ILLUMRUN_DISTANCE_CUBEMAP_L2; 34 break; 35 case 3: 36 cubemapLayer = ILLUMRUN_DISTANCE_CUBEMAP_L3; 37 break; 38 case 4: 39 cubemapLayer = ILLUMRUN_DISTANCE_CUBEMAP_L4; 40 break; 41 case 5: 42 cubemapLayer = ILLUMRUN_DISTANCE_CUBEMAP_L5; 43 break; 44 case 6: 45 cubemapLayer = ILLUMRUN_DISTANCE_CUBEMAP_L6; 46 break; 47 } 48 } 49 50 DistanceCubeMapRenderTechnique::~DistanceCubeMapRenderTechnique() 22 51 { 23 52 24 53 } 25 54 26 DistanceCubeMapRenderTechnique::~DistanceCubeMapRenderTechnique()27 {28 29 }30 31 55 void DistanceCubeMapRenderTechnique::runChanged(RenderingRunType runType, RenderingRun* run) 32 56 { 33 if(runType == ILLUMRUN_DISTANCE_CUBEMAP)57 if(runType == cubemapLayer) 34 58 distanceCubeMapRunChanged(run); 35 59 } … … 37 61 void DistanceCubeMapRenderTechnique::runUpdated(RenderingRunType runType, RenderingRun* run) 38 62 { 39 if(runType == ILLUMRUN_DISTANCE_CUBEMAP)63 if(runType == cubemapLayer) 40 64 distanceCubeMapRunUpdated(run); 41 65 } … … 43 67 void DistanceCubeMapRenderTechnique::update(unsigned long frameNum) 44 68 { 45 sharedRuns->updateRun( ILLUMRUN_DISTANCE_CUBEMAP, frameNum);69 sharedRuns->updateRun(cubemapLayer, frameNum); 46 70 } -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreColorCubeMapRenderTechnique.h
r1722 r1725 51 51 String selfMaterial, 52 52 String environmentMaterial, 53 int layer, 53 54 Pass* pass, 54 55 OgreRenderable* parentRenderable, … … 64 65 65 66 protected: 66 67 67 //inherited 68 68 void colorCubeMapRunChanged(RenderingRun* run); … … 72 72 { 73 73 public: 74 75 74 OgreColorCubeMapRenderTechniqueFactory(); 76 75 -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreCubeMapRenderTechnique.h
r1722 r1725 51 51 String selfMaterial, 52 52 String environmentMaterial, 53 int layer, 53 54 Pass* pass, 54 55 OgreRenderable* parentRenderable, … … 102 103 String selfMaterial; 103 104 String environmentMaterial; 105 int layer; 104 106 }; -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreDistanceCubeMapRenderTechnique.h
r1722 r1725 51 51 String selfMaterial, 52 52 String environmentMaterial, 53 int layer, 53 54 Pass* pass, 54 55 OgreRenderable* parentRenderable, … … 77 78 { 78 79 public: 79 80 80 OgreDistanceCubeMapRenderTechniqueFactory(); 81 81 -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreCubeMapRenderingRun.h
r1722 r1725 48 48 bool renderEnvironment, 49 49 String selfMaterial, 50 String environmentMaterial); 50 String environmentMaterial, 51 RenderingRunType cubemapRunType); 51 52 /** 52 53 @brief returns the name of the resulting color cubemap texture … … 72 73 String environmentMaterial; 73 74 bool useEnvMaterial; 74 75 RenderingRunType cubemapRunType; 75 76 76 77 -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreRenderingRun.cpp
r1670 r1725 110 110 v->setOverlaysEnabled(false); 111 111 rt->setAutoUpdated(false); 112 112 v->setBackgroundColour(clearColor); 113 113 114 Root::getSingleton().getRenderSystem()->_setViewport(v); 114 115 Root::getSingleton().getRenderSystem()->clearFrameBuffer( FBT_COLOUR, clearColor); -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCausticCasterRenderTechnique.cpp
r1722 r1725 132 132 true, 133 133 "", 134 "GameTools/DistanceShader"); 134 "GameTools/DistanceShader", 135 ILLUMRUN_DISTANCE_CUBEMAP); 135 136 136 137 } -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreColorCubeMapRenderTechnique.cpp
r1722 r1725 16 16 String selfMaterial, 17 17 String environmentMaterial, 18 int layer, 18 19 Pass* pass, 19 20 OgreRenderable* parentRenderable, 20 21 OgreTechniqueGroup* 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),22 :OgreCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, texID, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, selfMaterial, environmentMaterial, layer, pass, parentRenderable, parentTechniqueGroup), 23 ColorCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, layer, parentRenderable, parentTechniqueGroup), 24 CubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, layer, parentRenderable, parentTechniqueGroup), 24 25 RenderTechnique(parentRenderable, parentTechniqueGroup) 25 26 { 26 texturePostFix = "_COLORCUBEMAP"; 27 switch(layer) 28 { 29 case 0: 30 texturePostFix = "_COLORCUBEMAP"; 31 break; 32 case 1: 33 texturePostFix = "_COLORCUBEMAP_L1"; 34 break; 35 case 2: 36 texturePostFix = "_COLORCUBEMAP_L2"; 37 break; 38 case 3: 39 texturePostFix = "_COLORCUBEMAP_L3"; 40 break; 41 case 4: 42 texturePostFix = "_COLORCUBEMAP_L4"; 43 break; 44 case 5: 45 texturePostFix = "_COLORCUBEMAP_L5"; 46 break; 47 case 6: 48 texturePostFix = "_COLORCUBEMAP_L6"; 49 break; 50 } 27 51 28 if(sharedRuns->getRun( ILLUMRUN_COLOR_CUBEMAP) == 0)29 sharedRuns->addRun( ILLUMRUN_COLOR_CUBEMAP, createCubeMapRun());52 if(sharedRuns->getRun(cubemapLayer) == 0) 53 sharedRuns->addRun(cubemapLayer, createCubeMapRun()); 30 54 31 colorCubeMapRunChanged(sharedRuns->getRun( ILLUMRUN_COLOR_CUBEMAP));55 colorCubeMapRunChanged(sharedRuns->getRun(cubemapLayer)); 32 56 } 33 57 … … 57 81 } 58 82 59 60 61 62 83 ///Technique factory 63 84 OgreColorCubeMapRenderTechniqueFactory::OgreColorCubeMapRenderTechniqueFactory() 64 85 { 65 typeName = "ColorCubeMap"; 86 typeName = "ColorCubeMap"; 66 87 } 67 88 … … 91 112 selfMaterial, 92 113 environmentMaterial, 114 layer, 93 115 pass, 94 116 parentRenderable, -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreConvolvedCubeMapRenderTechnique.cpp
r1722 r1725 22 22 OgreTechniqueGroup* parentTechniqueGroup) 23 23 : 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),24 OgreCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, texID, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, selfMaterial, environmentMaterial, layer, pass, parentRenderable, parentTechniqueGroup), 25 CubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, layer, parentRenderable, parentTechniqueGroup), 26 26 ConvolvedCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, reducedCubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, parentRenderable, parentTechniqueGroup), 27 27 RenderTechnique(parentRenderable, parentTechniqueGroup) -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCubeMapRenderTechnique.cpp
r1722 r1725 16 16 String selfMaterial, 17 17 String environmentMaterial, 18 int layer, 18 19 Pass* pass, 19 20 OgreRenderable* parentRenderable, … … 21 22 bool createCubeRun) 22 23 :OgreRenderTechnique( pass, parentRenderable, parentTechniqueGroup), 23 CubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, parentRenderable, parentTechniqueGroup),24 CubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, layer, parentRenderable, parentTechniqueGroup), 24 25 RenderTechnique(parentRenderable, parentTechniqueGroup) 25 26 { … … 67 68 renderEnvironment, 68 69 selfMaterial, 69 environmentMaterial); 70 environmentMaterial, 71 cubemapLayer); 70 72 } 71 73 … … 167 169 f->environmentMaterial = params; 168 170 } 171 void parseLayer(String& params, RenderTechniqueFactory* factory) 172 { 173 OgreCubeMapRenderTechniqueFactory* f = (OgreCubeMapRenderTechniqueFactory*) factory; 174 f->layer = StringConverter::parseInt(params); 175 } 176 169 177 } 170 178 ///Technique factory 171 179 OgreCubeMapRenderTechniqueFactory::OgreCubeMapRenderTechniqueFactory() 172 180 { 173 181 typeName = "CubeMap"; 182 174 183 using namespace CubemapParsers; 175 184 … … 186 195 this->attributeParsers.insert(AttribParserList::value_type("self_material", (ILLUM_ATTRIBUTE_PARSER) parseSelfMaterial)); 187 196 this->attributeParsers.insert(AttribParserList::value_type("env_material", (ILLUM_ATTRIBUTE_PARSER) parseEnvMaterial)); 197 this->attributeParsers.insert(AttribParserList::value_type("layer", (ILLUM_ATTRIBUTE_PARSER) parseLayer)); 188 198 189 199 } … … 204 214 selfMaterial = ""; 205 215 environmentMaterial = ""; 216 layer = 0; 206 217 } 207 218 … … 229 240 selfMaterial, 230 241 environmentMaterial, 242 layer, 231 243 pass, 232 244 parentRenderable, -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreDistanceCubeMapRenderTechnique.cpp
r1722 r1725 16 16 String selfMaterial, 17 17 String environmentMaterial, 18 int layer, 18 19 Pass* pass, 19 20 OgreRenderable* parentRenderable, 20 21 OgreTechniqueGroup* parentTechniqueGroup) 21 22 : 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),23 OgreCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, texID, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, selfMaterial, environmentMaterial, layer, pass, parentRenderable, parentTechniqueGroup), 24 CubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, layer, parentRenderable, parentTechniqueGroup), 25 DistanceCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment, layer, parentRenderable, parentTechniqueGroup), 25 26 RenderTechnique(parentRenderable, parentTechniqueGroup) 26 27 { 27 texturePostFix = "_DISTANCECUBEMAP"; 28 switch(layer) 29 { 30 case 0: 31 texturePostFix = "_DISTANCECUBEMAP"; 32 break; 33 case 1: 34 texturePostFix = "_DISTANCECUBEMAP_L1"; 35 break; 36 case 2: 37 texturePostFix = "_DISTANCECUBEMAP_L2"; 38 break; 39 case 3: 40 texturePostFix = "_DISTANCECUBEMAP_L3"; 41 break; 42 case 4: 43 texturePostFix = "_DISTANCECUBEMAP_L4"; 44 break; 45 case 5: 46 texturePostFix = "_DISTANCECUBEMAP_L5"; 47 break; 48 case 6: 49 texturePostFix = "_DISTANCECUBEMAP_L6"; 50 break; 51 } 52 if(sharedRuns->getRun(cubemapLayer) == 0) 53 sharedRuns->addRun(cubemapLayer, createCubeMapRun()); 28 54 29 if(sharedRuns->getRun(ILLUMRUN_DISTANCE_CUBEMAP) == 0) 30 sharedRuns->addRun(ILLUMRUN_DISTANCE_CUBEMAP, createCubeMapRun()); 31 32 distanceCubeMapRunChanged(sharedRuns->getRun(ILLUMRUN_DISTANCE_CUBEMAP)); 55 distanceCubeMapRunChanged(sharedRuns->getRun(cubemapLayer)); 33 56 } 34 57 … … 55 78 { 56 79 GpuProgramParametersSharedPtr fpParams = pass->getFragmentProgramParameters(); 57 Vector3 center = ((OgreSharedRuns*) sharedRuns)->getRootPosition( ILLUMRUN_DISTANCE_CUBEMAP);80 Vector3 center = ((OgreSharedRuns*) sharedRuns)->getRootPosition(cubemapLayer); 58 81 fpParams->setNamedConstant("lastCenter",center); 59 82 } … … 94 117 selfMaterial, 95 118 environmentMaterial, 119 layer, 96 120 pass, 97 121 parentRenderable, -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreCubeMapRenderingRun.cpp
r1722 r1725 17 17 bool renderEnvironment, 18 18 String selfMaterial, 19 String environmentMaterial) 19 String environmentMaterial, 20 RenderingRunType cubemapRunType) 20 21 :CubeMapRenderingRun(startFrame, updateInterval, resolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, renderEnvironment) 21 22 , OgreRenderingRun(startFrame, updateInterval) … … 23 24 24 25 { 26 this->cubemapRunType = cubemapRunType; 25 27 this->sharedRuns = sharedRuns; 26 28 this->name = name; … … 44 46 void OgreCubeMapRenderingRun::createCubeMap() 45 47 { 48 ColourValue clearColor = ColourValue::Black; 49 clearColor.a = 0.0; 46 50 cubemapTexture = createCubeRenderTexture(name, 47 51 sharedRuns->getRootPosition(), … … 49 53 PF_FLOAT16_RGBA, 50 54 //PF_R8G8B8A8, 51 0); 55 0, 56 clearColor); 52 57 } 53 58 54 59 void OgreCubeMapRenderingRun::updateCubeFace(int facenum) 55 60 { 56 OgreSharedRuns* root = (OgreSharedRuns*) sharedRuns->getRoot( ILLUMRUN_COLOR_CUBEMAP);61 OgreSharedRuns* root = (OgreSharedRuns*) sharedRuns->getRoot(cubemapRunType); 57 62 SceneManager* sm = Ogre::Root::getSingleton()._getCurrentSceneManager(); 58 63 RenderQueue* rq = sm->getRenderQueue(); … … 60 65 RenderTarget* rt = cubemapTexture->getBuffer(facenum, 0).getPointer()->getRenderTarget(); 61 66 Camera* cam = rt->getViewport(0)->getCamera(); 62 Vector3 center = sharedRuns->getRootPosition( ILLUMRUN_COLOR_CUBEMAP);67 Vector3 center = sharedRuns->getRootPosition(cubemapRunType); 63 68 cam->setPosition(center); 64 69 … … 94 99 if(renderSelf) 95 100 { 96 sharedRuns->getRoot(ILLUMRUN_COLOR_CUBEMAP)->restoreVisibility();101 root->restoreVisibility(); 97 102 if(useSelfMaterial) 98 103 root->setMaterial(selfMaterial); … … 105 110 rt->update(); 106 111 107 //rt->writeContentsToFile( "cubbe" +StringConverter::toString(facenum) + ".dds");112 //rt->writeContentsToFile( "cubeLayer" + StringConverter::toString(cubemapRunType)+ "face" + StringConverter::toString(facenum) + ".dds"); 108 113 109 114 if(!renderAllwithOwnColor) … … 132 137 if(useDistCalc) 133 138 { 134 Vector3 cubemapPosition = sharedRuns->getRootPosition( ILLUMRUN_COLOR_CUBEMAP);135 float objradius = sharedRuns->getRootBoundingSphere( ILLUMRUN_COLOR_CUBEMAP).getRadius();139 Vector3 cubemapPosition = sharedRuns->getRootPosition(cubemapRunType); 140 float objradius = sharedRuns->getRootBoundingSphere(cubemapRunType).getRadius(); 136 141 float fov = mainCamera->getFOVy().valueRadians() / 2.0; 137 142 float dist = (cubemapPosition - mainCamera->getPosition()).length();
Note: See TracChangeset
for help on using the changeset viewer.