Start reading pbr materials

pull/1423/head
Daniel Hritzkiv 2017-08-25 17:58:41 -04:00
parent 4d59dee5ea
commit 39172feb3e
No known key found for this signature in database
GPG Key ID: D1D19875679D5CBF
1 changed files with 6 additions and 0 deletions

View File

@ -733,6 +733,12 @@ inline void Material::Read(Value& material, Asset& r)
ReadMember(*values, "shininess", shininess); ReadMember(*values, "shininess", shininess);
} }
if (Value* values = FindObject(material, "pbrMetallicRoughness")) {
ReadMaterialProperty(r, *values, "baseColorFactor", this->diffuse);
}
ReadMember(material, "doubleSided", doubleSided);
if (Value* extensions = FindObject(material, "extensions")) { if (Value* extensions = FindObject(material, "extensions")) {
if (r.extensionsUsed.KHR_materials_common) { if (r.extensionsUsed.KHR_materials_common) {
if (Value* ext = FindObject(*extensions, "KHR_materials_common")) { if (Value* ext = FindObject(*extensions, "KHR_materials_common")) {