mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-14 20:45:52 +08:00
set default values for baseColorFactor so that it has correct values when parsing a material without a pbrMetallicRoughness struct
This commit is contained in:
parent
81b672bcc2
commit
c3353e1acd
@ -739,7 +739,7 @@ struct PbrMetallicRoughness {
|
||||
Value extras;
|
||||
ExtensionMap extensions;
|
||||
|
||||
PbrMetallicRoughness() : metallicFactor(1.0), roughnessFactor(1.0) {}
|
||||
PbrMetallicRoughness() : baseColorFactor(std::vector<double>{ 1.0,1.0,1.0,1.0 }), metallicFactor(1.0), roughnessFactor(1.0) {}
|
||||
PbrMetallicRoughness(const PbrMetallicRoughness &) = default;
|
||||
PbrMetallicRoughness &operator=(const PbrMetallicRoughness &) = default;
|
||||
PbrMetallicRoughness(PbrMetallicRoughness &&rhs) noexcept
|
||||
@ -4412,11 +4412,8 @@ static bool ParsePbrMetallicRoughness(PbrMetallicRoughness *pbr,
|
||||
}
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
// fill with default values
|
||||
baseColorFactor = {1.0, 1.0, 1.0, 1.0};
|
||||
pbr->baseColorFactor = baseColorFactor;
|
||||
}
|
||||
pbr->baseColorFactor = baseColorFactor;
|
||||
|
||||
{
|
||||
json_const_iterator it;
|
||||
|
Loading…
x
Reference in New Issue
Block a user