Gazebo Rendering

API Reference

8.2.1

Ogre 2.x implementation of the material class. More...

#include <Ogre2Material.hh>

Public Member Functions

virtual ~Ogre2Material ()
 Destructor. More...
 
virtual void ClearEmissiveMap () override
 Removes any emissive map mapped to this material. More...
 
virtual void ClearEnvironmentMap () override
 Removes any environment map mapped to this material. More...
 
virtual void ClearLightMap () override
 Removes any light map mapped to this material. More...
 
virtual void ClearMetalnessMap () override
 Removes any metalness map mapped to this material. More...
 
virtual void ClearNormalMap () override
 Removes any normal map mapped to this material. More...
 
virtual void ClearRoughnessMap () override
 Removes any roughness map mapped to this material. More...
 
virtual void ClearTexture () override
 Removes any texture mapped to this material. More...
 
virtual Ogre::HlmsPbsDatablock * Datablock () const
 Return ogre Hlms material pbs datablock. More...
 
virtual bool DepthCheckEnabled () const override
 Determine if depth buffer checking is enabled. More...
 
virtual bool DepthWriteEnabled () const override
 Determine if depth buffer writing is enabled. More...
 
virtual void Destroy () override
 
virtual math::Color Diffuse () const override
 Get the diffuse color. More...
 
virtual math::Color Emissive () const override
 Get the emissive color. More...
 
virtual std::string EmissiveMap () const override
 Get the URI of the emissive map file. More...
 
virtual std::shared_ptr< const common::ImageEmissiveMapData () const override
 Get the emissive map data. More...
 
virtual std::string EnvironmentMap () const override
 Get the URI of the environment map file. More...
 
virtual std::shared_ptr< const common::ImageEnvironmentMapData () const override
 Get the environment map data. More...
 
virtual void FillUnlitDatablock (Ogre::HlmsUnlitDatablock *_datablock) const
 Fill the input unlit datablock with current material properties from the pbs datablock. More...
 
virtual std::string FragmentShader () const override
 Get path to the fragment shader. More...
 
virtual ShaderParamsPtr FragmentShaderParams () override
 Get params for the fragment shader. More...
 
virtual bool HasEmissiveMap () const override
 Determine if this material has an emissive map. More...
 
virtual bool HasEnvironmentMap () const override
 Determine if this material has a environment map. More...
 
virtual bool HasLightMap () const override
 Determine if this material has a light map. More...
 
virtual bool HasMetalnessMap () const override
 Determine if this material has a metalness map. More...
 
virtual bool HasNormalMap () const override
 Determine if this material has a normal map. More...
 
virtual bool HasRoughnessMap () const override
 Determine if this material has a roughness map. More...
 
virtual bool HasTexture () const override
 Determine if this material has a texture. More...
 
virtual std::string LightMap () const override
 Get the URI of the light map file. More...
 
virtual std::shared_ptr< const common::ImageLightMapData () const override
 Get the light map data. More...
 
virtual unsigned int LightMapTexCoordSet () const override
 Get the texture coordinate set used by lightmap. More...
 
virtual Ogre::MaterialPtr Material ()
 Return ogre low level material. More...
 
virtual float Metalness () const override
 Get the metalness value of this material. More...
 
virtual std::string MetalnessMap () const override
 Get the URI of the metalness map file. More...
 
virtual std::shared_ptr< const common::ImageMetalnessMapData () const override
 Get the metalness map data. More...
 
virtual std::string NormalMap () const override
 Get the URI of the normal map file. More...
 
virtual std::shared_ptr< const common::ImageNormalMapData () const override
 Get the normal map data. More...
 
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. More...
 
virtual bool ReceiveShadows () const override
 Determine if this material receives shadows. More...
 
virtual float RenderOrder () const override
 Get the render order value of this material. More...
 
virtual float Roughness () const override
 Get the roughness value of this material. More...
 
virtual std::string RoughnessMap () const override
 Get the URI of the roughness map file. More...
 
