RTShaderSystem.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2016 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 
18 #ifndef _GAZEBO_RTSHADERSYSTEM_HH_
19 #define _GAZEBO_RTSHADERSYSTEM_HH_
20 
21 #include <list>
22 #include <string>
23 
25 #include "gazebo/gazebo_config.h"
26 
29 #include "gazebo/util/system.hh"
30 
31 namespace gazebo
32 {
33  namespace rendering
34  {
35  class RTShaderSystemPrivate;
36 
39 
45  class GZ_RENDERING_VISIBLE RTShaderSystem :
46  public SingletonT<RTShaderSystem>
47  {
50  public: enum LightingModel
51  {
61  SSLM_NormalMapLightingObjectSpace
62  };
63 
65  private: RTShaderSystem();
66 
68  private: virtual ~RTShaderSystem();
69 
71  public: void Init();
72 
74  public: void Fini();
75 
77  public: void Clear() GAZEBO_DEPRECATED(7.0);
78 
81  public: void AddScene(ScenePtr _scene);
82 
85  public: void RemoveScene(ScenePtr _scene);
86 
89  public: void RemoveScene(const std::string &_scene);
90 
92  public: void UpdateShaders();
93 
98  public: void AttachEntity(Visual *vis) GAZEBO_DEPRECATED(7.0);
99 
104  public: void DetachEntity(Visual *_vis) GAZEBO_DEPRECATED(7.0);
105 
109  public: static void AttachViewport(Ogre::Viewport *_viewport,
110  ScenePtr _scene);
111 
115  public: static void DetachViewport(Ogre::Viewport *_viewport,
116  ScenePtr _scene);
117 
120  public: void SetPerPixelLighting(bool _set);
121 
125  public: void GenerateShaders(Visual *_vis) GAZEBO_DEPRECATED(7.0);
126 
129  public: void GenerateShaders(const VisualPtr &_vis);
130 
133  public: void ApplyShadows(ScenePtr _scene);
134 
137  public: void RemoveShadows(ScenePtr _scene);
138 
141  public: Ogre::PSSMShadowCameraSetup *GetPSSMShadowCameraSetup() const;
142 
144  public: void Update();
145 
150  private: bool GetPaths(std::string &_coreLibsPath,
151  std::string &_cachePath);
152 
155  private: void UpdateShaders(VisualPtr _vis);
156 
158  private: friend class SingletonT<RTShaderSystem>;
159 
162  private: RTShaderSystemPrivate *dataPtr;
163  };
165  }
166 }
167 #endif
Singleton template class.
Definition: SingletonT.hh:33
A renderable object.
Definition: Visual.hh:59
Normal Map lighting: lighting calculations have been stored in a light map (texture) using tangent sp...
Definition: RTShaderSystem.hh:58
boost::shared_ptr< Scene > ScenePtr
Definition: RenderTypes.hh:80
LightingModel
Definition: RTShaderSystem.hh:50
Per-Pixel lighting: best look.
Definition: RTShaderSystem.hh:55
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:112
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
Per-Vertex lighting: best performance.
Definition: RTShaderSystem.hh:53