BaseMaterial.hh
Go to the documentation of this file.
virtual void SetTransparency(const double _transparency) override
Set the transparency value.
Definition: BaseMaterial.hh:431
virtual void SetNormalMap(const std::string &_normalMap) override
Set the material normal map.
Definition: BaseMaterial.hh:700
std::string EmissiveMap() const
double AlphaThreshold() const override
Get the alpha threshold.
Definition: BaseMaterial.hh:455
virtual void SetRoughness(const float _roughness) override
Set the roughness value. Only affects material of type MT_PBS.
Definition: BaseMaterial.hh:826
static const common::Pbr kDefaultPbr
Default pbr material properties.
Definition: BaseMaterial.hh:35
bool TwoSidedEnabled() const
virtual void SetCastShadows(const bool _cast) override
Specify if this material casts shadows.
Definition: BaseMaterial.hh:504
virtual void ClearEmissiveMap() override
Removes any emissive map mapped to this material.
Definition: BaseMaterial.hh:819
virtual float Roughness() const override
Get the roughness value of this material.
Definition: BaseMaterial.hh:833
virtual void SetAmbient(const double _r, const double _g, const double _b, const double _a=1.0) override
Set the ambient color.
Definition: BaseMaterial.hh:364
virtual void SetLightingEnabled(const bool _enabled) override
Specify if lighting affects this material.
Definition: BaseMaterial.hh:483
virtual void ClearEnvironmentMap() override
Removes any environment map mapped to this material.
Definition: BaseMaterial.hh:791
double Transparency() const
virtual bool DepthCheckEnabled() const override
Determine if depth buffer checking is enabled.
Definition: BaseMaterial.hh:588
virtual void SetReceiveShadows(const bool _receiveShadows) override
Specify if this material receives shadows.
Definition: BaseMaterial.hh:511
virtual void SetDepthMaterial(const double far, const double near) override
Configuration for Depth Material.
Definition: BaseMaterial.hh:947
std::string EnvironmentMap() const
virtual std::string FragmentShader() const override
Get path to the fragment shader.
Definition: BaseMaterial.hh:637
std::string RoughnessMap() const
STL class.
virtual void SetMetalness(const float _metalness) override
Set the metalness value. Only affects material of type MT_PBS.
Definition: BaseMaterial.hh:840
virtual void SetEmissive(const double _r, const double _g, const double _b, const double _a=1.0) override
Set the emissive color.
Definition: BaseMaterial.hh:409
virtual bool HasMetalnessMap() const override
Determine if this material has a metalness map.
Definition: BaseMaterial.hh:742
virtual void PreRender() override
Prepare this object and any of its children for rendering. This should be called for each object in a...
Definition: BaseMaterial.hh:940
double Shininess() const
virtual void SetRoughnessMap(const std::string &_roughnessMap) override
Set the material roughness map.
Definition: BaseMaterial.hh:728
virtual void SetDepthWriteEnabled(bool _enabled) override
Specify if depth buffer writing is enabled.
Definition: BaseMaterial.hh:497
virtual void SetDiffuse(const double _r, const double _g, const double _b, const double _a=1.0) override
Set the diffuse color.
Definition: BaseMaterial.hh:379
virtual void ClearNormalMap() override
Removes any normal map mapped to this material.
Definition: BaseMaterial.hh:707
virtual void SetVertexShader(const std::string &_path) override
Set the vertex shader.
Definition: BaseMaterial.hh:630
virtual void ClearRoughnessMap() override
Removes any roughness map mapped to this material.
Definition: BaseMaterial.hh:735
virtual void SetAlphaFromTexture(bool _enabled, double _alpha=0.5, bool _twoSided=true) override
Set the material to use the alpha channel from the textures.
Definition: BaseMaterial.hh:438
virtual math::Color Ambient() const override
Get the ambient color.
Definition: BaseMaterial.hh:518
virtual void SetReflectivity(const double _reflectivity) override
Set the reflectivity value.
Definition: BaseMaterial.hh:469
double Roughness() const
virtual std::string Texture() const override
Get the URI of the texture file.
Definition: BaseMaterial.hh:665
virtual math::Color Diffuse() const override
Get the diffuse color.
Definition: BaseMaterial.hh:525
virtual MaterialPtr Clone(const std::string &_name="") const override
Clone this material.
Definition: BaseMaterial.hh:854
virtual ShaderParamsPtr VertexShaderParams() override
Get params for the vertex shader.
Definition: BaseMaterial.hh:623
std::string NormalMap() const
T dynamic_pointer_cast(T... args)
virtual bool ReflectionEnabled() const override
Determine if this material has a reflection.
Definition: BaseMaterial.hh:602
virtual double Reflectivity() const override
Get the reflectivity value.
Definition: BaseMaterial.hh:560
virtual std::string EmissiveMap() const override
Get the URI of the emissive map file.
Definition: BaseMaterial.hh:805
math::Color emissive
Emissive color.
Definition: BaseMaterial.hh:311
std::string TextureImage() const
bool Lighting() const
virtual bool HasNormalMap() const override
Determine if this material has a normal map.
Definition: BaseMaterial.hh:686
virtual ~BaseMaterial()
Definition: BaseMaterial.hh:358
math::Color Ambient() const
std::string MetalnessMap() const
virtual std::string NormalMap() const override
Get the URI of the normal map file.
Definition: BaseMaterial.hh:693
virtual bool CastShadows() const override
Determine if this material casts shadows.
Definition: BaseMaterial.hh:567
virtual std::string RoughnessMap() const override
Get the URI of the roughness map file.
Definition: BaseMaterial.hh:721
virtual math::Color Emissive() const override
Get the emissive color.
Definition: BaseMaterial.hh:539
virtual bool HasEmissiveMap() const override
Determine if this material has an emissive map.
Definition: BaseMaterial.hh:798
virtual void SetShininess(const double _shininess) override
Set the shininess value.
Definition: BaseMaterial.hh:424
bool TwoSidedEnabled() const override
Get the enable two sided rendering value.
Definition: BaseMaterial.hh:462
virtual void SetMetalnessMap(const std::string &_metalnessMap) override
Set the material metalness map.
Definition: BaseMaterial.hh:756
virtual bool ReceiveShadows() const override
Determine if this material receives shadows.
Definition: BaseMaterial.hh:574
virtual void ClearTexture() override
Removes any texture mapped to this material.
Definition: BaseMaterial.hh:679
virtual bool LightingEnabled() const override
Determine if lighting affects this material.
Definition: BaseMaterial.hh:581
virtual float Metalness() const override
Get the metalness value of this material.
Definition: BaseMaterial.hh:847
virtual void SetSpecular(const double _r, const double _g, const double _b, const double _a=1.0) override
Set the specular color.
Definition: BaseMaterial.hh:394
virtual void SetEnvironmentMap(const std::string &_metalnessMap) override
Set the material environment map.
Definition: BaseMaterial.hh:784
ShaderType
Available types of shaders. Note that not all rendering-engines will be able to use each type...
Definition: ShaderType.hh:34
Definition: BaseMaterial.hh:38
bool TextureAlphaEnabled() const override
Get the enable alpha from textures.
Definition: BaseMaterial.hh:448
virtual void SetDepthCheckEnabled(bool _enabled) override
Specify if depth buffer checking is enabled.
Definition: BaseMaterial.hh:490
virtual double Transparency() const override
Get the transparency value.
Definition: BaseMaterial.hh:553
virtual void SetTexture(const std::string &_texture) override
Set the material texture.
Definition: BaseMaterial.hh:672
bool TextureAlphaEnabled() const
math::Color ambient
Ambient color.
Definition: BaseMaterial.hh:302
virtual math::Color Specular() const override
Get the specular color.
Definition: BaseMaterial.hh:532
virtual void CopyFrom(ConstMaterialPtr _material) override
Copy properties from given Material.
Definition: BaseMaterial.hh:868
virtual bool HasRoughnessMap() const override
Determine if this material has a roughness map.
Definition: BaseMaterial.hh:714
virtual void SetReflectionEnabled(const bool _enabled) override
Specify if this material has a reflection.
Definition: BaseMaterial.hh:476
math::Color specular
Specular color.
Definition: BaseMaterial.hh:308
Pbr * PbrMaterial() const
virtual bool HasEnvironmentMap() const override
Determine if this material has a environment map.
Definition: BaseMaterial.hh:770
math::Color Specular() const
double Metalness() const
math::Color Diffuse() const
Represents a surface material of a Geometry.
Definition: Material.hh:47
virtual std::string EnvironmentMap() const override
Get the URI of the environment map file.
Definition: BaseMaterial.hh:777
virtual void SetEmissiveMap(const std::string &_emissiveMap) override
Set the material emissive map.
Definition: BaseMaterial.hh:812
virtual bool HasTexture() const override
Determine if this material has a texture.
Definition: BaseMaterial.hh:658
double AlphaThreshold() const
math::Color diffuse
Diffuse color.
Definition: BaseMaterial.hh:305
virtual std::string VertexShader() const override
Get path to the vertex shader.
Definition: BaseMaterial.hh:616
virtual double Shininess() const override
Get the shininess value.
Definition: BaseMaterial.hh:546
math::Color Emissive() const
virtual ShaderParamsPtr FragmentShaderParams() override
Get params for the fragment shader.
Definition: BaseMaterial.hh:644
virtual MaterialType Type() const override
Removes any metalness map mapped to this material.
Definition: BaseMaterial.hh:609
virtual void ClearMetalnessMap() override
Removes any metalness map mapped to this material.
Definition: BaseMaterial.hh:763
virtual std::string MetalnessMap() const override
Get the URI of the metalness map file.
Definition: BaseMaterial.hh:749
virtual void SetFragmentShader(const std::string &_path) override
Set the fragment shader.
Definition: BaseMaterial.hh:651
MaterialType
An enum for the type of material.
Definition: Material.hh:36
virtual bool DepthWriteEnabled() const override
Determine if depth buffer writing is enabled.
Definition: BaseMaterial.hh:595
virtual void SetShaderType(enum ShaderType) override
Set the ShaderType value.
Definition: BaseMaterial.hh:250