virtual std::shared_ptr< const common::ImageRoughnessMapData () const override
 Get the roughness map data. More...
 
virtual void SetAlphaFromTexture (bool _enabled, double _alpha=0.5, bool _twoSided=true) override
 Set the material to use the alpha channel from the textures. More...
 
virtual void SetDepthCheckEnabled (bool _enabled) override
 Specify if depth buffer checking is enabled. More...
 
virtual void SetDepthWriteEnabled (bool _enabled) override
 Specify if depth buffer writing is enabled. More...
 
virtual void SetDiffuse (const math::Color &_color) override
 Set the diffuse color. More...
 
virtual void SetEmissive (const math::Color &_color) override
 Set the emissive color. More...
 
virtual void SetEmissiveMap (const std::string &_emissiveMap, const std::shared_ptr< const common::Image > &_img) override
 Set the material emissive map. More...
 
virtual void SetEnvironmentMap (const std::string &_environmentMap, const std::shared_ptr< const common::Image > &_img) override
 Set the material environment map. More...
 
virtual void SetFragmentShader (const std::string &_path) override
 Set the fragment shader. More...
 
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. More...
 
virtual void SetMetalness (const float _roughness) override
 Set the metalness value. Only affects material of type MT_PBS. More...
 
virtual void SetMetalnessMap (const std::string &_metalnessMap, const std::shared_ptr< const common::Image > &_img) override
 Set the material metalness map. More...
 
virtual void SetNormalMap (const std::string &_normalMap, const std::shared_ptr< const common::Image > &_img) override
 Set the material normal map. More...
 
virtual void SetReceiveShadows (const bool _receiveShadows) override
 Specify if this material receives shadows. More...
 
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. More...
 
virtual void SetRoughness (const float _roughness) override
 Set the roughness value. Only affects material of type MT_PBS. More...
 
virtual void SetRoughnessMap (const std::string &_roughnessMap, const std::shared_ptr< const common::Image > &_img) override
 Set the material roughness map. More...
 
virtual void SetSpecular (const math::Color &_color) override
 Set the specular color. More...
 
virtual void SetTexture (const std::string &_texture, const std::shared_ptr< const common::Image > &_img) override
 Set the material texture. More...
 
virtual void SetTransparency (const double _transparency) override
 Set the transparency value. More...
 
virtual void SetVertexShader (const std::string &_path) override
 Set the vertex shader. More...
 
virtual math::Color Specular () const override
 Get the specular color. More...
 
virtual std::string Texture () const override
 Get the URI of the texture file. More...
 
virtual std::shared_ptr< const common::ImageTextureData () const override
 Get the texture data. More...
 
virtual enum MaterialType Type () const override
 Removes any metalness map mapped to this material. More...
 
virtual Ogre::HlmsUnlitDatablock * UnlitDatablock ()
 Return ogre Hlms material unlit datablock. More...
 
virtual std::string VertexShader () const override
 Get path to the vertex shader. More...
 
virtual ShaderParamsPtr VertexShaderParams () override
 Get params for the vertex shader. More...
 
- Public Member Functions inherited from BaseMaterial< Ogre2Object >
virtual ~BaseMaterial ()
 
double AlphaThreshold () const override
 Get the alpha threshold. More...
 
virtual math::Color Ambient () const override
 Get the ambient color. More...
 
virtual bool CastShadows () const override
 Determine if this material casts shadows. More...
 
virtual MaterialPtr Clone (const std::string &_name="") const override
 Clone this material. More...
 
virtual void CopyFrom (const common::Material &_material) override
 Copy properties from given Material. More...
 
virtual void CopyFrom (ConstMaterialPtr _material) override
 Copy properties from given Material. More...
 
virtual bool LightingEnabled () const override
 Determine if lighting affects this material. More...
 
virtual bool ReflectionEnabled () const override
 Determine if this material has a reflection. More...
 
virtual double Reflectivity () const override
 Get the reflectivity value. More...
 
