[1519] | 1 |
|
---|
| 2 |
|
---|
| 3 |
|
---|
| 4 | /*
|
---|
| 5 | -----------------------------------------------------------------------------
|
---|
| 6 | This source file is part of OGRE
|
---|
| 7 | (Object-oriented Graphics Rendering Engine)
|
---|
| 8 | For the latest info, see http://www.ogre3d.org/
|
---|
| 9 |
|
---|
| 10 | Copyright (c) 2000-2005 The OGRE Team
|
---|
| 11 | Also see acknowledgements in Readme.html
|
---|
| 12 |
|
---|
| 13 | You may use this sample code for anything you like, it is not covered by the
|
---|
| 14 | LGPL like the rest of the engine.
|
---|
| 15 | -----------------------------------------------------------------------------
|
---|
| 16 | */
|
---|
| 17 |
|
---|
| 18 | /**
|
---|
| 19 | \file
|
---|
| 20 | Lighting.h
|
---|
| 21 | \brief
|
---|
| 22 | Shows lighting support in OGRE. Also demonstrates the use of billboards
|
---|
| 23 | and controllers for automatic time-relative behaviour.
|
---|
| 24 | */
|
---|
| 25 |
|
---|
| 26 | #include "ExampleApplication.h"
|
---|
| 27 | #include "OgreIlluminationManager.h"
|
---|
[1868] | 28 | #include "FrameCapture.h"
|
---|
[1519] | 29 |
|
---|
[1868] | 30 | FrameCapture* capture;
|
---|
[1629] | 31 | int scene = 3;
|
---|
[1868] | 32 |
|
---|
[1519] | 33 | // Listener class for frame updates
|
---|
| 34 | class RaytraceDemoListener : public ExampleFrameListener
|
---|
| 35 | {
|
---|
| 36 | protected:
|
---|
| 37 |
|
---|
| 38 | SceneNode* objectNode;
|
---|
| 39 | unsigned long framecount;
|
---|
| 40 |
|
---|
| 41 | public:
|
---|
| 42 | RaytraceDemoListener(RenderWindow* window, Camera* maincam, SceneNode* objectNode)
|
---|
| 43 | :ExampleFrameListener(window, maincam)
|
---|
| 44 |
|
---|
| 45 | {
|
---|
[1590] | 46 | this->mMoveSpeed = 2.0;
|
---|
[1519] | 47 | framecount = 0;
|
---|
| 48 | this->objectNode = objectNode;
|
---|
| 49 | }
|
---|
[1868] | 50 |
|
---|
| 51 | void moveCamera()
|
---|
| 52 | {/*
|
---|
| 53 | mCamera->yaw(mRotX);
|
---|
| 54 | mCamera->pitch(mRotY);
|
---|
| 55 | mCamera->moveRelative(mTranslateVector);*/
|
---|
| 56 |
|
---|
| 57 | mCamera->getParentSceneNode()->yaw(mRotX, Node::TransformSpace::TS_WORLD);
|
---|
| 58 | mCamera->getParentSceneNode()->pitch(mRotY, Node::TransformSpace::TS_LOCAL);
|
---|
| 59 | mCamera->getParentSceneNode()->translate(mTranslateVector, Node::TransformSpace::TS_LOCAL);
|
---|
| 60 |
|
---|
| 61 | }
|
---|
| 62 |
|
---|
[1519] | 63 | bool processUnbufferedKeyInput(const FrameEvent& evt)
|
---|
| 64 | {
|
---|
[1834] | 65 | static float lastTime = 0.0;
|
---|
| 66 | float thisTime = (float) Root::getSingleton().getTimer()->getMilliseconds() / 1000.0f;
|
---|
| 67 | float elapsed = thisTime - lastTime;
|
---|
| 68 | float move = elapsed * 0.25;
|
---|
| 69 | float rotate = 80.0 * move;
|
---|
| 70 |
|
---|
[1519] | 71 | if (mInputDevice->isKeyDown(KC_UP))
|
---|
| 72 | {
|
---|
[1834] | 73 | objectNode->translate(0,0,move);
|
---|
[1519] | 74 | }
|
---|
[1590] | 75 | if (mInputDevice->isKeyDown(KC_MULTIPLY))
|
---|
| 76 | {
|
---|
[1629] | 77 | //objectNode->scale(1.1,1.1,1.1);
|
---|
[1834] | 78 | objectNode->rotate(Vector3(0,0,1), Degree(rotate));
|
---|
[1590] | 79 | mTimeUntilNextToggle = 1;
|
---|
| 80 | }
|
---|
| 81 | if (mInputDevice->isKeyDown(KC_DIVIDE))
|
---|
| 82 | {
|
---|
[1629] | 83 | //objectNode->scale(1.0/1.1,1.0/1.1,1.0/1.1);
|
---|
[1834] | 84 | objectNode->rotate(Vector3(1,0,0), Degree(rotate));
|
---|
[1590] | 85 | mTimeUntilNextToggle = 1;
|
---|
| 86 | }
|
---|
[1519] | 87 | if (mInputDevice->isKeyDown(KC_ADD))
|
---|
| 88 | {
|
---|
[1834] | 89 | objectNode->rotate(Vector3(0,1,0), Degree(rotate));
|
---|
[1519] | 90 | }
|
---|
[1629] | 91 | if (mInputDevice->isKeyDown(KC_HOME))
|
---|
| 92 | {
|
---|
[1834] | 93 | objectNode->translate(0,move,0);
|
---|
[1629] | 94 | }
|
---|
| 95 | if (mInputDevice->isKeyDown(KC_END))
|
---|
| 96 | {
|
---|
[1834] | 97 | objectNode->translate(0,-move,0);
|
---|
[1629] | 98 | }
|
---|
[1519] | 99 | if (mInputDevice->isKeyDown(KC_DOWN))
|
---|
| 100 | {
|
---|
[1834] | 101 | objectNode->translate(0,0,-move);
|
---|
[1519] | 102 | }
|
---|
| 103 | if (mInputDevice->isKeyDown(KC_RIGHT))
|
---|
| 104 | {
|
---|
[1834] | 105 | objectNode->translate(move,0,0);
|
---|
[1519] | 106 | }
|
---|
| 107 | if (mInputDevice->isKeyDown(KC_LEFT))
|
---|
| 108 | {
|
---|
[1834] | 109 | objectNode->translate(-move,0,0);
|
---|
[1519] | 110 | }
|
---|
| 111 |
|
---|
| 112 | if (mInputDevice->isKeyDown(KC_A))
|
---|
| 113 | {
|
---|
| 114 | // Move camera left
|
---|
| 115 | mTranslateVector.x = -mMoveScale;
|
---|
| 116 | }
|
---|
| 117 |
|
---|
| 118 | if (mInputDevice->isKeyDown(KC_D))
|
---|
| 119 | {
|
---|
| 120 | // Move camera RIGHT
|
---|
| 121 | mTranslateVector.x = mMoveScale;
|
---|
| 122 | }
|
---|
| 123 |
|
---|
| 124 | /* Move camera forward by keypress. */
|
---|
| 125 | if ( mInputDevice->isKeyDown(KC_W) )
|
---|
| 126 | {
|
---|
| 127 | mTranslateVector.z = -mMoveScale;
|
---|
| 128 | }
|
---|
| 129 |
|
---|
| 130 | /* Move camera backward by keypress. */
|
---|
| 131 | if (mInputDevice->isKeyDown(KC_S) )
|
---|
| 132 | {
|
---|
| 133 | mTranslateVector.z = mMoveScale;
|
---|
| 134 | }
|
---|
| 135 |
|
---|
| 136 | if (mInputDevice->isKeyDown(KC_PGUP))
|
---|
| 137 | {
|
---|
| 138 | // Move camera up
|
---|
| 139 | mTranslateVector.y = mMoveScale;
|
---|
| 140 | }
|
---|
| 141 |
|
---|
| 142 | if (mInputDevice->isKeyDown(KC_PGDOWN))
|
---|
| 143 | {
|
---|
| 144 | // Move camera down
|
---|
| 145 | mTranslateVector.y = -mMoveScale;
|
---|
| 146 | }
|
---|
| 147 |
|
---|
| 148 | if( mInputDevice->isKeyDown( KC_ESCAPE) )
|
---|
| 149 | {
|
---|
| 150 | return false;
|
---|
| 151 | }
|
---|
| 152 |
|
---|
| 153 | // see if switching is on, and you want to toggle
|
---|
| 154 | if (mInputTypeSwitchingOn && mInputDevice->isKeyDown(KC_M) && mTimeUntilNextToggle <= 0)
|
---|
| 155 | {
|
---|
| 156 | switchMouseMode();
|
---|
| 157 | mTimeUntilNextToggle = 1;
|
---|
| 158 | }
|
---|
| 159 |
|
---|
| 160 | if (mInputTypeSwitchingOn && mInputDevice->isKeyDown(KC_K) && mTimeUntilNextToggle <= 0)
|
---|
| 161 | {
|
---|
| 162 | // must be going from immediate keyboard to buffered keyboard
|
---|
| 163 | switchKeyMode();
|
---|
| 164 | mTimeUntilNextToggle = 1;
|
---|
| 165 | }
|
---|
| 166 | if (mInputDevice->isKeyDown(KC_F) && mTimeUntilNextToggle <= 0)
|
---|
| 167 | {
|
---|
| 168 | mStatsOn = !mStatsOn;
|
---|
| 169 | showDebugOverlay(mStatsOn);
|
---|
| 170 |
|
---|
| 171 | mTimeUntilNextToggle = 1;
|
---|
| 172 | }
|
---|
| 173 | if (mInputDevice->isKeyDown(KC_T) && mTimeUntilNextToggle <= 0)
|
---|
| 174 | {
|
---|
| 175 | switch(mFiltering)
|
---|
| 176 | {
|
---|
| 177 | case TFO_BILINEAR:
|
---|
| 178 | mFiltering = TFO_TRILINEAR;
|
---|
| 179 | mAniso = 1;
|
---|
| 180 | break;
|
---|
| 181 | case TFO_TRILINEAR:
|
---|
| 182 | mFiltering = TFO_ANISOTROPIC;
|
---|
| 183 | mAniso = 8;
|
---|
| 184 | break;
|
---|
| 185 | case TFO_ANISOTROPIC:
|
---|
| 186 | mFiltering = TFO_BILINEAR;
|
---|
| 187 | mAniso = 1;
|
---|
| 188 | break;
|
---|
| 189 | default:
|
---|
| 190 | break;
|
---|
| 191 | }
|
---|
| 192 | MaterialManager::getSingleton().setDefaultTextureFiltering(mFiltering);
|
---|
| 193 | MaterialManager::getSingleton().setDefaultAnisotropy(mAniso);
|
---|
| 194 |
|
---|
| 195 |
|
---|
| 196 | showDebugOverlay(mStatsOn);
|
---|
| 197 |
|
---|
| 198 | mTimeUntilNextToggle = 1;
|
---|
| 199 | }
|
---|
| 200 |
|
---|
| 201 | if (mInputDevice->isKeyDown(KC_SYSRQ) && mTimeUntilNextToggle <= 0)
|
---|
| 202 | {
|
---|
| 203 | char tmp[20];
|
---|
| 204 | sprintf(tmp, "screenshot_%d.png", ++mNumScreenShots);
|
---|
| 205 | mWindow->writeContentsToFile(tmp);
|
---|
| 206 | mTimeUntilNextToggle = 0.5;
|
---|
| 207 | mWindow->setDebugText(String("Wrote ") + tmp);
|
---|
| 208 | }
|
---|
| 209 |
|
---|
| 210 | if (mInputDevice->isKeyDown(KC_R) && mTimeUntilNextToggle <=0)
|
---|
| 211 | {
|
---|
| 212 | mSceneDetailIndex = (mSceneDetailIndex+1)%3 ;
|
---|
| 213 | switch(mSceneDetailIndex) {
|
---|
| 214 | case 0 : mCamera->setPolygonMode(PM_SOLID) ; break ;
|
---|
| 215 | case 1 : mCamera->setPolygonMode(PM_WIREFRAME) ; break ;
|
---|
| 216 | case 2 : mCamera->setPolygonMode(PM_POINTS) ; break ;
|
---|
| 217 | }
|
---|
| 218 | mTimeUntilNextToggle = 0.5;
|
---|
| 219 | }
|
---|
| 220 |
|
---|
| 221 | static bool displayCameraDetails = false;
|
---|
| 222 | if (mInputDevice->isKeyDown(KC_P) && mTimeUntilNextToggle <= 0)
|
---|
| 223 | {
|
---|
| 224 | displayCameraDetails = !displayCameraDetails;
|
---|
| 225 | mTimeUntilNextToggle = 0.5;
|
---|
| 226 | if (!displayCameraDetails)
|
---|
| 227 | mWindow->setDebugText("");
|
---|
| 228 | }
|
---|
| 229 | if (displayCameraDetails)
|
---|
| 230 | {
|
---|
| 231 | // Print camera details
|
---|
| 232 | mWindow->setDebugText("P: " + StringConverter::toString(mCamera->getDerivedPosition()) + " " +
|
---|
| 233 | "O: " + StringConverter::toString(mCamera->getDerivedOrientation()));
|
---|
| 234 | }
|
---|
[1868] | 235 | if (mInputDevice->isKeyDown(KC_N) && mTimeUntilNextToggle <= 0)
|
---|
| 236 | {
|
---|
| 237 | capture->playEvent();
|
---|
| 238 | mTimeUntilNextToggle = 1;
|
---|
| 239 | }
|
---|
| 240 | if (mInputDevice->isKeyDown(KC_B) && mTimeUntilNextToggle <= 0)
|
---|
| 241 | {
|
---|
| 242 | capture->recordEvent();
|
---|
| 243 | mTimeUntilNextToggle = 1;
|
---|
| 244 | }
|
---|
| 245 | if (mInputDevice->isKeyDown(KC_M) && mTimeUntilNextToggle <= 0)
|
---|
| 246 | {
|
---|
| 247 | capture->setSaving();
|
---|
| 248 | capture->playEvent();
|
---|
| 249 | mTimeUntilNextToggle = 1;
|
---|
| 250 | }
|
---|
[1519] | 251 |
|
---|
[1834] | 252 | lastTime = thisTime;
|
---|
[1519] | 253 | // Return true to continue rendering
|
---|
| 254 | return true;
|
---|
| 255 | }
|
---|
| 256 | bool frameStarted(const FrameEvent& evt)
|
---|
| 257 | {
|
---|
| 258 | static bool first = true;
|
---|
| 259 |
|
---|
| 260 |
|
---|
| 261 | // lightNode->setPosition( 100.0 * Vector3(cos(-(float)framecount/500.0),2.0,sin(-(float)framecount/500.0)));
|
---|
| 262 |
|
---|
| 263 |
|
---|
| 264 | bool result = ExampleFrameListener::frameStarted(evt);
|
---|
| 265 | framecount++;
|
---|
| 266 | return result;
|
---|
| 267 | }
|
---|
| 268 |
|
---|
| 269 |
|
---|
| 270 |
|
---|
| 271 | };
|
---|
| 272 |
|
---|
[1598] | 273 |
|
---|
| 274 | class FloorRenderTargetListener : public RenderTargetListener
|
---|
| 275 | {
|
---|
| 276 | public:
|
---|
| 277 | Entity* scene;
|
---|
| 278 | FloorRenderTargetListener(Entity* scene)
|
---|
| 279 | {
|
---|
| 280 | this->scene = scene;
|
---|
| 281 | }
|
---|
| 282 | void preRenderTargetUpdate(const RenderTargetEvent& evt)
|
---|
| 283 | {
|
---|
| 284 | scene->getSubEntity(0)->setVisible(false);
|
---|
| 285 | scene->getSubEntity(17)->setVisible(false);
|
---|
| 286 | scene->getSubEntity(35)->setVisible(false);
|
---|
| 287 | scene->getSubEntity(52)->setVisible(false);
|
---|
| 288 | }
|
---|
| 289 | void postRenderTargetUpdate(const RenderTargetEvent& evt)
|
---|
| 290 | {
|
---|
| 291 | scene->getSubEntity(0)->setVisible(true);
|
---|
| 292 | scene->getSubEntity(17)->setVisible(true);
|
---|
| 293 | scene->getSubEntity(35)->setVisible(true);
|
---|
| 294 | scene->getSubEntity(52)->setVisible(true);
|
---|
| 295 | }
|
---|
| 296 |
|
---|
| 297 | };
|
---|
| 298 |
|
---|
| 299 | class CeilRenderTargetListener : public RenderTargetListener
|
---|
| 300 | {
|
---|
| 301 | public:
|
---|
| 302 | Entity* scene;
|
---|
| 303 | CeilRenderTargetListener(Entity* scene)
|
---|
| 304 | {
|
---|
| 305 | this->scene = scene;
|
---|
| 306 | }
|
---|
| 307 | void preRenderTargetUpdate(const RenderTargetEvent& evt)
|
---|
| 308 | {
|
---|
| 309 | scene->getSubEntity(1)->setVisible(false);
|
---|
| 310 | scene->getSubEntity(18)->setVisible(false);
|
---|
| 311 | scene->getSubEntity(36)->setVisible(false);
|
---|
| 312 | scene->getSubEntity(53)->setVisible(false);
|
---|
| 313 | }
|
---|
| 314 | void postRenderTargetUpdate(const RenderTargetEvent& evt)
|
---|
| 315 | {
|
---|
| 316 | scene->getSubEntity(1)->setVisible(true);
|
---|
| 317 | scene->getSubEntity(18)->setVisible(true);
|
---|
| 318 | scene->getSubEntity(36)->setVisible(true);
|
---|
| 319 | scene->getSubEntity(53)->setVisible(true);
|
---|
| 320 | }
|
---|
| 321 |
|
---|
| 322 | };
|
---|
| 323 |
|
---|
| 324 | class ReflectionCameraFrameListener : public FrameListener
|
---|
| 325 | {
|
---|
| 326 | public:
|
---|
| 327 | Camera* floorReflCam;
|
---|
| 328 | Camera* ceilReflCam;
|
---|
| 329 | Camera* mainCamera;
|
---|
| 330 | ReflectionCameraFrameListener(Camera* floorcam, Camera* ceilCam, Camera* mainCam)
|
---|
| 331 | {
|
---|
| 332 | floorReflCam = floorcam;
|
---|
| 333 | ceilReflCam = ceilCam;
|
---|
| 334 | mainCamera = mainCam;
|
---|
| 335 | }
|
---|
| 336 | bool frameStarted(const FrameEvent& evt)
|
---|
| 337 | {
|
---|
| 338 | floorReflCam->setOrientation(mainCamera->getOrientation());
|
---|
| 339 | floorReflCam->setPosition(mainCamera->getPosition());
|
---|
| 340 |
|
---|
| 341 | // ceilReflCam->setOrientation(mainCamera->getOrientation());
|
---|
| 342 | // ceilReflCam->setPosition(mainCamera->getPosition());
|
---|
| 343 |
|
---|
| 344 | return true;
|
---|
| 345 | }
|
---|
| 346 | };
|
---|
[1519] | 347 | /** Application class */
|
---|
| 348 | class RaytraceDemoApplication : public ExampleApplication
|
---|
| 349 | {
|
---|
| 350 |
|
---|
| 351 | public:
|
---|
| 352 |
|
---|
| 353 | protected:
|
---|
| 354 | SceneNode* objectNode;
|
---|
| 355 |
|
---|
[2025] | 356 | void loadResources(void)
|
---|
| 357 | {
|
---|
| 358 | // Initialise, parse scripts etc
|
---|
| 359 | ResourceGroupManager::getSingleton().initialiseResourceGroup("Bootstrap");
|
---|
| 360 | ResourceGroupManager::getSingleton().initialiseResourceGroup("General");
|
---|
| 361 | ResourceGroupManager::getSingleton().initialiseResourceGroup("PostProc");
|
---|
[2057] | 362 | ResourceGroupManager::getSingleton().initialiseResourceGroup("GTP_Basic");
|
---|
[2334] | 363 | ResourceGroupManager::getSingleton().initialiseResourceGroup("GTP_Diffuse_Simple");
|
---|
[2025] | 364 | }
|
---|
| 365 |
|
---|
[1519] | 366 | void createPostproc()
|
---|
[2025] | 367 | {
|
---|
| 368 | CompositorManager::getSingleton().addCompositor(mWindow->getViewport(0),
|
---|
| 369 | "GTP/PostProc/Glow");
|
---|
[1519] | 370 | CompositorManager::getSingleton().setCompositorEnabled(mWindow->getViewport(0),
|
---|
[2025] | 371 | "GTP/PostProc/Glow", true);
|
---|
[1519] | 372 |
|
---|
[1691] | 373 | CompositorManager::getSingleton().addCompositor(mWindow->getViewport(0),
|
---|
[2025] | 374 | "GTP/PostProc/ToneMap");
|
---|
[1691] | 375 | CompositorManager::getSingleton().setCompositorEnabled(mWindow->getViewport(0),
|
---|
[2025] | 376 | "GTP/PostProc/ToneMap", true);
|
---|
[1519] | 377 | }
|
---|
[2175] | 378 |
|
---|
| 379 | void chooseSceneManager()
|
---|
| 380 | {
|
---|
[2334] | 381 | mSceneMgr = mRoot->createSceneManager("OctreeSceneManager");
|
---|
| 382 | //mSceneMgr = mRoot->createSceneManager("OcclusionCullingSceneManager");
|
---|
[2175] | 383 | }
|
---|
[1519] | 384 |
|
---|
[1879] | 385 | void createCamera(void)
|
---|
| 386 | {
|
---|
| 387 | // Create the camera
|
---|
| 388 | mCamera = mSceneMgr->createCamera("PlayerCam");
|
---|
| 389 |
|
---|
| 390 | SceneNode* camNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("mainCameraNode");
|
---|
| 391 | camNode->attachObject(mCamera);
|
---|
| 392 | //camNode->setPosition(Vector3(0,1,0));
|
---|
| 393 | // Position it at 500 in Z direction
|
---|
| 394 | //mCamera->setPosition(Vector3(0,0,500));
|
---|
| 395 | // Look back along -Z
|
---|
| 396 | //mCamera->lookAt(Vector3(0,0,-300));
|
---|
| 397 | mCamera->setNearClipDistance(5);
|
---|
[1519] | 398 |
|
---|
[1879] | 399 | }
|
---|
| 400 |
|
---|
[1519] | 401 | void createScene(void)
|
---|
| 402 | {
|
---|
[2334] | 403 | //std::string occlusion_cfg("OcclusionCulling.cfg");
|
---|
| 404 | //mSceneMgr->setWorldGeometry(occlusion_cfg);
|
---|
| 405 | createPostproc();
|
---|
[1519] | 406 |
|
---|
| 407 | OgreIlluminationManager::getSingleton().setMainCamera(mCamera);
|
---|
| 408 | OgreIlluminationManager::getSingleton().setMainViewport(mWindow->getViewport(0));
|
---|
| 409 |
|
---|
| 410 | OgreIlluminationManager::getSingleton().setMaxJoinRadius(420);
|
---|
| 411 |
|
---|
| 412 | Root::getSingleton()._setCurrentSceneManager(mSceneMgr);
|
---|
| 413 |
|
---|
[1879] | 414 | //mCamera->setPosition(0,1,0);
|
---|
[1519] | 415 | mCamera->setFOVy(Radian(Degree(80)));
|
---|
[1598] | 416 | mCamera->setFarClipDistance(200);
|
---|
[1590] | 417 | mCamera->setNearClipDistance(0.1);
|
---|
[1598] | 418 |
|
---|
[1868] | 419 | capture = new FrameCapture(mWindow);
|
---|
[1629] | 420 | switch (scene)
|
---|
| 421 | {
|
---|
| 422 | case 1:
|
---|
| 423 | createScene1();break;
|
---|
| 424 | case 2:
|
---|
| 425 | createScene2();break;
|
---|
| 426 | case 3:
|
---|
| 427 | createScene3();break;
|
---|
| 428 | }
|
---|
[1598] | 429 | OgreIlluminationManager::getSingleton().initTechniques();
|
---|
| 430 |
|
---|
| 431 |
|
---|
| 432 | }
|
---|
| 433 |
|
---|
| 434 | void createScene1()
|
---|
| 435 | {
|
---|
| 436 |
|
---|
[1590] | 437 | mSceneMgr->setAmbientLight(ColourValue(0.1, 0.0537, 0.0));
|
---|
| 438 | //mSceneMgr->setAmbientLight(ColourValue(0.0, 0.0, 0.0));
|
---|
| 439 |
|
---|
[1519] | 440 |
|
---|
| 441 | // Skybox
|
---|
| 442 | //mSceneMgr->setSkyBox(true, "Examples/MorningSkyBox");
|
---|
| 443 |
|
---|
| 444 | SceneNode* rootNode = mSceneMgr->getRootSceneNode();
|
---|
| 445 |
|
---|
[1611] | 446 | Entity* object = mSceneMgr->createEntity("object", "chinaman.mesh");
|
---|
[1525] | 447 | object->setMaterialName("GameTools/Diffuse/use");
|
---|
| 448 | //object->setMaterialName("GameTools/Diffuse2");
|
---|
[1519] | 449 | objectNode = rootNode->createChildSceneNode();
|
---|
| 450 | objectNode->attachObject(object);
|
---|
[1611] | 451 | // objectNode->scale(0.05,0.05,0.05);
|
---|
| 452 | objectNode->scale(3,3,3);
|
---|
| 453 | // objectNode->setPosition(0,4,0);
|
---|
[1519] | 454 | objectNode->_updateBounds();
|
---|
| 455 |
|
---|
[1590] | 456 | Entity* room = mSceneMgr->createEntity("atlascube", "diffscene.mesh");
|
---|
| 457 | //room->setMaterialName("GameTools/Phong");
|
---|
[1519] | 458 | SceneNode* roomNode = rootNode->createChildSceneNode();
|
---|
[1590] | 459 | //roomNode->setScale(10,10,10);
|
---|
[1519] | 460 | roomNode->attachObject(room);
|
---|
| 461 | roomNode->_updateBounds();
|
---|
[1590] | 462 |
|
---|
| 463 | Light* bluelight = mSceneMgr->createLight("BlueLight");
|
---|
| 464 | bluelight->setType(Light::LT_POINT);
|
---|
| 465 | bluelight->setDiffuseColour(ColourValue(0.152,0.824, 1.0));
|
---|
| 466 | //bluelight->setSpecularColour(ColourValue(0.152,0.824, 1.0));
|
---|
| 467 | bluelight->setPowerScale(5.726);
|
---|
| 468 | bluelight->setAttenuation(12, 0, 1, 0);
|
---|
| 469 | SceneNode* bluelightNode = rootNode->createChildSceneNode();
|
---|
| 470 | bluelightNode->setPosition(-5.948,9.619,0.980);
|
---|
| 471 | bluelightNode->attachObject(bluelight);
|
---|
[1519] | 472 |
|
---|
[1590] | 473 | Light* walllight1 = mSceneMgr->createLight("WallLight1");
|
---|
| 474 | walllight1->setType(Light::LT_POINT);
|
---|
| 475 | walllight1->setDiffuseColour(ColourValue(0.988,1.0, 0.808));
|
---|
| 476 | //walllight1->setSpecularColour(ColourValue(0.988,1.0, 0.808));
|
---|
| 477 | walllight1->setPowerScale(2.5);
|
---|
| 478 | walllight1->setAttenuation(12, 0, 1, 0);
|
---|
| 479 | SceneNode* walllight1Node = rootNode->createChildSceneNode();
|
---|
| 480 | walllight1Node->setPosition(-4.822,9.353,-5.194);
|
---|
| 481 | walllight1Node->attachObject(walllight1);
|
---|
[1519] | 482 |
|
---|
[1590] | 483 | Light* walllight2 = mSceneMgr->createLight("WallLight2");
|
---|
| 484 | walllight2->setType(Light::LT_POINT);
|
---|
| 485 | walllight2->setDiffuseColour(ColourValue(0.988,1.0, 0.808));
|
---|
| 486 | //walllight2->setSpecularColour(ColourValue(0.988,1.0, 0.808));
|
---|
| 487 | walllight2->setPowerScale(2.5);
|
---|
| 488 | walllight2->setAttenuation(12, 0, 1, 0);
|
---|
| 489 | SceneNode* walllight2Node = rootNode->createChildSceneNode();
|
---|
| 490 | walllight2Node->setPosition(-4.822,9.353,5.150);
|
---|
| 491 | walllight2Node->attachObject(walllight2);
|
---|
| 492 |
|
---|
| 493 | Light* walllight3 = mSceneMgr->createLight("WallLight3");
|
---|
| 494 | walllight3->setType(Light::LT_POINT);
|
---|
| 495 | walllight3->setDiffuseColour(ColourValue(0.988,1.0, 0.808));
|
---|
| 496 | //walllight3->setSpecularColour(ColourValue(0.988,1.0, 0.808));
|
---|
| 497 | walllight3->setPowerScale(2.5);
|
---|
| 498 | walllight3->setAttenuation(12, 0, 1, 0);
|
---|
| 499 | SceneNode* walllight3Node = rootNode->createChildSceneNode();
|
---|
| 500 | walllight3Node->setPosition(-11.08,10.07,-24.658);
|
---|
| 501 | walllight3Node->attachObject(walllight3);
|
---|
| 502 |
|
---|
| 503 | Light* walllight4 = mSceneMgr->createLight("WallLight4");
|
---|
| 504 | walllight4->setType(Light::LT_POINT);
|
---|
| 505 | walllight4->setDiffuseColour(ColourValue(0.988,1.0, 0.808));
|
---|
| 506 | //walllight4->setSpecularColour(ColourValue(0.988,1.0, 0.808));
|
---|
| 507 | walllight4->setPowerScale(2.5);
|
---|
| 508 | walllight4->setAttenuation(12, 0, 1, 0);
|
---|
| 509 | SceneNode* walllight4Node = rootNode->createChildSceneNode();
|
---|
| 510 | walllight4Node->setPosition(-11.08,10.07,-11.474);
|
---|
| 511 | walllight4Node->attachObject(walllight4);
|
---|
| 512 |
|
---|
| 513 | Light* redlight1 = mSceneMgr->createLight("RedLight1");
|
---|
| 514 | redlight1->setType(Light::LT_POINT);
|
---|
| 515 | redlight1->setDiffuseColour(ColourValue(1.0,0.367, 0.016));
|
---|
| 516 | //redlight1->setSpecularColour(ColourValue(1.0,0.367, 0.016));
|
---|
| 517 | redlight1->setPowerScale(3.59);
|
---|
| 518 | redlight1->setAttenuation(2, 0, 1, 0);
|
---|
| 519 | SceneNode* redlight1Node = rootNode->createChildSceneNode();
|
---|
| 520 | redlight1Node->setPosition(24.958,7.743,-10.838);
|
---|
| 521 | redlight1Node->attachObject(redlight1);
|
---|
| 522 |
|
---|
| 523 | Light* redlight2 = mSceneMgr->createLight("RedLight2");
|
---|
| 524 | redlight2->setType(Light::LT_POINT);
|
---|
| 525 | redlight2->setDiffuseColour(ColourValue(1.0,0.367, 0.016));
|
---|
| 526 | //redlight2->setSpecularColour(ColourValue(1.0,0.367, 0.016));
|
---|
| 527 | redlight2->setPowerScale(3.59);
|
---|
| 528 | redlight2->setAttenuation(2, 0, 1, 0);
|
---|
| 529 | SceneNode* redlight2Node = rootNode->createChildSceneNode();
|
---|
| 530 | redlight2Node->setPosition(18.689,7.743,-10.838);
|
---|
| 531 | redlight2Node->attachObject(redlight2);
|
---|
[1598] | 532 | }
|
---|
| 533 |
|
---|
| 534 | Camera* mReflectCamFloor;
|
---|
| 535 | Camera* mReflectCamCeil;
|
---|
| 536 | ReflectionCameraFrameListener* reflListener;
|
---|
| 537 | void createScene2()
|
---|
| 538 | {
|
---|
| 539 | mCamera->setPosition(0,5,10);
|
---|
| 540 | MovablePlane *floorPlane = new MovablePlane("ReflectPlaneFloor");
|
---|
| 541 | floorPlane->d = 0;
|
---|
| 542 | floorPlane->normal = Vector3::UNIT_Y;
|
---|
| 543 |
|
---|
| 544 | RenderTexture* rttTexFloor = mRoot->getRenderSystem()->createRenderTexture( "FloorReflection", 512, 512, TEX_TYPE_2D, PF_R8G8B8 );
|
---|
| 545 | {
|
---|
| 546 | mReflectCamFloor = mSceneMgr->createCamera("ReflectCamFloor");
|
---|
| 547 | mReflectCamFloor->setNearClipDistance(mCamera->getNearClipDistance());
|
---|
| 548 | mReflectCamFloor->setFarClipDistance(mCamera->getFarClipDistance());
|
---|
| 549 | /* mReflectCamFloor->setAspectRatio(
|
---|
| 550 | (Real)mWindow->getViewport(0)->getActualWidth() /
|
---|
| 551 | (Real)mWindow->getViewport(0)->getActualHeight());*/
|
---|
| 552 | mReflectCamFloor->setFOVy(mCamera->getFOVy());
|
---|
| 553 | mReflectCamFloor->setAspectRatio(mCamera->getAspectRatio());
|
---|
| 554 |
|
---|
| 555 | Viewport *v = rttTexFloor->addViewport( mReflectCamFloor );
|
---|
| 556 | v->setClearEveryFrame( true );
|
---|
| 557 | v->setBackgroundColour( ColourValue::Black );
|
---|
| 558 |
|
---|
| 559 |
|
---|
| 560 | // set up linked reflection
|
---|
| 561 | mReflectCamFloor->enableReflection(floorPlane);
|
---|
| 562 | // Also clip
|
---|
| 563 | mReflectCamFloor->enableCustomNearClipPlane(floorPlane);
|
---|
| 564 | }
|
---|
| 565 | /* MovablePlane *ceilPlane = new MovablePlane("ReflectPlaneCeil");
|
---|
| 566 | ceilPlane->d = -8;
|
---|
| 567 | ceilPlane->normal = Vector3::NEGATIVE_UNIT_Y;
|
---|
| 568 | RenderTexture* rttTexCeil = mRoot->getRenderSystem()->createRenderTexture( "CeilReflection", 512, 512, TEX_TYPE_2D, PF_R8G8B8 );
|
---|
| 569 | {
|
---|
| 570 | mReflectCamCeil = mSceneMgr->createCamera("ReflectCamCeil");
|
---|
| 571 | mReflectCamCeil->setNearClipDistance(mCamera->getNearClipDistance());
|
---|
| 572 | mReflectCamCeil->setFarClipDistance(mCamera->getFarClipDistance());
|
---|
| 573 | mReflectCamCeil->setAspectRatio(
|
---|
| 574 | (Real)mWindow->getViewport(0)->getActualWidth() /
|
---|
| 575 | (Real)mWindow->getViewport(0)->getActualHeight());
|
---|
| 576 |
|
---|
| 577 | Viewport *v = rttTexCeil->addViewport( mReflectCamCeil );
|
---|
| 578 | v->setClearEveryFrame( true );
|
---|
| 579 | v->setBackgroundColour( ColourValue::Black );
|
---|
| 580 |
|
---|
| 581 |
|
---|
| 582 | // set up linked reflection
|
---|
| 583 | mReflectCamCeil->enableReflection(floorPlane);
|
---|
| 584 | // Also clip
|
---|
| 585 | mReflectCamCeil->enableCustomNearClipPlane(floorPlane);
|
---|
| 586 | }
|
---|
| 587 | */
|
---|
| 588 | reflListener = new ReflectionCameraFrameListener(mReflectCamFloor, mReflectCamCeil, mCamera);
|
---|
| 589 | reflListener->setPriority(2);
|
---|
| 590 |
|
---|
| 591 | // mSceneMgr->setAmbientLight(ColourValue(0.1, 0.0537, 0.0));
|
---|
[1629] | 592 | mSceneMgr->setAmbientLight(ColourValue(0.2, 0.25, 0.3));
|
---|
[1590] | 593 |
|
---|
[1598] | 594 | SceneNode* rootNode = mSceneMgr->getRootSceneNode();
|
---|
| 595 |
|
---|
[1671] | 596 | Entity* object = mSceneMgr->createEntity("object", "buddha.mesh");
|
---|
[1598] | 597 | object->setMaterialName("GameTools/Diffuse/use");
|
---|
| 598 | //object->setMaterialName("GameTools/Diffuse2");
|
---|
| 599 | objectNode = rootNode->createChildSceneNode();
|
---|
| 600 | objectNode->attachObject(object);
|
---|
[1671] | 601 | objectNode->scale(1.8,1.8,1.8);
|
---|
[1629] | 602 | objectNode->rotate(Vector3(0,1,0),Radian(Math::PI));
|
---|
[1671] | 603 | objectNode->setPosition(0,0,0);
|
---|
[1598] | 604 | objectNode->_updateBounds();
|
---|
| 605 |
|
---|
| 606 | Entity* room = mSceneMgr->createEntity("scene", "uvegfolyoso2.mesh");
|
---|
| 607 | //room->setMaterialName("GameTools/Phong");
|
---|
| 608 | SceneNode* roomNode = rootNode->createChildSceneNode();
|
---|
| 609 | roomNode->attachObject(room);
|
---|
| 610 | roomNode->_updateBounds();
|
---|
| 611 | rttTexFloor->addListener(new FloorRenderTargetListener(room));
|
---|
| 612 | //rttTexCeil->addListener(new CeilRenderTargetListener(room));
|
---|
| 613 |
|
---|
| 614 | Light* light1 = mSceneMgr->createLight("Light1");
|
---|
| 615 | light1->setType(Light::LT_POINT);
|
---|
| 616 | light1->setDiffuseColour(ColourValue(0.526,0.535, 0.974));
|
---|
| 617 | light1->setPowerScale(3);
|
---|
| 618 | SceneNode* lightNode1 = rootNode->createChildSceneNode();
|
---|
| 619 | lightNode1->setPosition(-1.266,4.131,-4.438);
|
---|
| 620 | lightNode1->attachObject(light1);
|
---|
| 621 |
|
---|
| 622 | Light* light2 = mSceneMgr->createLight("Light2");
|
---|
| 623 | light2->setType(Light::LT_POINT);
|
---|
| 624 | light2->setDiffuseColour(ColourValue(0.391,0.781, 0.974));
|
---|
| 625 | light2->setPowerScale(3);
|
---|
| 626 | SceneNode* lightNode2 = rootNode->createChildSceneNode();
|
---|
| 627 | lightNode2->setPosition(-33.537,4.131,-4.438);
|
---|
| 628 | lightNode2->attachObject(light2);
|
---|
| 629 |
|
---|
| 630 | Light* light3 = mSceneMgr->createLight("Light3");
|
---|
| 631 | light3->setType(Light::LT_POINT);
|
---|
| 632 | light3->setDiffuseColour(ColourValue(0.391,0.781, 0.974));
|
---|
| 633 | light3->setPowerScale(3);
|
---|
| 634 | SceneNode* lightNode3 = rootNode->createChildSceneNode();
|
---|
| 635 | lightNode3->setPosition(-97.446,4.131,-4.438);
|
---|
| 636 | lightNode3->attachObject(light3);
|
---|
| 637 |
|
---|
| 638 | Light* light4 = mSceneMgr->createLight("Light4");
|
---|
| 639 | light4->setType(Light::LT_POINT);
|
---|
| 640 | light4->setDiffuseColour(ColourValue(0.304,0.974, 0.770));
|
---|
| 641 | light4->setPowerScale(3);
|
---|
| 642 | SceneNode* lightNode4 = rootNode->createChildSceneNode();
|
---|
| 643 | lightNode4->setPosition(-63.277,4.131,-4.438);
|
---|
| 644 | lightNode4->attachObject(light4);
|
---|
| 645 |
|
---|
[1519] | 646 |
|
---|
[1598] | 647 |
|
---|
| 648 |
|
---|
| 649 |
|
---|
[1519] | 650 | }
|
---|
[1598] | 651 |
|
---|
[1629] | 652 | void createScene3()
|
---|
| 653 | {
|
---|
[1638] | 654 | OgreIlluminationManager::getSingleton().setFocusingSM(false);
|
---|
[1671] | 655 | OgreIlluminationManager::getSingleton().setShadowMapSize(512);
|
---|
| 656 | OgreIlluminationManager::getSingleton().setBlurShadowMap(true);
|
---|
[2179] | 657 | OgreIlluminationManager::getSingleton().setShadowMapMaterialName("GTP/Basic/Distance_Normalized");//GameTools/ShadowMapDistance
|
---|
[1629] | 658 | mSceneMgr->setAmbientLight(ColourValue(0.505 * 0.2, 0.897 * 0.2, 0.914 * 0.2));
|
---|
| 659 |
|
---|
| 660 | SceneNode* rootNode = mSceneMgr->getRootSceneNode();
|
---|
| 661 |
|
---|
[1671] | 662 | Entity* object = mSceneMgr->createEntity("object", "buddha.mesh");
|
---|
[2334] | 663 | //object->setMaterialName("GTP/Diffuse/Disc2Point");
|
---|
[2260] | 664 | //object->setMaterialName("GTP/Diffuse/Poly2Point");
|
---|
[2334] | 665 | object->setMaterialName("GTP/Diffuse/Poly2PointSimple");
|
---|
| 666 |
|
---|
[1629] | 667 | objectNode = rootNode->createChildSceneNode();
|
---|
| 668 | objectNode->attachObject(object);
|
---|
[1671] | 669 | objectNode->scale(0.4,0.4,0.4);
|
---|
[1629] | 670 | objectNode->rotate(Vector3(0,1,0),Radian(Math::PI));
|
---|
[2057] | 671 | objectNode->setPosition(0,1,0);
|
---|
[1629] | 672 | objectNode->_updateBounds();
|
---|
| 673 |
|
---|
| 674 | Entity* room = mSceneMgr->createEntity("scene", "difflab.mesh");
|
---|
| 675 | //room->setMaterialName("GameTools/Phong");
|
---|
| 676 | SceneNode* roomNode = rootNode->createChildSceneNode();
|
---|
| 677 | roomNode->attachObject(room);
|
---|
[1879] | 678 | roomNode->_updateBounds();
|
---|
[1629] | 679 |
|
---|
[1879] | 680 |
|
---|
| 681 | capture->addAnimableNode(objectNode);
|
---|
| 682 | capture->addAnimableNode(mCamera->getParentSceneNode());
|
---|
| 683 |
|
---|
[1629] | 684 | mSceneMgr->setShadowTechnique(SHADOWTYPE_NONE);
|
---|
| 685 | Light* redLight1 = mSceneMgr->createLight("RedLight1");
|
---|
| 686 | redLight1->setType(Light::LT_POINT);
|
---|
| 687 | redLight1->setCastShadows(false);
|
---|
| 688 | redLight1->setDiffuseColour(ColourValue(1,0.055, 0.0));
|
---|
| 689 | redLight1->setPowerScale(1.6);
|
---|
| 690 | SceneNode* redLightNode1 = rootNode->createChildSceneNode();
|
---|
| 691 | redLightNode1->setPosition(0.05,2.361,-1.07);
|
---|
| 692 | redLightNode1->attachObject(redLight1);
|
---|
| 693 |
|
---|
| 694 | Light* greenLight1 = mSceneMgr->createLight("GreenLight1");
|
---|
| 695 | greenLight1->setType(Light::LT_POINT);
|
---|
| 696 | greenLight1->setCastShadows(false);
|
---|
| 697 | greenLight1->setDiffuseColour(ColourValue(0.362,0.783, 0.685));
|
---|
| 698 | greenLight1->setPowerScale(2.0);
|
---|
| 699 | SceneNode* greenLightNode1 = rootNode->createChildSceneNode();
|
---|
| 700 | greenLightNode1->setPosition(1.312,1.313,0);
|
---|
| 701 | greenLightNode1->attachObject(greenLight1);
|
---|
| 702 |
|
---|
| 703 | Light* mainBlueLight = mSceneMgr->createLight("MainBlueLight");
|
---|
| 704 | mainBlueLight->setType(Light::LT_SPOTLIGHT);
|
---|
| 705 | mainBlueLight->setCastShadows(true);
|
---|
| 706 | mainBlueLight->setDiffuseColour(ColourValue(0.395,0.766, 1.0));
|
---|
| 707 | mainBlueLight->setPowerScale(5.0);
|
---|
[1638] | 708 | mainBlueLight->setSpotlightRange(Degree(0),Degree(160));
|
---|
[1671] | 709 | mainBlueLight->setAttenuation(2.5, 0, 1, 0);
|
---|
[1629] | 710 | SceneNode* mainBlueLightNode = rootNode->createChildSceneNode();
|
---|
| 711 | mainBlueLightNode->setPosition(-0.546,2.095,1.035);
|
---|
| 712 | //mainBlueLightNode->rotate(Vector3::UNIT_X, Degree(161.396));
|
---|
| 713 | //mainBlueLightNode->rotate(Vector3::UNIT_Y, Degree(53.955));
|
---|
| 714 | //mainBlueLightNode->rotate(Vector3::UNIT_Z, Degree(-145.065));
|
---|
| 715 | mainBlueLight->setDirection(-1.5,-2.0,1.0);
|
---|
| 716 | mainBlueLightNode->attachObject(mainBlueLight);
|
---|
| 717 | /*
|
---|
| 718 | Light* blueLight1 = mSceneMgr->createLight("BlueLight1");
|
---|
| 719 | blueLight1->setType(Light::LT_SPOTLIGHT);
|
---|
| 720 | blueLight1->setCastShadows(false);
|
---|
| 721 | blueLight1->setDiffuseColour(ColourValue(0.395,0.766, 1.0));
|
---|
| 722 | blueLight1->setPowerScale(0.7);
|
---|
| 723 | blueLight1->setSpotlightRange(Degree(20),Degree(90));
|
---|
| 724 | SceneNode* blueLightNode = rootNode->createChildSceneNode();
|
---|
| 725 | blueLightNode->setPosition(-0.9,2.095,0.185);
|
---|
| 726 | //blueLightNode->rotate(Vector3::UNIT_X, Degree(148.785));
|
---|
| 727 | //blueLightNode->rotate(Vector3::UNIT_Y, Degree(39.001));
|
---|
| 728 | //blueLightNode->rotate(Vector3::UNIT_Z, Degree(-154.304));
|
---|
| 729 | blueLight1->setDirection(-1.5,-2.0,1.0);
|
---|
| 730 | blueLightNode->attachObject(blueLight1);
|
---|
| 731 |
|
---|
| 732 | Light* blueLight2 = mSceneMgr->createLight("BlueLight2");
|
---|
| 733 | blueLight2->setType(Light::LT_SPOTLIGHT);
|
---|
| 734 | blueLight2->setCastShadows(false);
|
---|
| 735 | blueLight2->setDiffuseColour(ColourValue(0.395,0.766, 1.0));
|
---|
| 736 | blueLight2->setPowerScale(0.7);
|
---|
| 737 | blueLight2->setSpotlightRange(Degree(20),Degree(90));
|
---|
| 738 | SceneNode* blueLightNode2 = rootNode->createChildSceneNode();
|
---|
| 739 | blueLightNode2->setPosition(0.091,2.095,1.556);
|
---|
| 740 | //blueLightNode2->rotate(Vector3::UNIT_X, Degree(-112.941));
|
---|
| 741 | //blueLightNode2->rotate(Vector3::UNIT_Y, Degree(68.432));
|
---|
| 742 | //blueLightNode2->rotate(Vector3::UNIT_Z, Degree(-66.441));
|
---|
| 743 | blueLight2->setDirection(-1.5,-2.0,1.0);
|
---|
| 744 | blueLightNode2->attachObject(blueLight2); */
|
---|
| 745 | }
|
---|
| 746 |
|
---|
[1519] | 747 | void createPlane(Ogre::String _name, Ogre::String _material, Ogre::Vector3 _pos, Ogre::Vector2 _size, Ogre::Vector2 _subdivisions = Ogre::Vector2(1,1)) {
|
---|
| 748 |
|
---|
| 749 | Plane _plane;
|
---|
| 750 | _plane.normal = Vector3::UNIT_Y;
|
---|
| 751 | _plane.d = 0;
|
---|
| 752 |
|
---|
| 753 |
|
---|
| 754 | MeshManager::getSingleton().createPlane(_name + ".plane",
|
---|
| 755 | ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
|
---|
| 756 | _plane,_size.x,_size.y,1,1,true,1,_subdivisions.x,_subdivisions.y,Vector3::UNIT_Z);
|
---|
| 757 |
|
---|
| 758 | Entity *_entity = mSceneMgr->createEntity(_name + ".entity", _name + ".plane");
|
---|
| 759 | _entity->setMaterialName(_material);
|
---|
| 760 |
|
---|
| 761 | SceneNode* _node = mSceneMgr->getRootSceneNode()->createChildSceneNode(_name + ".node");
|
---|
| 762 | _node->attachObject(_entity);
|
---|
| 763 | _node->setPosition(_pos);
|
---|
| 764 | }
|
---|
| 765 |
|
---|
| 766 |
|
---|
| 767 |
|
---|
| 768 | void createFrameListener(void)
|
---|
| 769 | {
|
---|
| 770 | // This is where we instantiate our own frame listener
|
---|
| 771 | mFrameListener= new RaytraceDemoListener(mWindow,
|
---|
| 772 | mCamera,
|
---|
| 773 | objectNode
|
---|
| 774 | );
|
---|
[1590] | 775 | mFrameListener->setPriority(1);
|
---|
[1598] | 776 | OgreIlluminationManager::getSingleton().setPriority(10);
|
---|
[1868] | 777 | capture->setPriority(6);
|
---|
| 778 | mRoot->addFrameListener(capture);
|
---|
[1519] | 779 | mRoot->addFrameListener(&OgreIlluminationManager::getSingleton());
|
---|
| 780 | mRoot->addFrameListener(mFrameListener);
|
---|
[1611] | 781 | if(scene == 2)
|
---|
[1598] | 782 | mRoot->addFrameListener(reflListener);
|
---|
[1519] | 783 |
|
---|
| 784 | }
|
---|
| 785 |
|
---|
| 786 | };
|
---|
| 787 |
|
---|
[1598] | 788 |
|
---|