Gazebo Rendering

API Reference

9.0.0

#include <BaseMaterial.hh>

Public Member Functions

virtual ~BaseMaterial ()
 
double AlphaThreshold () const override
 Get the alpha threshold.
 
virtual math::Color Ambient () const override
 Get the ambient color.
 
virtual bool CastShadows () const override
 Determine if this material casts shadows.
 
virtual void ClearEmissiveMap () override
 Removes any emissive map mapped to this material.
 
virtual void ClearEnvironmentMap () override
 Removes any environment map mapped to this material.
 
virtual void ClearLightMap () override
 Removes any light map mapped to this material.
 
virtual void ClearMetalnessMap () override
 Removes any metalness map mapped to this material.
 
virtual void ClearNormalMap () override
 Removes any normal map mapped to this material.
 
virtual void ClearRoughnessMap () override
 Removes any roughness map mapped to this material.
 
virtual void ClearTexture () override
 Removes any texture mapped to this material.
 
virtual MaterialPtr Clone (const std::string &_name="") const override
 Clone this material.
 
virtual void CopyFrom (const common::Material &_material) override
 Copy properties from given Material.
 
virtual void CopyFrom (ConstMaterialPtr _material) override
 Copy properties from given Material.
 
virtual bool DepthCheckEnabled () const override
 Determine if depth buffer checking is enabled.
 
virtual bool DepthWriteEnabled () const override
 Determine if depth buffer writing is enabled.
 
virtual math::Color Diffuse () const override
 Get the diffuse color.
 
virtual math::Color Emissive () const override
 Get the emissive color.
 
virtual std::string EmissiveMap () const override
 Get the URI of the emissive map file.
 
virtual std::shared_ptr< const common::ImageEmissiveMapData () const override
 Get the emissive map data.
 
virtual std::string EnvironmentMap () const override
 Get the URI of the environment map file.
 
virtual std::shared_ptr< const common::ImageEnvironmentMapData () const override
 Get the environment map data.
 
virtual std::string FragmentShader () const override
 Get path to the fragment shader.
 
virtual ShaderParamsPtr FragmentShaderParams () override
 Get params for the fragment shader.
 
virtual bool HasEmissiveMap () const override
 Determine if this material has an emissive map.
 
virtual bool HasEnvironmentMap () const override
 Determine if this material has a environment map.
 
virtual bool HasLightMap () const override
 Determine if this material has a light map.
 
virtual bool HasMetalnessMap () const override
 Determine if this material has a metalness map.
 
virtual bool HasNormalMap () const override
 Determine if this material has a normal map.
 
virtual bool HasRoughnessMap () const override
 Determine if this material has a roughness map.
 
virtual bool HasTexture () const override
 Determine if this material has a texture.
 
virtual bool LightingEnabled () const override
 Determine if lighting affects this material.
 
virtual std::string LightMap () const override
 Get the URI of the light map file.
 
virtual std::shared_ptr< const common::ImageLightMapData () const override
 Get the light map data.
 
virtual unsigned int LightMapTexCoordSet () const override
 Get the texture coordinate set used by lightmap.
 
virtual float Metalness () const override
 Get the metalness value of this material.
 
virtual std::string MetalnessMap () const override
 Get the URI of the metalness map file.
 
virtual std::shared_ptr< const common::ImageMetalnessMapData () const override
 Get the metalness map data.
 
virtual std::string NormalMap () const override
 Get the URI of the normal map file.
 
virtual std::shared_ptr< const common::ImageNormalMapData () const override
 Get the normal map data.
 
virtual void PreRender () override
 Prepare this object and any of its children for rendering. This should be called for each object in a scene just before rendering, which can be achieved by a single call to Scene::PreRender.
 
virtual bool ReceiveShadows () const override
 Determine if this material receives shadows.
 
virtual bool ReflectionEnabled () const override
 Determine if this material has a reflection.
 
virtual double Reflectivity () const override
 Get the reflectivity value.
 
virtual float RenderOrder () const override
 Get the render order value of this material.
 
virtual float Roughness () const override
 Get the roughness value of this material.
 
virtual std::string RoughnessMap () const override
 Get the URI of the roughness map file.
 
virtual std::shared_ptr< const common::ImageRoughnessMapData () const override
 Get the roughness map data.
 
virtual void SetAlphaFromTexture (bool _enabled, double _alpha=0.5, bool _twoSided=true) override
 Set the material to use the alpha channel from the textures.
 
