- Timestamp:
- 11/08/06 14:04:22 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.