virtual void SetAmbient (const double _r, const double _g, const double _b, const double _a=1.0) override
 Set the ambient color. More...
 
virtual void SetAmbient (const math::Color &_color) override
 Set the ambient color. More...
 
virtual void SetCastShadows (const bool _castShadows) override
 Specify if this material casts shadows. More...
 
virtual void SetDepthMaterial (const double far, const double near) override
 Configuration for Depth Material. More...
 
virtual void SetDiffuse (const double _r, const double _g, const double _b, const double _a=1.0) override
 Set the diffuse color. More...
 
virtual void SetEmissive (const double _r, const double _g, const double _b, const double _a=1.0) override
 Set the emissive color. More...
 
virtual void SetLightingEnabled (const bool _enabled) override
 Specify if lighting affects this material. More...
 
virtual void SetReflectionEnabled (const bool _enabled) override
 Specify if this material has a reflection. More...
 
virtual void SetReflectivity (const double _reflectivity) override
 Set the reflectivity value. More...
 
virtual void SetShaderType (enum ShaderType _type) override
 Set the ShaderType value. More...
 
virtual void SetShininess (const double _shininess) override
 Set the shininess value. More...
 
virtual void SetSpecular (const double _r, const double _g, const double _b, const double _a=1.0) override
 Set the specular color. More...
 
virtual enum ShaderType ShaderType () const override
 Get the ShaderType value. More...
 
virtual double Shininess () const override
 Get the shininess value. More...
 
bool TextureAlphaEnabled () const override
 Get the enable alpha from textures. More...
 
virtual double Transparency () const override
 Get the transparency value. More...
 
bool TwoSidedEnabled () const override
 Get the enable two sided rendering value. More...
 
- Public Member Functions inherited from Material
virtual ~Material ()
 Destructor. More...
 
virtual void SetEmissiveMap (const std::string &_emissiveMap)
 Set the material emissive map. More...
 
virtual void SetEnvironmentMap (const std::string &_environmentMap)
 Set the material environment map. More...
 
virtual void SetLightMap (const std::string &_lightMap, unsigned int _uvSet=0u)
 Set the material light map. More...
 
virtual void SetMetalnessMap (const std::string &_metalnessMap)
 Set the material metalness map. More...
 
virtual void SetNormalMap (const std::string &_normalMap)
 Set the material normal map. More...
 
virtual void SetRoughnessMap (const std::string &_roughnessMap)
 Set the material roughness map. More...
 
virtual void SetTexture (const std::string &_texture)
 Set the material texture. More...
 
- Public Member Functions inherited from Object
virtual ~Object ()
 Destructor. More...
 
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. More...
 
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. More...
 
virtual void PostRender ()=0
 Post process this object and any of its children after rendering. More...
 
virtual ScenePtr Scene () const =0
 Get the Scene that created this object. More...
 
- Public Member Functions inherited from Ogre2Object
virtual ~Ogre2Object ()
 Destructor. More...
 
virtual ScenePtr Scene () const override
 
- Public Member Functions inherited from BaseObject
virtual ~BaseObject ()
 
virtual unsigned int Id () const override
 
virtual std::string Name () const override
 
virtual void PostRender () override
 

Protected Member Functions

 Ogre2Material ()
 Constructor. More...
 
virtual void Init () override
 
void SetTextureMapDataImpl (const std::string &_texture, const std::shared_ptr< const common::Image > &_img, Ogre::PbsTextureTypes _type)
 Set the texture map for this material from an image loaded in memory. More...
 
virtual void SetTextureMapImpl (const std::string &_texture, Ogre::PbsTextureTypes _type)
 Set the texture map for this material. More...
 
virtual Ogre::TextureGpu * Texture (const std::string &_name)
 Get a pointer to the ogre texture by name. More...
 
void UpdateShaderParams ()
 bind shader parameters that have changed More...
 