virtual void SetAmbient (const double _r, const double _g, const double _b, const double _a=1.0) override
 Set the ambient color.
 
virtual void SetAmbient (const math::Color &_color) override
 Set the ambient color.
 
virtual void SetCastShadows (const bool _castShadows) override
 Specify if this material casts shadows.
 
virtual void SetDepthCheckEnabled (bool _enabled) override
 Specify if depth buffer checking is enabled.
 
virtual void SetDepthMaterial (const double far, const double near) override
 Configuration for Depth Material.
 
virtual void SetDepthWriteEnabled (bool _enabled) override
 Specify if depth buffer writing is enabled.
 
virtual void SetDiffuse (const double _r, const double _g, const double _b, const double _a=1.0) override
 Set the diffuse color.
 
virtual void SetDiffuse (const math::Color &_color) override
 Set the diffuse color.
 
virtual void SetEmissive (const double _r, const double _g, const double _b, const double _a=1.0) override
 Set the emissive color.
 
virtual void SetEmissive (const math::Color &_color) override
 Set the emissive color.
 
virtual void SetEmissiveMap (const std::string &_emissiveMap, const std::shared_ptr< const common::Image > &_img) override
 Set the material emissive map.
 
virtual void SetEnvironmentMap (const std::string &_environmentMap, const std::shared_ptr< const common::Image > &_img) override
 Set the material environment map.
 
virtual void SetFragmentShader (const std::string &_path) override
 Set the fragment shader.
 
virtual void SetLightingEnabled (const bool _enabled) override
 Specify if lighting affects this material.
 
virtual void SetLightMap (const std::string &_lightMap, const std::shared_ptr< const common::Image > &_img, unsigned int _uvSet=0u) override
 Set the material light map from an image loaded in memory.
 
virtual void SetMetalness (const float _metalness) override
 Set the metalness value. Only affects material of type MT_PBS.
 
virtual void SetMetalnessMap (const std::string &_metalnessMap, const std::shared_ptr< const common::Image > &_img) override
 Set the material metalness map.
 
virtual void SetNormalMap (const std::string &_normalMap, const std::shared_ptr< const common::Image > &_img) override
 Set the material normal map.
 
virtual void SetReceiveShadows (const bool _receiveShadows) override
 Specify if this material receives shadows.
 
virtual void SetReflectionEnabled (const bool _enabled) override
 Specify if this material has a reflection.
 
virtual void SetReflectivity (const double _reflectivity) override
 Set the reflectivity value.
 
virtual void SetRenderOrder (const float _renderOrder) override
 Set the render order. When polygons are coplanar, you can get problems with 'depth fighting' where the pixels from the two polys compete for the same screen pixel. This param help to avoid this problem.
 
virtual void SetRoughness (const float _roughness) override
 Set the roughness value. Only affects material of type MT_PBS.
 
virtual void SetRoughnessMap (const std::string &_roughnessMap, const std::shared_ptr< const common::Image > &_img) override
 Set the material roughness map.
 
virtual void SetShaderType (enum ShaderType _type) override
 Set the ShaderType value.
 
virtual void SetShininess (const double _shininess) override
 Set the shininess value.
 
virtual void SetSpecular (const double _r, const double _g, const double _b, const double _a=1.0) override
 Set the specular color.
 
virtual void SetSpecular (const math::Color &_color) override
 Set the specular color.
 
virtual void SetTexture (const std::string &_texture, const std::shared_ptr< const common::Image > &_img) override
 Set the material texture.
 
virtual void SetTransparency (const double _transparency) override
 Set the transparency value.
 
virtual void SetVertexShader (const std::string &_path) override
 Set the vertex shader.
 
virtual enum ShaderType ShaderType () const override
 Get the ShaderType value.
 
virtual double Shininess () const override
 Get the shininess value.
 
virtual math::Color Specular () const override
 Get the specular color.
 
virtual std::string Texture () const override
 Get the URI of the texture file.
 
bool TextureAlphaEnabled () const override
 Get the enable alpha from textures.
 
virtual std::shared_ptr< const common::ImageTextureData () const override
 Get the texture data.
 
virtual double Transparency () const override
 Get the transparency value.
 
bool TwoSidedEnabled () const override
 Get the enable two sided rendering value.
 
virtual MaterialType Type () const override
 Removes any metalness map mapped to this material.
 
virtual std::string VertexShader () const override
 Get path to the vertex shader.
 
