Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VkCV Framework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vulkan2021
VkCV Framework
Commits
413f343e
Commit
413f343e
authored
3 years ago
by
Trevor Hollmann
Browse files
Options
Downloads
Patches
Plain Diff
[
#26
] Provide rough sketch of loadMesh function.
parent
4ccf3731
No related branches found
No related tags found
1 merge request
!19
Resolve "Asset Loading"
Pipeline
#24970
failed
3 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/asset_loader/main.cpp
+39
-0
39 additions, 0 deletions
src/asset_loader/main.cpp
with
39 additions
and
0 deletions
src/asset_loader/main.cpp
+
39
−
0
View file @
413f343e
#include
"asset_loader/asset_loader.hpp"
#include
"asset_loader/asset_loader.hpp"
// TODO include the library: fx-gltf
int
loadMesh
(
const
std
::
string
&
path
,
Mesh
&
mesh
)
{
// TODO load the gltf file using the library, return 0 if there is an
// error.
// If the library throws excaptions, catch them and maybe print an
// error, but do not pass on the exception to the caller!
// Looking at the example code of fx-gltf I would assume that
// fx::gltf::LoadFromText(); is a good starting point.
// TODO Verify that all required information can be found in the
// struct/class returned by fx-gltf (eg. check if there is exactly one
// mesh and that it has at least 3 vertices or something like that) and
// return 0 if something is missing.
// The important thing here is that we don't create an incomplete mesh
// because we start copying data before making sure all the required
// data is available.
// TODO Fill the output argument 'mesh' with the data from the loaded
// glTF file.
// Look at the structs 'Mesh', 'VertexGroup' and 'VertexAttribute'
// defined in asset_loader.hpp and compare it to the glTF cheat sheet:
// https://raw.githubusercontent.com/KhronosGroup/glTF/master/specification/2.0/figures/gltfOverview-2.0.0b.png
//
// If the fx::gltf::Document struct/class from the fx-gltf library
// don't really match our structs, we may need to re-think how our
// structs are defined (they are only based on the glTF specification).
//
// In the first iteration our goal is to simply load the vertices of a
// mesh without textures and materials. (Maybe start with our triangle
// since that does not have textures)
// Once this works, we can add support for materials/textures, but I
// wouldn't include this feature until loading of vertices+indices is
// proven to work
// Finally return 1 to signal that all is fine
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment