16 namespace visualization {
19 struct MaterialRecord;
23 using TextureMaps = std::unordered_map<std::string, t::geometry::Image>;
28 std::hash<std::string>,
29 std::equal_to<std::string>,
30 Eigen::aligned_allocator<
31 std::pair<const std::string, Eigen::Vector4f>>>;
45 : material_name_(material_name) {}
53 bool IsValid()
const {
return !material_name_.empty(); }
69 return texture_maps_.at(key);
74 return scalar_properties_;
82 return scalar_properties_.at(key);
87 return vector_properties_;
95 return vector_properties_.at(key);
111 scalar_properties_[key] = value;
120 const Eigen::Vector4f &value) {
121 vector_properties_[key] = value;
130 material_name_ = material_name;
137 return texture_maps_.count(key) > 0;
144 return scalar_properties_.count(key) > 0;
151 return vector_properties_.count(key) > 0;
334 std::string material_name_;
std::shared_ptr< core::Tensor > image
Definition: FilamentRenderer.cpp:183
The Image class stores image with customizable rows, cols, channels, dtype and device.
Definition: Image.h:29
Definition: Material.h:21
void SetBaseRoughness(float value)
Definition: Material.h:288
std::unordered_map< std::string, t::geometry::Image > TextureMaps
Definition: Material.h:23
bool HasScalarProperty(const std::string &key) const
Definition: Material.h:143
void SetBaseClearcoatRoughness(float value)
Definition: Material.h:297
void SetPointSize(float value)
Definition: Material.h:327
void SetAlbedoMap(const t::geometry::Image &image)
Definition: Material.h:207
void SetAbsorptionColor(const Eigen::Vector4f &value)
Definition: Material.h:305
bool HasReflectanceMap() const
Definition: Material.h:197
static Material FromMaterialRecord(const MaterialRecord &mat)
Convert from MaterialRecord.
Definition: Material.cpp:149
bool HasBaseMetallic() const
Definition: Material.h:264
bool HasAORoughnessMetalMap() const
Definition: Material.h:203
bool HasThickness() const
Definition: Material.h:272
bool HasRoughnessMap() const
Definition: Material.h:196
void SetMaterialName(const std::string &material_name)
Set material name. The material name should match the name of a built.
Definition: Material.h:129
bool HasBaseReflectance() const
Definition: Material.h:266
const TextureMaps & GetTextureMaps() const
Returns the texture map map.
Definition: Material.h:62
Eigen::Vector4f GetBaseColor() const
Definition: Material.h:238
void SetAOMap(const t::geometry::Image &image)
Definition: Material.h:213
void SetScalarProperty(const std::string &key, float value)
Definition: Material.h:110
void SetAnisotropy(float value)
Definition: Material.h:300
const t::geometry::Image & GetTextureMap(const std::string &key) const
Definition: Material.h:68
void SetDefaultProperties()
Definition: Material.cpp:16
bool HasAnisotropyMap() const
Definition: Material.h:202
bool HasAOMap() const
Definition: Material.h:194
bool HasLineWidth() const
Definition: Material.h:325
const ScalarPropertyMap & GetScalarProperties() const
Returns the map of scalar properties.
Definition: Material.h:73
const t::geometry::Image & GetReflectanceMap() const
Definition: Material.h:174
bool IsValid() const
Definition: Material.h:53
bool HasAnisotropy() const
Definition: Material.h:271
void SetAORoughnessMetalMap(const t::geometry::Image &image)
Definition: Material.h:234
bool HasBaseClearcoatRoughness() const
Definition: Material.h:268
void SetThickness(float value)
Definition: Material.h:301
const std::string & GetMaterialName() const
Get the name of the material.
Definition: Material.h:56
void SetReflectanceMap(const t::geometry::Image &image)
Definition: Material.h:222
float GetThickness() const
Definition: Material.h:251
bool HasEmissiveColor() const
Definition: Material.h:280
std::unordered_map< std::string, float > ScalarPropertyMap
Definition: Material.h:24
const t::geometry::Image & GetRoughnessMap() const
Definition: Material.h:171
bool HasVectorProperty(const std::string &key) const
Definition: Material.h:150
void SetBaseReflectance(float value)
Definition: Material.h:291
bool HasBaseClearcoat() const
Definition: Material.h:267
const t::geometry::Image & GetAOMap() const
Definition: Material.h:165
const t::geometry::Image & GetNormalMap() const
Definition: Material.h:162
float GetBaseClearcoat() const
Definition: Material.h:246
float GetPointSize() const
Definition: Material.h:321
void SetTextureMap(const std::string &key, const t::geometry::Image &image)
Definition: Material.cpp:34
float GetBaseMetallic() const
Definition: Material.h:241
void SetAbsorptionDistance(float value)
Definition: Material.h:308
bool HasClearcoatRoughnessMap() const
Definition: Material.h:199
void SetAnisotropyMap(const t::geometry::Image &image)
Definition: Material.h:231
void SetVectorProperty(const std::string &key, const Eigen::Vector4f &value)
Definition: Material.h:119
void SetNormalMap(const t::geometry::Image &image)
Definition: Material.h:210
bool HasAlbedoMap() const
Definition: Material.h:192
bool HasMetallicMap() const
Definition: Material.h:195
Eigen::Vector4f GetVectorProperty(const std::string &key) const
Definition: Material.h:94
float GetBaseReflectance() const
Definition: Material.h:243
bool HasBaseColor() const
Definition: Material.h:263
const t::geometry::Image & GetClearcoatRoughnessMap() const
Definition: Material.h:180
void SetBaseClearcoat(float value)
Definition: Material.h:294
float GetScalarProperty(const std::string &key) const
Definition: Material.h:81
float GetBaseRoughness() const
Definition: Material.h:242
const t::geometry::Image & GetAnisotropyMap() const
Definition: Material.h:183
float GetAbsorptionDistance() const
Definition: Material.h:256
const t::geometry::Image & GetAlbedoMap() const
Definition: Material.h:159
void SetTransmission(float value)
Definition: Material.h:302
Eigen::Vector4f GetAbsorptionColor() const
Definition: Material.h:253
Material()=default
Create an empty, invalid material.
bool HasBaseRoughness() const
Definition: Material.h:265
const t::geometry::Image & GetClearcoatMap() const
Definition: Material.h:177
const VectorPropertyMap & GetVectorProperties() const
Returns the map of vector properties.
Definition: Material.h:86
const t::geometry::Image & GetMetallicMap() const
Definition: Material.h:168
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 > >> VectorPropertyMap
Definition: Material.h:31
Eigen::Vector4f GetEmissiveColor() const
Definition: Material.h:259
const t::geometry::Image & GetAORoughnessMetalMap() const
Definition: Material.h:188
void SetClearcoatRoughnessMap(const t::geometry::Image &image)
Definition: Material.h:228
void SetBaseMetallic(float value)
Definition: Material.h:287
bool HasNormalMap() const
Definition: Material.h:193
bool HasPointSize() const
Definition: Material.h:324
float GetAnisotropy() const
Definition: Material.h:250
bool HasTextureMap(const std::string &key) const
Definition: Material.h:136
bool HasTransmission() const
Definition: Material.h:273
float GetBaseClearcoatRoughness() const
Definition: Material.h:247
float GetTransmission() const
Definition: Material.h:252
void SetClearcoatMap(const t::geometry::Image &image)
Definition: Material.h:225
std::string ToString() const
String reprentation for printing.
Definition: Material.cpp:43
Material & operator=(const Material &other)=default
void SetRoughnessMap(const t::geometry::Image &image)
Definition: Material.h:219
void ToMaterialRecord(MaterialRecord &record) const
Fills a legacy MaterialRecord constructed from this Material.
Definition: Material.cpp:61
Material(const Material &mat)=default
void SetMetallicMap(const t::geometry::Image &image)
Definition: Material.h:216
bool HasAbsorptionColor() const
Definition: Material.h:274
Material(const std::string &material_name)
Create an empty but valid material for the specified material name.
Definition: Material.h:44
bool HasClearcoatMap() const
Definition: Material.h:198
float GetLineWidth() const
Definition: Material.h:322
void SetLineWidth(float value)
Definition: Material.h:328
void SetEmissiveColor(const Eigen::Vector4f &value)
Definition: Material.h:311
bool HasAbsorptionDistance() const
Definition: Material.h:277
void SetBaseColor(const Eigen::Vector4f &value)
Definition: Material.h:284
Definition: PinholeCameraIntrinsic.cpp:16
Definition: MaterialRecord.h:22