17
17
#ifndef GZ_COMMON_PBR_HH_
18
18
#define GZ_COMMON_PBR_HH_
19
19
20
+ #include < memory>
20
21
#include < string>
21
22
22
23
#include < gz/utils/ImplPtr.hh>
23
24
24
25
#include < gz/common/graphics/Export.hh>
26
+ #include < gz/common/Image.hh>
25
27
26
28
namespace gz
27
29
{
@@ -84,12 +86,20 @@ namespace common
84
86
// / has not been specified.
85
87
public: std::string NormalMap () const ;
86
88
89
+ // / \brief Gets the normal map data,
90
+ // / if the texture was loaded from memory, otherwise a nullptr
91
+ // / \return A pointer to the image that was loaded from memory
92
+ public: std::shared_ptr<const Image> NormalMapData () const ;
93
+
87
94
// / \brief Set the normal map filename.
88
95
// / \param[in] _map Filename of the normal map.
89
96
// / \param[in] _space Space that the normal map is defined in.
90
97
// / Defaults to tangent space.
98
+ // / \param[in] _img The image containing the texture if image has been
99
+ // / loaded in memory
91
100
public: void SetNormalMap (const std::string &_map,
92
- NormalMapSpace _space = NormalMapSpace::TANGENT);
101
+ NormalMapSpace _space = NormalMapSpace::TANGENT,
102
+ const std::shared_ptr<const Image> &_img = nullptr );
93
103
94
104
// / \brief Get the normal map type, either tangent or object space
95
105
// / \return Space that the normal map is defined in
@@ -123,7 +133,15 @@ namespace common
123
133
124
134
// / \brief Set the roughness map filename for metal workflow.
125
135
// / \param[in] _map Filename of the roughness map.
126
- public: void SetRoughnessMap (const std::string &_map);
136
+ // / \param[in] _img The image containing the texture if image has been
137
+ // / loaded in memory
138
+ public: void SetRoughnessMap (const std::string &_map,
139
+ const std::shared_ptr<const Image> &_img = nullptr );
140
+
141
+ // / \brief Gets the roughness map data,
142
+ // / if the texture was loaded from memory, otherwise a nullptr
143
+ // / \return A pointer to the image that was loaded from memory
144
+ public: std::shared_ptr<const Image> RoughnessMapData () const ;
127
145
128
146
// / \brief Get the metalness map filename for metal workflow. This will be
129
147
// / an empty string if a metalness map has not been set.
@@ -133,7 +151,15 @@ namespace common
133
151
134
152
// / \brief Set the metalness map filename for metal workflow.
135
153
// / \param[in] _map Filename of the metalness map.
136
- public: void SetMetalnessMap (const std::string &_map);
154
+ // / \param[in] _img The image containing the texture if image has been
155
+ // / loaded in memory
156
+ public: void SetMetalnessMap (const std::string &_map,
157
+ const std::shared_ptr<const Image> &_img = nullptr );
158
+
159
+ // / \brief Gets the metalness map data,
160
+ // / if the texture was loaded from memory, otherwise a nullptr
161
+ // / \return A pointer to the image that was loaded from memory
162
+ public: std::shared_ptr<const Image> MetalnessMapData () const ;
137
163
138
164
// / \brief Get the emissive map filename. This will be an empty string
139
165
// / if an emissive map has not been set.
@@ -143,18 +169,34 @@ namespace common
143
169
144
170
// / \brief Set the emissive map filename.
145
171
// / \param[in] _map Filename of the emissive map.
146
- public: void SetEmissiveMap (const std::string &_map);
172
+ // / \param[in] _img The image containing the texture if image has been
173
+ // / loaded in memory
174
+ public: void SetEmissiveMap (const std::string &_map,
175
+ const std::shared_ptr<const Image> &_img = nullptr );
176
+
177
+ // / \brief Gets the emissive map data,
178
+ // / if the texture was loaded from memory, otherwise a nullptr
179
+ // / \return A pointer to the image that was loaded from memory
180
+ public: std::shared_ptr<const Image> EmissiveMapData () const ;
147
181
148
182
// / \brief Get the light map filename. This will be an empty string
149
183
// / if an light map has not been set.
150
184
// / \return Filename of the light map, or empty string if a light
151
185
// / map has not been specified.
152
186
public: std::string LightMap () const ;
153
187
188
+ // / \brief Gets the light map data,
189
+ // / if the texture was loaded from memory, otherwise a nullptr
190
+ // / \return A pointer to the image that was loaded from memory
191
+ public: std::shared_ptr<const Image> LightMapData () const ;
192
+
154
193
// / \brief Set the light map filename.
155
194
// / \param[in] _map Filename of the light map.
156
195
// / \param[in] _uvSet Index of the texture coordinate set
157
- public: void SetLightMap (const std::string &_map, unsigned int _uvSet = 0u );
196
+ // / \param[in] _img The image containing the texture if image has been
197
+ // / loaded in memory
198
+ public: void SetLightMap (const std::string &_map, unsigned int _uvSet = 0u ,
199
+ const std::shared_ptr<const Image> &_img = nullptr );
158
200
159
201
// / \brief Get the light map texture coordinate set.
160
202
// / \return Index of the light map texture coordinate set
0 commit comments