summaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
authoromnisci3nce <omniscient.oce@gmail.com>2024-04-27 13:08:03 +1000
committeromnisci3nce <omniscient.oce@gmail.com>2024-04-27 13:08:03 +1000
commit4cbc38b92edaa331fd0f6a077bbe7d7aebdb9ecf (patch)
tree753d23b07b09e3494e4cce594bd4b0f4710566f8 /assets
parentd6837defc03e431517f6616ec8e49a8eb3643011 (diff)
parentc7c33cd18e057bc826a0d31e1860b0ac396a00b6 (diff)
Merge remote-tracking branch 'origin/cel-67-load-animation-data-from-gltf' into ral
Diffstat (limited to 'assets')
-rw-r--r--assets/models/gltf/AnimatedCube/LICENSE.md15
-rw-r--r--assets/models/gltf/AnimatedCube/README.body.md3
-rw-r--r--assets/models/gltf/AnimatedCube/README.md27
-rw-r--r--assets/models/gltf/AnimatedCube/glTF/AnimatedCube.binbin0 -> 1860 bytes
-rw-r--r--assets/models/gltf/AnimatedCube/glTF/AnimatedCube.gltf262
-rw-r--r--assets/models/gltf/AnimatedCube/glTF/AnimatedCube_BaseColor.pngbin0 -> 891995 bytes
-rw-r--r--assets/models/gltf/AnimatedCube/glTF/AnimatedCube_MetallicRoughness.pngbin0 -> 319 bytes
-rw-r--r--assets/models/gltf/AnimatedCube/metadata.json25
-rw-r--r--assets/models/gltf/AnimatedCube/screenshot/screenshot.gifbin0 -> 517169 bytes
-rw-r--r--assets/models/gltf/SimpleSkin/LICENSE.md15
-rw-r--r--assets/models/gltf/SimpleSkin/README.body.md18
-rw-r--r--assets/models/gltf/SimpleSkin/README.md42
-rw-r--r--assets/models/gltf/SimpleSkin/glTF-Embedded/SimpleSkin.gltf131
-rw-r--r--assets/models/gltf/SimpleSkin/glTF/SimpleSkin.gltf131
-rw-r--r--assets/models/gltf/SimpleSkin/glTF/inverseBindMatrices.binbin0 -> 128 bytes
-rw-r--r--assets/models/gltf/SimpleSkin/glTF/skinAnimation.binbin0 -> 240 bytes
-rw-r--r--assets/models/gltf/SimpleSkin/glTF/skinGeometry.binbin0 -> 168 bytes
-rw-r--r--assets/models/gltf/SimpleSkin/glTF/skinningData.binbin0 -> 320 bytes
-rw-r--r--assets/models/gltf/SimpleSkin/metadata.json26
-rw-r--r--assets/models/gltf/SimpleSkin/screenshot/inverseBindMatrices.pngbin0 -> 43880 bytes
-rw-r--r--assets/models/gltf/SimpleSkin/screenshot/screenshot.gifbin0 -> 2000860 bytes
-rw-r--r--assets/models/gltf/SimpleSkin/screenshot/skinAnimation.pngbin0 -> 100791 bytes
-rw-r--r--assets/models/gltf/SimpleSkin/screenshot/skinGeometry.pngbin0 -> 74566 bytes
-rw-r--r--assets/models/gltf/SimpleSkin/screenshot/skinningData.pngbin0 -> 86339 bytes
-rw-r--r--assets/shaders/blinn_phong.frag4
-rw-r--r--assets/shaders/blinn_phong.vert2
-rw-r--r--assets/shaders/object.frag14
-rw-r--r--assets/shaders/object.vert11
-rw-r--r--assets/shaders/skinned.vert59
29 files changed, 776 insertions, 9 deletions
diff --git a/assets/models/gltf/AnimatedCube/LICENSE.md b/assets/models/gltf/AnimatedCube/LICENSE.md
new file mode 100644
index 0000000..c001f8f
--- /dev/null
+++ b/assets/models/gltf/AnimatedCube/LICENSE.md
@@ -0,0 +1,15 @@
+# LICENSE file for the model: Animated Cube
+
+All files in this directory tree are licensed as indicated below.
+
+* All files directly associated with the model including all text, image and binary files:
+
+ * [CC0 1.0 Universal]("https://creativecommons.org/publicdomain/zero/1.0/legalcode") [SPDX license identifier: "CC0-1.0"]
+
+* This file and all other metadocumentation files including "metadata.json":
+
+ * [Creative Commons Attribtution 4.0 International]("https://creativecommons.org/licenses/by/4.0/legalcode") [SPDX license identifier: "CC-BY-4.0"]
+
+Full license text of these licenses are available at the links above
+
+#### Generated by modelmetadata \ No newline at end of file
diff --git a/assets/models/gltf/AnimatedCube/README.body.md b/assets/models/gltf/AnimatedCube/README.body.md
new file mode 100644
index 0000000..1efdf8c
--- /dev/null
+++ b/assets/models/gltf/AnimatedCube/README.body.md
@@ -0,0 +1,3 @@
+## Screenshot
+
+![screenshot](screenshot/screenshot.gif)
diff --git a/assets/models/gltf/AnimatedCube/README.md b/assets/models/gltf/AnimatedCube/README.md
new file mode 100644
index 0000000..d5cf0a3
--- /dev/null
+++ b/assets/models/gltf/AnimatedCube/README.md
@@ -0,0 +1,27 @@
+# Animated Cube
+
+## Tags
+
+[core](../../Models-core.md), [testing](../../Models-testing.md)
+
+## Summary
+
+Same as 'Cube', but having a linear rotation animation.
+
+## Operations
+
+* [Display](https://github.khronos.org/glTF-Sample-Viewer-Release/?model=https://raw.GithubUserContent.com/KhronosGroup/glTF-Sample-Assets/main/./Models/AnimatedCube/glTF/AnimatedCube.gltf) in SampleViewer
+* [Model Directory](./)
+
+## Screenshot
+
+![screenshot](screenshot/screenshot.gif)
+
+
+## Legal
+
+&copy; 2017, UX3D. [CC0 1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/legalcode)
+
+ - Norbert Nopper for Everything
+
+#### Assembled by modelmetadata \ No newline at end of file
diff --git a/assets/models/gltf/AnimatedCube/glTF/AnimatedCube.bin b/assets/models/gltf/AnimatedCube/glTF/AnimatedCube.bin
new file mode 100644
index 0000000..72f7d2d
--- /dev/null
+++ b/assets/models/gltf/AnimatedCube/glTF/AnimatedCube.bin
Binary files differ
diff --git a/assets/models/gltf/AnimatedCube/glTF/AnimatedCube.gltf b/assets/models/gltf/AnimatedCube/glTF/AnimatedCube.gltf
new file mode 100644
index 0000000..ff117b0
--- /dev/null
+++ b/assets/models/gltf/AnimatedCube/glTF/AnimatedCube.gltf
@@ -0,0 +1,262 @@
+{
+ "accessors" : [
+ {
+ "bufferView" : 0,
+ "byteOffset" : 0,
+ "componentType" : 5126,
+ "count" : 3,
+ "max" : [
+ 2.000000
+ ],
+ "min" : [
+ 0.000000
+ ],
+ "type" : "SCALAR"
+ },
+ {
+ "bufferView" : 1,
+ "byteOffset" : 0,
+ "componentType" : 5126,
+ "count" : 3,
+ "max" : [
+ 0.000000,
+ 1.000000,
+ 0.000000,
+ 1.000000
+ ],
+ "min" : [
+ 0.000000,
+ -8.742278e-008,
+ 0.000000,
+ -1.000000
+ ],
+ "type" : "VEC4"
+ },
+ {
+ "bufferView" : 2,
+ "byteOffset" : 0,
+ "componentType" : 5123,
+ "count" : 36,
+ "max" : [
+ 35
+ ],
+ "min" : [
+ 0
+ ],
+ "type" : "SCALAR"
+ },
+ {
+ "bufferView" : 3,
+ "byteOffset" : 0,
+ "componentType" : 5126,
+ "count" : 36,
+ "max" : [
+ 1.000000,
+ 1.000000,
+ 1.000001
+ ],
+ "min" : [
+ -1.000000,
+ -1.000000,
+ -1.000000
+ ],
+ "type" : "VEC3"
+ },
+ {
+ "bufferView" : 4,
+ "byteOffset" : 0,
+ "componentType" : 5126,
+ "count" : 36,
+ "max" : [
+ 1.000000,
+ 1.000000,
+ 1.000000
+ ],
+ "min" : [
+ -1.000000,
+ -1.000000,
+ -1.000000
+ ],
+ "type" : "VEC3"
+ },
+ {
+ "bufferView" : 5,
+ "byteOffset" : 0,
+ "componentType" : 5126,
+ "count" : 36,
+ "max" : [
+ 1.000000,
+ -0.000000,
+ -0.000000,
+ 1.000000
+ ],
+ "min" : [
+ 0.000000,
+ -0.000000,
+ -1.000000,
+ -1.000000
+ ],
+ "type" : "VEC4"
+ },
+ {
+ "bufferView" : 6,
+ "byteOffset" : 0,
+ "componentType" : 5126,
+ "count" : 36,
+ "max" : [
+ 1.000000,
+ 1.000000
+ ],
+ "min" : [
+ -1.000000,
+ -1.000000
+ ],
+ "type" : "VEC2"
+ }
+ ],
+ "animations" : [
+ {
+ "channels" : [
+ {
+ "sampler" : 0,
+ "target" : {
+ "node" : 0,
+ "path" : "rotation"
+ }
+ }
+ ],
+ "name" : "animation_AnimatedCube",
+ "samplers" : [
+ {
+ "input" : 0,
+ "interpolation" : "LINEAR",
+ "output" : 1
+ }
+ ]
+ }
+ ],
+ "asset" : {
+ "generator" : "VKTS glTF 2.0 exporter",
+ "version" : "2.0"
+ },
+ "bufferViews" : [
+ {
+ "buffer" : 0,
+ "byteLength" : 12,
+ "byteOffset" : 0
+ },
+ {
+ "buffer" : 0,
+ "byteLength" : 48,
+ "byteOffset" : 12
+ },
+ {
+ "buffer" : 0,
+ "byteLength" : 72,
+ "byteOffset" : 60,
+ "target" : 34963
+ },
+ {
+ "buffer" : 0,
+ "byteLength" : 432,
+ "byteOffset" : 132,
+ "target" : 34962
+ },
+ {
+ "buffer" : 0,
+ "byteLength" : 432,
+ "byteOffset" : 564,
+ "target" : 34962
+ },
+ {
+ "buffer" : 0,
+ "byteLength" : 576,
+ "byteOffset" : 996,
+ "target" : 34962
+ },
+ {
+ "buffer" : 0,
+ "byteLength" : 288,
+ "byteOffset" : 1572,
+ "target" : 34962
+ }
+ ],
+ "buffers" : [
+ {
+ "byteLength" : 1860,
+ "uri" : "AnimatedCube.bin"
+ }
+ ],
+ "images" : [
+ {
+ "uri" : "AnimatedCube_BaseColor.png"
+ },
+ {
+ "uri" : "AnimatedCube_MetallicRoughness.png"
+ }
+ ],
+ "materials" : [
+ {
+ "name" : "AnimatedCube",
+ "pbrMetallicRoughness" : {
+ "baseColorTexture" : {
+ "index" : 0
+ },
+ "metallicRoughnessTexture" : {
+ "index" : 1
+ }
+ }
+ }
+ ],
+ "meshes" : [
+ {
+ "name" : "AnimatedCube",
+ "primitives" : [
+ {
+ "attributes" : {
+ "NORMAL" : 4,
+ "POSITION" : 3,
+ "TANGENT" : 5,
+ "TEXCOORD_0" : 6
+ },
+ "indices" : 2,
+ "material" : 0,
+ "mode" : 4
+ }
+ ]
+ }
+ ],
+ "nodes" : [
+ {
+ "mesh" : 0,
+ "name" : "AnimatedCube",
+ "rotation" : [
+ 0.000000,
+ -1.000000,
+ 0.000000,
+ 0.000000
+ ]
+ }
+ ],
+ "samplers" : [
+ {}
+ ],
+ "scene" : 0,
+ "scenes" : [
+ {
+ "nodes" : [
+ 0
+ ]
+ }
+ ],
+ "textures" : [
+ {
+ "sampler" : 0,
+ "source" : 0
+ },
+ {
+ "sampler" : 0,
+ "source" : 1
+ }
+ ]
+} \ No newline at end of file
diff --git a/assets/models/gltf/AnimatedCube/glTF/AnimatedCube_BaseColor.png b/assets/models/gltf/AnimatedCube/glTF/AnimatedCube_BaseColor.png
new file mode 100644
index 0000000..5e5cb20
--- /dev/null
+++ b/assets/models/gltf/AnimatedCube/glTF/AnimatedCube_BaseColor.png
Binary files differ
diff --git a/assets/models/gltf/AnimatedCube/glTF/AnimatedCube_MetallicRoughness.png b/assets/models/gltf/AnimatedCube/glTF/AnimatedCube_MetallicRoughness.png
new file mode 100644
index 0000000..efd2026
--- /dev/null
+++ b/assets/models/gltf/AnimatedCube/glTF/AnimatedCube_MetallicRoughness.png
Binary files differ
diff --git a/assets/models/gltf/AnimatedCube/metadata.json b/assets/models/gltf/AnimatedCube/metadata.json
new file mode 100644
index 0000000..3af6fdb
--- /dev/null
+++ b/assets/models/gltf/AnimatedCube/metadata.json
@@ -0,0 +1,25 @@
+{
+ "version": 2,
+ "legal": [
+ {
+ "license": "CC0",
+ "licenseUrl": "https://creativecommons.org/publicdomain/zero/1.0/legalcode",
+ "artist": "Norbert Nopper",
+ "year": "2017",
+ "owner": "UX3D",
+ "what": "Everything",
+ "text": "CC0 1.0 Universal",
+ "spdx": "CC0-1.0",
+ "icon": "https://licensebuttons.net/p/zero/1.0/88x31.png"
+ }
+ ],
+ "tags": [
+ "core",
+ "testing"
+ ],
+ "screenshot": "screenshot/screenshot.gif",
+ "name": "Animated Cube",
+ "path": "./Models/AnimatedCube",
+ "summary": "Same as 'Cube', but having a linear rotation animation.",
+ "createReadme": true
+} \ No newline at end of file
diff --git a/assets/models/gltf/AnimatedCube/screenshot/screenshot.gif b/assets/models/gltf/AnimatedCube/screenshot/screenshot.gif
new file mode 100644
index 0000000..eea74ee
--- /dev/null
+++ b/assets/models/gltf/AnimatedCube/screenshot/screenshot.gif
Binary files differ
diff --git a/assets/models/gltf/SimpleSkin/LICENSE.md b/assets/models/gltf/SimpleSkin/LICENSE.md
new file mode 100644
index 0000000..e602203
--- /dev/null
+++ b/assets/models/gltf/SimpleSkin/LICENSE.md
@@ -0,0 +1,15 @@
+# LICENSE file for the model: Simple Skin
+
+All files in this directory tree are licensed as indicated below.
+
+* All files directly associated with the model including all text, image and binary files:
+
+ * [CC0 1.0 Universal]("https://creativecommons.org/publicdomain/zero/1.0/legalcode") [SPDX license identifier: "CC0-1.0"]
+
+* This file and all other metadocumentation files including "metadata.json":
+
+ * [Creative Commons Attribtution 4.0 International]("https://creativecommons.org/licenses/by/4.0/legalcode") [SPDX license identifier: "CC-BY-4.0"]
+
+Full license text of these licenses are available at the links above
+
+#### Generated by modelmetadata \ No newline at end of file
diff --git a/assets/models/gltf/SimpleSkin/README.body.md b/assets/models/gltf/SimpleSkin/README.body.md
new file mode 100644
index 0000000..00cd41e
--- /dev/null
+++ b/assets/models/gltf/SimpleSkin/README.body.md
@@ -0,0 +1,18 @@
+## Screenshot
+
+![screenshot](screenshot/screenshot.gif)
+
+## Notes
+
+Details about skinning using this particular model are explained in the
+[skinning section of the glTF tutorial](https://github.com/javagl/glTF-Tutorials/blob/master/gltfTutorial/gltfTutorial_019_SimpleSkin.md).
+
+## Data layout
+
+The following images show the data layout of this sample:
+
+![skinGeometry](screenshot/skinGeometry.png)
+![skinAnimation](screenshot/skinAnimation.png)
+![inverseBindMatrices](screenshot/inverseBindMatrices.png)
+![skinningData](screenshot/skinningData.png)
+
diff --git a/assets/models/gltf/SimpleSkin/README.md b/assets/models/gltf/SimpleSkin/README.md
new file mode 100644
index 0000000..ec08353
--- /dev/null
+++ b/assets/models/gltf/SimpleSkin/README.md
@@ -0,0 +1,42 @@
+# Simple Skin
+
+## Tags
+
+[core](../../Models-core.md), [testing](../../Models-testing.md), [written](../../Models-written.md)
+
+## Summary
+
+A simple example of vertex skinning in glTF
+
+## Operations
+
+* [Display](https://github.khronos.org/glTF-Sample-Viewer-Release/?model=https://raw.GithubUserContent.com/KhronosGroup/glTF-Sample-Assets/main/./Models/SimpleSkin/glTF/SimpleSkin.gltf) in SampleViewer
+* [Model Directory](./)
+
+## Screenshot
+
+![screenshot](screenshot/screenshot.gif)
+
+## Notes
+
+Details about skinning using this particular model are explained in the
+[skinning section of the glTF tutorial](https://github.com/javagl/glTF-Tutorials/blob/master/gltfTutorial/gltfTutorial_019_SimpleSkin.md).
+
+## Data layout
+
+The following images show the data layout of this sample:
+
+![skinGeometry](screenshot/skinGeometry.png)
+![skinAnimation](screenshot/skinAnimation.png)
+![inverseBindMatrices](screenshot/inverseBindMatrices.png)
+![skinningData](screenshot/skinningData.png)
+
+
+
+## Legal
+
+&copy; 2017, Public. [CC0 1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/legalcode)
+
+ - javagl for Everything
+
+#### Assembled by modelmetadata \ No newline at end of file
diff --git a/assets/models/gltf/SimpleSkin/glTF-Embedded/SimpleSkin.gltf b/assets/models/gltf/SimpleSkin/glTF-Embedded/SimpleSkin.gltf
new file mode 100644
index 0000000..e9f4e4d
--- /dev/null
+++ b/assets/models/gltf/SimpleSkin/glTF-Embedded/SimpleSkin.gltf
@@ -0,0 +1,131 @@
+{
+ "scene" : 0,
+ "scenes" : [ {
+ "nodes" : [ 0, 1 ]
+ } ],
+
+ "nodes" : [ {
+ "skin" : 0,
+ "mesh" : 0
+ }, {
+ "children" : [ 2 ]
+ }, {
+ "translation" : [ 0.0, 1.0, 0.0 ],
+ "rotation" : [ 0.0, 0.0, 0.0, 1.0 ]
+ } ],
+
+ "meshes" : [ {
+ "primitives" : [ {
+ "attributes" : {
+ "POSITION" : 1,
+ "JOINTS_0" : 2,
+ "WEIGHTS_0" : 3
+ },
+ "indices" : 0
+ } ]
+ } ],
+
+ "skins" : [ {
+ "inverseBindMatrices" : 4,
+ "joints" : [ 1, 2 ]
+ } ],
+
+ "animations" : [ {
+ "channels" : [ {
+ "sampler" : 0,
+ "target" : {
+ "node" : 2,
+ "path" : "rotation"
+ }
+ } ],
+ "samplers" : [ {
+ "input" : 5,
+ "interpolation" : "LINEAR",
+ "output" : 6
+ } ]
+ } ],
+
+ "buffers" : [ {
+ "uri" : "data:application/gltf-buffer;base64,AAABAAMAAAADAAIAAgADAAUAAgAFAAQABAAFAAcABAAHAAYABgAHAAkABgAJAAgAAAAAvwAAAAAAAAAAAAAAPwAAAAAAAAAAAAAAvwAAAD8AAAAAAAAAPwAAAD8AAAAAAAAAvwAAgD8AAAAAAAAAPwAAgD8AAAAAAAAAvwAAwD8AAAAAAAAAPwAAwD8AAAAAAAAAvwAAAEAAAAAAAAAAPwAAAEAAAAAA",
+ "byteLength" : 168
+ }, {
+ "uri" : "data:application/gltf-buffer;base64,AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAABAPwAAgD4AAAAAAAAAAAAAQD8AAIA+AAAAAAAAAAAAAAA/AAAAPwAAAAAAAAAAAAAAPwAAAD8AAAAAAAAAAAAAgD4AAEA/AAAAAAAAAAAAAIA+AABAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAA=",
+ "byteLength" : 320
+ }, {
+ "uri" : "data:application/gltf-buffer;base64,AACAPwAAAAAAAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAAAAAAAAAAACAPwAAgD8AAAAAAAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAIC/AAAAAAAAgD8=",
+ "byteLength" : 128
+ }, {
+ "uri" : "data:application/gltf-buffer;base64,AAAAAAAAAD8AAIA/AADAPwAAAEAAACBAAABAQAAAYEAAAIBAAACQQAAAoEAAALBAAAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAkxjEPkSLbD8AAAAAAAAAAPT9ND/0/TQ/AAAAAAAAAAD0/TQ/9P00PwAAAAAAAAAAkxjEPkSLbD8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAkxjEvkSLbD8AAAAAAAAAAPT9NL/0/TQ/AAAAAAAAAAD0/TS/9P00PwAAAAAAAAAAkxjEvkSLbD8AAAAAAAAAAAAAAAAAAIA/",
+ "byteLength" : 240
+ } ],
+
+ "bufferViews" : [ {
+ "buffer" : 0,
+ "byteLength" : 48,
+ "target" : 34963
+ }, {
+ "buffer" : 0,
+ "byteOffset" : 48,
+ "byteLength" : 120,
+ "target" : 34962
+ }, {
+ "buffer" : 1,
+ "byteLength" : 320,
+ "byteStride" : 16
+ }, {
+ "buffer" : 2,
+ "byteLength" : 128
+ }, {
+ "buffer" : 3,
+ "byteLength" : 240
+ } ],
+
+ "accessors" : [ {
+ "bufferView" : 0,
+ "componentType" : 5123,
+ "count" : 24,
+ "type" : "SCALAR"
+ }, {
+ "bufferView" : 1,
+ "componentType" : 5126,
+ "count" : 10,
+ "type" : "VEC3",
+ "max" : [ 0.5, 2.0, 0.0 ],
+ "min" : [ -0.5, 0.0, 0.0 ]
+ }, {
+ "bufferView" : 2,
+ "componentType" : 5123,
+ "count" : 10,
+ "type" : "VEC4"
+ }, {
+ "bufferView" : 2,
+ "byteOffset" : 160,
+ "componentType" : 5126,
+ "count" : 10,
+ "type" : "VEC4"
+ }, {
+ "bufferView" : 3,
+ "componentType" : 5126,
+ "count" : 2,
+ "type" : "MAT4"
+ }, {
+ "bufferView" : 4,
+ "componentType" : 5126,
+ "count" : 12,
+ "type" : "SCALAR",
+ "max" : [ 5.5 ],
+ "min" : [ 0.0 ]
+ }, {
+ "bufferView" : 4,
+ "byteOffset" : 48,
+ "componentType" : 5126,
+ "count" : 12,
+ "type" : "VEC4",
+ "max" : [ 0.0, 0.0, 0.707, 1.0 ],
+ "min" : [ 0.0, 0.0, -0.707, 0.707 ]
+ } ],
+
+ "asset" : {
+ "version" : "2.0"
+ }
+} \ No newline at end of file
diff --git a/assets/models/gltf/SimpleSkin/glTF/SimpleSkin.gltf b/assets/models/gltf/SimpleSkin/glTF/SimpleSkin.gltf
new file mode 100644
index 0000000..52f0aa0
--- /dev/null
+++ b/assets/models/gltf/SimpleSkin/glTF/SimpleSkin.gltf
@@ -0,0 +1,131 @@
+{
+ "scene" : 0,
+ "scenes" : [ {
+ "nodes" : [ 0, 1 ]
+ } ],
+
+ "nodes" : [ {
+ "skin" : 0,
+ "mesh" : 0
+ }, {
+ "children" : [ 2 ]
+ }, {
+ "translation" : [ 0.0, 1.0, 0.0 ],
+ "rotation" : [ 0.0, 0.0, 0.0, 1.0 ]
+ } ],
+
+ "meshes" : [ {
+ "primitives" : [ {
+ "attributes" : {
+ "POSITION" : 1,
+ "JOINTS_0" : 2,
+ "WEIGHTS_0" : 3
+ },
+ "indices" : 0
+ } ]
+ } ],
+
+ "skins" : [ {
+ "inverseBindMatrices" : 4,
+ "joints" : [ 1, 2 ]
+ } ],
+
+ "animations" : [ {
+ "channels" : [ {
+ "sampler" : 0,
+ "target" : {
+ "node" : 2,
+ "path" : "rotation"
+ }
+ } ],
+ "samplers" : [ {
+ "input" : 5,
+ "interpolation" : "LINEAR",
+ "output" : 6
+ } ]
+ } ],
+
+ "buffers" : [ {
+ "uri" : "skinGeometry.bin",
+ "byteLength" : 168
+ }, {
+ "uri" : "skinningData.bin",
+ "byteLength" : 320
+ }, {
+ "uri" : "inverseBindMatrices.bin",
+ "byteLength" : 128
+ }, {
+ "uri" : "skinAnimation.bin",
+ "byteLength" : 240
+ } ],
+
+ "bufferViews" : [ {
+ "buffer" : 0,
+ "byteLength" : 48,
+ "target" : 34963
+ }, {
+ "buffer" : 0,
+ "byteOffset" : 48,
+ "byteLength" : 120,
+ "target" : 34962
+ }, {
+ "buffer" : 1,
+ "byteLength" : 320,
+ "byteStride" : 16
+ }, {
+ "buffer" : 2,
+ "byteLength" : 128
+ }, {
+ "buffer" : 3,
+ "byteLength" : 240
+ } ],
+
+ "accessors" : [ {
+ "bufferView" : 0,
+ "componentType" : 5123,
+ "count" : 24,
+ "type" : "SCALAR"
+ }, {
+ "bufferView" : 1,
+ "componentType" : 5126,
+ "count" : 10,
+ "type" : "VEC3",
+ "max" : [ 0.5, 2.0, 0.0 ],
+ "min" : [ -0.5, 0.0, 0.0 ]
+ }, {
+ "bufferView" : 2,
+ "componentType" : 5123,
+ "count" : 10,
+ "type" : "VEC4"
+ }, {
+ "bufferView" : 2,
+ "byteOffset" : 160,
+ "componentType" : 5126,
+ "count" : 10,
+ "type" : "VEC4"
+ }, {
+ "bufferView" : 3,
+ "componentType" : 5126,
+ "count" : 2,
+ "type" : "MAT4"
+ }, {
+ "bufferView" : 4,
+ "componentType" : 5126,
+ "count" : 12,
+ "type" : "SCALAR",
+ "max" : [ 5.5 ],
+ "min" : [ 0.0 ]
+ }, {
+ "bufferView" : 4,
+ "byteOffset" : 48,
+ "componentType" : 5126,
+ "count" : 12,
+ "type" : "VEC4",
+ "max" : [ 0.0, 0.0, 0.707, 1.0 ],
+ "min" : [ 0.0, 0.0, -0.707, 0.707 ]
+ } ],
+
+ "asset" : {
+ "version" : "2.0"
+ }
+} \ No newline at end of file
diff --git a/assets/models/gltf/SimpleSkin/glTF/inverseBindMatrices.bin b/assets/models/gltf/SimpleSkin/glTF/inverseBindMatrices.bin
new file mode 100644
index 0000000..5af0b5e
--- /dev/null
+++ b/assets/models/gltf/SimpleSkin/glTF/inverseBindMatrices.bin
Binary files differ
diff --git a/assets/models/gltf/SimpleSkin/glTF/skinAnimation.bin b/assets/models/gltf/SimpleSkin/glTF/skinAnimation.bin
new file mode 100644
index 0000000..ff550c6
--- /dev/null
+++ b/assets/models/gltf/SimpleSkin/glTF/skinAnimation.bin
Binary files differ
diff --git a/assets/models/gltf/SimpleSkin/glTF/skinGeometry.bin b/assets/models/gltf/SimpleSkin/glTF/skinGeometry.bin
new file mode 100644
index 0000000..15375c4
--- /dev/null
+++ b/assets/models/gltf/SimpleSkin/glTF/skinGeometry.bin
Binary files differ
diff --git a/assets/models/gltf/SimpleSkin/glTF/skinningData.bin b/assets/models/gltf/SimpleSkin/glTF/skinningData.bin
new file mode 100644
index 0000000..fd0c165
--- /dev/null
+++ b/assets/models/gltf/SimpleSkin/glTF/skinningData.bin
Binary files differ
diff --git a/assets/models/gltf/SimpleSkin/metadata.json b/assets/models/gltf/SimpleSkin/metadata.json
new file mode 100644
index 0000000..764a837
--- /dev/null
+++ b/assets/models/gltf/SimpleSkin/metadata.json
@@ -0,0 +1,26 @@
+{
+ "version": 2,
+ "legal": [
+ {
+ "license": "CC0",
+ "licenseUrl": "https://creativecommons.org/publicdomain/zero/1.0/legalcode",
+ "artist": "javagl",
+ "year": "2017",
+ "owner": "Public",
+ "what": "Everything",
+ "text": "CC0 1.0 Universal",
+ "spdx": "CC0-1.0",
+ "icon": "https://licensebuttons.net/p/zero/1.0/88x31.png"
+ }
+ ],
+ "tags": [
+ "core",
+ "testing",
+ "written"
+ ],
+ "screenshot": "screenshot/screenshot.gif",
+ "name": "Simple Skin",
+ "path": "./Models/SimpleSkin",
+ "summary": "A simple example of vertex skinning in glTF",
+ "createReadme": true
+} \ No newline at end of file
diff --git a/assets/models/gltf/SimpleSkin/screenshot/inverseBindMatrices.png b/assets/models/gltf/SimpleSkin/screenshot/inverseBindMatrices.png
new file mode 100644
index 0000000..a069f59
--- /dev/null
+++ b/assets/models/gltf/SimpleSkin/screenshot/inverseBindMatrices.png
Binary files differ
diff --git a/assets/models/gltf/SimpleSkin/screenshot/screenshot.gif b/assets/models/gltf/SimpleSkin/screenshot/screenshot.gif
new file mode 100644
index 0000000..c8fb353
--- /dev/null
+++ b/assets/models/gltf/SimpleSkin/screenshot/screenshot.gif
Binary files differ
diff --git a/assets/models/gltf/SimpleSkin/screenshot/skinAnimation.png b/assets/models/gltf/SimpleSkin/screenshot/skinAnimation.png
new file mode 100644
index 0000000..20257e1
--- /dev/null
+++ b/assets/models/gltf/SimpleSkin/screenshot/skinAnimation.png
Binary files differ
diff --git a/assets/models/gltf/SimpleSkin/screenshot/skinGeometry.png b/assets/models/gltf/SimpleSkin/screenshot/skinGeometry.png
new file mode 100644
index 0000000..2569d9f
--- /dev/null
+++ b/assets/models/gltf/SimpleSkin/screenshot/skinGeometry.png
Binary files differ
diff --git a/assets/models/gltf/SimpleSkin/screenshot/skinningData.png b/assets/models/gltf/SimpleSkin/screenshot/skinningData.png
new file mode 100644
index 0000000..bd25b70
--- /dev/null
+++ b/assets/models/gltf/SimpleSkin/screenshot/skinningData.png
Binary files differ
diff --git a/assets/shaders/blinn_phong.frag b/assets/shaders/blinn_phong.frag
index 095b19a..a0ba905 100644
--- a/assets/shaders/blinn_phong.frag
+++ b/assets/shaders/blinn_phong.frag
@@ -33,6 +33,7 @@ in VS_OUT {
vec3 Normal;
vec2 TexCoords;
vec4 FragPosLightSpace;
+ vec4 Color;
} fs_in;
// --- Uniforms
@@ -55,7 +56,8 @@ void main() {
result += CalcPointLight(pointLights[i], norm, fs_in.FragPos, viewDir);
}
- FragColor = vec4(result, 1.0);
+// FragColor = vec4(result, 1.0);
+ FragColor = fs_in.Color + 0.5;
}
vec3 CalcDirLight(DirLight light, vec3 normal, vec3 viewDir)
diff --git a/assets/shaders/blinn_phong.vert b/assets/shaders/blinn_phong.vert
index 6028178..06dc5e7 100644
--- a/assets/shaders/blinn_phong.vert
+++ b/assets/shaders/blinn_phong.vert
@@ -15,6 +15,7 @@ out VS_OUT {
vec3 Normal;
vec2 TexCoords;
vec4 FragPosLightSpace;
+ vec4 Color;
} vs_out;
void main() {
@@ -22,5 +23,6 @@ void main() {
vs_out.Normal = inNormal;
vs_out.TexCoords = inTexCoords;
vs_out.FragPosLightSpace = lightSpaceMatrix * vec4(vs_out.FragPos, 1.0);
+ vs_out.Color = vec4(1.0);
gl_Position = projection * view * model * vec4(inPos, 1.0);
} \ No newline at end of file
diff --git a/assets/shaders/object.frag b/assets/shaders/object.frag
index 11b33e1..fa50fcf 100644
--- a/assets/shaders/object.frag
+++ b/assets/shaders/object.frag
@@ -1,9 +1,15 @@
#version 450
#extension GL_ARB_separate_shader_objects : enable
-layout(location = 0) in vec3 in_normal;
-layout(location = 1) in vec3 in_position;
+layout(location = 0) in vec3 in_position;
+layout(location = 1) in vec3 in_normal;
+layout(location = 2) in vec2 in_tex_coord;
-layout(location = 0) out vec4 out_colour;
+layout(set = 0, binding = 1) uniform sampler2D texSampler;
-void main() { out_colour = vec4(in_normal, 1.0); } \ No newline at end of file
+layout(location = 0) out vec4 out_color;
+
+void main() {
+ // out_color = vec4(1.0);
+ out_color = texture(texSampler, in_tex_coord);
+} \ No newline at end of file
diff --git a/assets/shaders/object.vert b/assets/shaders/object.vert
index a7237bb..23c0ffb 100644
--- a/assets/shaders/object.vert
+++ b/assets/shaders/object.vert
@@ -3,9 +3,11 @@
layout(location = 0) in vec3 in_position;
layout(location = 1) in vec3 in_normal;
+layout(location = 2) in vec2 in_tex_coord;
-layout(location = 0) out vec3 out_normal;
-layout(location = 1) out vec3 out_position;
+layout(location = 0) out vec3 out_position;
+layout(location = 1) out vec3 out_normal;
+layout(location = 2) out vec2 out_tex_coord;
layout(set = 0, binding = 0) uniform global_object_uniform {
mat4 projection;
@@ -19,8 +21,9 @@ layout(push_constant) uniform push_constants {
u_push_constants;
void main() {
- out_position = in_position;
gl_Position = global_ubo.projection * global_ubo.view * u_push_constants.model *
vec4(in_position.x, in_position.y, in_position.z, 1.0);
- out_normal = in_normal; // forward normal vectors
+ out_position = in_position;
+ out_normal = in_normal;
+ out_tex_coord = in_tex_coord;
} \ No newline at end of file
diff --git a/assets/shaders/skinned.vert b/assets/shaders/skinned.vert
new file mode 100644
index 0000000..cb2ca85
--- /dev/null
+++ b/assets/shaders/skinned.vert
@@ -0,0 +1,59 @@
+#version 410 core
+// Inputs
+layout (location = 0) in vec3 inPos;
+layout (location = 1) in vec3 inNormal;
+layout (location = 2) in vec2 inTexCoords;
+layout (location = 3) in ivec4 inBoneIndices;
+layout (location = 4) in vec4 inWeights;
+
+uniform mat4 model;
+uniform mat4 view;
+uniform mat4 projection;
+uniform mat4 lightSpaceMatrix;
+
+const int MAX_BONES = 100;
+const int MAX_BONE_INFLUENCES = 4;
+uniform mat4 boneMatrices[MAX_BONES]; // TODO!
+
+// Output
+out VS_OUT {
+ vec3 FragPos;
+ vec3 Normal;
+ vec2 TexCoords;
+ vec4 FragPosLightSpace;
+ vec4 Color;
+} vs_out;
+
+void main() {
+ // vec4 totalPosition = vec4(0.0f);
+ // for(int i = 0 ; i < MAX_BONE_INFLUENCES ; i++) {
+ // if(inBoneIndices[i] == 0)
+ // continue;
+ // if(inBoneIndices[i] >=MAX_BONES)
+ // {
+ // totalPosition = vec4(inPos,1.0f);
+ // break;
+ // }
+ // vec4 localPosition = finalBoneMatrices[inBoneIndices[i]] * vec4(inPos,1.0f);
+ // totalPosition += localPosition * inWeights[i];
+ // vec3 localNormal = mat3(finalBoneMatrices[inBoneIndices[i]]) * inNormal;
+ // vs_out.Normal = localNormal;
+ // }
+
+
+ mat4 skinMatrix = // mat4(1.0)
+ // boneMatrices[int(inBoneIndices.z)]; // should just be the identtiy
+ inWeights.x * boneMatrices[int(inBoneIndices.x)] +
+ inWeights.y * boneMatrices[int(inBoneIndices.y)] +
+ inWeights.z * boneMatrices[int(inBoneIndices.z)] +
+ inWeights.w * boneMatrices[int(inBoneIndices.w)];
+
+ vec4 totalPosition = skinMatrix * vec4(inPos, 1.0);
+
+ vs_out.FragPos = vec3(model * totalPosition);
+ // vs_out.Normal = inNormal;
+ vs_out.TexCoords = inTexCoords;
+ vs_out.FragPosLightSpace = lightSpaceMatrix * vec4(vs_out.FragPos, 1.0);
+ vs_out.Color = inWeights;
+ gl_Position = projection * view * model * totalPosition;
+} \ No newline at end of file