15 namespace visualization {
18 struct MaterialRecord;
22 using TextureMaps = std::unordered_map<std::string, t::geometry::Image>;
27 std::hash<std::string>,
28 std::equal_to<std::string>,
29 Eigen::aligned_allocator<
30 std::pair<const std::string, Eigen::Vector4f>>>;
41 : material_name_(material_name) {}
49 bool IsValid()
const {
return !material_name_.empty(); }
62 return texture_maps_.at(key);
67 return scalar_properties_;
75 return scalar_properties_.at(key);
80 return vector_properties_;
88 return vector_properties_.at(key);
104 scalar_properties_[key] = value;
113 const Eigen::Vector4f &value) {
114 vector_properties_[key] = value;
123 material_name_ = material_name;
130 return texture_maps_.count(key) > 0;
137 return scalar_properties_.count(key) > 0;
144 return vector_properties_.count(key) > 0;
318 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:20
void SetBaseRoughness(float value)
Definition: Material.h:275
std::unordered_map< std::string, t::geometry::Image > TextureMaps
Definition: Material.h:22
bool HasScalarProperty(const std::string &key) const
Definition: Material.h:136
void SetBaseClearcoatRoughness(float value)
Definition: Material.h:284
void SetPointSize(float value)
Definition: Material.h:311
void SetAlbedoMap(const t::geometry::Image &image)
Definition: Material.h:200
void SetAbsorptionColor(const Eigen::Vector4f &value)
Definition: Material.h:292
bool HasReflectanceMap() const
Definition: Material.h:190
bool HasBaseMetallic() const
Definition: Material.h:254
bool HasAORoughnessMetalMap() const
Definition: Material.h:196
bool HasThickness() const
Definition: Material.h:262
bool HasRoughnessMap() const
Definition: Material.h:189
void SetMaterialName(const std::string &material_name)
Set material name. The material name should match the name of a built.
Definition: Material.h:122
bool HasBaseReflectance() const
Definition: Material.h:256
const TextureMaps & GetTextureMaps() const
Returns the texture map map.
Definition: Material.h:55
Eigen::Vector4f GetBaseColor() const
Definition: Material.h:231
void SetAOMap(const t::geometry::Image &image)
Definition: Material.h:206
void SetScalarProperty(const std::string &key, float value)
Definition: Material.h:103
void SetAnisotropy(float value)
Definition: Material.h:287
const t::geometry::Image & GetTextureMap(const std::string &key) const
Definition: Material.h:61
void SetDefaultProperties()
Definition: Material.cpp:16
bool HasAnisotropyMap() const
Definition: Material.h:195
bool HasAOMap() const
Definition: Material.h:187
bool HasLineWidth() const
Definition: Material.h:309
const ScalarPropertyMap & GetScalarProperties() const
Returns the map of scalar properties.
Definition: Material.h:66
const t::geometry::Image & GetReflectanceMap() const
Definition: Material.h:167
bool IsValid() const
Definition: Material.h:49
bool HasAnisotropy() const
Definition: Material.h:261
void SetAORoughnessMetalMap(const t::geometry::Image &image)
Definition: Material.h:227
bool HasBaseClearcoatRoughness() const
Definition: Material.h:258
void SetThickness(float value)
Definition: Material.h:288
const std::string & GetMaterialName() const
Get the name of the material.
Definition: Material.h:52
void SetReflectanceMap(const t::geometry::Image &image)
Definition: Material.h:215
float GetThickness() const
Definition: Material.h:244
std::unordered_map< std::string, float > ScalarPropertyMap
Definition: Material.h:23
const t::geometry::Image & GetRoughnessMap() const
Definition: Material.h:164
bool HasVectorProperty(const std::string &key) const
Definition: Material.h:143
void SetBaseReflectance(float value)
Definition: Material.h:278
bool HasBaseClearcoat() const
Definition: Material.h:257
const t::geometry::Image & GetAOMap() const
Definition: Material.h:158
const t::geometry::Image & GetNormalMap() const
Definition: Material.h:155
float GetBaseClearcoat() const
Definition: Material.h:239
float GetPointSize() const
Definition: Material.h:305
void SetTextureMap(const std::string &key, const t::geometry::Image &image)
Definition: Material.cpp:33
float GetBaseMetallic() const
Definition: Material.h:234
void SetAbsorptionDistance(float value)
Definition: Material.h:295
bool HasClearcoatRoughnessMap() const
Definition: Material.h:192
void SetAnisotropyMap(const t::geometry::Image &image)
Definition: Material.h:224
void SetVectorProperty(const std::string &key, const Eigen::Vector4f &value)
Definition: Material.h:112
void SetNormalMap(const t::geometry::Image &image)
Definition: Material.h:203
bool HasAlbedoMap() const
Definition: Material.h:185
bool HasMetallicMap() const
Definition: Material.h:188
Eigen::Vector4f GetVectorProperty(const std::string &key) const
Definition: Material.h:87
float GetBaseReflectance() const
Definition: Material.h:236
bool HasBaseColor() const
Definition: Material.h:253
const t::geometry::Image & GetClearcoatRoughnessMap() const
Definition: Material.h:173
void SetBaseClearcoat(float value)
Definition: Material.h:281
float GetScalarProperty(const std::string &key) const
Definition: Material.h:74
float GetBaseRoughness() const
Definition: Material.h:235
const t::geometry::Image & GetAnisotropyMap() const
Definition: Material.h:176
float GetAbsorptionDistance() const
Definition: Material.h:249
const t::geometry::Image & GetAlbedoMap() const
Definition: Material.h:152
void SetTransmission(float value)
Definition: Material.h:289
Eigen::Vector4f GetAbsorptionColor() const
Definition: Material.h:246
Material()=default
Create an empty, invalid material.
bool HasBaseRoughness() const
Definition: Material.h:255
const t::geometry::Image & GetClearcoatMap() const
Definition: Material.h:170
const VectorPropertyMap & GetVectorProperties() const
Returns the map of vector properties.
Definition: Material.h:79
const t::geometry::Image & GetMetallicMap() const
Definition: Material.h:161
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:30
const t::geometry::Image & GetAORoughnessMetalMap() const
Definition: Material.h:181
void SetClearcoatRoughnessMap(const t::geometry::Image &image)
Definition: Material.h:221
void SetBaseMetallic(float value)
Definition: Material.h:274
bool HasNormalMap() const
Definition: Material.h:186
bool HasPointSize() const
Definition: Material.h:308
float GetAnisotropy() const
Definition: Material.h:243
bool HasTextureMap(const std::string &key) const
Definition: Material.h:129
bool HasTransmission() const
Definition: Material.h:263
float GetBaseClearcoatRoughness() const
Definition: Material.h:240
float GetTransmission() const
Definition: Material.h:245
void SetClearcoatMap(const t::geometry::Image &image)
Definition: Material.h:218
Material & operator=(const Material &other)=default
void SetRoughnessMap(const t::geometry::Image &image)
Definition: Material.h:212
void ToMaterialRecord(MaterialRecord &record) const
Fills a legacy MaterialRecord constructed from this Material.
Definition: Material.cpp:42
Material(const Material &mat)=default
void SetMetallicMap(const t::geometry::Image &image)
Definition: Material.h:209
bool HasAbsorptionColor() const
Definition: Material.h:264
Material(const std::string &material_name)
Create an empty but valid material for the specified material name.
Definition: Material.h:40
bool HasClearcoatMap() const
Definition: Material.h:191
float GetLineWidth() const
Definition: Material.h:306
void SetLineWidth(float value)
Definition: Material.h:312
bool HasAbsorptionDistance() const
Definition: Material.h:267
void SetBaseColor(const Eigen::Vector4f &value)
Definition: Material.h:271
Definition: PinholeCameraIntrinsic.cpp:16
Definition: MaterialRecord.h:22