Open3D (C++ API)  0.18.0+252c867
Public Types | Public Member Functions | Static Public Member Functions
open3d::visualization::rendering::Material Class Reference

#include <Material.h>

Public Types

using TextureMaps = std::unordered_map< std::string, t::geometry::Image >
 
using ScalarPropertyMap = std::unordered_map< std::string, float >
 
using VectorPropertyMap = std::unordered_map< std::string, Eigen::Vector4f, std::hash< std::string >, std::equal_to< std::string >, Eigen::aligned_allocator< std::pair< const std::string, Eigen::Vector4f > >>
 

Public Member Functions

 Material ()=default
 Create an empty, invalid material. More...
 
 Material (const Material &mat)=default
 
Materialoperator= (const Material &other)=default
 
 Material (const std::string &material_name)
 Create an empty but valid material for the specified material name. More...
 
void SetDefaultProperties ()
 
bool IsValid () const
 
const std::string & GetMaterialName () const
 Get the name of the material. More...
 
std::string ToString () const
 String reprentation for printing. More...
 
const TextureMapsGetTextureMaps () const
 Returns the texture map map. More...
 
const t::geometry::ImageGetTextureMap (const std::string &key) const
 
const ScalarPropertyMapGetScalarProperties () const
 Returns the map of scalar properties. More...
 
float GetScalarProperty (const std::string &key) const
 
const VectorPropertyMapGetVectorProperties () const
 Returns the map of vector properties. More...
 
Eigen::Vector4f GetVectorProperty (const std::string &key) const
 
void SetTextureMap (const std::string &key, const t::geometry::Image &image)
 
void SetScalarProperty (const std::string &key, float value)
 
void SetVectorProperty (const std::string &key, const Eigen::Vector4f &value)
 
void SetMaterialName (const std::string &material_name)
 Set material name. The material name should match the name of a built. More...
 
bool HasTextureMap (const std::string &key) const
 
bool HasScalarProperty (const std::string &key) const
 
bool HasVectorProperty (const std::string &key) const
 
const t::geometry::ImageGetAlbedoMap () const
 
const t::geometry::ImageGetNormalMap () const
 
const t::geometry::ImageGetAOMap () const
 
const t::geometry::ImageGetMetallicMap () const
 
const t::geometry::ImageGetRoughnessMap () const
 
const t::geometry::ImageGetReflectanceMap () const
 
const t::geometry::ImageGetClearcoatMap () const
 
const t::geometry::ImageGetClearcoatRoughnessMap () const
 
const t::geometry::ImageGetAnisotropyMap () const
 
const t::geometry::ImageGetAORoughnessMetalMap () const
 
bool HasAlbedoMap () const
 
bool HasNormalMap () const
 
bool HasAOMap () const
 
bool HasMetallicMap () const
 
bool HasRoughnessMap () const
 
bool HasReflectanceMap () const
 
bool HasClearcoatMap () const
 
bool HasClearcoatRoughnessMap () const
 
bool HasAnisotropyMap () const
 
bool HasAORoughnessMetalMap () const
 
void SetAlbedoMap (const t::geometry::Image &image)
 
void SetNormalMap (const t::geometry::Image &image)
 
void SetAOMap (const t::geometry::Image &image)
 
void SetMetallicMap (const t::geometry::Image &image)
 
void SetRoughnessMap (const t::geometry::Image &image)
 
void SetReflectanceMap (const t::geometry::Image &image)
 
void SetClearcoatMap (const t::geometry::Image &image)
 
void SetClearcoatRoughnessMap (const t::geometry::Image &image)
 
void SetAnisotropyMap (const t::geometry::Image &image)
 
void SetAORoughnessMetalMap (const t::geometry::Image &image)
 
Eigen::Vector4f GetBaseColor () const
 
float GetBaseMetallic () const
 
float GetBaseRoughness () const
 
float GetBaseReflectance () const
 
float GetBaseClearcoat () const
 
float GetBaseClearcoatRoughness () const
 
float GetAnisotropy () const
 
float GetThickness () const
 
