-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GltfImporter: Support morph target attributes
- Loading branch information
Showing
16 changed files
with
567 additions
and
125 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
170 changes: 144 additions & 26 deletions
170
src/MagnumPlugins/GltfImporter/Test/GltfImporterTest.cpp
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file modified
BIN
+16 Bytes
(110%)
src/MagnumPlugins/GltfImporter/Test/mesh-custom-attributes.bin
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,13 @@ | |
"COLOR_0": 1, | ||
"COLOR_1": 1, | ||
"COLOR_0": 3 | ||
} | ||
}, | ||
"targets": [ | ||
{ | ||
"COLOR_0": 3, | ||
"COLOR_0": 1 | ||
} | ||
] | ||
} | ||
] | ||
} | ||
|
19 changes: 19 additions & 0 deletions
19
src/MagnumPlugins/GltfImporter/Test/mesh-invalid-morph-target.gltf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"asset": { | ||
"version": "2.0" | ||
}, | ||
"meshes": [ | ||
{ | ||
"primitives": [ | ||
{} | ||
] | ||
}, | ||
{ | ||
"primitives": [ | ||
{ | ||
"targets": [-1] | ||
} | ||
] | ||
} | ||
] | ||
} |
19 changes: 19 additions & 0 deletions
19
src/MagnumPlugins/GltfImporter/Test/mesh-invalid-primitive-targets-property.gltf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"asset": { | ||
"version": "2.0" | ||
}, | ||
"meshes": [ | ||
{ | ||
"primitives": [ | ||
{} | ||
] | ||
}, | ||
{ | ||
"primitives": [ | ||
{ | ||
"targets": {} | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+135 Bytes
src/MagnumPlugins/GltfImporter/Test/mesh-morph-target-attributes.bin
Binary file not shown.
39 changes: 39 additions & 0 deletions
39
src/MagnumPlugins/GltfImporter/Test/mesh-morph-target-attributes.bin.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
type = '<' | ||
input = [] | ||
|
||
type += '3f3f 3f3f 3f3f' | ||
input += [ | ||
# positions, # normals | ||
1.5, -1.0, -0.5, 1.0, 0.0, 0.0, | ||
-0.5, 2.5, 0.75, 0.0, 1.0, 0.0, | ||
-2.0, 1.0, 0.3, 0.0, 0.0, 1.0 | ||
] | ||
|
||
# Morph target 1 | ||
type += '3H3H 3H3H 3H3H' | ||
input += [ | ||
# positions (deltas), # normals (deltas) | ||
10, 20, 30, 1, 2, 3, | ||
40, 50, 60, 4, 5, 6, | ||
70, 80, 90, 7, 8, 9 | ||
] | ||
|
||
# Morph target 2 | ||
type += '3H 3H 3H' | ||
input += [ | ||
# positions (deltas) | ||
100, 200, 300, | ||
400, 500, 600, | ||
700, 800, 900 | ||
] | ||
|
||
# Morph target 3 | ||
type += '3b 3b 3b' | ||
input += [ | ||
# normals (deltas) | ||
-1, -2, -3, | ||
-4, -5, -6, | ||
-7, -8, -9 | ||
] | ||
|
||
# kate: hl python |
106 changes: 106 additions & 0 deletions
106
src/MagnumPlugins/GltfImporter/Test/mesh-morph-target-attributes.gltf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
{ | ||
"asset": { | ||
"version": "2.0" | ||
}, | ||
"accessors": [ | ||
{ | ||
"bufferView": 0, | ||
"componentType": 5126, | ||
"count": 3, | ||
"type": "VEC3" | ||
}, | ||
{ | ||
"bufferView": 0, | ||
"byteOffset": 12, | ||
"componentType": 5126, | ||
"count": 3, | ||
"type": "VEC3" | ||
}, | ||
{ | ||
"bufferView": 1, | ||
"componentType": 5123, | ||
"count": 3, | ||
"type": "VEC3" | ||
}, | ||
{ | ||
"bufferView": 1, | ||
"byteOffset": 6, | ||
"componentType": 5122, | ||
"normalized": true, | ||
"count": 3, | ||
"type": "VEC3" | ||
}, | ||
{ | ||
"bufferView": 2, | ||
"componentType": 5123, | ||
"count": 3, | ||
"type": "VEC3" | ||
}, | ||
{ | ||
"bufferView": 3, | ||
"componentType": 5120, | ||
"normalized": true, | ||
"count": 3, | ||
"type": "VEC3" | ||
} | ||
], | ||
"bufferViews": [ | ||
{ | ||
"buffer": 0, | ||
"byteLength": 72, | ||
"byteStride": 24, | ||
"target": 34962 | ||
}, | ||
{ | ||
"buffer": 0, | ||
"byteLength": 36, | ||
"byteOffset": 72, | ||
"byteStride": 12, | ||
"target": 34962 | ||
}, | ||
{ | ||
"buffer": 0, | ||
"byteLength": 18, | ||
"byteOffset": 108, | ||
"byteStride": 6, | ||
"target": 34962 | ||
}, | ||
{ | ||
"buffer": 0, | ||
"byteLength": 9, | ||
"byteOffset": 126, | ||
"byteStride": 3, | ||
"target": 34962 | ||
} | ||
], | ||
"buffers": [ | ||
{ | ||
"byteLength": 135, | ||
"uri": "mesh-morph-target-attributes.bin" | ||
} | ||
], | ||
"meshes": [ | ||
{ | ||
"primitives": [ | ||
{ | ||
"attributes": { | ||
"POSITION": 0, | ||
"NORMAL": 1 | ||
}, | ||
"targets": [ | ||
{ | ||
"POSITION": 2, | ||
"NORMAL": 3 | ||
}, | ||
{ | ||
"POSITION": 4 | ||
}, | ||
{ | ||
"NORMAL": 5 | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
Binary file modified
BIN
+16 Bytes
(160%)
src/MagnumPlugins/GltfImporter/Test/mesh-unsupported-vertex-formats.bin
Binary file not shown.
5 changes: 3 additions & 2 deletions
5
src/MagnumPlugins/GltfImporter/Test/mesh-unsupported-vertex-formats.bin.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
type = "<4H 3f h 3B" | ||
type = "<4H 3f h 3B 4f" | ||
input = [ | ||
0x1122, 0x3344, 0x5566, 0x7788, | ||
1.0, 2.0, 3.0, | ||
-5602, | ||
3, 16, 166 | ||
3, 16, 166, | ||
1.0, 2.0, 3.0, 4.0 | ||
] | ||
|
||
# kate: hl python |
Oops, something went wrong.