Index: code/branches/usability/src/libraries/core/CMakeLists.txt
===================================================================
--- code/branches/usability/src/libraries/core/CMakeLists.txt	(revision 7963)
+++ code/branches/usability/src/libraries/core/CMakeLists.txt	(revision 7966)
@@ -35,5 +35,4 @@
   OrxonoxClass.cc
   Resource.cc
-  WindowEventListener.cc
 
   # hierarchy
@@ -49,5 +48,10 @@
   Template.cc
   XMLPort.cc
+
+COMPILATION_BEGIN ListenerCompilation.cc
+  ViewportEventListener.cc
+  WindowEventListener.cc
   XMLNameListener.cc
+COMPILATION_END
 
 COMPILATION_BEGIN FilesystemCompilation.cc
Index: code/branches/usability/src/libraries/core/CorePrereqs.h
===================================================================
--- code/branches/usability/src/libraries/core/CorePrereqs.h	(revision 7963)
+++ code/branches/usability/src/libraries/core/CorePrereqs.h	(revision 7966)
@@ -182,4 +182,5 @@
     class Thread;
     class ThreadPool;
+    class ViewportEventListener;
     template <class T>
     class WeakPtr;
Index: code/branches/usability/src/libraries/core/GraphicsManager.cc
===================================================================
--- code/branches/usability/src/libraries/core/GraphicsManager.cc	(revision 7963)
+++ code/branches/usability/src/libraries/core/GraphicsManager.cc	(revision 7966)
@@ -57,7 +57,9 @@
 #include "Game.h"
 #include "GameMode.h"
+#include "GUIManager.h"
 #include "Loader.h"
 #include "MemoryArchive.h"
 #include "PathConfig.h"
+#include "ViewportEventListener.h"
 #include "WindowEventListener.h"
 #include "XMLFile.h"
@@ -381,5 +383,11 @@
     void GraphicsManager::setCamera(Ogre::Camera* camera)
     {
+        Ogre::Camera* oldCamera = this->viewport_->getCamera();
+
         this->viewport_->setCamera(camera);
+        GUIManager::getInstance().setCamera(camera);
+
+        for (ObjectList<ViewportEventListener>::iterator it = ObjectList<ViewportEventListener>::begin(); it != ObjectList<ViewportEventListener>::end(); ++it)
+            it->cameraChanged(this->viewport_, oldCamera);
     }
 
Index: code/branches/usability/src/libraries/core/ViewportEventListener.cc
===================================================================
--- code/branches/usability/src/libraries/core/ViewportEventListener.cc	(revision 7966)
+++ code/branches/usability/src/libraries/core/ViewportEventListener.cc	(revision 7966)
@@ -0,0 +1,38 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "ViewportEventListener.h"
+#include "CoreIncludes.h"
+
+namespace orxonox
+{
+    ViewportEventListener::ViewportEventListener()
+    {
+        RegisterRootObject(ViewportEventListener);
+    }
+}
Index: code/branches/usability/src/libraries/core/ViewportEventListener.h
===================================================================
--- code/branches/usability/src/libraries/core/ViewportEventListener.h	(revision 7966)
+++ code/branches/usability/src/libraries/core/ViewportEventListener.h	(revision 7966)
@@ -0,0 +1,50 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _ViewportEventListener_H__
+#define _ViewportEventListener_H__
+
+#include "util/OgreForwardRefs.h"
+
+#include "CorePrereqs.h"
+#include "OrxonoxClass.h"
+
+namespace orxonox
+{
+    class _CoreExport ViewportEventListener : virtual public OrxonoxClass
+    {
+        public:
+            virtual void cameraChanged(Ogre::Viewport* viewport, Ogre::Camera* oldCamera) {}
+
+        protected:
+            ViewportEventListener();
+            virtual ~ViewportEventListener() {}
+    };
+}
+
+#endif /* _ViewportEventListener_H__ */
Index: code/branches/usability/src/libraries/tools/Shader.cc
===================================================================
--- code/branches/usability/src/libraries/tools/Shader.cc	(revision 7963)
+++ code/branches/usability/src/libraries/tools/Shader.cc	(revision 7966)
@@ -56,5 +56,5 @@
         this->bVisible_ = true;
         this->bLoadCompositor_ = GameMode::showsGraphics();
