Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 7, 2008, 4:18:11 AM (16 years ago)
Author:
landauf
Message:
  • Added support for postprocessing shaders (bloom, motion blur, …). Shaders are only visible if Plugin_CgProgramManager is included in bin/Plugins.cfg.
  • Added class GlobalShader which is visible on all clients and can be activated or deactivated by triggers or other events.
  • Added RadialBlur shader to the SpaceShip's engine. The strength of the RadialBlur depends on the SpaceShip's velocity.
Location:
code/branches/objecthierarchy2/src/orxonox/objects/worldentities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy2/src/orxonox/objects/worldentities/Backlight.cc

    r2254 r2350  
    3838#include "core/XMLPort.h"
    3939#include "objects/Scene.h"
     40#include "util/Exception.h"
    4041
    4142namespace orxonox
     
    5960        if (Core::showsGraphics())
    6061        {
    61             assert(this->getScene());
    62             assert(this->getScene()->getSceneManager());
    63             assert(this->getScene()->getRootSceneNode());
     62            if (!this->getScene())
     63                ThrowException(AbortLoading, "Can't create Camera, no scene given.");
     64            if (!this->getScene()->getSceneManager())
     65                ThrowException(AbortLoading, "Can't create Camera, no scene manager given.");
     66            if (!this->getScene()->getRootSceneNode())
     67                ThrowException(AbortLoading, "Can't create Camera, no root scene node given.");
    6468
    6569            this->ribbonTrail_ = this->getScene()->getSceneManager()->createRibbonTrail(this->getNode()->getName());
  • code/branches/objecthierarchy2/src/orxonox/objects/worldentities/Camera.cc

    r2171 r2350  
    3737#include <OgreSceneNode.h>
    3838#include <OgreViewport.h>
     39#include <OgreCompositorManager.h>
     40#include <OgreResource.h>
    3941
    4042#include "util/Exception.h"
     
    4244#include "core/ConfigValueIncludes.h"
    4345#include "objects/Scene.h"
     46#include "tools/Shader.h"
    4447#include "CameraManager.h"
    4548
     
    7578        {
    7679            this->releaseFocus();
     80            this->getScene()->getSceneManager()->destroyCamera(this->camera_);
    7781        }
    7882    }
     
    122126    void Camera::setFocus(Ogre::Viewport* viewport)
    123127    {
     128        // This workaround is needed to avoid weird behaviour with active compositors while
     129        // switching the camera (like freezing the image)
     130        //
     131        // Last known Ogre version needing this workaround:
     132        // 1.4.8
     133
     134        // deactivate all compositors
     135        {
     136            Ogre::ResourceManager::ResourceMapIterator iterator = Ogre::CompositorManager::getSingleton().getResourceIterator();
     137            while (iterator.hasMoreElements())
     138                Ogre::CompositorManager::getSingleton().setCompositorEnabled(viewport, iterator.getNext()->getName(), false);
     139        }
     140
    124141        this->bHasFocus_ = true;
    125142        viewport->setCamera(this->camera_);
     143
     144        // reactivate all visible compositors
     145        {
     146            for (ObjectList<Shader>::iterator it = ObjectList<Shader>::begin(); it != ObjectList<Shader>::end(); ++it)
     147                it->updateVisibility();
     148        }
    126149    }
    127150}
Note: See TracChangeset for help on using the changeset viewer.