virtual ShaderParamsPtr VertexShaderParams () override
 Get params for the vertex shader.
 
- Public Member Functions inherited from Material
virtual ~Material ()
 Destructor.
 
virtual void SetEmissiveMap (const std::string &_emissiveMap)
 Set the material emissive map.
 
virtual void SetEnvironmentMap (const std::string &_environmentMap)
 Set the material environment map.
 
virtual void SetLightMap (const std::string &_lightMap, unsigned int _uvSet=0u)
 Set the material light map.
 
virtual void SetMetalnessMap (const std::string &_metalnessMap)
 Set the material metalness map.
 
virtual void SetNormalMap (const std::string &_normalMap)
 Set the material normal map.
 
virtual void SetRoughnessMap (const std::string &_roughnessMap)
 Set the material roughness map.
 
virtual void SetTexture (const std::string &_texture)
 Set the material texture.
 
- Public Member Functions inherited from Object
virtual ~Object ()
 Destructor.
 
virtual void Destroy ()=0
 Destroy any resources associated with this object. Invoking any other functions after destroying an object will result in undefined behavior.
 
virtual unsigned int Id () const =0
 Get the object ID. This ID will be unique across all objects inside a given scene, but necessarily true for objects across different scenes.
 
virtual std::string Name () const =0
 Get the object name. This name will be unique across all objects inside a given scene, but necessarily true for objects across different scenes.
 
virtual void PostRender ()=0
 Post process this object and any of its children after rendering.
 
virtual ScenePtr Scene () const =0
 Get the Scene that created this object.
 

Protected Member Functions

 BaseMaterial ()
 
virtual void Reset ()
 

Protected Attributes

double alphaThreshold = 0.5
 Threshold for alpha channel rejection.
 
math::Color ambient
 Ambient color.
 
bool castShadows = true
 Set to true to enable object with this material to cast shadows.
 
bool depthCheckEnabled = true
 Flag to indicate if depth buffer checking is enabled.
 
bool depthWriteEnabled = true
 Flag to indicate if depth buffer writing is enabled.
 
math::Color diffuse
 Diffuse color.
 
math::Color emissive
 Emissive color.
 
bool lightingEnabled = false
 Flag to indicate if dynamic lighting is enabled.
 
bool receiveShadows = true
 True if material receives shadows.
 
bool reflectionEnabled = false
 Flag to indicate if reflection is enabled.
 
double reflectivity = 0.0
 Reflectivity.
 
double renderOrder = 0.0
 Material render order.
 
double shininess = 0.0
 Shininess factor.
 
math::Color specular
 Specular color.
 
bool textureAlphaEnabled = false
 Enable alpha channel based texture transparency.
 
double transparency = 0.0
 Transparent. 1: fully transparent, 0: opaque.
 
bool twoSidedEnabled = false
 Enable two sided rendering.
 

Constructor & Destructor Documentation

◆ BaseMaterial()

template<class T >
BaseMaterial ( )
protected

◆ ~BaseMaterial()

template<class T >
~BaseMaterial ( )
virtual

Member Function Documentation

◆ AlphaThreshold()

template<class T >
double AlphaThreshold ( ) const
overridevirtual

Get the alpha threshold.

Returns
The alpha threshold value

Implements Material.

◆ Ambient()

template<class T >
math::Color Ambient ( ) const
overridevirtual

Get the ambient color.

Returns
The ambient color

Implements Material.

Reimplemented in OgreMaterial.

◆ CastShadows()

template<class T >
bool CastShadows ( ) const
overridevirtual

Determine if this material casts shadows.

Returns
True if this material casts shadows

Implements Material.

Reimplemented in OgreMaterial.

◆ ClearEmissiveMap()

template<class T >
void ClearEmissiveMap ( )
overridevirtual

Removes any emissive map mapped to this material.

Implements Material.

Reimplemented in Ogre2Material.

◆ ClearEnvironmentMap()

template<class T >
void ClearEnvironmentMap ( )
overridevirtual

Removes any environment map mapped to this material.

Implements Material.

Reimplemented in Ogre2Material.

◆ ClearLightMap()

template<class T >
void ClearLightMap ( )
overridevirtual

Removes any light map mapped to this material.

Implements Material.

Reimplemented in Ogre2Material.

◆ ClearMetalnessMap()

template<class T >
void ClearMetalnessMap ( )
overridevirtual

Removes any metalness map mapped to this material.

Implements Material.

Reimplemented in Ogre2Material.