-        this->bViewportInitialized_ = false;
+        this->bViewportInitialized_ = true;
 
         if (this->bLoadCompositor_ && Ogre::Root::getSingletonPtr())
@@ -89,7 +89,31 @@
     {
         this->scenemanager_ = scenemanager;
-        this->bViewportInitialized_ = false;
-    }
-
+//        this->bViewportInitialized_ = false;
+    }
+
+    void Shader::cameraChanged(Ogre::Viewport* viewport, Ogre::Camera* oldCamera)
+    {
+        if (!this->scenemanager_ || (viewport != this->scenemanager_->getCurrentViewport() && this->scenemanager_->getCurrentViewport() != NULL))
+            return;
+
+        // update compositor in viewport (shader should only be active if the current camera is in the same scene as the shader)
+
+        // Note:
+        // The shader needs also to be switched off and on after changing the camera in the
+        // same scene to avoid weird behaviour with active compositors while switching the
+        // camera (like freezing the image)
+        //
+        // Last known Ogre version needing this workaround:
+        // 1.4.8
+        // 1.7.2
+
+
+        if (oldCamera && this->scenemanager_ == oldCamera->getSceneManager())
+            Ogre::CompositorManager::getSingleton().setCompositorEnabled(viewport, this->compositor_, false);
+
+        if (viewport->getCamera() && this->scenemanager_ == viewport->getCamera()->getSceneManager())
+            Ogre::CompositorManager::getSingleton().setCompositorEnabled(viewport, this->compositor_, this->isVisible());
+    }
+/*
     void Shader::tick(float dt)
     {
@@ -102,5 +126,5 @@
         }
     }
-
+*/
     void Shader::changedCompositor()
     {
@@ -119,5 +143,5 @@
                 if (!this->compositorInstance_)
                     COUT(2) << "Warning: Couldn't load compositor with name \"" << this->compositor_ << "\"." << std::endl;
-                Ogre::CompositorManager::getSingleton().setCompositorEnabled(viewport, this->compositor_, this->bViewportInitialized_ && this->isVisible());
+                //Ogre::CompositorManager::getSingleton().setCompositorEnabled(viewport, this->compositor_, this->bViewportInitialized_ && this->isVisible());
             }
             this->oldcompositor_ = this->compositor_;
Index: code/branches/usability/src/libraries/tools/Shader.h
===================================================================
--- code/branches/usability/src/libraries/tools/Shader.h	(revision 7963)
+++ code/branches/usability/src/libraries/tools/Shader.h	(revision 7966)
@@ -37,9 +37,9 @@
 
 #include "util/OgreForwardRefs.h"
-#include "tools/interfaces/Tickable.h"
+#include "core/ViewportEventListener.h"
 
 namespace orxonox
 {
-    class _ToolsExport Shader : public Tickable
+    class _ToolsExport Shader : public ViewportEventListener
     {
         typedef std::pair<bool, void*>                  ParameterPointer;
@@ -52,6 +52,4 @@
             Shader(Ogre::SceneManager* scenemanager = 0);
             virtual ~Shader();
-
-            virtual void tick(float dt);
 
             inline void setVisible(bool bVisible)
@@ -83,4 +81,6 @@
                 { return this->scenemanager_; }
 
+            virtual void cameraChanged(Ogre::Viewport* viewport, Ogre::Camera* oldCamera);
+
             void setParameter(const std::string& material, size_t technique, size_t pass, const std::string& parameter, float value);
             void setParameter(const std::string& material, size_t technique, size_t pass, const std::string& parameter, int value);
