GLTF: Material Resource loading complete
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, macos-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, macos-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled
This commit is contained in:
@@ -329,6 +329,8 @@ KRBundle* LoadGltf(KRContext& context, simdjson::ondemand::object& jsonRoot, std
|
|||||||
};
|
};
|
||||||
|
|
||||||
new_material = new KRMaterial(context, std::string(materialName).c_str());
|
new_material = new KRMaterial(context, std::string(materialName).c_str());
|
||||||
|
context.getMaterialManager()->add(new_material);
|
||||||
|
|
||||||
simdjson::ondemand::object pbrMetallicRoughnessObj;
|
simdjson::ondemand::object pbrMetallicRoughnessObj;
|
||||||
if(tryJson(jsonMaterial["pbrMetallicRoughness"].get(pbrMetallicRoughnessObj))) {
|
if(tryJson(jsonMaterial["pbrMetallicRoughness"].get(pbrMetallicRoughnessObj))) {
|
||||||
tryJson(pbrMetallicRoughnessObj["baseColorFactor"].get(new_material->m_baseColorFactor));
|
tryJson(pbrMetallicRoughnessObj["baseColorFactor"].get(new_material->m_baseColorFactor));
|
||||||
@@ -345,7 +347,6 @@ KRBundle* LoadGltf(KRContext& context, simdjson::ondemand::object& jsonRoot, std
|
|||||||
}
|
}
|
||||||
parseTextureInfo(jsonMaterial, "emissiveTexture", new_material->m_emissiveMap);
|
parseTextureInfo(jsonMaterial, "emissiveTexture", new_material->m_emissiveMap);
|
||||||
tryJson(jsonMaterial["emissiveFactor"].get(new_material->m_emissiveFactor));
|
tryJson(jsonMaterial["emissiveFactor"].get(new_material->m_emissiveFactor));
|
||||||
new_material->moveToBundle(bundle);
|
|
||||||
|
|
||||||
std::string_view alphaMode;
|
std::string_view alphaMode;
|
||||||
if(tryJson(jsonMaterial["alphaMode"].get(alphaMode))) {
|
if(tryJson(jsonMaterial["alphaMode"].get(alphaMode))) {
|
||||||
@@ -418,6 +419,7 @@ KRBundle* LoadGltf(KRContext& context, simdjson::ondemand::object& jsonRoot, std
|
|||||||
new_material->m_emissiveFactor *= strength;
|
new_material->m_emissiveFactor *= strength;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
new_material->moveToBundle(bundle);
|
||||||
materialIndex++;
|
materialIndex++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user