Changeset 1514
- Timestamp:
- Jun 1, 2008, 8:59:09 PM (16 years ago)
- Location:
- code/branches/shader/src/orxonox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/shader/src/orxonox/GraphicsEngine.cc
r1511 r1514 399 399 } 400 400 401 //HACK!! 402 SetConsoleCommandShortcut(GraphicsEngine, CompositorBloomOn).setAccessLevel(AccessLevel::User); 403 SetConsoleCommandShortcut(GraphicsEngine, CompositorMotionBlurOn).setAccessLevel(AccessLevel::User); 404 SetConsoleCommandShortcut(GraphicsEngine, CompositorBloomOff).setAccessLevel(AccessLevel::User); 405 SetConsoleCommandShortcut(GraphicsEngine, CompositorMotionBlurOff).setAccessLevel(AccessLevel::User); 406 void GraphicsEngine::CompositorBloomOn() 407 { 408 Ogre::SceneManager* mSceneMgr = GraphicsEngine::getSingleton().getSceneManager(); 409 Ogre::Viewport* mViewport = mSceneMgr->getCurrentViewport(); 410 Ogre::CompositorManager::getSingleton().addCompositor(mViewport, "Bloom"); 411 Ogre::CompositorManager::getSingleton().setCompositorEnabled(mViewport, "Bloom", true); 412 } 413 void GraphicsEngine::CompositorBloomOff() 414 { 415 Ogre::SceneManager* mSceneMgr = GraphicsEngine::getSingleton().getSceneManager(); 416 Ogre::Viewport* mViewport = mSceneMgr->getCurrentViewport(); 417 Ogre::CompositorManager::getSingleton().setCompositorEnabled(mViewport, "Bloom", false); 418 } 419 420 void GraphicsEngine::CompositorMotionBlurOn() 421 { 422 Ogre::SceneManager* mSceneMgr = GraphicsEngine::getSingleton().getSceneManager(); 423 Ogre::Viewport* mViewport = mSceneMgr->getCurrentViewport(); 424 Ogre::CompositorManager::getSingleton().addCompositor(mViewport, "MotionBlur"); 425 Ogre::CompositorManager::getSingleton().setCompositorEnabled(mViewport, "MotionBlur", true); 426 } 427 void GraphicsEngine::CompositorMotionBlurOff() 428 { 429 Ogre::SceneManager* mSceneMgr = GraphicsEngine::getSingleton().getSceneManager(); 430 Ogre::Viewport* mViewport = mSceneMgr->getCurrentViewport(); 431 Ogre::CompositorManager::getSingleton().setCompositorEnabled(mViewport, "MotionBlur", false); 432 } 401 433 } -
code/branches/shader/src/orxonox/GraphicsEngine.h
r1511 r1514 84 84 static GraphicsEngine* getSingletonPtr() { return &getSingleton(); } 85 85 86 //HACK!!! 87 void static CompositorBloomOn(); 88 void static CompositorBloomOff(); 89 void static CompositorMotionBlurOn(); 90 void static CompositorMotionBlurOff(); 91 86 92 87 93 private: -
code/branches/shader/src/orxonox/Orxonox.cc
r1511 r1514 354 354 Loader::open(startlevel); 355 355 356 // HACK: shader stuff for presentation 357 Ogre::SceneManager* mSceneMgr = GraphicsEngine::getSingleton().getSceneManager(); 358 mSceneMgr->setAmbientLight(ColourValue(0.4,0.4,0.4)); 359 Ogre::Light* dirlight = mSceneMgr->createLight("Light1"); 360 361 dirlight->setType(Ogre::Light::LT_DIRECTIONAL); 362 dirlight->setDirection(Vector3( 0, 1, 5 )); 363 dirlight->setDiffuseColour(ColourValue(0.6, 0.6, 0.4)); 364 dirlight->setSpecularColour(ColourValue(1.0, 1.0, 1.0)); 365 356 366 return true; 357 367 } -
code/branches/shader/src/orxonox/objects/Model.cc
r1511 r1514 84 84 this->attachObject(this->mesh_.getEntity()); 85 85 86 //HACK!! 87 if ((this->meshSrc_ == "assff.mesh") || (this->meshSrc_ == "ast1.mesh") || (this->meshSrc_ == "ast2.mesh") || (this->meshSrc_ == "ast3.mesh") || (this->meshSrc_ == "ast4.mesh") ||(this->meshSrc_ == "ast5.mesh") || (this->meshSrc_ == "ast6.mesh")) 88 { 89 Ogre::MeshPtr pMesh = this->mesh_.getEntity()->getMesh(); 90 //set Mesh to tangentspace 91 unsigned short src, dest; 92 if (!pMesh->suggestTangentVectorBuildParams(Ogre::VES_TANGENT, src, dest)) 93 { 94 pMesh->buildTangentVectors(Ogre::VES_TANGENT, src, dest); 95 } 96 if ((this->meshSrc_ == "assff.mesh")) 97 { 98 (this->mesh_.getEntity())->setMaterialName("Assff/BumpMap"); 99 } 100 else 101 { 102 (this->mesh_.getEntity())->setMaterialName("Asteroid/BumpMap"); 103 } 104 105 106 } 86 107 COUT(4) << "Loader (Model.cc): Created model" << std::endl; 87 108 }
Note: See TracChangeset
for help on using the changeset viewer.