BaseMaterial.hh
Go to the documentation of this file.
virtual void SetTransparency(const double _transparency) override
Set the transparency value.
Definition: BaseMaterial.hh:457
virtual void SetNormalMap(const std::string &_normalMap) override
Set the material normal map.
Definition: BaseMaterial.hh:740
virtual void SetCastShadows(const bool _castShadows) override
Specify if this material casts shadows.
Definition: BaseMaterial.hh:530
std::string EmissiveMap() const
double AlphaThreshold() const override
Get the alpha threshold.
Definition: BaseMaterial.hh:481
virtual void SetRoughness(const float _roughness) override
Set the roughness value. Only affects material of type MT_PBS.
Definition: BaseMaterial.hh:901
static const common::Pbr kDefaultPbr
Default pbr material properties.
Definition: BaseMaterial.hh:35
virtual bool HasLightMap() const override
Determine if this material has a light map.
Definition: BaseMaterial.hh:866
bool TwoSidedEnabled() const
virtual void ClearLightMap() override
Removes any light map mapped to this material.
Definition: BaseMaterial.hh:894
unsigned int LightMapTexCoordSet() const
virtual void ClearEmissiveMap() override
Removes any emissive map mapped to this material.
Definition: BaseMaterial.hh:859
virtual float Roughness() const override
Get the roughness value of this material.
Definition: BaseMaterial.hh:908
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:390
virtual void SetLightingEnabled(const bool _enabled) override
Specify if lighting affects this material.
Definition: BaseMaterial.hh:509
virtual void ClearEnvironmentMap() override
Removes any environment map mapped to this material.
Definition: BaseMaterial.hh:831
double Transparency() const
virtual bool DepthCheckEnabled() const override
Determine if depth buffer checking is enabled.
Definition: BaseMaterial.hh:628
virtual unsigned int LightMapTexCoordSet() const override
Get the texture coordinate set used by lightmap.
Definition: BaseMaterial.hh:880
virtual void SetReceiveShadows(const bool _receiveShadows) override
Specify if this material receives shadows.
Definition: BaseMaterial.hh:537
virtual void SetDepthMaterial(const double far, const double near) override
Configuration for Depth Material.
Definition: BaseMaterial.hh:1028
std::string EnvironmentMap() const
virtual std::string FragmentShader() const override
Get path to the fragment shader.
Definition: BaseMaterial.hh:677
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:915
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:435
virtual bool HasMetalnessMap() const override
Determine if this material has a metalness map.
Definition: BaseMaterial.hh:782
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:1021
double Shininess() const
virtual void SetRoughnessMap(const std::string &_roughnessMap) override
Set the material roughness map.
Definition: BaseMaterial.hh:768
std::string LightMap() const
virtual void SetDepthWriteEnabled(bool _enabled) override
Specify if depth buffer writing is enabled.
Definition: BaseMaterial.hh:523
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:405
virtual void ClearNormalMap() override
Removes any normal map mapped to this material.
Definition: BaseMaterial.hh:747
virtual void SetVertexShader(const std::string &_path) override
Set the vertex shader.
Definition: BaseMaterial.hh:670
virtual void ClearRoughnessMap() override
Removes any roughness map mapped to this material.
Definition: BaseMaterial.hh:775
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:464
virtual math::Color Ambient() const override
Get the ambient color.
Definition: BaseMaterial.hh:551
virtual void SetReflectivity(const double _reflectivity) override
Set the reflectivity value.
Definition: BaseMaterial.hh:495
double Roughness() const
virtual std::string Texture() const override
Get the URI of the texture file.
Definition: BaseMaterial.hh:705
virtual math::Color Diffuse() const override
Get the diffuse color.
Definition: BaseMaterial.hh:558
virtual MaterialPtr Clone(const std::string &_name="") const override
Clone this material.
Definition: BaseMaterial.hh:929
virtual ShaderParamsPtr VertexShaderParams() override
Get params for the vertex shader.
Definition: BaseMaterial.hh:663
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:642
virtual double Reflectivity() const override
Get the reflectivity value.
Definition: BaseMaterial.hh:600
virtual std::string EmissiveMap() const override
Get the URI of the emissive map file.
Definition: BaseMaterial.hh:845
math::Color emissive
Emissive color.
Definition: BaseMaterial.hh:334
std::string TextureImage() const
bool Lighting() const
virtual bool HasNormalMap() const override
Determine if this material has a normal map.
Definition: BaseMaterial.hh:726
virtual ~BaseMaterial()
Definition: BaseMaterial.hh:384
virtual std::string LightMap() const override
Get the URI of the light map file.
Definition: BaseMaterial.hh:873
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:733
virtual bool CastShadows() const override
Determine if this material casts shadows.
Definition: BaseMaterial.hh:607
virtual std::string RoughnessMap() const override
Get the URI of the roughness map file.
Definition: BaseMaterial.hh:761
virtual math::Color Emissive() const override
Get the emissive color.
Definition: BaseMaterial.hh:572
virtual bool HasEmissiveMap() const override
Determine if this material has an emissive map.
Definition: BaseMaterial.hh:838
virtual void SetRenderOrder(const float _renderOrder) override
Set the render order. When polygons are coplanar, you can get problems with 'depth fighting' where th...
Definition: BaseMaterial.hh:544
virtual void SetShininess(const double _shininess) override
Set the shininess value.
Definition: BaseMaterial.hh:450
bool TwoSidedEnabled() const override
Get the enable two sided rendering value.
Definition: BaseMaterial.hh:488
virtual void SetMetalnessMap(const std::string &_metalnessMap) override
Set the material metalness map.
Definition: BaseMaterial.hh:796
virtual void SetLightMap(const std::string &_lightMap, unsigned int _uvSet=0u) override
Set the material light map.
Definition: BaseMaterial.hh:887
virtual bool ReceiveShadows() const override
Determine if this material receives shadows.
Definition: BaseMaterial.hh:614
virtual void ClearTexture() override
Removes any texture mapped to this material.
Definition: BaseMaterial.hh:719
virtual bool LightingEnabled() const override
Determine if lighting affects this material.
Definition: BaseMaterial.hh:621
virtual float Metalness() const override
Get the metalness value of this material.
Definition: BaseMaterial.hh:922
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:420
virtual void SetEnvironmentMap(const std::string &_metalnessMap) override
Set the material environment map.
Definition: BaseMaterial.hh:824
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:474
virtual void SetDepthCheckEnabled(bool _enabled) override
Specify if depth buffer checking is enabled.
Definition: BaseMaterial.hh:516
virtual double Transparency() const override
Get the transparency value.
Definition: BaseMaterial.hh:586
virtual void SetTexture(const std::string &_texture) override
Set the material texture.
Definition: BaseMaterial.hh:712
bool TextureAlphaEnabled() const
math::Color ambient
Ambient color.
Definition: BaseMaterial.hh:325
virtual math::Color Specular() const override
Get the specular color.
Definition: BaseMaterial.hh:565
virtual void CopyFrom(ConstMaterialPtr _material) override
Copy properties from given Material.
Definition: BaseMaterial.hh:943
virtual bool HasRoughnessMap() const override
Determine if this material has a roughness map.
Definition: BaseMaterial.hh:754
virtual void SetReflectionEnabled(const bool _enabled) override
Specify if this material has a reflection.
Definition: BaseMaterial.hh:502
math::Color specular
Specular color.
Definition: BaseMaterial.hh:331
Pbr * PbrMaterial() const
virtual bool HasEnvironmentMap() const override
Determine if this material has a environment map.
Definition: BaseMaterial.hh:810
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:817
virtual void SetEmissiveMap(const std::string &_emissiveMap) override
Set the material emissive map.
Definition: BaseMaterial.hh:852
virtual bool HasTexture() const override
Determine if this material has a texture.
Definition: BaseMaterial.hh:698
float RenderOrder() const
double AlphaThreshold() const
math::Color diffuse
Diffuse color.
Definition: BaseMaterial.hh:328
virtual std::string VertexShader() const override
Get path to the vertex shader.
Definition: BaseMaterial.hh:656
virtual double Shininess() const override
Get the shininess value.
Definition: BaseMaterial.hh:579
math::Color Emissive() const
virtual ShaderParamsPtr FragmentShaderParams() override
Get params for the fragment shader.
Definition: BaseMaterial.hh:684
virtual MaterialType Type() const override
Removes any metalness map mapped to this material.
Definition: BaseMaterial.hh:649
virtual void ClearMetalnessMap() override
Removes any metalness map mapped to this material.
Definition: BaseMaterial.hh:803
virtual void SetShaderType(enum ShaderType _type) override
Set the ShaderType value.
Definition: BaseMaterial.hh:272
virtual float RenderOrder() const override
Get the render order value of this material.
Definition: BaseMaterial.hh:593
virtual std::string MetalnessMap() const override
Get the URI of the metalness map file.
Definition: BaseMaterial.hh:789
virtual void SetFragmentShader(const std::string &_path) override
Set the fragment shader.
Definition: BaseMaterial.hh:691
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:635