◆ ClearNormalMap()

template<class T >
void ClearNormalMap ( )
overridevirtual

Removes any normal map mapped to this material.

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ ClearRoughnessMap()

template<class T >
void ClearRoughnessMap ( )
overridevirtual

Removes any roughness map mapped to this material.

Implements Material.

Reimplemented in Ogre2Material.

◆ ClearTexture()

template<class T >
void ClearTexture ( )
overridevirtual

Removes any texture mapped to this material.

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ Clone()

template<class T >
MaterialPtr Clone ( const std::string _name = "") const
overridevirtual

Clone this material.

Returns
New cloned material

Implements Material.

References std::dynamic_pointer_cast().

◆ CopyFrom() [1/2]

◆ CopyFrom() [2/2]

template<class T >
void CopyFrom ( ConstMaterialPtr  _material)
overridevirtual

Copy properties from given Material.

Parameters
[in]_materialSource Material to be copied from

Implements Material.

◆ DepthCheckEnabled()

template<class T >
bool DepthCheckEnabled ( ) const
overridevirtual

Determine if depth buffer checking is enabled.

Returns
True if depth check is enabled

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ DepthWriteEnabled()

template<class T >
bool DepthWriteEnabled ( ) const
overridevirtual

Determine if depth buffer writing is enabled.

Returns
True if depth buffer writing is enabled

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ Diffuse()

template<class T >
math::Color Diffuse ( ) const
overridevirtual

Get the diffuse color.

Returns
The diffuse color

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ Emissive()

template<class T >
math::Color Emissive ( ) const
overridevirtual

Get the emissive color.

Returns
The emissive color

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ EmissiveMap()

template<class T >
std::string EmissiveMap ( ) const
overridevirtual

Get the URI of the emissive map file.

Returns
URI of the emissive map file

Implements Material.

Reimplemented in Ogre2Material.

◆ EmissiveMapData()

template<class T >
std::shared_ptr< const common::Image > EmissiveMapData ( ) const
overridevirtual

Get the emissive map data.

Returns
Pointer to the common::Image with the data if the texture was loaded from memory

Implements Material.

Reimplemented in Ogre2Material.

◆ EnvironmentMap()

template<class T >
std::string EnvironmentMap ( ) const
overridevirtual

Get the URI of the environment map file.

Returns
URI of the environment map file

Implements Material.

Reimplemented in Ogre2Material.

◆ EnvironmentMapData()

template<class T >
std::shared_ptr< const common::Image > EnvironmentMapData ( ) const
overridevirtual

Get the environment map data.

Returns
Pointer to the common::Image with the data if the texture was loaded from memory

Implements Material.

Reimplemented in Ogre2Material.

◆ FragmentShader()

template<class T >
std::string FragmentShader ( ) const
overridevirtual

Get path to the fragment shader.

Returns
Path to fragment shader

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ FragmentShaderParams()

template<class T >
ShaderParamsPtr FragmentShaderParams ( )
overridevirtual

Get params for the fragment shader.

Returns
editable parameters

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ HasEmissiveMap()

template<class T >
bool HasEmissiveMap ( ) const
overridevirtual

Determine if this material has an emissive map.

Returns
True if this material has an emissive map

Implements Material.

Reimplemented in Ogre2Material.

◆ HasEnvironmentMap()

template<class T >
bool HasEnvironmentMap ( ) const
overridevirtual

Determine if this material has a environment map.

Returns
True if this material has a environment map

Implements Material.

Reimplemented in Ogre2Material.

◆ HasLightMap()

template<class T >
bool HasLightMap ( ) const
overridevirtual

Determine if this material has a light map.

Returns
True if this material has a light map

Implements Material.

Reimplemented in Ogre2Material.

◆ HasMetalnessMap()

template<class T >
bool HasMetalnessMap ( ) const
overridevirtual

Determine if this material has a metalness map.

Returns
True if this material has a metalness map

Implements Material.

Reimplemented in Ogre2Material.

◆ HasNormalMap()

template<class T >
bool HasNormalMap ( ) const
overridevirtual

Determine if this material has a normal map.

Returns
True if this material has a normal map

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ HasRoughnessMap()

template<class T >
bool HasRoughnessMap ( ) const
overridevirtual

Determine if this material has a roughness map.

Returns
True if this material has a roughness map

Implements Material.

Reimplemented in Ogre2Material.

◆ HasTexture()

