##

RTShaderSystem.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef _GAZEBO_RTSHADERSYSTEM_HH_
#define _GAZEBO_RTSHADERSYSTEM_HH_
#include <list>
#include <string>
#include "gazebo/rendering/ogre_gazebo.h"
#include "gazebo/gazebo_config.h"
#include "gazebo/rendering/Camera.hh"
#include "gazebo/common/SingletonT.hh"
#include "gazebo/util/system.hh"
GZ_SINGLETON_DECLARE(GZ_RENDERING_VISIBLE, gazebo, rendering, RTShaderSystem)
namespace gazebo
{
namespace rendering
{
class RTShaderSystemPrivate;
class GZ_RENDERING_VISIBLE RTShaderSystem :
public SingletonT<RTShaderSystem>
{
public: enum LightingModel
{
SSLM_PerVertexLighting,
SSLM_PerPixelLighting,
SSLM_NormalMapLightingTangentSpace,
SSLM_NormalMapLightingObjectSpace
};
private: RTShaderSystem();
private: virtual ~RTShaderSystem();
public: void Init();
public: void Fini();
public: void AddScene(ScenePtr _scene);
public: void RemoveScene(ScenePtr _scene);
public: void RemoveScene(const std::string &_scene);
public: void UpdateShaders();
public: static void AttachViewport(Ogre::Viewport *_viewport,
ScenePtr _scene);
public: static void DetachViewport(Ogre::Viewport *_viewport,
ScenePtr _scene);
public: void SetPerPixelLighting(bool _set);
public: void GenerateShaders(const VisualPtr &_vis);
public: void ApplyShadows(ScenePtr _scene);
public: void RemoveShadows(ScenePtr _scene);
public: Ogre::PSSMShadowCameraSetup *GetPSSMShadowCameraSetup() const;
public: void Update();
public: bool SetShadowTextureSize(const unsigned int _size);
public: unsigned int ShadowTextureSize() const;
public: void SetShadowClipDist(const double _near, const double _far);
public: double ShadowNearClip() const;
public: double ShadowFarClip() const;
public: void SetShadowSplitLambda(const double _lambda);
public: double ShadowSplitLambda() const;
public: void SetShadowSplitPadding(const double _padding);
public: double ShadowSplitPadding() const;
private: bool GetPaths(std::string &_coreLibsPath,
std::string &_cachePath);
private: void UpdateShaders(VisualPtr _vis);
private: void ReapplyShadows();
private: friend class SingletonT<RTShaderSystem>;
private: RTShaderSystemPrivate *dataPtr;
};
}
}
#endif
gazebo::rendering::RTShaderSystem::SSLM_PerPixelLighting
Per-Pixel lighting: best look.
Definition: RTShaderSystem.hh:58
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
SingletonT
Singleton template class.
Definition: SingletonT.hh:33
gazebo::rendering::RTShaderSystem::SSLM_PerVertexLighting
Per-Vertex lighting: best performance.
Definition: RTShaderSystem.hh:56
system.hh
gazebo::rendering::RTShaderSystem::LightingModel
LightingModel
The type of lighting.
Definition: RTShaderSystem.hh:53
Camera.hh
gazebo::rendering::RTShaderSystem
Implements Ogre's Run-Time Shader system.
Definition: RTShaderSystem.hh:48
gazebo
gazebo
Definition: RTShaderSystem.hh:32
gazebo::rendering::ScenePtr
boost::shared_ptr< Scene > ScenePtr
Definition: RenderTypes.hh:82
ogre_gazebo.h
gazebo::msgs::Init
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
gazebo::rendering::VisualPtr
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:114
rendering
rendering
Definition: RTShaderSystem.hh:32
GZ_SINGLETON_DECLARE
#define GZ_SINGLETON_DECLARE(visibility, n1, n2, singletonType)
Helper to declare typed SingletonT.
Definition: SingletonT.hh:61
SingletonT.hh
gazebo::rendering::RTShaderSystem::SSLM_NormalMapLightingTangentSpace
Normal Map lighting: lighting calculations have been stored in a light map (texture) using tangent sp...
Definition: RTShaderSystem.hh:61