void UpdateShaderParams (ConstShaderParamsPtr _params, Ogre::GpuProgramParametersSharedPtr _ogreParams)
 Transfer params from gz-rendering type to ogre type. More...
 
virtual void UpdateTransparency ()
 Updates the material transparency in the engine, based on transparency and diffuse alpha values. More...
 
- Protected Member Functions inherited from BaseMaterial< Ogre2Object >
 BaseMaterial ()
 
virtual void Reset ()
 
- Protected Member Functions inherited from Ogre2Object
 Ogre2Object ()
 Constructor. More...
 
- Protected Member Functions inherited from BaseObject
 BaseObject ()
 
virtual void Load ()
 

Protected Attributes

std::string emissiveMapName
 Name of the emissive map. More...
 
std::string environmentMapName
 Name of the environment map. More...
 
std::string lightMapName
 Name of the light map. More...
 
unsigned int lightMapUvSet = 0u
 Texture coorindate set used by the light map. More...
 
std::string metalnessMapName
 Name of the metalness map. More...
 
std::string normalMapName
 Name of the normal map. More...
 
Ogre::HlmsPbsDatablock * ogreDatablock = nullptr
 Ogre data block containing all pbs material properties. More...
 
std::string ogreDatablockId
 Unique id assigned to ogre hlms datablock. More...
 
Ogre::HlmsPbs * ogreHlmsPbs = nullptr
 Ogre high level physical based shading object. More...
 
Ogre::MaterialPtr ogreMaterial
 Ogre material. Mainly used for render targets. More...
 
Ogre::HlmsUnlitDatablock * ogreUnlitDatablock = nullptr
 Ogre data block containing all unlit material properties. More...
 
std::string roughnessMapName
 Name of the roughness map. More...
 
std::string textureName
 Name of the texture. More...
 
- Protected Attributes inherited from BaseMaterial< Ogre2Object >
double alphaThreshold
 Threshold for alpha channel rejection. More...
 
math::Color ambient
 Ambient color. More...
 
bool castShadows
 Set to true to enable object with this material to cast shadows. More...
 
bool depthCheckEnabled
 Flag to indicate if depth buffer checking is enabled. More...
 
bool depthWriteEnabled
 Flag to indicate if depth buffer writing is enabled. More...
 
math::Color diffuse
 Diffuse color. More...
 
math::Color emissive
 Emissive color. More...
 
bool lightingEnabled
 Flag to indicate if dynamic lighting is enabled. More...
 
bool receiveShadows
 True if material receives shadows. More...
 
bool reflectionEnabled
 Flag to indicate if reflection is enabled. More...
 
double reflectivity
 Reflectivity. More...
 
double renderOrder
 Material render order. More...
 
double shininess
 Shininess factor. More...
 
math::Color specular
 Specular color. More...
 
bool textureAlphaEnabled
 Enable alpha channel based texture transparency. More...
 
double transparency
 Transparent. 1: fully transparent, 0: opaque. More...
 
bool twoSidedEnabled
 Enable two sided rendering. More...
 
- Protected Attributes inherited from Ogre2Object
Ogre2ScenePtr scene
 Pointer to the ogre scene. More...
 
- Protected Attributes inherited from BaseObject
unsigned int id
 
std::string name
 

Detailed Description

Ogre 2.x implementation of the material class.

Constructor & Destructor Documentation

◆ Ogre2Material()

Ogre2Material ( )
protected

Constructor.

◆ ~Ogre2Material()

virtual ~Ogre2Material ( )
virtual

Destructor.

Member Function Documentation

◆ ClearEmissiveMap()

virtual void ClearEmissiveMap ( )
overridevirtual

Removes any emissive map mapped to this material.

Reimplemented from BaseMaterial< Ogre2Object >.

◆ ClearEnvironmentMap()

virtual void ClearEnvironmentMap ( )
overridevirtual

Removes any environment map mapped to this material.

Reimplemented from BaseMaterial< Ogre2Object >.

◆ ClearLightMap()

virtual void ClearLightMap ( )
overridevirtual