template<class T >
bool HasTexture ( ) const
overridevirtual

Determine if this material has a texture.

Returns
True if this material has a texture

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ LightingEnabled()

template<class T >
bool LightingEnabled ( ) const
overridevirtual

Determine if lighting affects this material.

Returns
True if lighting affects this material

Implements Material.

Reimplemented in OgreMaterial.

◆ LightMap()

template<class T >
std::string LightMap ( ) const
overridevirtual

Get the URI of the light map file.

Returns
URI of the light map file

Implements Material.

Reimplemented in Ogre2Material.

◆ LightMapData()

template<class T >
std::shared_ptr< const common::Image > LightMapData ( ) const
overridevirtual

Get the light map data.

Returns
Pointer to the common::Image with the data if the texture was loaded from memory

Implements Material.

Reimplemented in Ogre2Material.

◆ LightMapTexCoordSet()

template<class T >
unsigned int LightMapTexCoordSet ( ) const
overridevirtual

Get the texture coordinate set used by lightmap.

Returns
texture coordinate set of the light map

Implements Material.

Reimplemented in Ogre2Material.

◆ Metalness()

template<class T >
float Metalness ( ) const
overridevirtual

Get the metalness value of this material.

Returns
Material metalness

Implements Material.

Reimplemented in Ogre2Material.

◆ MetalnessMap()

template<class T >
std::string MetalnessMap ( ) const
overridevirtual

Get the URI of the metalness map file.

Returns
URI of the metalness map file

Implements Material.

Reimplemented in Ogre2Material.

◆ MetalnessMapData()

template<class T >
std::shared_ptr< const common::Image > MetalnessMapData ( ) const
overridevirtual

Get the metalness map data.

Returns
Pointer to the common::Image with the data if the texture was loaded from memory

Implements Material.

Reimplemented in Ogre2Material.

◆ NormalMap()

template<class T >
std::string NormalMap ( ) const
overridevirtual

Get the URI of the normal map file.

Returns
URI of the normal map file

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ NormalMapData()

template<class T >
std::shared_ptr< const common::Image > NormalMapData ( ) const
overridevirtual

Get the normal map data.

Returns
Pointer to the common::Image with the data if the texture was loaded from memory

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ PreRender()

template<class T >
void PreRender ( )
overridevirtual

Prepare this object and any of its children for rendering. This should be called for each object in a scene just before rendering, which can be achieved by a single call to Scene::PreRender.

Implements Object.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ ReceiveShadows()

template<class T >
bool ReceiveShadows ( ) const
overridevirtual

Determine if this material receives shadows.

Returns
True if this material receives shadows

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ ReflectionEnabled()

template<class T >
bool ReflectionEnabled ( ) const
overridevirtual

Determine if this material has a reflection.

Returns
True if this material has a reflection

Implements Material.

Reimplemented in OgreMaterial.

◆ Reflectivity()

template<class T >
double Reflectivity ( ) const
overridevirtual

Get the reflectivity value.

Returns
The reflectivity value

Implements Material.

Reimplemented in OgreMaterial.

◆ RenderOrder()

template<class T >
float RenderOrder ( ) const
overridevirtual

Get the render order value of this material.

Returns
Material render order

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ Reset()

template<class T >
void Reset ( )
protectedvirtual

◆ Roughness()

template<class T >
float Roughness ( ) const
overridevirtual

Get the roughness value of this material.

Returns
Material roughness

Implements Material.

Reimplemented in Ogre2Material.

◆ RoughnessMap()

template<class T >
std::string RoughnessMap ( ) const
overridevirtual

Get the URI of the roughness map file.

Returns
URI of the roughness map file

Implements Material.

Reimplemented in Ogre2Material.

◆ RoughnessMapData()

template<class T >
std::shared_ptr< const common::Image > RoughnessMapData ( ) const
overridevirtual

Get the roughness map data.

Returns
Pointer to the common::Image with the data if the texture was loaded from memory

Implements Material.

Reimplemented in Ogre2Material.

◆ SetAlphaFromTexture()

template<class T >
void SetAlphaFromTexture ( bool  _enabled,
double  _alpha = 0.5,
bool  _twoSided = true 
)
overridevirtual

Set the material to use the alpha channel from the textures.

Parameters
[in]_enabledEnable alpha channel based rendering
[in]_alphaSet the alpha threshold value
[in]_twoSidedEnable two sided rendering

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ SetAmbient() [1/2]