float GetTransmission () const
 
Eigen::Vector4f GetAbsorptionColor () const
 
float GetAbsorptionDistance () const
 
Eigen::Vector4f GetEmissiveColor () const
 
bool HasBaseColor () const
 
bool HasBaseMetallic () const
 
bool HasBaseRoughness () const
 
bool HasBaseReflectance () const
 
bool HasBaseClearcoat () const
 
bool HasBaseClearcoatRoughness () const
 
bool HasAnisotropy () const
 
bool HasThickness () const
 
bool HasTransmission () const
 
bool HasAbsorptionColor () const
 
bool HasAbsorptionDistance () const
 
bool HasEmissiveColor () const
 
void SetBaseColor (const Eigen::Vector4f &value)
 
void SetBaseMetallic (float value)
 
void SetBaseRoughness (float value)
 
void SetBaseReflectance (float value)
 
void SetBaseClearcoat (float value)
 
void SetBaseClearcoatRoughness (float value)
 
void SetAnisotropy (float value)
 
void SetThickness (float value)
 
void SetTransmission (float value)
 
void SetAbsorptionColor (const Eigen::Vector4f &value)
 
void SetAbsorptionDistance (float value)
 
void SetEmissiveColor (const Eigen::Vector4f &value)
 
float GetPointSize () const
 
float GetLineWidth () const
 
bool HasPointSize () const
 
bool HasLineWidth () const
 
void SetPointSize (float value)
 
void SetLineWidth (float value)
 
void ToMaterialRecord (MaterialRecord &record) const
 Fills a legacy MaterialRecord constructed from this Material. More...
 

Static Public Member Functions

static Material FromMaterialRecord (const MaterialRecord &mat)
 Convert from MaterialRecord. More...
 

Member Typedef Documentation

◆ ScalarPropertyMap

using open3d::visualization::rendering::Material::ScalarPropertyMap = std::unordered_map<std::string, float>

◆ TextureMaps

◆ VectorPropertyMap

using open3d::visualization::rendering::Material::VectorPropertyMap = std::unordered_map< std::string, Eigen::Vector4f, std::hash<std::string>, std::equal_to<std::string>, Eigen::aligned_allocator< std::pair<const std::string, Eigen::Vector4f> >>

Constructor & Destructor Documentation

◆ Material() [1/3]

open3d::visualization::rendering::Material::Material ( )
default

Create an empty, invalid material.

◆ Material() [2/3]

open3d::visualization::rendering::Material::Material ( const Material mat)
default

◆ Material() [3/3]

open3d::visualization::rendering::Material::Material ( const std::string &  material_name)
inline

Create an empty but valid material for the specified material name.

Member Function Documentation

◆ FromMaterialRecord()

Material open3d::visualization::rendering::Material::FromMaterialRecord ( const MaterialRecord mat)
static

Convert from MaterialRecord.

◆ GetAbsorptionColor()

Eigen::Vector4f open3d::visualization::rendering::Material::GetAbsorptionColor ( ) const
inline

◆ GetAbsorptionDistance()

float open3d::visualization::rendering::Material::GetAbsorptionDistance ( ) const
inline

◆ GetAlbedoMap()

const t::geometry::Image& open3d::visualization::rendering::Material::GetAlbedoMap ( ) const
inline

The following are convenience methods for common PBR material properties

◆ GetAnisotropy()

float open3d::visualization::rendering::Material::GetAnisotropy ( ) const
inline

◆ GetAnisotropyMap()

const t::geometry::Image& open3d::visualization::rendering::Material::GetAnisotropyMap ( ) const
inline

◆ GetAOMap()

const t::geometry::Image& open3d::visualization::rendering::Material::GetAOMap ( ) const
inline

◆ GetAORoughnessMetalMap()

const t::geometry::Image& open3d::visualization::rendering::Material::GetAORoughnessMetalMap ( ) const
inline

Ambient occlusion, roughness, and metallic maps in a single 3 channel texture. Commonly used in glTF models.

◆ GetBaseClearcoat()