Removes any light map mapped to this material.

Reimplemented from BaseMaterial< Ogre2Object >.

◆ ClearMetalnessMap()

virtual void ClearMetalnessMap ( )
overridevirtual

Removes any metalness map mapped to this material.

Reimplemented from BaseMaterial< Ogre2Object >.

◆ ClearNormalMap()

virtual void ClearNormalMap ( )
overridevirtual

Removes any normal map mapped to this material.

Reimplemented from BaseMaterial< Ogre2Object >.

◆ ClearRoughnessMap()

virtual void ClearRoughnessMap ( )
overridevirtual

Removes any roughness map mapped to this material.

Reimplemented from BaseMaterial< Ogre2Object >.

◆ ClearTexture()

virtual void ClearTexture ( )
overridevirtual

Removes any texture mapped to this material.

Reimplemented from BaseMaterial< Ogre2Object >.

◆ Datablock()

virtual Ogre::HlmsPbsDatablock* Datablock ( ) const
virtual

Return ogre Hlms material pbs datablock.

Returns
Ogre Hlms pbs datablock

◆ DepthCheckEnabled()

virtual bool DepthCheckEnabled ( ) const
overridevirtual

Determine if depth buffer checking is enabled.

Returns
True if depth check is enabled

Reimplemented from BaseMaterial< Ogre2Object >.

◆ DepthWriteEnabled()

virtual bool DepthWriteEnabled ( ) const
overridevirtual

Determine if depth buffer writing is enabled.

Returns
True if depth buffer writing is enabled

Reimplemented from BaseMaterial< Ogre2Object >.

◆ Destroy()

virtual void Destroy ( )
overridevirtual

Reimplemented from BaseObject.

◆ Diffuse()

virtual math::Color Diffuse ( ) const
overridevirtual

Get the diffuse color.

Returns
The diffuse color

Reimplemented from BaseMaterial< Ogre2Object >.

◆ Emissive()

virtual math::Color Emissive ( ) const
overridevirtual

Get the emissive color.

Returns
The emissive color

Reimplemented from BaseMaterial< Ogre2Object >.

◆ EmissiveMap()

virtual std::string EmissiveMap ( ) const
overridevirtual

Get the URI of the emissive map file.

Returns
URI of the emissive map file

Reimplemented from BaseMaterial< Ogre2Object >.

◆ EmissiveMapData()

virtual 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

Reimplemented from BaseMaterial< Ogre2Object >.

◆ EnvironmentMap()

virtual std::string EnvironmentMap ( ) const
overridevirtual

Get the URI of the environment map file.

Returns
URI of the environment map file

Reimplemented from BaseMaterial< Ogre2Object >.

◆ EnvironmentMapData()

virtual 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

Reimplemented from BaseMaterial< Ogre2Object >.

◆ FillUnlitDatablock()

virtual void FillUnlitDatablock ( Ogre::HlmsUnlitDatablock *  _datablock) const
virtual

Fill the input unlit datablock with current material properties from the pbs datablock.

Parameters
[in]_datablockUnlit datablock to fill

◆ FragmentShader()

virtual std::string FragmentShader ( ) const
overridevirtual

Get path to the fragment shader.

Returns
Path to fragment shader

Reimplemented from BaseMaterial< Ogre2Object >.

◆ FragmentShaderParams()

virtual ShaderParamsPtr FragmentShaderParams ( )
overridevirtual

Get params for the fragment shader.

Returns
editable parameters

Reimplemented from BaseMaterial< Ogre2Object >.

◆ HasEmissiveMap()

virtual bool HasEmissiveMap ( ) const
overridevirtual

Determine if this material has an emissive map.

Returns
True if this material has an emissive map

Reimplemented from BaseMaterial< Ogre2Object >.

◆ HasEnvironmentMap()

virtual bool HasEnvironmentMap ( ) const
overridevirtual

Determine if this material has a environment map.

Returns
True if this material has a environment map