template<class T >
void SetAmbient ( const double  _r,
const double  _g,
const double  _b,
const double  _a = 1.0 
)
overridevirtual

Set the ambient color.

Parameters
[in]_rRed value
[in]_gGreen value
[in]_bBlue value
[in]_aAlpha value

Implements Material.

◆ SetAmbient() [2/2]

template<class T >
void SetAmbient ( const math::Color _color)
overridevirtual

Set the ambient color.

Parameters
[in]_colorNew ambient color

Implements Material.

Reimplemented in OgreMaterial.

◆ SetCastShadows()

template<class T >
void SetCastShadows ( const bool  _castShadows)
overridevirtual

Specify if this material casts shadows.

Parameters
[in]_castShadowsTrue if this material casts shadows

Implements Material.

Reimplemented in OgreMaterial.

◆ SetDepthCheckEnabled()

template<class T >
void SetDepthCheckEnabled ( bool  _enabled)
overridevirtual

Specify if depth buffer checking is enabled.

Parameters
[in]_enabledTrue if depth check is enabled

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ SetDepthMaterial()

template<class T >
void SetDepthMaterial ( const double  far,
const double  near 
)
overridevirtual

Configuration for Depth Material.

Parameters
[in]farFar distance for normalized output
[in]nearNear distance for normalized output

Implements Material.

Reimplemented in OgreMaterial.

◆ SetDepthWriteEnabled()

template<class T >
void SetDepthWriteEnabled ( bool  _enabled)
overridevirtual

Specify if depth buffer writing is enabled.

Parameters
[in]_enabledTrue if depth buffer writing is enabled

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ SetDiffuse() [1/2]

template<class T >
void SetDiffuse ( const double  _r,
const double  _g,
const double  _b,
const double  _a = 1.0 
)
overridevirtual

Set the diffuse color.

Parameters
[in]_rRed value
[in]_gGreen value
[in]_bBlue value
[in]_aAlpha value

Implements Material.

◆ SetDiffuse() [2/2]

template<class T >
void SetDiffuse ( const math::Color _color)
overridevirtual

Set the diffuse color.

Parameters
[in]_colorNew diffuse color

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ SetEmissive() [1/2]

template<class T >
void SetEmissive ( const double  _r,
const double  _g,
const double  _b,
const double  _a = 1.0 
)
overridevirtual

Set the emissive color.

Parameters
[in]_rRed value
[in]_gGreen value
[in]_bBlue value
[in]_aAlpha value

Implements Material.

◆ SetEmissive() [2/2]

template<class T >
void SetEmissive ( const math::Color _color)
overridevirtual

Set the emissive color.

Parameters
[in]_colorNew emissive color

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ SetEmissiveMap()

template<class T >
void SetEmissiveMap ( const std::string _emissiveMap,
const std::shared_ptr< const common::Image > &  _img 
)
overridevirtual

Set the material emissive map.

Parameters
[in]_emissiveMapMap URI of the new emissive map file, or identifying name if map was set from raw data
[in]_imgImage data, nullptr if the image should be loaded from a file

Reimplemented from Material.

Reimplemented in Ogre2Material.

◆ SetEnvironmentMap()

template<class T >
void SetEnvironmentMap ( const std::string _environmentMap,
const std::shared_ptr< const common::Image > &  _img 
)
overridevirtual

Set the material environment map.

Parameters
[in]_environmentMapURI of the new environment map file, or identifying name if map was set from raw data
[in]_imgImage data, nullptr if the image should be loaded from a file

Reimplemented from Material.

Reimplemented in Ogre2Material.

◆ SetFragmentShader()

template<class T >
void SetFragmentShader ( const std::string _path)
overridevirtual

Set the fragment shader.

Parameters
[in]_pathpath to a file containing a glsl shader

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ SetLightingEnabled()

template<class T >
void SetLightingEnabled ( const bool  _enabled)
overridevirtual

Specify if lighting affects this material.

Parameters
[in]_enabledTrue if lighting affects this material

Implements Material.

Reimplemented in OgreMaterial.

◆ SetLightMap()

template<class T >
void SetLightMap ( const std::string _lightMap,
const std::shared_ptr< const common::Image > &  _img,
unsigned int  _uvSet = 0u 
)
overridevirtual

Set the material light map from an image loaded in memory.

Parameters
[in]_lightMapURI of the new light map file
[in]_imgImage data, nullptr if the image should be loaded from a file
[in]_uvSetTexture coordinate set to use

