![]() |
Tesseract 0.28.4
|
Represents material information extracted from a mesh file. More...
#include <mesh_material.h>
Public Types | |
| using | Ptr = std::shared_ptr<MeshMaterial> |
| using | ConstPtr = std::shared_ptr<const MeshMaterial> |
Public Member Functions | |
| MeshMaterial (const Eigen::Vector4d &base_color_factor, double metallic_factor, double roughness_factor, const Eigen::Vector4d &emissive_factor) | |
| Construct a new MeshMaterial. | |
| Eigen::Vector4d | getBaseColorFactor () const |
| Get the base color of the mesh. | |
| double | getMetallicFactor () const |
| Get the Metallic Factor of the mesh (PBR parameter). | |
| double | getRoughnessFactor () const |
| Get the Roughness Factor of the mesh (PBR parameter). | |
| Eigen::Vector4d | getEmissiveFactor () const |
| Get the emissive factor of the mesh. | |
| MeshMaterialAlphaMode | getAlphaMode () const |
| Get the alpha mode, which controls how the base color alpha is interpreted. | |
| double | getAlphaCutoff () const |
| Get the alpha cutoff, used only when the alpha mode is MASK. | |
| bool | getDoubleSided () const |
| Get whether back faces should be rendered (back-face culling disabled). | |
| double | getEmissiveStrength () const |
| Get the emissive strength multiplier (KHR_materials_emissive_strength). | |
| double | getNormalScale () const |
| Get the scale applied to the normal texture's X and Y components. | |
| double | getOcclusionStrength () const |
| Get the strength of the occlusion texture, between 0 (no occlusion) and 1 (full occlusion). | |
| void | setBaseColorFactor (const Eigen::Vector4d &base_color_factor) |
| Set the base color in RGBA. | |
| void | setMetallicFactor (double metallic_factor) |
| Set the metallic factor, between 0 and 1. | |
| void | setRoughnessFactor (double roughness_factor) |
| Set the roughness factor, between 0 and 1. | |
| void | setEmissiveFactor (const Eigen::Vector4d &emissive_factor) |
| Set the emissive factor in RGBA. | |
| void | setAlphaMode (MeshMaterialAlphaMode alpha_mode) |
| Set the alpha mode. | |
| void | setAlphaCutoff (double alpha_cutoff) |
| Set the alpha cutoff, used only when the alpha mode is MASK. | |
| void | setDoubleSided (bool double_sided) |
| Set whether the material is double sided. | |
| void | setEmissiveStrength (double emissive_strength) |
| Set the emissive strength multiplier. | |
| void | setNormalScale (double normal_scale) |
| Set the normal texture scale. | |
| void | setOcclusionStrength (double occlusion_strength) |
| Set the occlusion texture strength. | |
| bool | operator== (const MeshMaterial &rhs) const |
| bool | operator!= (const MeshMaterial &rhs) const |
Friends | |
| template<class Archive> | |
| friend | void::tesseract::geometry::serialize (Archive &ar, MeshMaterial &obj) |
Represents material information extracted from a mesh file.
Mesh files contain material information. The mesh parser will extract the material information and store it in a MeshMaterial instance. The MeshMaterial class follows the PBR metallic-roughness workflow specified in the glTF 2.0 file format standard. The parameters supported are:
Texture images are stored separately in MeshTexture instances, one per texture slot (base color, metallic-roughness, normal, occlusion and emissive). The scalar parameters here apply to those textures as specified by glTF 2.0.
The MeshMaterial favors PBR materials extracted from glTF 2.0 files. COLLADA does not support PBR. Only "Diffuse" and "Emissive" are read. "Specular" and "Ambient" are ignored.
| tesseract::geometry::MeshMaterial::MeshMaterial | ( | const Eigen::Vector4d & | base_color_factor, |
| double | metallic_factor, | ||
| double | roughness_factor, | ||
| const Eigen::Vector4d & | emissive_factor ) |
Construct a new MeshMaterial.
| base_color_factor | The base color of the mesh |
| metallic_factor | The metallic factor parameter (PBR parameter) |
| roughness_factor | The roughness factor parameter (PBR parameter) |
| emissive_factor | The emissivity of the mesh |
| Eigen::Vector4d tesseract::geometry::MeshMaterial::getBaseColorFactor | ( | ) | const |
Get the base color of the mesh.
| double tesseract::geometry::MeshMaterial::getMetallicFactor | ( | ) | const |
Get the Metallic Factor of the mesh (PBR parameter).
| double tesseract::geometry::MeshMaterial::getRoughnessFactor | ( | ) | const |
Get the Roughness Factor of the mesh (PBR parameter).
| Eigen::Vector4d tesseract::geometry::MeshMaterial::getEmissiveFactor | ( | ) | const |
Get the emissive factor of the mesh.
"Emissive factor" is used to make the mesh "glow". How this is interpreted depends on the rendering engine.
| MeshMaterialAlphaMode tesseract::geometry::MeshMaterial::getAlphaMode | ( | ) | const |
Get the alpha mode, which controls how the base color alpha is interpreted.
| double tesseract::geometry::MeshMaterial::getAlphaCutoff | ( | ) | const |
Get the alpha cutoff, used only when the alpha mode is MASK.
| bool tesseract::geometry::MeshMaterial::getDoubleSided | ( | ) | const |
Get whether back faces should be rendered (back-face culling disabled).
| double tesseract::geometry::MeshMaterial::getEmissiveStrength | ( | ) | const |
Get the emissive strength multiplier (KHR_materials_emissive_strength).
| double tesseract::geometry::MeshMaterial::getNormalScale | ( | ) | const |
Get the scale applied to the normal texture's X and Y components.
| double tesseract::geometry::MeshMaterial::getOcclusionStrength | ( | ) | const |
Get the strength of the occlusion texture, between 0 (no occlusion) and 1 (full occlusion).