Reimplemented from BaseMaterial< Ogre2Object >.

◆ HasLightMap()

virtual bool HasLightMap ( ) const
overridevirtual

Determine if this material has a light map.

Returns
True if this material has a light map

Reimplemented from BaseMaterial< Ogre2Object >.

◆ HasMetalnessMap()

virtual bool HasMetalnessMap ( ) const
overridevirtual

Determine if this material has a metalness map.

Returns
True if this material has a metalness map

Reimplemented from BaseMaterial< Ogre2Object >.

◆ HasNormalMap()

virtual bool HasNormalMap ( ) const
overridevirtual

Determine if this material has a normal map.

Returns
True if this material has a normal map

Reimplemented from BaseMaterial< Ogre2Object >.

◆ HasRoughnessMap()

virtual bool HasRoughnessMap ( ) const
overridevirtual

Determine if this material has a roughness map.

Returns
True if this material has a roughness map

Reimplemented from BaseMaterial< Ogre2Object >.

◆ HasTexture()

virtual bool HasTexture ( ) const
overridevirtual

Determine if this material has a texture.

Returns
True if this material has a texture

Reimplemented from BaseMaterial< Ogre2Object >.

◆ Init()

virtual void Init ( )
overrideprotectedvirtual

Reimplemented from BaseObject.

◆ LightMap()

virtual std::string LightMap ( ) const
overridevirtual

Get the URI of the light map file.

Returns
URI of the light map file

Reimplemented from BaseMaterial< Ogre2Object >.

◆ LightMapData()

virtual 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

Reimplemented from BaseMaterial< Ogre2Object >.

◆ LightMapTexCoordSet()

virtual unsigned int LightMapTexCoordSet ( ) const
overridevirtual

Get the texture coordinate set used by lightmap.

Returns
texture coordinate set of the light map

Reimplemented from BaseMaterial< Ogre2Object >.

◆ Material()

virtual Ogre::MaterialPtr Material ( )
virtual

Return ogre low level material.

Returns
Ogre material pointer

◆ Metalness()

virtual float Metalness ( ) const
overridevirtual

Get the metalness value of this material.

Returns
Material metalness

Reimplemented from BaseMaterial< Ogre2Object >.

◆ MetalnessMap()

virtual std::string MetalnessMap ( ) const
overridevirtual

Get the URI of the metalness map file.

Returns
URI of the metalness map file

Reimplemented from BaseMaterial< Ogre2Object >.

◆ MetalnessMapData()

virtual 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

Reimplemented from BaseMaterial< Ogre2Object >.

◆ NormalMap()

virtual std::string NormalMap ( ) const
overridevirtual

Get the URI of the normal map file.

Returns
URI of the normal map file

Reimplemented from BaseMaterial< Ogre2Object >.

◆ NormalMapData()

virtual 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

Reimplemented from BaseMaterial< Ogre2Object >.

◆ PreRender()

virtual 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.

Reimplemented from BaseMaterial< Ogre2Object >.

◆ ReceiveShadows()

virtual bool ReceiveShadows ( ) const
overridevirtual

Determine if this material receives shadows.

Returns
True if this material receives shadows

Reimplemented from BaseMaterial< Ogre2Object >.

◆ RenderOrder()

virtual float RenderOrder ( ) const
overridevirtual

Get the render order value of this material.

Returns
Material render order

Reimplemented from BaseMaterial< Ogre2Object >.

◆ Roughness()

virtual float Roughness ( ) const
overridevirtual

Get the roughness value of this material.

Returns
Material roughness

Reimplemented from BaseMaterial< Ogre2Object >.

◆ RoughnessMap()

virtual std::string RoughnessMap ( ) const
overridevirtual

Get the URI of the roughness map file.

Returns
URI of the roughness map file

Reimplemented from BaseMaterial< Ogre2Object >.

◆ RoughnessMapData()

virtual 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

Reimplemented from BaseMaterial< Ogre2Object >.

