mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-20 08:05:45 +00:00
chore: set gltf material default metallicness to 0
This commit is contained in:
parent
1a35152098
commit
a0138c8abc
@ -206,9 +206,10 @@ namespace gltf
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
std::optional<JsonTextureInfo> baseColorTexture;
|
std::optional<JsonTextureInfo> baseColorTexture;
|
||||||
|
std::optional<float> metallicFactor;
|
||||||
};
|
};
|
||||||
|
|
||||||
NLOHMANN_DEFINE_TYPE_EXTENSION(JsonPbrMetallicRoughness, baseColorTexture);
|
NLOHMANN_DEFINE_TYPE_EXTENSION(JsonPbrMetallicRoughness, baseColorTexture, metallicFactor);
|
||||||
|
|
||||||
class JsonNormalTextureInfo
|
class JsonNormalTextureInfo
|
||||||
{
|
{
|
||||||
|
@ -127,7 +127,13 @@ namespace
|
|||||||
material.name = modelMaterial.name;
|
material.name = modelMaterial.name;
|
||||||
|
|
||||||
if (!modelMaterial.colorMapName.empty())
|
if (!modelMaterial.colorMapName.empty())
|
||||||
material.pbrMetallicRoughness.emplace().baseColorTexture.emplace().index = CreateTexture(gltf, modelMaterial.colorMapName);
|
{
|
||||||
|
material.pbrMetallicRoughness.emplace();
|
||||||
|
material.pbrMetallicRoughness->baseColorTexture.emplace();
|
||||||
|
|
||||||
|
material.pbrMetallicRoughness->baseColorTexture->index = CreateTexture(gltf, modelMaterial.colorMapName);
|
||||||
|
material.pbrMetallicRoughness->metallicFactor = 0.0f;
|
||||||
|
}
|
||||||
|
|
||||||
if (!modelMaterial.normalMapName.empty())
|
if (!modelMaterial.normalMapName.empty())
|
||||||
material.normalTexture.emplace().index = CreateTexture(gltf, modelMaterial.colorMapName);
|
material.normalTexture.emplace().index = CreateTexture(gltf, modelMaterial.colorMapName);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user