Gazebo Common

API Reference

6.0.0
Pbr.hh
Go to the documentation of this file.
1/*
2 * Copyright 2020 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_COMMON_PBR_HH_
18#define GZ_COMMON_PBR_HH_
19
20#include <memory>
21#include <string>
22
23#include <gz/utils/ImplPtr.hh>
24
25#include <gz/common/graphics/Export.hh>
26#include <gz/common/Image.hh>
27
28namespace gz
29{
30namespace common
31{
33 enum class PbrType : int
34 {
36 NONE = 0,
37
39 METAL = 1,
40
42 SPECULAR = 2,
43 };
44
46 enum class NormalMapSpace: int
47 {
49 TANGENT = 0,
50
52 OBJECT = 1,
53 };
54
57 class GZ_COMMON_GRAPHICS_VISIBLE Pbr
58 {
60 public: Pbr();
61
65 public: bool operator==(const Pbr &_pbr) const;
66
71 public: bool operator!=(const Pbr &_pbr) const;
72
77 public: std::string AlbedoMap() const;
78
81 public: void SetAlbedoMap(const std::string &_map);
82
87 public: std::string NormalMap() const;
88
93
100 public: void SetNormalMap(const std::string &_map,
101 NormalMapSpace _space = NormalMapSpace::TANGENT,
102 const std::shared_ptr<const Image> &_img = nullptr);
103
107
113
116 public: void SetEnvironmentMap(const std::string &_map);
117
123
126 public: void SetAmbientOcclusionMap(const std::string &_map);
127
132 public: std::string RoughnessMap() const;
133
138 public: void SetRoughnessMap(const std::string &_map,
139 const std::shared_ptr<const Image> &_img = nullptr);
140
145
150 public: std::string MetalnessMap() const;
151
156 public: void SetMetalnessMap(const std::string &_map,
157 const std::shared_ptr<const Image> &_img = nullptr);
158
163
168 public: std::string EmissiveMap() const;
169
174 public: void SetEmissiveMap(const std::string &_map,
175 const std::shared_ptr<const Image> &_img = nullptr);
176
181
186 public: std::string LightMap() const;
187
192
198 public: void SetLightMap(const std::string &_map, unsigned int _uvSet = 0u,
199 const std::shared_ptr<const Image> &_img = nullptr);
200
203 public: unsigned int LightMapTexCoordSet() const;
204
207 public: double Metalness() const;
208
211 public: void SetMetalness(double _value);
212
215 public: double Roughness() const;
216
219 public: void SetRoughness(double _value);
220
225 public: std::string GlossinessMap() const;
226
229 public: void SetGlossinessMap(const std::string &_map);
230
233 public: double Glossiness() const;
234
237 public: void SetGlossiness(double _value);
238
243 public: std::string SpecularMap() const;
244
247 public: void SetSpecularMap(const std::string &_map);
248
251 public: PbrType Type() const;
252
255 public: void SetType(PbrType _type);
256
258 GZ_UTILS_IMPL_PTR(dataPtr)
259 };
260}
261}
262#endif