◆ SetAlphaFromTexture()

virtual 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

Reimplemented from BaseMaterial< Ogre2Object >.

◆ SetDepthCheckEnabled()

virtual void SetDepthCheckEnabled ( bool  _enabled)
overridevirtual

Specify if depth buffer checking is enabled.

Parameters
[in]_enabledTrue if depth check is enabled

Reimplemented from BaseMaterial< Ogre2Object >.

◆ SetDepthWriteEnabled()

virtual void SetDepthWriteEnabled ( bool  _enabled)
overridevirtual

Specify if depth buffer writing is enabled.

Parameters
[in]_enabledTrue if depth buffer writing is enabled

Reimplemented from BaseMaterial< Ogre2Object >.

◆ SetDiffuse()

virtual void SetDiffuse ( const math::Color _color)
overridevirtual

Set the diffuse color.

Parameters
[in]_colorNew diffuse color

Reimplemented from BaseMaterial< Ogre2Object >.

◆ SetEmissive()

virtual void SetEmissive ( const math::Color _color)
overridevirtual

Set the emissive color.

Parameters
[in]_colorNew emissive color

Reimplemented from BaseMaterial< Ogre2Object >.

◆ SetEmissiveMap()

virtual 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 BaseMaterial< Ogre2Object >.

◆ SetEnvironmentMap()

virtual 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 BaseMaterial< Ogre2Object >.

◆ SetFragmentShader()

virtual void SetFragmentShader ( const std::string _path)
overridevirtual

Set the fragment shader.

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

Reimplemented from BaseMaterial< Ogre2Object >.

◆ SetLightMap()

virtual 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 BaseMaterial< Ogre2Object >.

◆ SetMetalness()

virtual void SetMetalness ( const float  _metalness)
overridevirtual

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

Parameters
[in]_metalnessMetalness to set to

Reimplemented from BaseMaterial< Ogre2Object >.

◆ SetMetalnessMap()

virtual 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 BaseMaterial< Ogre2Object >.

◆ SetNormalMap()

virtual 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 BaseMaterial< Ogre2Object >.

◆ SetReceiveShadows()

virtual void SetReceiveShadows ( const bool  _receiveShadows)
overridevirtual

Specify if this material receives shadows.

Parameters
[in]_receiveShadowsTrue if this material receives shadows

Reimplemented from BaseMaterial< Ogre2Object >.

◆ SetRenderOrder()

virtual 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

Reimplemented from BaseMaterial< Ogre2Object >.

◆ SetRoughness()

virtual void SetRoughness ( const float  _roughness)
overridevirtual

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

Parameters
[in]_roughnessRoughness to set to

Reimplemented from BaseMaterial< Ogre2Object >.

◆ SetRoughnessMap()

virtual 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 BaseMaterial< Ogre2Object >.

◆ SetSpecular()

virtual void SetSpecular ( const math::Color _color)
overridevirtual

Set the specular color.

Parameters
[in]_colorNew specular color

Reimplemented from BaseMaterial< Ogre2Object >.

◆ SetTexture()

virtual 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 BaseMaterial< Ogre2Object >.

◆ SetTextureMapDataImpl()

void SetTextureMapDataImpl ( const std::string _texture,
const std::shared_ptr< const common::Image > &  _img,
Ogre::PbsTextureTypes  _type 
)
protected

Set the texture map for this material from an image loaded in memory.

Parameters
[in]_textureName of the texture.
[in]_imgcommon::Image containing the texture data
[in]_typeType of texture, i.e. diffuse, normal, roughness, metalness

◆ SetTextureMapImpl()

virtual void SetTextureMapImpl ( const std::string _texture,
Ogre::PbsTextureTypes  _type 
)
protectedvirtual

Set the texture map for this material.

Parameters
[in]_textureName of the texture.
[in]_typeType of texture, i.e. diffuse, normal, roughness, metalness

◆ SetTransparency()

virtual void SetTransparency ( const double  _transparency)
overridevirtual