float open3d::visualization::rendering::Material::GetBaseClearcoat ( ) const
inline

◆ GetBaseClearcoatRoughness()

float open3d::visualization::rendering::Material::GetBaseClearcoatRoughness ( ) const
inline

◆ GetBaseColor()

Eigen::Vector4f open3d::visualization::rendering::Material::GetBaseColor ( ) const
inline

◆ GetBaseMetallic()

float open3d::visualization::rendering::Material::GetBaseMetallic ( ) const
inline

◆ GetBaseReflectance()

float open3d::visualization::rendering::Material::GetBaseReflectance ( ) const
inline

◆ GetBaseRoughness()

float open3d::visualization::rendering::Material::GetBaseRoughness ( ) const
inline

◆ GetClearcoatMap()

const t::geometry::Image& open3d::visualization::rendering::Material::GetClearcoatMap ( ) const
inline

◆ GetClearcoatRoughnessMap()

const t::geometry::Image& open3d::visualization::rendering::Material::GetClearcoatRoughnessMap ( ) const
inline

◆ GetEmissiveColor()

Eigen::Vector4f open3d::visualization::rendering::Material::GetEmissiveColor ( ) const
inline

◆ GetLineWidth()

float open3d::visualization::rendering::Material::GetLineWidth ( ) const
inline

◆ GetMaterialName()

const std::string& open3d::visualization::rendering::Material::GetMaterialName ( ) const
inline

Get the name of the material.

◆ GetMetallicMap()

const t::geometry::Image& open3d::visualization::rendering::Material::GetMetallicMap ( ) const
inline

◆ GetNormalMap()

const t::geometry::Image& open3d::visualization::rendering::Material::GetNormalMap ( ) const
inline

◆ GetPointSize()

float open3d::visualization::rendering::Material::GetPointSize ( ) const
inline

The following are convenience methods for Pointclouds and LineSet shaders

◆ GetReflectanceMap()

const t::geometry::Image& open3d::visualization::rendering::Material::GetReflectanceMap ( ) const
inline

◆ GetRoughnessMap()

const t::geometry::Image& open3d::visualization::rendering::Material::GetRoughnessMap ( ) const
inline

◆ GetScalarProperties()

const ScalarPropertyMap& open3d::visualization::rendering::Material::GetScalarProperties ( ) const
inline

Returns the map of scalar properties.

◆ GetScalarProperty()

float open3d::visualization::rendering::Material::GetScalarProperty ( const std::string &  key) const
inline

Get scalar properties of this Material. Throws exception if the property does not exist.

Parameters
keyProperty name

◆ GetTextureMap()

const t::geometry::Image& open3d::visualization::rendering::Material::GetTextureMap ( const std::string &  key) const
inline

Get images (texture maps) of this Material. Throws exception if the image does not exist.

Parameters
keyMap name

◆ GetTextureMaps()

const TextureMaps& open3d::visualization::rendering::Material::GetTextureMaps ( ) const
inline

Returns the texture map map.

◆ GetThickness()

float open3d::visualization::rendering::Material::GetThickness ( ) const
inline

◆ GetTransmission()

float open3d::visualization::rendering::Material::GetTransmission ( ) const
inline

◆ GetVectorProperties()

const VectorPropertyMap& open3d::visualization::rendering::Material::GetVectorProperties ( ) const
inline

Returns the map of vector properties.

◆ GetVectorProperty()

Eigen::Vector4f open3d::visualization::rendering::Material::GetVectorProperty ( const std::string &  key) const
inline

Get vector properties of this Material. Throws exception if the property does not exist.

Parameters
keyProperty name

◆ HasAbsorptionColor()

bool open3d::visualization::rendering::Material::HasAbsorptionColor ( ) const
inline

◆ HasAbsorptionDistance()

bool open3d::visualization::rendering::Material::HasAbsorptionDistance ( ) const
inline

◆ HasAlbedoMap()

bool open3d::visualization::rendering::Material::HasAlbedoMap ( ) const
inline

◆ HasAnisotropy()

bool open3d::visualization::rendering::Material::HasAnisotropy ( ) const
inline

