Gazebo Rendering

API Reference

3.7.2
gz/rendering/ogre2/Ogre2Material.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 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 GZ_RENDERING_OGRE2_OGRE2MATERIAL_HH_
18 #define GZ_RENDERING_OGRE2_OGRE2MATERIAL_HH_
19 
20 #include <string>
21 
25 
26 namespace ignition
27 {
28  namespace rendering
29  {
30  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
31  //
33  class IGNITION_RENDERING_OGRE2_VISIBLE Ogre2Material :
34  public BaseMaterial<Ogre2Object>
35  {
37  protected: Ogre2Material();
38 
40  public: virtual ~Ogre2Material();
41 
42  // Documentation inherited
43  public: virtual void Destroy() override;
44 
45  // Documentation inherited
46  public: virtual math::Color Diffuse() const override;
47 
48  // Documentation inherited
49  public: virtual void SetDiffuse(const math::Color &_color) override;
50 
51  // Documentation inherited
52  public: virtual math::Color Specular() const override;
53 
54  // Documentation inherited
55  public: virtual void SetSpecular(const math::Color &_color) override;
56 
57  // Documentation inherited
58  public: virtual math::Color Emissive() const override;
59 
60  // Documentation inherited
61  public: virtual void SetEmissive(const math::Color &_color) override;
62 
63  // Documentation inherited
64  public: virtual void SetTransparency(const double _transparency) override;
65 
66  // Documentation inherited
67  public: virtual bool ReceiveShadows() const override;
68 
69  // Documentation inherited
70  public: virtual void SetReceiveShadows(const bool _receiveShadows)
71  override;
72 
73  // Documentation inherited
74  public: virtual bool HasTexture() const override;
75 
76  // Documentation inherited
77  public: virtual std::string Texture() const override;
78 
79  // Documentation inherited
80  public: virtual void SetTexture(const std::string &_texture) override;
81 
82  // Documentation inherited
83  public: virtual void ClearTexture() override;
84 
85  // Documentation inherited
86  public: virtual bool HasNormalMap() const override;
87 
88  // Documentation inherited
89  public: virtual std::string NormalMap() const override;
90 
91  // Documentation inherited
92  public: virtual void SetNormalMap(const std::string &_normalMap) override;
93 
94  // Documentation inherited
95  public: virtual void ClearNormalMap() override;
96 
97  // Documentation inherited
98  public: virtual bool HasRoughnessMap() const override;
99 
100  // Documentation inherited
101  public: virtual std::string RoughnessMap() const override;
102 
103  // Documentation inherited
104  public: virtual void SetRoughnessMap(
105  const std::string &_roughnessMap) override;
106 
107  // Documentation inherited
108  public: virtual void ClearRoughnessMap() override;
109 
110  // Documentation inherited
111  public: virtual bool HasMetalnessMap() const override;
112 
113  // Documentation inherited
114  public: virtual std::string MetalnessMap() const override;
115 
116  // Documentation inherited
117  public: virtual void SetMetalnessMap(
118  const std::string &_metalnessMap) override;
119 
120  // Documentation inherited
121  public: virtual void ClearMetalnessMap() override;
122 
123  // Documentation inherited
124  public: virtual bool HasEnvironmentMap() const override;
125 
126  // Documentation inherited
127  public: virtual std::string EnvironmentMap() const override;
128 
129  // Documentation inherited
130  public: virtual void SetEnvironmentMap(
131  const std::string &_metalnessMap) override;
132 
133  // Documentation inherited
134  public: virtual void ClearEnvironmentMap() override;
135 
136  // Documentation inherited
137  public: virtual void SetRoughness(const float _roughness) override;
138 
139  // Documentation inherited
140  public: virtual bool HasEmissiveMap() const override;
141 
142  // Documentation inherited
143  public: virtual std::string EmissiveMap() const override;
144 
145  // Documentation inherited
146  public: virtual void SetEmissiveMap(
147  const std::string &_emissiveMap) override;
148 
149  // Documentation inherited
150  public: virtual void ClearEmissiveMap() override;
151 
152  // Documentation inherited
153  public: virtual float Roughness() const override;
154 
155  // Documentation inherited
156  public: virtual void SetMetalness(const float _roughness) override;
157 
158  // Documentation inherited
159  public: virtual float Metalness() const override;
160 
163  public: virtual Ogre::MaterialPtr Material();
164 
167  public: virtual Ogre::HlmsPbsDatablock *Datablock() const;
168 
169  // Documentation inherited.
170  // \sa BaseMaterial::PreRender()
171  public: virtual void PreRender() override;
172 
173  // Documentation inherited.
174  public: virtual enum MaterialType Type() const override;
175 
176  // Documentation inherited
177  public: virtual bool DepthCheckEnabled() const override;
178 
179  // Documentation inherited
180  public: virtual void SetDepthCheckEnabled(bool _enabled) override;
181 
182  // Documentation inherited
183  public: virtual bool DepthWriteEnabled() const override;
184 
185  // Documentation inherited
186  public: virtual void SetDepthWriteEnabled(bool _enabled) override;
187 
192  protected: virtual void SetTextureMapImpl(const std::string &_texture,
193  Ogre::PbsTextureTypes _type);
194 
197  protected: virtual Ogre::TexturePtr Texture(const std::string &_name);
198 
201  protected: virtual void UpdateTransparency();
202 
203  // Documentation inherited.
204  protected: virtual void Init() override;
205 
207  protected: Ogre::MaterialPtr ogreMaterial;
208 
210  protected: Ogre::HlmsPbsDatablock *ogreDatablock = nullptr;
211 
213  protected: Ogre::HlmsPbs *ogreHlmsPbs = nullptr;
214 
217 
220 
223 
226 
229 
232 
235 
237  private: friend class Ogre2Scene;
238  };
239  }
240  }
241 }
242 #endif
MaterialType
An enum for the type of material.
Definition: gz/rendering/Material.hh:36
STL class.
std::string environmentMapName
Name of the environment map.
Definition: gz/rendering/ogre2/Ogre2Material.hh:228
std::string metalnessMapName
Name of the metalness map.
Definition: gz/rendering/ogre2/Ogre2Material.hh:225
std::string emissiveMapName
Name of the emissive map.
Definition: gz/rendering/ogre2/Ogre2Material.hh:231
std::string normalMapName
Name of the normal map.
Definition: gz/rendering/ogre2/Ogre2Material.hh:219
Definition: gz/rendering/base/BaseMaterial.hh:38
std::string textureName
Name of the texture.
Definition: gz/rendering/ogre2/Ogre2Material.hh:216
std::string roughnessMapName
Name of the roughness map.
Definition: gz/rendering/ogre2/Ogre2Material.hh:222
Ogre2.x implementation of the scene class.
Definition: gz/rendering/ogre2/Ogre2Scene.hh:41
Ogre 2.x implementation of the material class.
Definition: gz/rendering/ogre2/Ogre2Material.hh:33
std::string ogreDatablockId
Unique id assigned to ogre hlms datablock.
Definition: gz/rendering/ogre2/Ogre2Material.hh:234
Represents a surface material of a Geometry.
Definition: gz/rendering/Material.hh:47
Ogre::MaterialPtr ogreMaterial
Ogre material. Mainly used for render targets.
Definition: gz/rendering/ogre2/Ogre2Material.hh:207