From 39172feb3e3e9bb0c185209ed996867414ff0f44 Mon Sep 17 00:00:00 2001 From: Daniel Hritzkiv Date: Fri, 25 Aug 2017 17:58:41 -0400 Subject: [PATCH] Start reading pbr materials --- code/glTF2Asset.inl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/glTF2Asset.inl b/code/glTF2Asset.inl index 062d8318d..27fdd1c01 100644 --- a/code/glTF2Asset.inl +++ b/code/glTF2Asset.inl @@ -733,6 +733,12 @@ inline void Material::Read(Value& material, Asset& r) 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 (r.extensionsUsed.KHR_materials_common) { if (Value* ext = FindObject(*extensions, "KHR_materials_common")) {