|
Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
|
Material data extracted from a glTF material and engine extensions. More...
#include <GltfLoader.h>
Public Member Functions | |
| GltfMaterialData ()=default | |
| Creates default material data with no parsed source material. | |
| GltfMaterialData (const tinygltf::Model &model, const tinygltf::Material &material, const StaticMeshExtensions &meshSettings) | |
| Parses material data from glTF and engine extension metadata. | |
| bool | hasTexture () const |
| Checks whether the material references a base color texture. | |
| uint32_t | getTextureIndex () const |
| Gets the engine texture index for the base color texture. | |
| bool | hasVulkanSchneeExtension () const |
| Checks whether the material has a Vulkan Schnee material extension. | |
| const VulkanSchneeMaterialExtension & | getVulkanSchneeExtension () const |
| Gets the parsed Vulkan Schnee material extension. | |
| std::string | getShaderName () const |
| Gets the shader name selected for this material. | |
| const Materials::MaterialData & | getMaterialData () const |
| Gets immutable engine material data generated from glTF and extension data. | |
| Materials::MaterialData & | getMaterialDataRef () |
| Gets mutable engine material data generated from glTF and extension data. | |
| uint32_t | getNormalTextureIndex () const |
| Gets the engine normal texture index. | |
| uint32_t | getRoughnessMetallicTextureIndex () const |
| Gets the engine metallic-roughness texture index. | |
| uint32_t | getEmissiveTextureIndex () const |
| Gets the engine emissive texture index. | |
| float | getRoughnessFactor () const |
| Gets the glTF roughness factor. | |
| float | getMetallicFactor () const |
| Gets the glTF metallic factor. | |
| float | getNormalScale () const |
| Gets the normal map scale. | |
| glm::vec3 | getEmissiveFactor () const |
| Gets the emissive factor. | |
| bool | hasNormalTexture () const |
| Checks whether the glTF material references a normal texture. | |
| bool | hasMetallicRoughnessTexture () const |
| Checks whether the glTF material references a metallic-roughness texture. | |
| bool | hasEmissiveTexture () const |
| Checks whether the glTF material references an emissive texture. | |
| int32_t | getGltfNormalTextureIndex () const |
| Gets the original glTF normal texture index. | |
| int32_t | getGltfMetallicRoughnessTextureIndex () const |
| Gets the original glTF metallic-roughness texture index. | |
| int32_t | getGltfEmissiveTextureIndex () const |
| Gets the original glTF emissive texture index. | |
| bool | hasLightmapTexture () const |
| Checks whether this material uses a lightmap texture path. | |
| const std::filesystem::path & | getLightmapPath () const |
| Gets the lightmap texture path from the engine extension. | |
Private Member Functions | |
| void | setupMaterialData () |
| void | parsePbrData (const tinygltf::Model &model, const tinygltf::Material &material) |
Private Attributes | |
| Materials::MaterialData | materialData |
| std::optional< MaterialExtensions > | materialExtensions |
| glm::vec4 | baseColorFactor = glm::vec4( 0.0f, 0.0f, 0.0f, 0.0f ) |
| uint32_t | textureIndex = std::numeric_limits<uint32_t>::max() |
| uint32_t | normalTextureIndex = 0xFFFFFFFF |
| uint32_t | roughnessMetallicTextureIndex = 0xFFFFFFFF |
| uint32_t | emissiveTextureIndex = 0xFFFFFFFF |
| float | roughnessFactor = 1.0f |
| float | metallicFactor = 0.0f |
| float | normalScale = 1.0f |
| glm::vec3 | emissiveFactor = glm::vec3( 0.0f ) |
| int32_t | gltfNormalTextureIndex = -1 |
| int32_t | gltfMetallicRoughnessTextureIndex = -1 |
| int32_t | gltfEmissiveTextureIndex = -1 |
| std::filesystem::path | lightmapPath |
Material data extracted from a glTF material and engine extensions.
The object stores standard glTF PBR factors and texture indices, optional Vulkan Schnee material extension data, and the renderer-facing Materials::MaterialData built from those inputs.
Definition at line 831 of file GltfLoader.h.
|
default |
Creates default material data with no parsed source material.
| Engine::Assets::Loaders::GltfLoader::GltfMaterialData::GltfMaterialData | ( | const tinygltf::Model & | model, |
| const tinygltf::Material & | material, | ||
| const StaticMeshExtensions & | meshSettings ) |
Parses material data from glTF and engine extension metadata.
| model | Source glTF model that owns texture records referenced by the material. |
| material | glTF material to parse. |
| meshSettings | Parsed node or mesh extension data used for lightmap material handling. |
| std::runtime_error | When baseColorFactor is present but does not contain RGBA data. |
|
inlinenodiscard |
Gets the emissive factor.
Definition at line 958 of file GltfLoader.h.
References emissiveFactor.
|
inlinenodiscard |
Gets the engine emissive texture index.
Definition at line 922 of file GltfLoader.h.
References emissiveTextureIndex.
|
inlinenodiscard |
Gets the original glTF emissive texture index.
Definition at line 1012 of file GltfLoader.h.
References gltfEmissiveTextureIndex.
|
inlinenodiscard |
Gets the original glTF metallic-roughness texture index.
Definition at line 1003 of file GltfLoader.h.
References gltfMetallicRoughnessTextureIndex.
|
inlinenodiscard |
Gets the original glTF normal texture index.
Definition at line 994 of file GltfLoader.h.
References gltfNormalTextureIndex.
|
inlinenodiscard |
Gets the lightmap texture path from the engine extension.
Definition at line 1030 of file GltfLoader.h.
References lightmapPath.
|
inlinenodiscard |
Gets immutable engine material data generated from glTF and extension data.
Definition at line 886 of file GltfLoader.h.
References materialData.
|
inlinenodiscard |
Gets mutable engine material data generated from glTF and extension data.
Definition at line 895 of file GltfLoader.h.
References materialData.
|
inlinenodiscard |
Gets the glTF metallic factor.
Definition at line 940 of file GltfLoader.h.
References metallicFactor.
|
inlinenodiscard |
Gets the normal map scale.
Definition at line 949 of file GltfLoader.h.
References normalScale.
|
inlinenodiscard |
Gets the engine normal texture index.
Definition at line 904 of file GltfLoader.h.
References normalTextureIndex.
|
inlinenodiscard |
Gets the glTF roughness factor.
Definition at line 931 of file GltfLoader.h.
References roughnessFactor.
|
inlinenodiscard |
Gets the engine metallic-roughness texture index.
Definition at line 913 of file GltfLoader.h.
References roughnessMetallicTextureIndex.
|
nodiscard |
Gets the shader name selected for this material.
|
nodiscard |
Gets the engine texture index for the base color texture.
|
nodiscard |
Gets the parsed Vulkan Schnee material extension.
| std::runtime_error | When this material has no parsed Vulkan Schnee material extension. |
|
inlinenodiscard |
Checks whether the glTF material references an emissive texture.
Definition at line 985 of file GltfLoader.h.
References gltfEmissiveTextureIndex.
|
inlinenodiscard |
Checks whether this material uses a lightmap texture path.
Definition at line 1021 of file GltfLoader.h.
References lightmapPath.
|
inlinenodiscard |
Checks whether the glTF material references a metallic-roughness texture.
Definition at line 976 of file GltfLoader.h.
References gltfMetallicRoughnessTextureIndex.
|
inlinenodiscard |
Checks whether the glTF material references a normal texture.
Definition at line 967 of file GltfLoader.h.
References gltfNormalTextureIndex.
|
nodiscard |
Checks whether the material references a base color texture.
|
nodiscard |
Checks whether the material has a Vulkan Schnee material extension.
|
private |
|
private |
|
private |
Definition at line 1042 of file GltfLoader.h.
|
private |
Definition at line 1054 of file GltfLoader.h.
Referenced by getEmissiveFactor().
|
private |
Definition at line 1048 of file GltfLoader.h.
Referenced by getEmissiveTextureIndex().
|
private |
Definition at line 1059 of file GltfLoader.h.
Referenced by getGltfEmissiveTextureIndex(), and hasEmissiveTexture().
|
private |
Definition at line 1058 of file GltfLoader.h.
Referenced by getGltfMetallicRoughnessTextureIndex(), and hasMetallicRoughnessTexture().
|
private |
Definition at line 1057 of file GltfLoader.h.
Referenced by getGltfNormalTextureIndex(), and hasNormalTexture().
|
private |
Definition at line 1062 of file GltfLoader.h.
Referenced by getLightmapPath(), and hasLightmapTexture().
|
private |
Definition at line 1039 of file GltfLoader.h.
Referenced by getMaterialData(), and getMaterialDataRef().
|
private |
Definition at line 1041 of file GltfLoader.h.
|
private |
Definition at line 1052 of file GltfLoader.h.
Referenced by getMetallicFactor().
|
private |
Definition at line 1053 of file GltfLoader.h.
Referenced by getNormalScale().
|
private |
Definition at line 1046 of file GltfLoader.h.
Referenced by getNormalTextureIndex().
|
private |
Definition at line 1051 of file GltfLoader.h.
Referenced by getRoughnessFactor().
|
private |
Definition at line 1047 of file GltfLoader.h.
Referenced by getRoughnessMetallicTextureIndex().
|
private |
Definition at line 1043 of file GltfLoader.h.