◆ HasAnisotropyMap()

bool open3d::visualization::rendering::Material::HasAnisotropyMap ( ) const
inline

◆ HasAOMap()

bool open3d::visualization::rendering::Material::HasAOMap ( ) const
inline

◆ HasAORoughnessMetalMap()

bool open3d::visualization::rendering::Material::HasAORoughnessMetalMap ( ) const
inline

◆ HasBaseClearcoat()

bool open3d::visualization::rendering::Material::HasBaseClearcoat ( ) const
inline

◆ HasBaseClearcoatRoughness()

bool open3d::visualization::rendering::Material::HasBaseClearcoatRoughness ( ) const
inline

◆ HasBaseColor()

bool open3d::visualization::rendering::Material::HasBaseColor ( ) const
inline

◆ HasBaseMetallic()

bool open3d::visualization::rendering::Material::HasBaseMetallic ( ) const
inline

◆ HasBaseReflectance()

bool open3d::visualization::rendering::Material::HasBaseReflectance ( ) const
inline

◆ HasBaseRoughness()

bool open3d::visualization::rendering::Material::HasBaseRoughness ( ) const
inline

◆ HasClearcoatMap()

bool open3d::visualization::rendering::Material::HasClearcoatMap ( ) const
inline

◆ HasClearcoatRoughnessMap()

bool open3d::visualization::rendering::Material::HasClearcoatRoughnessMap ( ) const
inline

◆ HasEmissiveColor()

bool open3d::visualization::rendering::Material::HasEmissiveColor ( ) const
inline

◆ HasLineWidth()

bool open3d::visualization::rendering::Material::HasLineWidth ( ) const
inline

◆ HasMetallicMap()

bool open3d::visualization::rendering::Material::HasMetallicMap ( ) const
inline

◆ HasNormalMap()

bool open3d::visualization::rendering::Material::HasNormalMap ( ) const
inline

◆ HasPointSize()

bool open3d::visualization::rendering::Material::HasPointSize ( ) const
inline

◆ HasReflectanceMap()

bool open3d::visualization::rendering::Material::HasReflectanceMap ( ) const
inline

◆ HasRoughnessMap()

bool open3d::visualization::rendering::Material::HasRoughnessMap ( ) const
inline

◆ HasScalarProperty()

bool open3d::visualization::rendering::Material::HasScalarProperty ( const std::string &  key) const
inline

Return true if the property exists

Parameters
keyProperty name

◆ HasTextureMap()

bool open3d::visualization::rendering::Material::HasTextureMap ( const std::string &  key) const
inline

Return true if the map exists

Parameters
keyMap name

◆ HasThickness()

bool open3d::visualization::rendering::Material::HasThickness ( ) const
inline

◆ HasTransmission()

bool open3d::visualization::rendering::Material::HasTransmission ( ) const
inline

◆ HasVectorProperty()

bool open3d::visualization::rendering::Material::HasVectorProperty ( const std::string &  key) const
inline

Return true if the property exists

Parameters
keyProperty name

◆ IsValid()

bool open3d::visualization::rendering::Material::IsValid ( ) const
inline

Returns true if the Material was not created with the default constructor and therefore has a valid shader name.

◆ operator=()

Material& open3d::visualization::rendering::Material::operator= ( const Material other)
default

◆ SetAbsorptionColor()

void open3d::visualization::rendering::Material::SetAbsorptionColor ( const Eigen::Vector4f &  value)
inline

◆ SetAbsorptionDistance()

void open3d::visualization::rendering::Material::SetAbsorptionDistance ( float  value)
inline

◆ SetAlbedoMap()

void open3d::visualization::rendering::Material::SetAlbedoMap ( const t::geometry::Image image)
inline

◆ SetAnisotropy()

void open3d::visualization::rendering::Material::SetAnisotropy ( float  value)
inline

◆ SetAnisotropyMap()

void open3d::visualization::rendering::Material::SetAnisotropyMap ( const t::geometry::Image image)
inline

◆ SetAOMap()

