Ignition Rendering

API Reference

0.1.0
OgreRTShaderSystem.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 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 #ifndef IGNITION_RENDERING_OGRE_OGRERTSHADERSYSTEM_HH_
18 #define IGNITION_RENDERING_OGRE_OGRERTSHADERSYSTEM_HH_
19 
20 #include <memory>
21 #include <string>
22 
23 #include <ignition/common/SingletonT.hh>
26 #include "ignition/rendering/ogre/Export.hh"
27 
28 namespace ignition
29 {
30  namespace rendering
31  {
32  // forward declaration
33  class OgreRTShaderSystemPrivate;
34 
37 
43  class IGNITION_RENDERING_OGRE_VISIBLE OgreRTShaderSystem :
44  public common::SingletonT<OgreRTShaderSystem>
45  {
48  public: enum LightingModel
49  {
59  SSLM_NormalMapLightingObjectSpace
60  };
61 
63  private: OgreRTShaderSystem();
64 
66  private: virtual ~OgreRTShaderSystem();
67 
71  public: bool Init();
72 
74  public: void Fini();
75 
77  public: void Clear();
78 
81  public: void AddScene(OgreScenePtr _scene);
82 
85  public: void RemoveScene(OgreScenePtr _scene);
86 
89  public: void RemoveScene(const std::string &_scene);
90 
92  public: void UpdateShaders();
93 
96  public: void AttachEntity(OgreSubMesh *vis);
97 
100  public: void DetachEntity(OgreSubMesh *_vis);
101 
105  public: static void AttachViewport(Ogre::Viewport *_viewport,
106  OgreScenePtr _scene);
107 
111  public: static void DetachViewport(Ogre::Viewport *_viewport,
112  OgreScenePtr _scene);
113 
116  public: void SetPerPixelLighting(bool _set);
117 
120  public: void GenerateShaders(OgreSubMesh *_vis);
121 
124  public: void ApplyShadows(OgreScenePtr _scene);
125 
128  public: void RemoveShadows(OgreScenePtr _scene);
129 
132  public: Ogre::PSSMShadowCameraSetup *PSSMShadowCameraSetup() const;
133 
138  private: bool Paths(std::string &_coreLibsPath,
139  std::string &_cachePath);
140 
145  public: bool SetShadowTextureSize(const unsigned int _size);
146 
149  public: unsigned int ShadowTextureSize() const;
150 
153  public: bool IsInitialized() const;
154 
163  public: void Update();
164 
166  private: friend class SingletonT<OgreRTShaderSystem>;
167 
170  };
172  }
173 }
174 #endif
Definition: OgreMesh.hh:59
LightingModel
The type of lighting.
Definition: OgreRTShaderSystem.hh:48
STL class.
Per-Vertex lighting: best performance.
Definition: OgreRTShaderSystem.hh:51
Per-Pixel lighting: best look.
Definition: OgreRTShaderSystem.hh:53
Implements Ogre&#39;s Run-Time Shader system.
Definition: OgreRTShaderSystem.hh:43
Definition: ArrowVisual.hh:22
Normal Map lighting: lighting calculations have been stored in a light map (texture) using tangent sp...
Definition: OgreRTShaderSystem.hh:56