diff options
| author | ladevieq <ladevie.quentin@gmail.com> | 2021-09-06 22:55:51 +0200 |
|---|---|---|
| committer | ladevieq <ladevie.quentin@gmail.com> | 2021-09-06 22:55:51 +0200 |
| commit | 3f6d9a3a75e2615866f8ed2cd0015fabea6490b7 (patch) | |
| tree | 077e568cca0a8823f0b361f570a2d76b43011aac /include/gltf.hpp | |
| parent | bf512216323f3df55627421bb0187ed364d58340 (diff) | |
Load gltf materials + diffuse and specular brdf
Diffstat (limited to 'include/gltf.hpp')
| -rw-r--r-- | include/gltf.hpp | 9 |
1 files changed, 7 insertions, 2 deletions
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<uint16_t> indices;
std::vector<vec3> positions;
std::vector<vec3> normals;
+ std::vector<vec3> 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<mesh> load_meshes(json &gltf_json, std::vector<std::vector<uint8_t>> &buffers_content, std::vector<material> &materials);
- static std::vector<material> load_materials(json &gltf_json);
+ static std::vector<texture> load_textures(json &gltf_json, std::filesystem::path &path, vkrenderer &renderer);
+
+ static std::vector<material> load_materials(json &gltf_json, std::vector<texture> &textures);
static mesh_part load_primitive(json &gltf_json, json &primitive, std::vector<std::vector<uint8_t>> &buffers_content, std::vector<material> &materials);
};
|
