Changeset 2426 for GTP/trunk/App/Demos/Illum
- Timestamp:
- 06/08/07 01:16:47 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/src/HierarchicalSystem/include/HierarchicalSystem.h
r2301 r2426 26 26 #include "SpriteParticleRenderer.h" 27 27 28 28 bool visibilitySM = false; 29 29 int scene = 1; 30 30 … … 80 80 ResourceGroupManager::getSingleton().initialiseResourceGroup("GTP_Basic"); 81 81 //ResourceGroupManager::getSingleton().initialiseResourceGroup("PostProc"); 82 ResourceGroupManager::getSingleton().initialiseResourceGroup("GTP_Basic"); 82 83 ResourceGroupManager::getSingleton().initialiseResourceGroup("GTP_Particles"); 83 84 } … … 98 99 void chooseSceneManager() 99 100 { 100 if(scene == 1) 101 if(visibilitySM) 102 mSceneMgr = mRoot->createSceneManager("OcclusionCullingSceneManager"); 103 else 101 104 { 102 mSceneMgr = mRoot->createSceneManager("OctreeSceneManager"); 103 //mSceneMgr = mRoot->createSceneManager("OcclusionCullingSceneManager"); 104 } 105 else if(scene == 2) 106 mSceneMgr = mRoot->createSceneManager("TerrainSceneManager"); 105 106 if(scene == 1) 107 mSceneMgr = mRoot->createSceneManager("OctreeSceneManager"); 108 else if(scene == 2) 109 mSceneMgr = mRoot->createSceneManager("TerrainSceneManager"); 110 } 111 107 112 } 108 109 113 void createScene(void) 110 114 { 111 //createPostproc(); 112 std::string occlusion_cfg("OcclusionCulling.cfg"); 113 //mSceneMgr->setWorldGeometry(occlusion_cfg); 114 115 115 116 OgreIlluminationManager::getSingleton().setMainCamera(mCamera); 116 117 OgreIlluminationManager::getSingleton().setMainViewport(mWindow->getViewport(0)); … … 131 132 132 133 133 //OgreIlluminationManager::getSingleton().createGlobalRun(ILLUMRUN_PHASE_TEXTURE);134 //OgreIlluminationManager::getSingleton().updateGlobalRun(ILLUMRUN_PHASE_TEXTURE, 1);135 //OgreIlluminationManager::getSingleton().savePhaseTextureToFile("phase.dds");134 //OgreIlluminationManager::getSingleton().createGlobalRun(ILLUMRUN_PHASE_TEXTURE); 135 //OgreIlluminationManager::getSingleton().updateGlobalRun(ILLUMRUN_PHASE_TEXTURE, 1); 136 //OgreIlluminationManager::getSingleton().savePhaseTextureToFile("phase.dds"); 136 137 137 138 … … 142 143 143 144 144 145 OgreIlluminationManager::getSingleton().initTechniques(); 145 146 146 147 } … … 148 149 void createScene1() 149 150 { 151 std::string occlusion_cfg("OcclusionCulling.cfg"); 152 if(visibilitySM) 153 mSceneMgr->setWorldGeometry(occlusion_cfg); 154 150 155 mCamera->setPosition(0,150,100); 151 156 mCamera->setDirection(0,0,-1); … … 164 169 165 170 ParticleSystem* pSys1 = mSceneMgr->createParticleSystem("psys1", "GTP/HPS/Smoke_Large"); 171 //ParticleSystem* pSys1 = mSceneMgr->createParticleSystem("psys1", "GTP/Smoke_Large"); 166 172 pSys1->setKeepParticlesInLocalSpace(false); 167 173 SceneNode *pSysNode = rootNode->createChildSceneNode("psys1"); … … 190 196 191 197 SceneNode* rootNode = mSceneMgr->getRootSceneNode(); 192 std::string terrain_cfg("terrain.cfg"); 193 mSceneMgr -> setWorldGeometry( terrain_cfg ); 194 195 ParticleSystem* pSys1 = mSceneMgr->createParticleSystem("psys1", "GameTools/FogBig"); 198 if(visibilitySM) 199 { 200 std::string terrain_cfg("VisTerrain.cfg"); 201 mSceneMgr -> setWorldGeometry( terrain_cfg ); 202 } 203 else 204 { 205 std::string terrain_cfg("terrain.cfg"); 206 mSceneMgr -> setWorldGeometry( terrain_cfg ); 207 } 208 209 ParticleSystem* pSys1 = mSceneMgr->createParticleSystem("psys1", "GTP/HPS/Smoke_Large"); 196 210 pSys1->setKeepParticlesInLocalSpace(false); 197 211 SceneNode *pSysNode = rootNode->createChildSceneNode("psys1"); 198 212 pSysNode->attachObject(pSys1); 199 213 pSysNode->setPosition(600,-50,600); 214 215 //Init lights 216 Light* mainLight = mSceneMgr->createLight("MainLight"); 217 mainLight->setType(Light::LT_POINT); 218 mainLight->setDiffuseColour(ColourValue::White); 219 mainLight->setSpecularColour(ColourValue::White); 220 mainLightNode = rootNode->createChildSceneNode(); 221 mainLightNode->setPosition(0,500,0); 222 mainLight->setPosition(mainLightNode->getWorldPosition()); 223 mainLightNode->attachObject(mainLight); 224 BillboardSet* bbs = mSceneMgr->createBillboardSet("bb", 1); 225 bbs->createBillboard(Vector3::ZERO, ColourValue::White); 226 bbs->setMaterialName("Flare"); 227 mainLightNode->attachObject(bbs); 200 228 201 229 }
Note: See TracChangeset
for help on using the changeset viewer.