Reimplemented from Material.

Reimplemented in Ogre2Material.

◆ SetMetalness()

template<class T >
void SetMetalness ( const float  _metalness)
overridevirtual

Set the metalness value. Only affects material of type MT_PBS.

Parameters
[in]_metalnessMetalness to set to

Implements Material.

Reimplemented in Ogre2Material.

◆ SetMetalnessMap()

template<class T >
void SetMetalnessMap ( const std::string _metalnessMap,
const std::shared_ptr< const common::Image > &  _img 
)
overridevirtual

Set the material metalness map.

Parameters
[in]_metalnessMapURI of the new metalness map file, or identifying name if map was set from raw data
[in]_imgImage data, nullptr if the image should be loaded from a file

Reimplemented from Material.

Reimplemented in Ogre2Material.

◆ SetNormalMap()

template<class T >
void SetNormalMap ( const std::string _normalMap,
const std::shared_ptr< const common::Image > &  _img 
)
overridevirtual

Set the material normal map.

Parameters
[in]_normalMapURI of the new normal map file, or identifying name if map was set from raw data
[in]_imgImage data, nullptr if the image should be loaded from a file

Reimplemented from Material.

Reimplemented in Ogre2Material, and OgreMaterial.

◆ SetReceiveShadows()

template<class T >
void SetReceiveShadows ( const bool  _receiveShadows)
overridevirtual

Specify if this material receives shadows.

Parameters
[in]_receiveShadowsTrue if this material receives shadows

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ SetReflectionEnabled()

template<class T >
void SetReflectionEnabled ( const bool  _enabled)
overridevirtual

Specify if this material has a reflection.

Parameters
[in]_enabledTrue if this material has a reflection

Implements Material.

Reimplemented in OgreMaterial.

◆ SetReflectivity()

template<class T >
void SetReflectivity ( const double  _reflectivity)
overridevirtual

Set the reflectivity value.

Parameters
[in]_reflectivityNew reflectivity value

Implements Material.

Reimplemented in OgreMaterial.

◆ SetRenderOrder()

template<class T >
void SetRenderOrder ( const float  _renderOrder)
overridevirtual

Set the render order. When polygons are coplanar, you can get problems with 'depth fighting' where the pixels from the two polys compete for the same screen pixel. This param help to avoid this problem.

Parameters
[in]_renderOrderRender order to set to

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ SetRoughness()

template<class T >
void SetRoughness ( const float  _roughness)
overridevirtual

Set the roughness value. Only affects material of type MT_PBS.

Parameters
[in]_roughnessRoughness to set to

Implements Material.

Reimplemented in Ogre2Material.

◆ SetRoughnessMap()

template<class T >
void SetRoughnessMap ( const std::string _roughnessMap,
const std::shared_ptr< const common::Image > &  _img 
)
overridevirtual

Set the material roughness map.

Parameters
[in]_roughnessMapURI of the new roughness map file, or identifying name if map was set from raw data
[in]_imgImage data, nullptr if the image should be loaded from a file

Reimplemented from Material.

Reimplemented in Ogre2Material.

◆ SetShaderType()

template<class T >
virtual void SetShaderType ( enum ShaderType  _type)
inlineoverridevirtual

Set the ShaderType value.

Parameters
[in]_typeNew ShaderType value

Implements Material.

Reimplemented in OgreMaterial.

◆ SetShininess()

template<class T >
void SetShininess ( const double  _shininess)
overridevirtual

Set the shininess value.

Parameters
[in]_shininessNew shininess value

Implements Material.

Reimplemented in OgreMaterial.

◆ SetSpecular() [1/2]

template<class T >
void SetSpecular ( const double  _r,
const double  _g,
const double  _b,
const double  _a = 1.0 
)
overridevirtual

Set the specular color.

Parameters
[in]_rRed value
[in]_gGreen value
[in]_bBlue value
[in]_aAlpha value

Implements Material.

◆ SetSpecular() [2/2]

template<class T >
void SetSpecular ( const math::Color _color)
overridevirtual

Set the specular color.

Parameters
[in]_colorNew specular color

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ SetTexture()

template<class T >
void SetTexture ( const std::string _texture,
const std::shared_ptr< const common::Image > &  _img 
)
overridevirtual

Set the material texture.

Parameters
[in]_textureURI of the new texture file or identifying name if _img is set
[in]_imgImage data, nullptr if the image should be loaded from a file

Reimplemented from Material.

