2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-06-06 08:42:35 +00:00

Extended GLTF classes to support: material colours, and images buffer view index / image type.

This commit is contained in:
LJW-Dev
2026-03-16 14:14:35 +08:00
committed by Jan Laupetin
parent 21ddc368f5
commit d683967b1d
+6 -2
View File
@@ -277,10 +277,11 @@ namespace gltf
{
public:
std::optional<JsonTextureInfo> baseColorTexture;
std::optional<std::array<float, 4>> baseColorFactor;
std::optional<float> metallicFactor;
};
NLOHMANN_DEFINE_TYPE_EXTENSION(JsonPbrMetallicRoughness, baseColorTexture, metallicFactor);
NLOHMANN_DEFINE_TYPE_EXTENSION(JsonPbrMetallicRoughness, baseColorTexture, baseColorFactor, metallicFactor);
class JsonNormalTextureInfo
{
@@ -388,9 +389,12 @@ namespace gltf
{
public:
std::optional<std::string> uri;
std::optional<unsigned int> bufferView;
std::optional<std::string> mimeType;
};
NLOHMANN_DEFINE_TYPE_EXTENSION(JsonImage, uri);
NLOHMANN_DEFINE_TYPE_EXTENSION(JsonImage, uri, bufferView, mimeType);
class JsonRoot
{