void open3d::visualization::rendering::Material::SetAOMap ( const t::geometry::Image image)
inline

◆ SetAORoughnessMetalMap()

void open3d::visualization::rendering::Material::SetAORoughnessMetalMap ( const t::geometry::Image image)
inline

◆ SetBaseClearcoat()

void open3d::visualization::rendering::Material::SetBaseClearcoat ( float  value)
inline

◆ SetBaseClearcoatRoughness()

void open3d::visualization::rendering::Material::SetBaseClearcoatRoughness ( float  value)
inline

◆ SetBaseColor()

void open3d::visualization::rendering::Material::SetBaseColor ( const Eigen::Vector4f &  value)
inline

◆ SetBaseMetallic()

void open3d::visualization::rendering::Material::SetBaseMetallic ( float  value)
inline

◆ SetBaseReflectance()

void open3d::visualization::rendering::Material::SetBaseReflectance ( float  value)
inline

◆ SetBaseRoughness()

void open3d::visualization::rendering::Material::SetBaseRoughness ( float  value)
inline

◆ SetClearcoatMap()

void open3d::visualization::rendering::Material::SetClearcoatMap ( const t::geometry::Image image)
inline

◆ SetClearcoatRoughnessMap()

void open3d::visualization::rendering::Material::SetClearcoatRoughnessMap ( const t::geometry::Image image)
inline

◆ SetDefaultProperties()

void open3d::visualization::rendering::Material::SetDefaultProperties ( )

Sets a number of properties to the defaults expected by Open3D shaders

◆ SetEmissiveColor()

void open3d::visualization::rendering::Material::SetEmissiveColor ( const Eigen::Vector4f &  value)
inline

◆ SetLineWidth()

void open3d::visualization::rendering::Material::SetLineWidth ( float  value)
inline

◆ SetMaterialName()

void open3d::visualization::rendering::Material::SetMaterialName ( const std::string &  material_name)
inline

Set material name. The material name should match the name of a built.

Parameters
shaderThe name of the shader.

◆ SetMetallicMap()

void open3d::visualization::rendering::Material::SetMetallicMap ( const t::geometry::Image image)
inline

◆ SetNormalMap()

void open3d::visualization::rendering::Material::SetNormalMap ( const t::geometry::Image image)
inline

◆ SetPointSize()

void open3d::visualization::rendering::Material::SetPointSize ( float  value)
inline

◆ SetReflectanceMap()

void open3d::visualization::rendering::Material::SetReflectanceMap ( const t::geometry::Image image)
inline

◆ SetRoughnessMap()

void open3d::visualization::rendering::Material::SetRoughnessMap ( const t::geometry::Image image)
inline

◆ SetScalarProperty()

void open3d::visualization::rendering::Material::SetScalarProperty ( const std::string &  key,
float  value 
)
inline

Set scalar property. If property already exists it is overwritten, otherwise a new key/value will be created.

Parameters
keyproperty name
valueValue to assign to property name

◆ SetTextureMap()

void open3d::visualization::rendering::Material::SetTextureMap ( const std::string &  key,
const t::geometry::Image image 
)

Set texture map. If map already exists it is overwritten, otherwise a new key/image will be created.

Parameters
keymap name
imageImage associated with map name

◆ SetThickness()

void open3d::visualization::rendering::Material::SetThickness ( float  value)
inline

◆ SetTransmission()

void open3d::visualization::rendering::Material::SetTransmission ( float  value)
inline

◆ SetVectorProperty()

void open3d::visualization::rendering::Material::SetVectorProperty ( const std::string &  key,
const Eigen::Vector4f &  value 
)
inline

Set vector property. If property already exists it is overwritten, otherwise a new key/value will be created.

Parameters
keyproperty name
valueValue to assign to property name

◆ ToMaterialRecord()

void open3d::visualization::rendering::Material::ToMaterialRecord ( MaterialRecord record) const

Fills a legacy MaterialRecord constructed from this Material.

◆ ToString()

std::string open3d::visualization::rendering::Material::ToString ( ) const

String reprentation for printing.


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