Reimplemented in Ogre2Material, and OgreMaterial.

◆ SetTransparency()

template<class T >
void SetTransparency ( const double  _transparency)
overridevirtual

Set the transparency value.

Parameters
[in]_transparencyNew transparency value

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ SetVertexShader()

template<class T >
void SetVertexShader ( const std::string _path)
overridevirtual

Set the vertex shader.

Parameters
[in]_pathpath to a file containing a glsl shader

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ ShaderType()

template<class T >
virtual enum ShaderType ShaderType ( ) const
inlineoverridevirtual

Get the ShaderType value.

Returns
The ShaderType value

Implements Material.

Reimplemented in OgreMaterial.

References gz::rendering::ST_PIXEL.

◆ Shininess()

template<class T >
double Shininess ( ) const
overridevirtual

Get the shininess value.

Returns
The shininess value

Implements Material.

Reimplemented in OgreMaterial.

◆ Specular()

template<class T >
math::Color Specular ( ) const
overridevirtual

Get the specular color.

Returns
The specular color

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ Texture()

template<class T >
std::string Texture ( ) const
overridevirtual

Get the URI of the texture file.

Returns
URI of the texture file

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ TextureAlphaEnabled()

template<class T >
bool TextureAlphaEnabled ( ) const
overridevirtual

Get the enable alpha from textures.

Returns
The enable alpha value

Implements Material.

◆ TextureData()

template<class T >
std::shared_ptr< const common::Image > TextureData ( ) const
overridevirtual

Get the texture data.

Returns
Pointer to the common::Image with the data if the texture was loaded from memory

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ Transparency()

template<class T >
double Transparency ( ) const
overridevirtual

Get the transparency value.

Returns
The transparency value

Implements Material.

Reimplemented in OgreMaterial.

◆ TwoSidedEnabled()

template<class T >
bool TwoSidedEnabled ( ) const
overridevirtual

Get the enable two sided rendering value.

Returns
The enable two sided rendering value

Implements Material.

◆ Type()

template<class T >
MaterialType Type ( ) const
overridevirtual

Removes any metalness map mapped to this material.

Implements Material.

Reimplemented in Ogre2Material.

References gz::rendering::MT_CLASSIC.

◆ VertexShader()

template<class T >
std::string VertexShader ( ) const
overridevirtual

Get path to the vertex shader.

Returns
Path to vertex shader

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ VertexShaderParams()

template<class T >
ShaderParamsPtr VertexShaderParams ( )
overridevirtual

Get params for the vertex shader.

Returns
editable parameters

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

Member Data Documentation

◆ alphaThreshold

template<class T >
double alphaThreshold = 0.5
protected

Threshold for alpha channel rejection.

◆ ambient

template<class T >
math::Color ambient
protected

Ambient color.

◆ castShadows

template<class T >
bool castShadows = true
protected

Set to true to enable object with this material to cast shadows.

◆ depthCheckEnabled

template<class T >
bool depthCheckEnabled = true
protected

Flag to indicate if depth buffer checking is enabled.

◆ depthWriteEnabled

template<class T >
bool depthWriteEnabled = true
protected

Flag to indicate if depth buffer writing is enabled.

◆ diffuse

template<class T >
math::Color diffuse
protected

Diffuse color.

◆ emissive

template<class T >
math::Color emissive
protected

Emissive color.

◆ lightingEnabled

template<class T >
bool lightingEnabled = false
protected

Flag to indicate if dynamic lighting is enabled.

◆ receiveShadows

template<class T >
bool receiveShadows = true
protected

True if material receives shadows.

◆ reflectionEnabled

template<class T >
bool reflectionEnabled = false
protected

Flag to indicate if reflection is enabled.

◆ reflectivity

template<class T >
double reflectivity = 0.0
protected

Reflectivity.

◆ renderOrder

template<class T >
double renderOrder = 0.0
protected

Material render order.

◆ shininess

template<class T >
double shininess = 0.0
protected

Shininess factor.

◆ specular

template<class T >
math::Color specular
protected

Specular color.

◆ textureAlphaEnabled

template<class T >
bool textureAlphaEnabled = false
protected

Enable alpha channel based texture transparency.

◆ transparency

template<class T >
double transparency = 0.0
protected

Transparent. 1: fully transparent, 0: opaque.

◆ twoSidedEnabled

template<class T >
bool twoSidedEnabled = false
protected

Enable two sided rendering.


The documentation for this class was generated from the following file: