TDME2  1.9.200
PBRMaterialProperties.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 
5 #include <tdme/tdme.h>
7 #include <tdme/engine/fwd-tdme.h>
8 #include <tdme/engine/Color4.h>
9 
10 
11 using std::string;
12 
15 
16 /**
17  * Represents specular material properties
18  * @author andreas.drewke
19  */
21 {
22 
23 private:
36  float normalScale;
44  float exposure;
45 
46  /**
47  * Checks and set ups base color texture transparency
48  */
50 
51 public:
52  // forbid class copy
54 
55  /**
56  * Public constructor
57  */
59 
60  /**
61  * Destructor
62  */
64 
65  /**
66  * @return base color factor
67  */
68  inline const Color4& getBaseColorFactor() const {
69  return baseColorFactor;
70  }
71 
72  /**
73  * Set base color factor
74  * @param baseColorFactor base color factor
75  */
77  this->baseColorFactor = baseColorFactor;
78  }
79 
80  /**
81  * @return base color texture path name
82  */
83  inline const string& getBaseColorTexturePathName() const {
85  }
86 
87  /**
88  * @return base color texture file name
89  */
90  inline const string& getBaseColorTextureFileName() const {
92  }
93 
94  /**
95  * Set up a base color texture by the texture itself
96  * @param baseColorTexture base color texture
97  */
99 
100  /**
101  * Set up a base color texture
102  * @param pathName path name
103  * @param fileName file name
104  */
105  void setBaseColorTexture(const string& pathName, const string& fileName);
106 
107  /**
108  * @return if material has a base color texture
109  */
110  inline bool hasBaseColorTexture() const {
111  return baseColorTexture != nullptr;
112  }
113 
114  /**
115  * @return the material's base color texture
116  */
117  inline Texture* getBaseColorTexture() const {
118  return baseColorTexture;
119  }
120 
121  /**
122  * @return base color texture has transparent pixels
123  */
124  inline bool hasBaseColorTextureTransparency() const {
126  }
127 
128  /**
129  * Set if base color texture uses transparency
130  * @param transparency transparency
131  */
132  inline void setBaseColorTextureTransparency(bool transparency) {
133  baseColorTextureTransparency = transparency;
134  }
135 
136  /**
137  * @return base color texture has masked transparency, means pixel are eighter opaque or not visible
138  */
141  }
142 
143  /**
144  * Set if base color texture uses masked transparency(means pixel are eighter opaque or not visible)
145  * @param maskedTransparency masked transparency
146  */
147  inline void setBaseColorTextureMaskedTransparency(bool maskedTransparency) {
148  baseColorTextureMaskedTransparency = maskedTransparency;
149  }
150 
151  /**
152  * @return base color texture masked transparency threshold
153  */
156  }
157 
158  /**
159  * Set base color texture masked transparency threshold
160  * @param maskedTransparencyThreshold diffuse texture masked transparency threshold
161  */
162  inline void setBaseColorTextureMaskedTransparencyThreshold(float maskedTransparencyThreshold) {
163  baseColorTextureMaskedTransparencyThreshold = maskedTransparencyThreshold;
164  }
165 
166  /**
167  * @return metallic factor
168  */
169  inline float getMetallicFactor() const {
170  return metallicFactor;
171  }
172 
173  /**
174  * Set metallic factor
175  * @param metallicFactor metallic factor
176  */
177  inline void setMetallicFactor(float metallicFactor) {
178  this->metallicFactor = metallicFactor;
179  }
180 
181  /**
182  * @return roughness factor
183  */
184  inline float getRoughnessFactor() const {
185  return roughnessFactor;
186  }
187 
188  /**
189  * Set roughness factor
190  * @param roughnessFactor roughness factor
191  */
192  inline void setRoughnessFactor(float roughnessFactor) {
193  this->roughnessFactor = roughnessFactor;
194  }
195 
196  /**
197  * @return metallic roughness texture path name
198  */
199  inline const string& getMetallicRoughnessTexturePathName() const {
201  }
202 
203  /**
204  * @return metallic roughness texture file name
205  */
206  inline const string& getMetallicRoughnessTextureFileName() const {
208  }
209 
210  /**
211  * Set up a metallic roughness texture by the texture itself
212  * @param metallicRoughnessTexture metallic roughness texture
213  */
215 
216  /**
217  * Set up a metallic roughness texture
218  * @param pathName path name
219  * @param fileName file name
220  */
221  void setMetallicRoughnessTexture(const string& pathName, const string& fileName);
222 
223  /**
224  * @return if material has a metallic roughness texture
225  */
226  inline bool hasMetallicRoughnessTexture() const {
227  return metallicRoughnessTexture != nullptr;
228  }
229 
230  /**
231  * @return the material's metallic roughness texture
232  */
235  }
236 
237  /**
238  * @return normal scale
239  */
240  inline float getNormalScale() const {
241  return normalScale;
242  }
243 
244  /**
245  * Set normal scale
246  * @param normalScale normal scale
247  */
248  inline void setNormalScale(float normalScale) {
249  this->normalScale = normalScale;
250  }
251 
252  /**
253  * @return normal texture path name
254  */
255  inline const string& getNormalTexturePathName() const {
256  return normalTexturePathName;
257  }
258 
259  /**
260  * @return normal texture file name
261  */
262  inline const string& getNormalTextureFileName() const {
263  return normalTextureFileName;
264  }
265 
266  /**
267  * Set up a normal texture by the texture itself
268  * @param normalTexture normal texture
269  */
271 
272  /**
273  * Set up a normal texture
274  * @param pathName path name
275  * @param fileName file name
276  */
277  void setNormalTexture(const string& pathName, const string& fileName);
278 
279  /**
280  * @return if material has a normal texture
281  */
282  inline bool hasNormalTexture() const {
283  return normalTexture != nullptr;
284  }
285 
286  /**
287  * @return the material's normal texture
288  */
289  inline Texture* getNormalTexture() const {
290  return normalTexture;
291  }
292 
293  /**
294  * @return emissive factor
295  */
296  inline const Color4& getEmissiveFactor() const {
297  return emissiveFactor;
298  }
299 
300  /**
301  * Set emissive factor
302  * @param emissiveFactor emissive factor
303  */
305  this->emissiveFactor = emissiveFactor;
306  }
307 
308  /**
309  * @return emissive texture path name
310  */
311  inline const string& getEmissiveTexturePathName() const {
313  }
314 
315  /**
316  * @return emissive texture file name
317  */
318  inline const string& getEmissiveTextureFileName() const {
320  }
321 
322  /**
323  * Set up a emissive texture by the texture itself
324  * @param normalTexture normal texture
325  */
327 
328  /**
329  * Set up a emissive texture
330  * @param pathName path name
331  * @param fileName file name
332  */
333  void setEmissiveTexture(const string& pathName, const string& fileName);
334 
335  /**
336  * @return if material has a emissive texture
337  */
338  inline bool hasEmissiveTexture() const {
339  return emissiveTexture != nullptr;
340  }
341 
342  /**
343  * @return the material's emissive texture
344  */
345  inline Texture* getEmissiveTexture() const {
346  return emissiveTexture;
347  }
348 
349  /**
350  * @return exposure
351  */
352  inline float getExposure() const {
353  return exposure;
354  }
355 
356  /**
357  * Set exposure
358  * @param exposure exposure
359  */
360  inline void setExposure(float exposure) {
361  this->exposure = exposure;
362  }
363 
364 };
Color 4 definition class.
Definition: Color4.h:18
Texture entity.
Definition: Texture.h:24
Represents specular material properties.
void setBaseColorTextureMaskedTransparencyThreshold(float maskedTransparencyThreshold)
Set base color texture masked transparency threshold.
void setBaseColorTexture(Texture *baseColorTexture)
Set up a base color texture by the texture itself.
void setBaseColorTextureTransparency(bool transparency)
Set if base color texture uses transparency.
void setEmissiveTexture(Texture *emissiveTexture)
Set up a emissive texture by the texture itself.
void setRoughnessFactor(float roughnessFactor)
Set roughness factor.
void setBaseColorFactor(const Color4 &baseColorFactor)
Set base color factor.
void setExposure(float exposure)
Set exposure.
void setNormalScale(float normalScale)
Set normal scale.
void setMetallicRoughnessTexture(Texture *metallicRoughnessTexture)
Set up a metallic roughness texture by the texture itself.
void setBaseColorTextureMaskedTransparency(bool maskedTransparency)
Set if base color texture uses masked transparency(means pixel are eighter opaque or not visible)
void setEmissiveFactor(const Color4 &emissiveFactor)
Set emissive factor.
void setNormalTexture(Texture *normalTexture)
Set up a normal texture by the texture itself.
void setMetallicFactor(float metallicFactor)
Set metallic factor.
void checkBaseColorTextureTransparency()
Checks and set ups base color texture transparency.
#define FORBID_CLASS_COPY(CLASS)
Definition: tdme.h:6