Set the transparency value.

Parameters
[in]_transparencyNew transparency value

Reimplemented from BaseMaterial< Ogre2Object >.

◆ SetVertexShader()

virtual void SetVertexShader ( const std::string _path)
overridevirtual

Set the vertex shader.

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

Reimplemented from BaseMaterial< Ogre2Object >.

◆ Specular()

virtual math::Color Specular ( ) const
overridevirtual

Get the specular color.

Returns
The specular color

Reimplemented from BaseMaterial< Ogre2Object >.

◆ Texture() [1/2]

virtual std::string Texture ( ) const
overridevirtual

Get the URI of the texture file.

Returns
URI of the texture file

Reimplemented from BaseMaterial< Ogre2Object >.

◆ Texture() [2/2]

virtual Ogre::TextureGpu* Texture ( const std::string _name)
protectedvirtual

Get a pointer to the ogre texture by name.

Returns
Ogre texture

◆ TextureData()

virtual 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

Reimplemented from BaseMaterial< Ogre2Object >.

◆ Type()

virtual enum MaterialType Type ( ) const
overridevirtual

Removes any metalness map mapped to this material.

Reimplemented from BaseMaterial< Ogre2Object >.

◆ UnlitDatablock()

virtual Ogre::HlmsUnlitDatablock* UnlitDatablock ( )
virtual

Return ogre Hlms material unlit datablock.

Returns
Ogre Hlms unlit datablock

◆ UpdateShaderParams() [1/2]

void UpdateShaderParams ( )
protected

bind shader parameters that have changed

◆ UpdateShaderParams() [2/2]

void UpdateShaderParams ( ConstShaderParamsPtr  _params,
Ogre::GpuProgramParametersSharedPtr  _ogreParams 
)
protected

Transfer params from gz-rendering type to ogre type.

Parameters
[in]_paramsGazebo Rendering params
[out]_ogreParamsogre type for holding params

◆ UpdateTransparency()

virtual void UpdateTransparency ( )
protectedvirtual

Updates the material transparency in the engine, based on transparency and diffuse alpha values.

◆ VertexShader()

virtual std::string VertexShader ( ) const
overridevirtual

Get path to the vertex shader.

Returns
Path to vertex shader

Reimplemented from BaseMaterial< Ogre2Object >.

◆ VertexShaderParams()

virtual ShaderParamsPtr VertexShaderParams ( )
overridevirtual

Get params for the vertex shader.

Returns
editable parameters

Reimplemented from BaseMaterial< Ogre2Object >.

Member Data Documentation

◆ emissiveMapName

std::string emissiveMapName
protected

Name of the emissive map.

◆ environmentMapName

std::string environmentMapName
protected

Name of the environment map.

◆ lightMapName

std::string lightMapName
protected

Name of the light map.

◆ lightMapUvSet

unsigned int lightMapUvSet = 0u
protected

Texture coorindate set used by the light map.

◆ metalnessMapName

std::string metalnessMapName
protected

Name of the metalness map.

◆ normalMapName

std::string normalMapName
protected

Name of the normal map.

◆ ogreDatablock

Ogre::HlmsPbsDatablock* ogreDatablock = nullptr
protected

Ogre data block containing all pbs material properties.

◆ ogreDatablockId

std::string ogreDatablockId
protected

Unique id assigned to ogre hlms datablock.

◆ ogreHlmsPbs

Ogre::HlmsPbs* ogreHlmsPbs = nullptr
protected

Ogre high level physical based shading object.

◆ ogreMaterial

Ogre::MaterialPtr ogreMaterial
protected

Ogre material. Mainly used for render targets.

◆ ogreUnlitDatablock

Ogre::HlmsUnlitDatablock* ogreUnlitDatablock = nullptr
protected

Ogre data block containing all unlit material properties.

◆ roughnessMapName

std::string roughnessMapName
protected

Name of the roughness map.

◆ textureName

std::string textureName
protected

Name of the texture.


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