From e7fa745f13dd8cd062f9454071ca7fc4504706f5 Mon Sep 17 00:00:00 2001 From: assiduous Date: Sat, 16 May 2020 20:47:34 -0700 Subject: GLTF Loader: split GLTF vertex data into two streams: pos, normal, uv0, uv1, and joint, weight --- AssetLoader/interface/GLTFLoader.hpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'AssetLoader/interface') diff --git a/AssetLoader/interface/GLTFLoader.hpp b/AssetLoader/interface/GLTFLoader.hpp index 1a4d9d9..b9096d9 100644 --- a/AssetLoader/interface/GLTFLoader.hpp +++ b/AssetLoader/interface/GLTFLoader.hpp @@ -238,17 +238,21 @@ struct Animation struct Model { - struct Vertex + struct VertexAttribs0 { float3 pos; float3 normal; float2 uv0; float2 uv1; + }; + + struct VertexAttribs1 + { float4 joint0; float4 weight0; }; - RefCntAutoPtr pVertexBuffer; + RefCntAutoPtr pVertexBuffer[2]; RefCntAutoPtr pIndexBuffer; Uint32 IndexCount = 0; @@ -286,13 +290,14 @@ private: const std::string& filename, TextureCacheType* pTextureCache); - void LoadNode(IRenderDevice* pDevice, - Node* parent, - const tinygltf::Node& gltf_node, - uint32_t nodeIndex, - const tinygltf::Model& gltf_model, - std::vector& indexBuffer, - std::vector& vertexBuffer); + void LoadNode(IRenderDevice* pDevice, + Node* parent, + const tinygltf::Node& gltf_node, + uint32_t nodeIndex, + const tinygltf::Model& gltf_model, + std::vector& indexBuffer, + std::vector& vertexData0, + std::vector& vertexData1); void LoadSkins(const tinygltf::Model& gltf_model); -- cgit v1.2.3