BaseMaterial.hh
Go to the documentation of this file.
virtual void SetTransparency(const double _transparency) override
Set the transparency value.
Definition: BaseMaterial.hh:456
virtual void SetNormalMap(const std::string &_normalMap) override
Set the material normal map.
Definition: BaseMaterial.hh:739
std::string EmissiveMap() const
double AlphaThreshold() const override
Get the alpha threshold.
Definition: BaseMaterial.hh:480
virtual void SetRoughness(const float _roughness) override
Set the roughness value. Only affects material of type MT_PBS.
Definition: BaseMaterial.hh:900
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:865
bool TwoSidedEnabled() const
virtual void ClearLightMap() override
Removes any light map mapped to this material.
Definition: BaseMaterial.hh:893
unsigned int LightMapTexCoordSet() const
virtual void SetCastShadows(const bool _cast) override
Specify if this material casts shadows.
Definition: BaseMaterial.hh:529
virtual void ClearEmissiveMap() override
Removes any emissive map mapped to this material.
Definition: BaseMaterial.hh:858
virtual float Roughness() const override
Get the roughness value of this material.
Definition: BaseMaterial.hh:907
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:389
virtual void SetLightingEnabled(const bool _enabled) override
Specify if lighting affects this material.
Definition: BaseMaterial.hh:508
virtual void ClearEnvironmentMap() override
Removes any environment map mapped to this material.
Definition: BaseMaterial.hh:830
virtual void SetLightMap(const std::string &_lightMap, unsigned int uvSet=0u) override
Set the material light map.
Definition: BaseMaterial.hh:886
double Transparency() const
virtual bool DepthCheckEnabled() const override
Determine if depth buffer checking is enabled.
Definition: BaseMaterial.hh:627
virtual unsigned int LightMapTexCoordSet() const override
Get the texture coordinate set used by lightmap.
Definition: BaseMaterial.hh:879
virtual void SetReceiveShadows(const bool _receiveShadows) override
Specify if this material receives shadows.
Definition: BaseMaterial.hh:536
virtual void SetDepthMaterial(const double far, const double near) override
Configuration for Depth Material.
Definition: BaseMaterial.hh:1027
std::string EnvironmentMap() const
virtual std::string FragmentShader() const override
Get path to the fragment shader.
Definition: BaseMaterial.hh:676
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:914
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:434
virtual bool HasMetalnessMap() const override
Determine if this material has a metalness map.
Definition: BaseMaterial.hh:781
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:1020
double Shininess() const
virtual void SetRoughnessMap(const std::string &_roughnessMap) override
Set the material roughness map.
Definition: BaseMaterial.hh:767
std::string LightMap() const
virtual void SetDepthWriteEnabled(bool _enabled) override
Specify if depth buffer writing is enabled.
Definition: BaseMaterial.hh:522
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:404
virtual void ClearNormalMap() override
Removes any normal map mapped to this material.
Definition: BaseMaterial.hh:746
virtual void SetVertexShader(const std::string &_path) override
Set the vertex shader.
Definition: BaseMaterial.hh:669
virtual void ClearRoughnessMap() override
Removes any roughness map mapped to this material.
Definition: BaseMaterial.hh:774
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:463
virtual math::Color Ambient() const override
Get the ambient color.
Definition: BaseMaterial.hh:550
virtual void SetReflectivity(const double _reflectivity) override
Set the reflectivity value.
Definition: BaseMaterial.hh:494
double Roughness() const
virtual std::string Texture() const override
Get the URI of the texture file.
Definition: BaseMaterial.hh:704
virtual math::Color Diffuse() const override
Get the diffuse color.
Definition: BaseMaterial.hh:557
virtual MaterialPtr Clone(const std::string &_name="") const override
Clone this material.
Definition: BaseMaterial.hh:928
virtual ShaderParamsPtr VertexShaderParams() override
Get params for the vertex shader.
Definition: BaseMaterial.hh:662
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:641
virtual double Reflectivity() const override
Get the reflectivity value.
Definition: BaseMaterial.hh:599
virtual std::string EmissiveMap() const override
Get the URI of the emissive map file.
Definition: BaseMaterial.hh:844
math::Color emissive
Emissive color.
Definition: BaseMaterial.hh:333
std::string TextureImage() const
bool Lighting() const
virtual bool HasNormalMap() const override
Determine if this material has a normal map.
Definition: BaseMaterial.hh:725
virtual ~BaseMaterial()
Definition: BaseMaterial.hh:383
virtual std::string LightMap() const override
Get the URI of the light map file.
Definition: BaseMaterial.hh:872
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:732
virtual bool CastShadows() const override
Determine if this material casts shadows.
Definition: BaseMaterial.hh:606
virtual std::string RoughnessMap() const override
Get the URI of the roughness map file.
Definition: BaseMaterial.hh:760
virtual math::Color Emissive() const override
Get the emissive color.
Definition: BaseMaterial.hh:571
virtual bool HasEmissiveMap() const override
Determine if this material has an emissive map.
Definition: BaseMaterial.hh:837
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:543
virtual void SetShininess(const double _shininess) override
Set the shininess value.
Definition: BaseMaterial.hh:449
bool TwoSidedEnabled() const override
Get the enable two sided rendering value.
Definition: BaseMaterial.hh:487
virtual void SetMetalnessMap(const std::string &_metalnessMap) override
Set the material metalness map.
Definition: BaseMaterial.hh:795
virtual bool ReceiveShadows() const override
Determine if this material receives shadows.
Definition: BaseMaterial.hh:613
virtual void ClearTexture() override
Removes any texture mapped to this material.
Definition: BaseMaterial.hh:718
virtual bool LightingEnabled() const override
Determine if lighting affects this material.
Definition: BaseMaterial.hh:620
virtual float Metalness() const override
Get the metalness value of this material.
Definition: BaseMaterial.hh:921
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:419
virtual void SetEnvironmentMap(const std::string &_metalnessMap) override
Set the material environment map.
Definition: BaseMaterial.hh:823
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:473
virtual void SetDepthCheckEnabled(bool _enabled) override
Specify if depth buffer checking is enabled.
Definition: BaseMaterial.hh:515
virtual double Transparency() const override
Get the transparency value.
Definition: BaseMaterial.hh:585
virtual void SetTexture(const std::string &_texture) override
Set the material texture.
Definition: BaseMaterial.hh:711
bool TextureAlphaEnabled() const
math::Color ambient
Ambient color.
Definition: BaseMaterial.hh:324
virtual math::Color Specular() const override
Get the specular color.
Definition: BaseMaterial.hh:564
virtual void CopyFrom(ConstMaterialPtr _material) override
Copy properties from given Material.
Definition: BaseMaterial.hh:942
virtual bool HasRoughnessMap() const override
Determine if this material has a roughness map.
Definition: BaseMaterial.hh:753
virtual void SetReflectionEnabled(const bool _enabled) override
Specify if this material has a reflection.
Definition: BaseMaterial.hh:501
math::Color specular
Specular color.
Definition: BaseMaterial.hh:330
Pbr * PbrMaterial() const
virtual bool HasEnvironmentMap() const override
Determine if this material has a environment map.
Definition: BaseMaterial.hh:809
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:816
virtual void SetEmissiveMap(const std::string &_emissiveMap) override
Set the material emissive map.
Definition: BaseMaterial.hh:851
virtual bool HasTexture() const override
Determine if this material has a texture.
Definition: BaseMaterial.hh:697
float RenderOrder() const
double AlphaThreshold() const
math::Color diffuse
Diffuse color.
Definition: BaseMaterial.hh:327
virtual std::string VertexShader() const override
Get path to the vertex shader.
Definition: BaseMaterial.hh:655
virtual double Shininess() const override
Get the shininess value.
Definition: BaseMaterial.hh:578
math::Color Emissive() const
virtual ShaderParamsPtr FragmentShaderParams() override
Get params for the fragment shader.
Definition: BaseMaterial.hh:683
virtual MaterialType Type() const override
Removes any metalness map mapped to this material.
Definition: BaseMaterial.hh:648
virtual void ClearMetalnessMap() override
Removes any metalness map mapped to this material.
Definition: BaseMaterial.hh:802
virtual float RenderOrder() const override
Get the render order value of this material.
Definition: BaseMaterial.hh:592
virtual std::string MetalnessMap() const override
Get the URI of the metalness map file.
Definition: BaseMaterial.hh:788
virtual void SetFragmentShader(const std::string &_path) override
Set the fragment shader.
Definition: BaseMaterial.hh:690
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:634
virtual void SetShaderType(enum ShaderType) override
Set the ShaderType value.
Definition: BaseMaterial.hh:272