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
e9cafd07
Commit
e9cafd07
authored
3 years ago
by
Trevor Hollmann
Browse files
Options
Downloads
Patches
Plain Diff
[
#26
] Update TODO comments and fix some formatting.
parent
d6c44973
No related branches found
No related tags found
1 merge request
!19
Resolve "Asset Loading"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/asset_loader/include/vkcv/asset/asset_loader.hpp
+7
-3
7 additions, 3 deletions
modules/asset_loader/include/vkcv/asset/asset_loader.hpp
modules/asset_loader/src/vkcv/asset/asset_loader.cpp
+9
-2
9 additions, 2 deletions
modules/asset_loader/src/vkcv/asset/asset_loader.cpp
with
16 additions
and
5 deletions
modules/asset_loader/include/vkcv/asset/asset_loader.hpp
+
7
−
3
View file @
e9cafd07
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
* top.
* top.
*
*
* Each Mesh has an array of one or more vertex groups (called "primitives" in
* Each Mesh has an array of one or more vertex groups (called "primitives" in
* glF
W
parlance) and an array of zero or more Materials.
* gl
T
F parlance) and an array of zero or more Materials.
*
*
* Each vertex group describes a part of the meshes vertices by defining how
* Each vertex group describes a part of the meshes vertices by defining how
* they should be rendered (as points, lines, triangles), how many indices and
* they should be rendered (as points, lines, triangles), how many indices and
...
@@ -43,8 +43,12 @@
...
@@ -43,8 +43,12 @@
namespace
vkcv
::
asset
{
namespace
vkcv
::
asset
{
// enum matches modes in fx-gltf, the library returns a standard mode (TRIANGLES) if no mode is given in the file
/* This enum matches modes in fx-gltf, the library returns a standard mode
enum
PrimitiveMode
{
POINTS
=
0
,
LINES
,
LINELOOP
,
LINESTRIP
,
TRIANGLES
,
TRIANGLESTRIP
,
TRIANGLEFAN
};
* (TRIANGLES) if no mode is given in the file. */
enum
PrimitiveMode
{
POINTS
=
0
,
LINES
,
LINELOOP
,
LINESTRIP
,
TRIANGLES
,
TRIANGLESTRIP
,
TRIANGLEFAN
};
/* With these enums, 0 is reserved to signal uninitialized or invalid data. */
/* With these enums, 0 is reserved to signal uninitialized or invalid data. */
enum
PrimitiveType
{
POSITION
=
1
,
NORMAL
,
TEXCOORD_0
};
enum
PrimitiveType
{
POSITION
=
1
,
NORMAL
,
TEXCOORD_0
};
/* The indices in the index buffer can be of different bit width. */
/* The indices in the index buffer can be of different bit width. */
...
...
This diff is collapsed.
Click to expand it.
modules/asset_loader/src/vkcv/asset/asset_loader.cpp
+
9
−
2
View file @
e9cafd07
...
@@ -11,6 +11,9 @@ namespace vkcv::asset {
...
@@ -11,6 +11,9 @@ namespace vkcv::asset {
* @param type
* @param type
* @return unsigned integer representation
* @return unsigned integer representation
*/
*/
// TODO Return proper error code (we need to define those as macros or enums,
// will discuss during the next core meeting if that should happen on the scope
// of the vkcv framework or just this module)
uint8_t
convertTypeToInt
(
const
fx
::
gltf
::
Accessor
::
Type
type
)
{
uint8_t
convertTypeToInt
(
const
fx
::
gltf
::
Accessor
::
Type
type
)
{
switch
(
type
)
{
switch
(
type
)
{
case
fx
::
gltf
::
Accessor
::
Type
::
None
:
case
fx
::
gltf
::
Accessor
::
Type
::
None
:
...
@@ -63,11 +66,15 @@ int loadMesh(const std::string &path, Mesh &mesh) {
...
@@ -63,11 +66,15 @@ int loadMesh(const std::string &path, Mesh &mesh) {
return
0
;
return
0
;
}
}
// XXX Temporary restriction: Only one mesh per glTF file
// TODO Temporary restriction: Only one mesh per glTF file allowed
// currently. Later, we want to support whole scenes with more than
// just meshes.
if
(
object
.
meshes
.
size
()
!=
1
)
return
0
;
if
(
object
.
meshes
.
size
()
!=
1
)
return
0
;
fx
::
gltf
::
Mesh
const
&
objectMesh
=
object
.
meshes
[
0
];
fx
::
gltf
::
Mesh
const
&
objectMesh
=
object
.
meshes
[
0
];
// TODO We want to support more than one vertex group eventually...
// TODO We want to support more than one vertex group per mesh
// eventually... right now this is hard-coded to use only the first one
// because we only care about the example triangle and cube
fx
::
gltf
::
Primitive
const
&
objectPrimitive
=
objectMesh
.
primitives
[
0
];
fx
::
gltf
::
Primitive
const
&
objectPrimitive
=
objectMesh
.
primitives
[
0
];
fx
::
gltf
::
Accessor
posAccessor
;
fx
::
gltf
::
Accessor
posAccessor
;
...
...
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