Go to the documentation of this file.
17 #ifndef GZ_COMMON_MATERIAL_HH_
18 #define GZ_COMMON_MATERIAL_HH_
24 #include <gz/math/Color.hh>
25 #include <gz/common/graphics/Export.hh>
35 class MaterialPrivate;
38 class IGNITION_COMMON_GRAPHICS_VISIBLE
Material
108 public:
void SetTextureImage(
const std::string &_tex);
113 public:
void SetTextureImage(
const std::string &_tex,
156 public:
void SetTransparency(
double _t);
161 public:
double Transparency()
const;
167 public:
void SetAlphaFromTexture(
bool _enabled,
168 double _alpha = 0.5,
bool _twoSided =
true);
172 public:
bool TextureAlphaEnabled()
const;
176 public:
double AlphaThreshold()
const;
180 public:
bool TwoSidedEnabled()
const;
185 public:
void SetRenderOrder(
float _renderOrder);
189 public:
float RenderOrder()
const;
193 public:
void SetShininess(
double _t);
197 public:
double Shininess()
const;
203 public:
void SetBlendFactors(
double _srcFactor,
double _dstFactor);
208 public:
void BlendFactors(
double &_srcFactor,
double &_dstFactor)
const;
212 public:
void SetBlend(BlendMode _b);
216 public: BlendMode Blend()
const;
226 public:
void SetShade(ShadeMode _b);
230 public: ShadeMode Shade()
const;
234 public:
void SetPointSize(
double _size);
238 public:
double PointSize()
const;
242 public:
void SetDepthWrite(
bool _value);
246 public:
bool DepthWrite()
const;
250 public:
void SetLighting(
bool _value);
254 public:
bool Lighting()
const;
258 public:
void SetPbrMaterial(
const Pbr &_pbr);
262 public:
Pbr *PbrMaterial()
const;
268 const gz::common::Material &_m)
270 _out <<
"Material:\n";
271 _out <<
" Name: " << _m.Name() <<
"\n";
272 _out <<
" Texture: " << _m.TextureImage() <<
"\n";
273 _out <<
" Ambient: " << _m.Ambient() <<
"\n";
274 _out <<
" Diffuse: " << _m.Diffuse() <<
"\n";
275 _out <<
" Specular: " << _m.Specular() <<
"\n";
276 _out <<
" Emissive: " << _m.Emissive() <<
"\n";
277 _out <<
" Transparency: " << _m.Transparency() <<
"\n";
278 _out <<
" Shininess: " << _m.Shininess() <<
"\n";
279 _out <<
" Render order: " << _m.RenderOrder() <<
"\n";
280 _out <<
" BlendMode: " << _m.BlendStr() <<
"\n";
281 _out <<
" ShadeMode: " << _m.ShadeStr() <<
"\n";
282 _out <<
" DepthWrite: " << _m.DepthWrite() <<
"\n";
ShadeMode
Definition: gz/common/Material.hh:42
bool DepthWrite() const
Get depth write.
std::string BlendStr() const
Get the blend mode string.
Forward declarations for the common classes.
std::string Name() const
Get the name of the material.
#define IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
Microsoft Visual Studio does not automatically export the interface information for member variables ...
Definition: gz/common/SuppressWarning.hh:65
float RenderOrder() const
Get the render order.
double Shininess() const
Get the shininess.
std::string TextureImage() const
Get a texture image.
Encapsulates description of a material.
Definition: gz/common/Material.hh:38
math::Color Emissive() const
Get the emissive color.
BlendMode
Definition: gz/common/Material.hh:69
math::Color Diffuse() const
Get the diffuse color.
std::string ShadeStr() const
Get the shade mode string.
This class contains Physically-Based-Rendering (PBR) workflow properties.
Definition: gz/common/Pbr.hh:55
friend std::ostream & operator<<(std::ostream &_out, const Material &_m)
Stream insertion operator param[in] _out the output stream to extract from param[out] _m the material...
Definition: gz/common/Material.hh:267
double Transparency() const
Get the transparency percentage (0..1) A value of 1 is fully transparent and 0 is not transparent.
math::Color Ambient() const
Get the ambient color.
#define IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
Definition: gz/common/SuppressWarning.hh:68
math::Color Specular() const
Get the specular color.