17 #ifndef GZ_RENDERING_MATERIAL_HH_
18 #define GZ_RENDERING_MATERIAL_HH_
22 #include <gz/math/Color.hh>
23 #include <gz/common/Material.hh>
24 #include "gz/rendering/config.hh"
28 #include "gz/rendering/Export.hh"
34 inline namespace GZ_RENDERING_VERSION_NAMESPACE {
56 public:
virtual bool LightingEnabled()
const = 0;
60 public:
virtual void SetLightingEnabled(
const bool _enabled) = 0;
64 public:
virtual void SetDepthCheckEnabled(
bool _enabled) = 0;
68 public:
virtual bool DepthCheckEnabled()
const = 0;
72 public:
virtual void SetDepthWriteEnabled(
bool _enabled) = 0;
76 public:
virtual bool DepthWriteEnabled()
const = 0;
87 public:
virtual void SetAmbient(
const double _r,
const double _g,
88 const double _b,
const double _a = 1.0) = 0;
92 public:
virtual void SetAmbient(
const math::Color &_color) = 0;
103 public:
virtual void SetDiffuse(
const double _r,
const double _g,
104 const double _b,
const double _a = 1.0) = 0;
108 public:
virtual void SetDiffuse(
const math::Color &_color) = 0;
119 public:
virtual void SetSpecular(
const double _r,
const double _g,
120 const double _b,
const double _a = 1.0) = 0;
124 public:
virtual void SetSpecular(
const math::Color &_color) = 0;
135 public:
virtual void SetEmissive(
const double _r,
const double _g,
136 const double _b,
const double _a = 1.0) = 0;
140 public:
virtual void SetEmissive(
const math::Color &_color) = 0;
144 public:
virtual double Shininess()
const = 0;
148 public:
virtual void SetShininess(
const double _shininess) = 0;
152 public:
virtual double Transparency()
const = 0;
157 public:
virtual void SetDepthMaterial(
const double far,
158 const double near) = 0;
162 public:
virtual void SetTransparency(
const double _transparency) = 0;
168 public:
virtual void SetAlphaFromTexture(
bool _enabled,
169 double _alpha = 0.5,
bool _twoSided =
true) = 0;
173 public:
virtual bool TextureAlphaEnabled()
const = 0;
177 public:
virtual double AlphaThreshold()
const = 0;
181 public:
virtual bool TwoSidedEnabled()
const = 0;
185 public:
virtual double Reflectivity()
const = 0;
189 public:
virtual void SetReflectivity(
const double _reflectivity) = 0;
193 public:
virtual bool CastShadows()
const = 0;
197 public:
virtual void SetCastShadows(
const bool _castShadows) = 0;
201 public:
virtual bool ReceiveShadows()
const = 0;
205 public:
virtual void SetReceiveShadows(
const bool _receiveShadows) = 0;
209 public:
virtual bool ReflectionEnabled()
const = 0;
213 public:
virtual void SetReflectionEnabled(
const bool _enabled) = 0;
217 public:
virtual bool HasTexture()
const = 0;
228 this->SetTexture(_texture,
nullptr);
250 public:
virtual void ClearTexture() = 0;
254 public:
virtual bool HasNormalMap()
const = 0;
270 this->SetNormalMap(_normalMap,
nullptr);
286 public:
virtual void ClearNormalMap() = 0;
290 public:
virtual bool HasRoughnessMap()
const = 0;
294 public:
virtual std::string RoughnessMap()
const = 0;
306 this->SetRoughnessMap(_roughnessMap,
nullptr);
323 public:
virtual void ClearRoughnessMap() = 0;
327 public:
virtual bool HasMetalnessMap()
const = 0;
331 public:
virtual std::string MetalnessMap()
const = 0;
343 this->SetMetalnessMap(_metalnessMap,
nullptr);
360 public:
virtual void ClearMetalnessMap() = 0;
364 public:
virtual bool HasEnvironmentMap()
const = 0;
368 public:
virtual std::string EnvironmentMap()
const = 0;
380 this->SetEnvironmentMap(_environmentMap,
nullptr);
392 (void)_environmentMap;
397 public:
virtual void ClearEnvironmentMap() = 0;
401 public:
virtual bool HasEmissiveMap()
const = 0;
405 public:
virtual std::string EmissiveMap()
const = 0;
417 this->SetEmissiveMap(_emissiveMap,
nullptr);
434 public:
virtual void ClearEmissiveMap() = 0;
438 public:
virtual bool HasLightMap()
const = 0;
446 public:
virtual unsigned int LightMapTexCoordSet()
const = 0;
452 unsigned int _uvSet = 0u)
454 this->SetLightMap(_lightMap,
nullptr, _uvSet);
464 unsigned int _uvSet = 0)
478 public:
virtual void ClearLightMap() = 0;
485 public:
virtual void SetRenderOrder(
const float _renderOrder) = 0;
489 public:
virtual float RenderOrder()
const = 0;
493 public:
virtual void SetRoughness(
const float _roughness) = 0;
497 public:
virtual float Roughness()
const = 0;
501 public:
virtual void SetMetalness(
const float _metalness) = 0;
505 public:
virtual float Metalness()
const = 0;
516 public:
virtual void SetShaderType(
enum ShaderType _type) = 0;
533 public:
virtual std::string VertexShader()
const = 0;
541 public:
virtual void SetVertexShader(
const std::string &_path) = 0;
545 public:
virtual std::string FragmentShader()
const = 0;
553 public:
virtual void SetFragmentShader(
const std::string &_path) = 0;