Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1514


Ignore:
Timestamp:
Jun 1, 2008, 8:59:09 PM (17 years ago)
Author:
rgrieder
Message:
  • readded and uncommented the shader hacks in shader branch
Location:
code/branches/shader/src/orxonox
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/shader/src/orxonox/GraphicsEngine.cc

    r1511 r1514  
    399399  }
    400400
     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  }
    401433}
  • code/branches/shader/src/orxonox/GraphicsEngine.h

    r1511 r1514  
    8484            static GraphicsEngine* getSingletonPtr() { return &getSingleton(); }
    8585
     86            //HACK!!!
     87            void static CompositorBloomOn();
     88            void static CompositorBloomOff();
     89            void static CompositorMotionBlurOn();
     90            void static CompositorMotionBlurOff();
     91
    8692
    8793        private:
  • code/branches/shader/src/orxonox/Orxonox.cc

    r1511 r1514  
    354354    Loader::open(startlevel);
    355355   
     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   
    356366    return true;
    357367  }
  • code/branches/shader/src/orxonox/objects/Model.cc

    r1511 r1514  
    8484        this->attachObject(this->mesh_.getEntity());
    8585
     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        }
    86107        COUT(4) << "Loader (Model.cc): Created model" << std::endl;
    87108      }
Note: See TracChangeset for help on using the changeset viewer.