summaryrefslogtreecommitdiffstats
path: root/AssetLoader/interface
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-05-17 03:47:34 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-05-17 03:47:34 +0000
commite7fa745f13dd8cd062f9454071ca7fc4504706f5 (patch)
treed18e91caefbf17114eab80e6a175841263bf9a2c /AssetLoader/interface
parentImproved mipmap generation for alpha-cutoff materials (diff)
downloadDiligentTools-e7fa745f13dd8cd062f9454071ca7fc4504706f5.tar.gz
DiligentTools-e7fa745f13dd8cd062f9454071ca7fc4504706f5.zip
GLTF Loader: split GLTF vertex data into two streams: pos, normal, uv0, uv1, and joint, weight
Diffstat (limited to 'AssetLoader/interface')
-rw-r--r--AssetLoader/interface/GLTFLoader.hpp23
1 files changed, 14 insertions, 9 deletions
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<IBuffer> pVertexBuffer;
+ RefCntAutoPtr<IBuffer> pVertexBuffer[2];
RefCntAutoPtr<IBuffer> 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<uint32_t>& indexBuffer,
- std::vector<Vertex>& vertexBuffer);
+ void LoadNode(IRenderDevice* pDevice,
+ Node* parent,
+ const tinygltf::Node& gltf_node,
+ uint32_t nodeIndex,
+ const tinygltf::Model& gltf_model,
+ std::vector<uint32_t>& indexBuffer,
+ std::vector<VertexAttribs0>& vertexData0,
+ std::vector<VertexAttribs1>& vertexData1);
void LoadSkins(const tinygltf::Model& gltf_model);