From 3f6d9a3a75e2615866f8ed2cd0015fabea6490b7 Mon Sep 17 00:00:00 2001 From: ladevieq Date: Mon, 6 Sep 2021 22:55:51 +0200 Subject: Load gltf materials + diffuse and specular brdf --- include/gltf.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'include/gltf.hpp') diff --git a/include/gltf.hpp b/include/gltf.hpp index 6633811..0a63ba6 100644 --- a/include/gltf.hpp +++ b/include/gltf.hpp @@ -12,10 +12,13 @@ using json = nlohmann::json; #include "material.hpp" #include "vec3.hpp" +#include "vk-renderer.hpp" + struct mesh_part { std::vector indices; std::vector positions; std::vector normals; + std::vector uvs; material mat; }; @@ -30,7 +33,7 @@ struct node { class gltf { public: - static node load(std::filesystem::path &path, std::string &filename); + static node load(std::filesystem::path &path, std::string &filename, vkrenderer &renderer); private: @@ -38,7 +41,9 @@ private: static std::vector load_meshes(json &gltf_json, std::vector> &buffers_content, std::vector &materials); - static std::vector load_materials(json &gltf_json); + static std::vector load_textures(json &gltf_json, std::filesystem::path &path, vkrenderer &renderer); + + static std::vector load_materials(json &gltf_json, std::vector &textures); static mesh_part load_primitive(json &gltf_json, json &primitive, std::vector> &buffers_content, std::vector &materials); }; -- cgit v1.3