diff --git a/Output/Positive/Animation_Skin/Animation_Skin_05.bin b/Output/Positive/Animation_Skin/Animation_Skin_05.bin index a5a25ad1..897926e5 100644 Binary files a/Output/Positive/Animation_Skin/Animation_Skin_05.bin and b/Output/Positive/Animation_Skin/Animation_Skin_05.bin differ diff --git a/Output/Positive/Animation_Skin/Animation_Skin_05.gltf b/Output/Positive/Animation_Skin/Animation_Skin_05.gltf index e32cef82..70a9e4ae 100644 --- a/Output/Positive/Animation_Skin/Animation_Skin_05.gltf +++ b/Output/Positive/Animation_Skin/Animation_Skin_05.gltf @@ -64,20 +64,13 @@ }, { "bufferView": 6, - "componentType": 5125, - "count": 12, - "type": "SCALAR", - "name": "Indices Accessor" - }, - { - "bufferView": 7, "componentType": 5126, "count": 6, "type": "VEC4", "name": "weights accessor" }, { - "bufferView": 8, + "bufferView": 7, "componentType": 5123, "count": 6, "type": "VEC4", @@ -91,7 +84,7 @@ "buffers": [ { "uri": "Animation_Skin_05.bin", - "byteLength": 656 + "byteLength": 608 } ], "bufferViews": [ @@ -133,18 +126,12 @@ { "buffer": 0, "byteOffset": 464, - "byteLength": 48, - "name": "Indices" - }, - { - "buffer": 0, - "byteOffset": 512, "byteLength": 96, "name": "weights buffer view" }, { "buffer": 0, - "byteOffset": 608, + "byteOffset": 560, "byteLength": 48, "name": "joint indices buffer view" } @@ -192,10 +179,10 @@ { "attributes": { "POSITION": 5, - "WEIGHTS_0": 7, - "JOINTS_0": 8 + "WEIGHTS_0": 6, + "JOINTS_0": 7 }, - "indices": 6, + "indices": 1, "material": 1 } ] diff --git a/Output/Positive/Animation_Skin/Animation_Skin_07.bin b/Output/Positive/Animation_Skin/Animation_Skin_07.bin index fcf2f9df..89f6a260 100644 Binary files a/Output/Positive/Animation_Skin/Animation_Skin_07.bin and b/Output/Positive/Animation_Skin/Animation_Skin_07.bin differ diff --git a/Output/Positive/Animation_Skin/Animation_Skin_07.gltf b/Output/Positive/Animation_Skin/Animation_Skin_07.gltf index 45cef560..2ed68d45 100644 --- a/Output/Positive/Animation_Skin/Animation_Skin_07.gltf +++ b/Output/Positive/Animation_Skin/Animation_Skin_07.gltf @@ -86,13 +86,6 @@ { "bufferView": 9, "componentType": 5126, - "count": 2, - "type": "MAT4", - "name": "IBM" - }, - { - "bufferView": 10, - "componentType": 5126, "count": 3, "type": "SCALAR", "max": [ @@ -104,7 +97,7 @@ "name": "Animation Sampler Input" }, { - "bufferView": 11, + "bufferView": 10, "componentType": 5126, "count": 3, "type": "VEC4", @@ -124,8 +117,8 @@ ], "samplers": [ { - "input": 10, - "output": 11 + "input": 9, + "output": 10 } ] } @@ -137,7 +130,7 @@ "buffers": [ { "uri": "Animation_Skin_07.bin", - "byteLength": 892 + "byteLength": 764 } ], "bufferViews": [ @@ -197,18 +190,12 @@ { "buffer": 0, "byteOffset": 704, - "byteLength": 128, - "name": "Inverse Bind Matrix" - }, - { - "buffer": 0, - "byteOffset": 832, "byteLength": 12, "name": "Animation Sampler Input" }, { "buffer": 0, - "byteOffset": 844, + "byteOffset": 716, "byteLength": 48, "name": "Animation Sampler Output" } @@ -299,7 +286,7 @@ "name": "joint1" }, { - "skin": 1, + "skin": 0, "mesh": 1, "name": "outerPrism" } @@ -320,16 +307,7 @@ "joints": [ 1, 2 - ], - "name": "innerPrismSkinB" - }, - { - "inverseBindMatrices": 9, - "joints": [ - 1, - 2 - ], - "name": "outerPrismSkinB" + ] } ] } \ No newline at end of file diff --git a/Output/Positive/Animation_Skin/Figures/SampleImages/Animation_Skin_11.png b/Output/Positive/Animation_Skin/Figures/SampleImages/Animation_Skin_11.png index 5d8b8e91..da3608f2 100644 Binary files a/Output/Positive/Animation_Skin/Figures/SampleImages/Animation_Skin_11.png and b/Output/Positive/Animation_Skin/Figures/SampleImages/Animation_Skin_11.png differ diff --git a/Output/Positive/Animation_Skin/Figures/Thumbnails/Animation_Skin_11.png b/Output/Positive/Animation_Skin/Figures/Thumbnails/Animation_Skin_11.png index c95523fc..2846256d 100644 Binary files a/Output/Positive/Animation_Skin/Figures/Thumbnails/Animation_Skin_11.png and b/Output/Positive/Animation_Skin/Figures/Thumbnails/Animation_Skin_11.png differ diff --git a/Output/Positive/Animation_Skin/Manifest.json b/Output/Positive/Animation_Skin/Manifest.json index 91606a55..8e6402a1 100644 --- a/Output/Positive/Animation_Skin/Manifest.json +++ b/Output/Positive/Animation_Skin/Manifest.json @@ -140,7 +140,7 @@ "sampleImageName": "Figures/SampleImages/Animation_Skin_11.png", "camera": { "translation": [ - 0.8, + 1.5, 0.0, 1.0 ] diff --git a/Output/Positive/Animation_Skin/ValidatorResults/Animation_Skin_05.json b/Output/Positive/Animation_Skin/ValidatorResults/Animation_Skin_05.json index 244be1c6..cce59a30 100644 --- a/Output/Positive/Animation_Skin/ValidatorResults/Animation_Skin_05.json +++ b/Output/Positive/Animation_Skin/ValidatorResults/Animation_Skin_05.json @@ -19,7 +19,7 @@ "mimeType": "application/gltf-buffer", "storage": "external", "uri": "Animation_Skin_05.bin", - "byteLength": 656 + "byteLength": 608 } ], "hasAnimations": false, diff --git a/Output/Positive/Animation_Skin/ValidatorResults/Animation_Skin_07.json b/Output/Positive/Animation_Skin/ValidatorResults/Animation_Skin_07.json index 34f00089..dd0a61cb 100644 --- a/Output/Positive/Animation_Skin/ValidatorResults/Animation_Skin_07.json +++ b/Output/Positive/Animation_Skin/ValidatorResults/Animation_Skin_07.json @@ -19,7 +19,7 @@ "mimeType": "application/gltf-buffer", "storage": "external", "uri": "Animation_Skin_07.bin", - "byteLength": 892 + "byteLength": 764 } ], "hasAnimations": true, diff --git a/Output/Positive/Instancing/Figures/SampleImages/Instancing_00.png b/Output/Positive/Instancing/Figures/SampleImages/Instancing_00.png new file mode 100644 index 00000000..cdcdc01d Binary files /dev/null and b/Output/Positive/Instancing/Figures/SampleImages/Instancing_00.png differ diff --git a/Output/Positive/Instancing/Figures/SampleImages/Instancing_01.png b/Output/Positive/Instancing/Figures/SampleImages/Instancing_01.png new file mode 100644 index 00000000..ea618911 Binary files /dev/null and b/Output/Positive/Instancing/Figures/SampleImages/Instancing_01.png differ diff --git a/Output/Positive/Instancing/Figures/SampleImages/Instancing_02.png b/Output/Positive/Instancing/Figures/SampleImages/Instancing_02.png new file mode 100644 index 00000000..4f19ea4e Binary files /dev/null and b/Output/Positive/Instancing/Figures/SampleImages/Instancing_02.png differ diff --git a/Output/Positive/Instancing/Figures/SampleImages/Instancing_03.png b/Output/Positive/Instancing/Figures/SampleImages/Instancing_03.png new file mode 100644 index 00000000..0846d1b2 Binary files /dev/null and b/Output/Positive/Instancing/Figures/SampleImages/Instancing_03.png differ diff --git a/Output/Positive/Instancing/Figures/SampleImages/Instancing_04.png b/Output/Positive/Instancing/Figures/SampleImages/Instancing_04.png new file mode 100644 index 00000000..13394a9a Binary files /dev/null and b/Output/Positive/Instancing/Figures/SampleImages/Instancing_04.png differ diff --git a/Output/Positive/Instancing/Figures/SampleImages/Instancing_05.png b/Output/Positive/Instancing/Figures/SampleImages/Instancing_05.png new file mode 100644 index 00000000..13394a9a Binary files /dev/null and b/Output/Positive/Instancing/Figures/SampleImages/Instancing_05.png differ diff --git a/Output/Positive/Instancing/Figures/SampleImages/Instancing_06.png b/Output/Positive/Instancing/Figures/SampleImages/Instancing_06.png new file mode 100644 index 00000000..12a621ba Binary files /dev/null and b/Output/Positive/Instancing/Figures/SampleImages/Instancing_06.png differ diff --git a/Output/Positive/Instancing/Figures/SampleImages/Instancing_07.png b/Output/Positive/Instancing/Figures/SampleImages/Instancing_07.png new file mode 100644 index 00000000..9ae77ce6 Binary files /dev/null and b/Output/Positive/Instancing/Figures/SampleImages/Instancing_07.png differ diff --git a/Output/Positive/Instancing/Figures/SampleImages/Instancing_08.png b/Output/Positive/Instancing/Figures/SampleImages/Instancing_08.png new file mode 100644 index 00000000..96c70254 Binary files /dev/null and b/Output/Positive/Instancing/Figures/SampleImages/Instancing_08.png differ diff --git a/Output/Positive/Instancing/Figures/SampleImages/Instancing_09.png b/Output/Positive/Instancing/Figures/SampleImages/Instancing_09.png new file mode 100644 index 00000000..9ae77ce6 Binary files /dev/null and b/Output/Positive/Instancing/Figures/SampleImages/Instancing_09.png differ diff --git a/Output/Positive/Instancing/Figures/SampleImages/Instancing_10.gif b/Output/Positive/Instancing/Figures/SampleImages/Instancing_10.gif new file mode 100644 index 00000000..adee2fd6 Binary files /dev/null and b/Output/Positive/Instancing/Figures/SampleImages/Instancing_10.gif differ diff --git a/Output/Positive/Instancing/Figures/SampleImages/Instancing_11.gif b/Output/Positive/Instancing/Figures/SampleImages/Instancing_11.gif new file mode 100644 index 00000000..a908fa40 Binary files /dev/null and b/Output/Positive/Instancing/Figures/SampleImages/Instancing_11.gif differ diff --git a/Output/Positive/Instancing/Figures/SampleImages/Instancing_12.gif b/Output/Positive/Instancing/Figures/SampleImages/Instancing_12.gif new file mode 100644 index 00000000..fcad7c7c Binary files /dev/null and b/Output/Positive/Instancing/Figures/SampleImages/Instancing_12.gif differ diff --git a/Output/Positive/Instancing/Figures/Thumbnails/BaseColor_A.png b/Output/Positive/Instancing/Figures/Thumbnails/BaseColor_A.png new file mode 100644 index 00000000..5772f4e4 Binary files /dev/null and b/Output/Positive/Instancing/Figures/Thumbnails/BaseColor_A.png differ diff --git a/Output/Positive/Instancing/Figures/Thumbnails/BaseColor_B.png b/Output/Positive/Instancing/Figures/Thumbnails/BaseColor_B.png new file mode 100644 index 00000000..073399f8 Binary files /dev/null and b/Output/Positive/Instancing/Figures/Thumbnails/BaseColor_B.png differ diff --git a/Output/Positive/Instancing/Figures/Thumbnails/BaseColor_Cube.png b/Output/Positive/Instancing/Figures/Thumbnails/BaseColor_Cube.png new file mode 100644 index 00000000..4dd78402 Binary files /dev/null and b/Output/Positive/Instancing/Figures/Thumbnails/BaseColor_Cube.png differ diff --git a/Output/Positive/Instancing/Figures/Thumbnails/Instancing_00.png b/Output/Positive/Instancing/Figures/Thumbnails/Instancing_00.png new file mode 100644 index 00000000..b351a310 Binary files /dev/null and b/Output/Positive/Instancing/Figures/Thumbnails/Instancing_00.png differ diff --git a/Output/Positive/Instancing/Figures/Thumbnails/Instancing_01.png b/Output/Positive/Instancing/Figures/Thumbnails/Instancing_01.png new file mode 100644 index 00000000..433a467d Binary files /dev/null and b/Output/Positive/Instancing/Figures/Thumbnails/Instancing_01.png differ diff --git a/Output/Positive/Instancing/Figures/Thumbnails/Instancing_02.png b/Output/Positive/Instancing/Figures/Thumbnails/Instancing_02.png new file mode 100644 index 00000000..cd85cb73 Binary files /dev/null and b/Output/Positive/Instancing/Figures/Thumbnails/Instancing_02.png differ diff --git a/Output/Positive/Instancing/Figures/Thumbnails/Instancing_03.png b/Output/Positive/Instancing/Figures/Thumbnails/Instancing_03.png new file mode 100644 index 00000000..8216ed7a Binary files /dev/null and b/Output/Positive/Instancing/Figures/Thumbnails/Instancing_03.png differ diff --git a/Output/Positive/Instancing/Figures/Thumbnails/Instancing_04.png b/Output/Positive/Instancing/Figures/Thumbnails/Instancing_04.png new file mode 100644 index 00000000..9a99f8b7 Binary files /dev/null and b/Output/Positive/Instancing/Figures/Thumbnails/Instancing_04.png differ diff --git a/Output/Positive/Instancing/Figures/Thumbnails/Instancing_05.png b/Output/Positive/Instancing/Figures/Thumbnails/Instancing_05.png new file mode 100644 index 00000000..9a99f8b7 Binary files /dev/null and b/Output/Positive/Instancing/Figures/Thumbnails/Instancing_05.png differ diff --git a/Output/Positive/Instancing/Figures/Thumbnails/Instancing_06.png b/Output/Positive/Instancing/Figures/Thumbnails/Instancing_06.png new file mode 100644 index 00000000..7f87614b Binary files /dev/null and b/Output/Positive/Instancing/Figures/Thumbnails/Instancing_06.png differ diff --git a/Output/Positive/Instancing/Figures/Thumbnails/Instancing_07.png b/Output/Positive/Instancing/Figures/Thumbnails/Instancing_07.png new file mode 100644 index 00000000..6ceca2dc Binary files /dev/null and b/Output/Positive/Instancing/Figures/Thumbnails/Instancing_07.png differ diff --git a/Output/Positive/Instancing/Figures/Thumbnails/Instancing_08.png b/Output/Positive/Instancing/Figures/Thumbnails/Instancing_08.png new file mode 100644 index 00000000..e0716e40 Binary files /dev/null and b/Output/Positive/Instancing/Figures/Thumbnails/Instancing_08.png differ diff --git a/Output/Positive/Instancing/Figures/Thumbnails/Instancing_09.png b/Output/Positive/Instancing/Figures/Thumbnails/Instancing_09.png new file mode 100644 index 00000000..6ceca2dc Binary files /dev/null and b/Output/Positive/Instancing/Figures/Thumbnails/Instancing_09.png differ diff --git a/Output/Positive/Instancing/Figures/Thumbnails/Instancing_10.gif b/Output/Positive/Instancing/Figures/Thumbnails/Instancing_10.gif new file mode 100644 index 00000000..4469355f Binary files /dev/null and b/Output/Positive/Instancing/Figures/Thumbnails/Instancing_10.gif differ diff --git a/Output/Positive/Instancing/Figures/Thumbnails/Instancing_11.gif b/Output/Positive/Instancing/Figures/Thumbnails/Instancing_11.gif new file mode 100644 index 00000000..1afa1d2f Binary files /dev/null and b/Output/Positive/Instancing/Figures/Thumbnails/Instancing_11.gif differ diff --git a/Output/Positive/Instancing/Figures/Thumbnails/Instancing_12.gif b/Output/Positive/Instancing/Figures/Thumbnails/Instancing_12.gif new file mode 100644 index 00000000..398b5c61 Binary files /dev/null and b/Output/Positive/Instancing/Figures/Thumbnails/Instancing_12.gif differ diff --git a/Output/Positive/Instancing/Instancing_00.bin b/Output/Positive/Instancing/Instancing_00.bin new file mode 100644 index 00000000..5544c5b0 Binary files /dev/null and b/Output/Positive/Instancing/Instancing_00.bin differ diff --git a/Output/Positive/Instancing/Instancing_00.gltf b/Output/Positive/Instancing/Instancing_00.gltf new file mode 100644 index 00000000..9671a526 --- /dev/null +++ b/Output/Positive/Instancing/Instancing_00.gltf @@ -0,0 +1,189 @@ +{ + "accessors": [ + { + "bufferView": 0, + "componentType": 5126, + "count": 4, + "type": "VEC3", + "max": [ + -0.100000024, + 0.5, + 0.0 + ], + "min": [ + -1.1, + -0.5, + 0.0 + ], + "name": "Positions Accessor" + }, + { + "bufferView": 1, + "componentType": 5126, + "count": 4, + "type": "VEC2", + "name": "UV Accessor 0" + }, + { + "bufferView": 2, + "componentType": 5125, + "count": 6, + "type": "SCALAR", + "name": "Indices Accessor" + }, + { + "bufferView": 3, + "componentType": 5126, + "count": 4, + "type": "VEC3", + "max": [ + 1.1, + 0.5, + 0.0 + ], + "min": [ + 0.100000024, + -0.5, + 0.0 + ], + "name": "Positions Accessor" + }, + { + "bufferView": 4, + "componentType": 5126, + "count": 4, + "type": "VEC2", + "name": "UV Accessor 0" + }, + { + "bufferView": 5, + "componentType": 5125, + "count": 6, + "type": "SCALAR", + "name": "Indices Accessor" + } + ], + "asset": { + "generator": "glTF Asset Generator", + "version": "2.0" + }, + "buffers": [ + { + "uri": "Instancing_00.bin", + "byteLength": 208 + } + ], + "bufferViews": [ + { + "buffer": 0, + "byteLength": 48, + "name": "Positions" + }, + { + "buffer": 0, + "byteOffset": 48, + "byteLength": 32, + "name": "Texture Coords 0" + }, + { + "buffer": 0, + "byteOffset": 80, + "byteLength": 24, + "name": "Indices" + }, + { + "buffer": 0, + "byteOffset": 104, + "byteLength": 48, + "name": "Positions" + }, + { + "buffer": 0, + "byteOffset": 152, + "byteLength": 32, + "name": "Texture Coords 0" + }, + { + "buffer": 0, + "byteOffset": 184, + "byteLength": 24, + "name": "Indices" + } + ], + "images": [ + { + "uri": "Textures/BaseColor_A.png" + } + ], + "materials": [ + { + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 0 + } + } + }, + { + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 1 + } + } + } + ], + "meshes": [ + { + "primitives": [ + { + "attributes": { + "POSITION": 0, + "TEXCOORD_0": 1 + }, + "indices": 2, + "material": 0 + }, + { + "attributes": { + "POSITION": 3, + "TEXCOORD_0": 4 + }, + "indices": 5, + "material": 1 + } + ] + } + ], + "nodes": [ + { + "mesh": 0 + } + ], + "samplers": [ + { + "wrapS": 33071, + "wrapT": 33071 + }, + { + "wrapS": 33648, + "wrapT": 33648 + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ], + "textures": [ + { + "sampler": 0, + "source": 0 + }, + { + "sampler": 1, + "source": 0 + } + ] +} \ No newline at end of file diff --git a/Output/Positive/Instancing/Instancing_01.bin b/Output/Positive/Instancing/Instancing_01.bin new file mode 100644 index 00000000..5544c5b0 Binary files /dev/null and b/Output/Positive/Instancing/Instancing_01.bin differ diff --git a/Output/Positive/Instancing/Instancing_01.gltf b/Output/Positive/Instancing/Instancing_01.gltf new file mode 100644 index 00000000..aeec8b0f --- /dev/null +++ b/Output/Positive/Instancing/Instancing_01.gltf @@ -0,0 +1,188 @@ +{ + "accessors": [ + { + "bufferView": 0, + "componentType": 5126, + "count": 4, + "type": "VEC3", + "max": [ + -0.100000024, + 0.5, + 0.0 + ], + "min": [ + -1.1, + -0.5, + 0.0 + ], + "name": "Positions Accessor" + }, + { + "bufferView": 1, + "componentType": 5126, + "count": 4, + "type": "VEC2", + "name": "UV Accessor 0" + }, + { + "bufferView": 2, + "componentType": 5125, + "count": 6, + "type": "SCALAR", + "name": "Indices Accessor" + }, + { + "bufferView": 3, + "componentType": 5126, + "count": 4, + "type": "VEC3", + "max": [ + 1.1, + 0.5, + 0.0 + ], + "min": [ + 0.100000024, + -0.5, + 0.0 + ], + "name": "Positions Accessor" + }, + { + "bufferView": 4, + "componentType": 5126, + "count": 4, + "type": "VEC2", + "name": "UV Accessor 0" + }, + { + "bufferView": 5, + "componentType": 5125, + "count": 6, + "type": "SCALAR", + "name": "Indices Accessor" + } + ], + "asset": { + "generator": "glTF Asset Generator", + "version": "2.0" + }, + "buffers": [ + { + "uri": "Instancing_01.bin", + "byteLength": 208 + } + ], + "bufferViews": [ + { + "buffer": 0, + "byteLength": 48, + "name": "Positions" + }, + { + "buffer": 0, + "byteOffset": 48, + "byteLength": 32, + "name": "Texture Coords 0" + }, + { + "buffer": 0, + "byteOffset": 80, + "byteLength": 24, + "name": "Indices" + }, + { + "buffer": 0, + "byteOffset": 104, + "byteLength": 48, + "name": "Positions" + }, + { + "buffer": 0, + "byteOffset": 152, + "byteLength": 32, + "name": "Texture Coords 0" + }, + { + "buffer": 0, + "byteOffset": 184, + "byteLength": 24, + "name": "Indices" + } + ], + "images": [ + { + "uri": "Textures/BaseColor_A.png" + }, + { + "uri": "Textures/BaseColor_B.png" + } + ], + "materials": [ + { + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 0 + } + } + }, + { + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 1 + } + } + } + ], + "meshes": [ + { + "primitives": [ + { + "attributes": { + "POSITION": 0, + "TEXCOORD_0": 1 + }, + "indices": 2, + "material": 0 + }, + { + "attributes": { + "POSITION": 3, + "TEXCOORD_0": 4 + }, + "indices": 5, + "material": 1 + } + ] + } + ], + "nodes": [ + { + "mesh": 0 + } + ], + "samplers": [ + { + "wrapS": 33071, + "wrapT": 33071 + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ], + "textures": [ + { + "sampler": 0, + "source": 0 + }, + { + "sampler": 0, + "source": 1 + } + ] +} \ No newline at end of file diff --git a/Output/Positive/Instancing/Instancing_02.bin b/Output/Positive/Instancing/Instancing_02.bin new file mode 100644 index 00000000..5c4590cf Binary files /dev/null and b/Output/Positive/Instancing/Instancing_02.bin differ diff --git a/Output/Positive/Instancing/Instancing_02.gltf b/Output/Positive/Instancing/Instancing_02.gltf new file mode 100644 index 00000000..e5fdef30 --- /dev/null +++ b/Output/Positive/Instancing/Instancing_02.gltf @@ -0,0 +1,180 @@ +{ + "accessors": [ + { + "bufferView": 0, + "componentType": 5126, + "count": 4, + "type": "VEC3", + "max": [ + -0.100000024, + 0.5, + 0.0 + ], + "min": [ + -1.1, + -0.5, + 0.0 + ], + "name": "Positions Accessor" + }, + { + "bufferView": 1, + "componentType": 5126, + "count": 4, + "type": "VEC2", + "name": "UV Accessor 0" + }, + { + "bufferView": 2, + "componentType": 5125, + "count": 6, + "type": "SCALAR", + "name": "Indices Accessor" + }, + { + "bufferView": 3, + "componentType": 5126, + "count": 4, + "type": "VEC3", + "max": [ + 1.1, + 0.5, + 0.0 + ], + "min": [ + 0.100000024, + -0.5, + 0.0 + ], + "name": "Positions Accessor" + }, + { + "bufferView": 4, + "componentType": 5126, + "count": 4, + "type": "VEC2", + "name": "UV Accessor 0" + }, + { + "bufferView": 5, + "componentType": 5125, + "count": 6, + "type": "SCALAR", + "name": "Indices Accessor" + } + ], + "asset": { + "generator": "glTF Asset Generator", + "version": "2.0" + }, + "buffers": [ + { + "uri": "Instancing_02.bin", + "byteLength": 208 + } + ], + "bufferViews": [ + { + "buffer": 0, + "byteLength": 48, + "name": "Positions" + }, + { + "buffer": 0, + "byteOffset": 48, + "byteLength": 32, + "name": "Texture Coords 0" + }, + { + "buffer": 0, + "byteOffset": 80, + "byteLength": 24, + "name": "Indices" + }, + { + "buffer": 0, + "byteOffset": 104, + "byteLength": 48, + "name": "Positions" + }, + { + "buffer": 0, + "byteOffset": 152, + "byteLength": 32, + "name": "Texture Coords 0" + }, + { + "buffer": 0, + "byteOffset": 184, + "byteLength": 24, + "name": "Indices" + } + ], + "images": [ + { + "uri": "Textures/BaseColor_A.png" + } + ], + "materials": [ + { + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 0 + } + } + }, + { + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.5, + 0.5, + 1.0, + 1.0 + ], + "baseColorTexture": { + "index": 0 + } + } + } + ], + "meshes": [ + { + "primitives": [ + { + "attributes": { + "POSITION": 0, + "TEXCOORD_0": 1 + }, + "indices": 2, + "material": 0 + }, + { + "attributes": { + "POSITION": 3, + "TEXCOORD_0": 4 + }, + "indices": 5, + "material": 1 + } + ] + } + ], + "nodes": [ + { + "mesh": 0 + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ], + "textures": [ + { + "source": 0 + } + ] +} \ No newline at end of file diff --git a/Output/Positive/Instancing/Instancing_03.bin b/Output/Positive/Instancing/Instancing_03.bin new file mode 100644 index 00000000..c462f04b Binary files /dev/null and b/Output/Positive/Instancing/Instancing_03.bin differ diff --git a/Output/Positive/Instancing/Instancing_03.gltf b/Output/Positive/Instancing/Instancing_03.gltf new file mode 100644 index 00000000..cf7dbf89 --- /dev/null +++ b/Output/Positive/Instancing/Instancing_03.gltf @@ -0,0 +1,167 @@ +{ + "accessors": [ + { + "bufferView": 0, + "componentType": 5126, + "count": 4, + "type": "VEC3", + "max": [ + -0.100000024, + 0.5, + 0.0 + ], + "min": [ + -1.1, + -0.5, + 0.0 + ], + "name": "Positions Accessor" + }, + { + "bufferView": 1, + "componentType": 5126, + "count": 4, + "type": "VEC2", + "name": "UV Accessor 0" + }, + { + "bufferView": 2, + "componentType": 5125, + "count": 6, + "type": "SCALAR", + "name": "Indices Accessor" + }, + { + "bufferView": 3, + "componentType": 5126, + "count": 4, + "type": "VEC3", + "max": [ + 1.1, + 0.5, + 0.0 + ], + "min": [ + 0.100000024, + -0.5, + 0.0 + ], + "name": "Positions Accessor" + }, + { + "bufferView": 4, + "componentType": 5126, + "count": 4, + "type": "VEC2", + "name": "UV Accessor 0" + }, + { + "bufferView": 5, + "componentType": 5125, + "count": 6, + "type": "SCALAR", + "name": "Indices Accessor" + } + ], + "asset": { + "generator": "glTF Asset Generator", + "version": "2.0" + }, + "buffers": [ + { + "uri": "Instancing_03.bin", + "byteLength": 208 + } + ], + "bufferViews": [ + { + "buffer": 0, + "byteLength": 48, + "name": "Positions" + }, + { + "buffer": 0, + "byteOffset": 48, + "byteLength": 32, + "name": "Texture Coords 0" + }, + { + "buffer": 0, + "byteOffset": 80, + "byteLength": 24, + "name": "Indices" + }, + { + "buffer": 0, + "byteOffset": 104, + "byteLength": 48, + "name": "Positions" + }, + { + "buffer": 0, + "byteOffset": 152, + "byteLength": 32, + "name": "Texture Coords 0" + }, + { + "buffer": 0, + "byteOffset": 184, + "byteLength": 24, + "name": "Indices" + } + ], + "images": [ + { + "uri": "Textures/BaseColor_A.png" + } + ], + "materials": [ + { + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 0 + } + } + } + ], + "meshes": [ + { + "primitives": [ + { + "attributes": { + "POSITION": 0, + "TEXCOORD_0": 1 + }, + "indices": 2, + "material": 0 + }, + { + "attributes": { + "POSITION": 3, + "TEXCOORD_0": 4 + }, + "indices": 5, + "material": 0 + } + ] + } + ], + "nodes": [ + { + "mesh": 0 + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ], + "textures": [ + { + "source": 0 + } + ] +} \ No newline at end of file diff --git a/Output/Positive/Instancing/Instancing_04.bin b/Output/Positive/Instancing/Instancing_04.bin new file mode 100644 index 00000000..4122dea9 Binary files /dev/null and b/Output/Positive/Instancing/Instancing_04.bin differ diff --git a/Output/Positive/Instancing/Instancing_04.gltf b/Output/Positive/Instancing/Instancing_04.gltf new file mode 100644 index 00000000..b8d9533c --- /dev/null +++ b/Output/Positive/Instancing/Instancing_04.gltf @@ -0,0 +1,175 @@ +{ + "accessors": [ + { + "bufferView": 0, + "componentType": 5126, + "count": 4, + "type": "VEC3", + "max": [ + 0.5, + 0.5, + 0.0 + ], + "min": [ + -0.5, + -0.5, + 0.0 + ], + "name": "Positions Accessor" + }, + { + "bufferView": 1, + "componentType": 5126, + "count": 4, + "type": "VEC2", + "name": "UV Accessor 0" + }, + { + "bufferView": 2, + "componentType": 5125, + "count": 6, + "type": "SCALAR", + "name": "Indices Accessor" + }, + { + "bufferView": 3, + "componentType": 5126, + "count": 4, + "type": "VEC2", + "name": "UV Accessor 0" + }, + { + "bufferView": 4, + "componentType": 5125, + "count": 6, + "type": "SCALAR", + "name": "Indices Accessor" + } + ], + "asset": { + "generator": "glTF Asset Generator", + "version": "2.0" + }, + "buffers": [ + { + "uri": "Instancing_04.bin", + "byteLength": 160 + } + ], + "bufferViews": [ + { + "buffer": 0, + "byteLength": 48, + "name": "Positions" + }, + { + "buffer": 0, + "byteOffset": 48, + "byteLength": 32, + "name": "Texture Coords 0" + }, + { + "buffer": 0, + "byteOffset": 80, + "byteLength": 24, + "name": "Indices" + }, + { + "buffer": 0, + "byteOffset": 104, + "byteLength": 32, + "name": "Texture Coords 0" + }, + { + "buffer": 0, + "byteOffset": 136, + "byteLength": 24, + "name": "Indices" + } + ], + "images": [ + { + "uri": "Textures/BaseColor_A.png" + }, + { + "uri": "Textures/BaseColor_B.png" + } + ], + "materials": [ + { + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 0 + } + } + }, + { + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 1 + } + } + } + ], + "meshes": [ + { + "primitives": [ + { + "attributes": { + "POSITION": 0, + "TEXCOORD_0": 1 + }, + "indices": 2, + "material": 0 + } + ] + }, + { + "primitives": [ + { + "attributes": { + "POSITION": 0, + "TEXCOORD_0": 3 + }, + "indices": 4, + "material": 1 + } + ] + } + ], + "nodes": [ + { + "mesh": 0, + "translation": [ + -0.6, + 0.0, + 0.0 + ] + }, + { + "mesh": 1, + "translation": [ + 0.6, + 0.0, + 0.0 + ] + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0, + 1 + ] + } + ], + "textures": [ + { + "source": 0 + }, + { + "source": 1 + } + ] +} \ No newline at end of file diff --git a/Output/Positive/Instancing/Instancing_05.bin b/Output/Positive/Instancing/Instancing_05.bin new file mode 100644 index 00000000..144fd81c Binary files /dev/null and b/Output/Positive/Instancing/Instancing_05.bin differ diff --git a/Output/Positive/Instancing/Instancing_05.gltf b/Output/Positive/Instancing/Instancing_05.gltf new file mode 100644 index 00000000..10173533 --- /dev/null +++ b/Output/Positive/Instancing/Instancing_05.gltf @@ -0,0 +1,185 @@ +{ + "accessors": [ + { + "bufferView": 0, + "componentType": 5126, + "count": 4, + "type": "VEC3", + "max": [ + 0.5, + 0.5, + 0.0 + ], + "min": [ + -0.5, + -0.5, + 0.0 + ], + "name": "Positions Accessor" + }, + { + "bufferView": 1, + "componentType": 5126, + "count": 4, + "type": "VEC2", + "name": "UV Accessor 0" + }, + { + "bufferView": 2, + "componentType": 5125, + "count": 6, + "type": "SCALAR", + "name": "Indices Accessor" + }, + { + "bufferView": 3, + "componentType": 5126, + "count": 4, + "type": "VEC3", + "max": [ + 0.5, + 0.5, + 0.0 + ], + "min": [ + -0.5, + -0.5, + 0.0 + ], + "name": "Positions Accessor" + }, + { + "bufferView": 4, + "componentType": 5126, + "count": 4, + "type": "VEC2", + "name": "UV Accessor 0" + } + ], + "asset": { + "generator": "glTF Asset Generator", + "version": "2.0" + }, + "buffers": [ + { + "uri": "Instancing_05.bin", + "byteLength": 184 + } + ], + "bufferViews": [ + { + "buffer": 0, + "byteLength": 48, + "name": "Positions" + }, + { + "buffer": 0, + "byteOffset": 48, + "byteLength": 32, + "name": "Texture Coords 0" + }, + { + "buffer": 0, + "byteOffset": 80, + "byteLength": 24, + "name": "Indices" + }, + { + "buffer": 0, + "byteOffset": 104, + "byteLength": 48, + "name": "Positions" + }, + { + "buffer": 0, + "byteOffset": 152, + "byteLength": 32, + "name": "Texture Coords 0" + } + ], + "images": [ + { + "uri": "Textures/BaseColor_A.png" + }, + { + "uri": "Textures/BaseColor_B.png" + } + ], + "materials": [ + { + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 0 + } + } + }, + { + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 1 + } + } + } + ], + "meshes": [ + { + "primitives": [ + { + "attributes": { + "POSITION": 0, + "TEXCOORD_0": 1 + }, + "indices": 2, + "material": 0 + } + ] + }, + { + "primitives": [ + { + "attributes": { + "POSITION": 3, + "TEXCOORD_0": 4 + }, + "indices": 2, + "material": 1 + } + ] + } + ], + "nodes": [ + { + "mesh": 0, + "translation": [ + -0.6, + 0.0, + 0.0 + ] + }, + { + "mesh": 1, + "translation": [ + 0.6, + 0.0, + 0.0 + ] + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0, + 1 + ] + } + ], + "textures": [ + { + "source": 0 + }, + { + "source": 1 + } + ] +} \ No newline at end of file diff --git a/Output/Positive/Instancing/Instancing_06.bin b/Output/Positive/Instancing/Instancing_06.bin new file mode 100644 index 00000000..d271b974 Binary files /dev/null and b/Output/Positive/Instancing/Instancing_06.bin differ diff --git a/Output/Positive/Instancing/Instancing_06.gltf b/Output/Positive/Instancing/Instancing_06.gltf new file mode 100644 index 00000000..34c01003 --- /dev/null +++ b/Output/Positive/Instancing/Instancing_06.gltf @@ -0,0 +1,124 @@ +{ + "accessors": [ + { + "bufferView": 0, + "componentType": 5126, + "count": 4, + "type": "VEC3", + "max": [ + 0.5, + 0.5, + 0.0 + ], + "min": [ + -0.5, + -0.5, + 0.0 + ], + "name": "Positions Accessor" + }, + { + "bufferView": 1, + "componentType": 5126, + "count": 4, + "type": "VEC2", + "name": "UV Accessor 0" + }, + { + "bufferView": 2, + "componentType": 5125, + "count": 6, + "type": "SCALAR", + "name": "Indices Accessor" + } + ], + "asset": { + "generator": "glTF Asset Generator", + "version": "2.0" + }, + "buffers": [ + { + "uri": "Instancing_06.bin", + "byteLength": 104 + } + ], + "bufferViews": [ + { + "buffer": 0, + "byteLength": 48, + "name": "Positions" + }, + { + "buffer": 0, + "byteOffset": 48, + "byteLength": 32, + "name": "Texture Coords 0" + }, + { + "buffer": 0, + "byteOffset": 80, + "byteLength": 24, + "name": "Indices" + } + ], + "images": [ + { + "uri": "Textures/BaseColor_A.png" + } + ], + "materials": [ + { + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 0 + } + } + } + ], + "meshes": [ + { + "primitives": [ + { + "attributes": { + "POSITION": 0, + "TEXCOORD_0": 1 + }, + "indices": 2, + "material": 0 + } + ] + } + ], + "nodes": [ + { + "mesh": 0, + "translation": [ + -0.6, + 0.0, + 0.0 + ] + }, + { + "mesh": 0, + "translation": [ + 0.6, + 0.0, + 0.0 + ] + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0, + 1 + ] + } + ], + "textures": [ + { + "source": 0 + } + ] +} \ No newline at end of file diff --git a/Output/Positive/Instancing/Instancing_07.bin b/Output/Positive/Instancing/Instancing_07.bin new file mode 100644 index 00000000..74819eb0 Binary files /dev/null and b/Output/Positive/Instancing/Instancing_07.bin differ diff --git a/Output/Positive/Instancing/Instancing_07.gltf b/Output/Positive/Instancing/Instancing_07.gltf new file mode 100644 index 00000000..607c0b31 --- /dev/null +++ b/Output/Positive/Instancing/Instancing_07.gltf @@ -0,0 +1,303 @@ +{ + "accessors": [ + { + "bufferView": 0, + "componentType": 5126, + "count": 6, + "type": "VEC3", + "max": [ + -0.0500000119, + 0.0, + 0.2 + ], + "min": [ + -0.55, + 0.0, + -0.2 + ], + "name": "Positions Accessor" + }, + { + "bufferView": 1, + "componentType": 5126, + "count": 6, + "type": "VEC2", + "name": "UV Accessor 0" + }, + { + "bufferView": 2, + "componentType": 5125, + "count": 12, + "type": "SCALAR", + "name": "Indices Accessor" + }, + { + "bufferView": 3, + "componentType": 5126, + "count": 6, + "type": "VEC4", + "name": "weights accessor" + }, + { + "bufferView": 4, + "componentType": 5123, + "count": 6, + "type": "VEC4", + "name": "joint indices accessor" + }, + { + "bufferView": 5, + "componentType": 5126, + "count": 2, + "type": "MAT4", + "name": "IBM" + }, + { + "bufferView": 6, + "componentType": 5126, + "count": 6, + "type": "VEC3", + "max": [ + 0.55, + 0.0, + 0.2 + ], + "min": [ + 0.0500000119, + 0.0, + -0.2 + ], + "name": "Positions Accessor" + }, + { + "bufferView": 7, + "componentType": 5126, + "count": 6, + "type": "VEC2", + "name": "UV Accessor 0" + }, + { + "bufferView": 8, + "componentType": 5125, + "count": 12, + "type": "SCALAR", + "name": "Indices Accessor" + }, + { + "bufferView": 9, + "componentType": 5126, + "count": 6, + "type": "VEC4", + "name": "weights accessor" + }, + { + "bufferView": 10, + "componentType": 5123, + "count": 6, + "type": "VEC4", + "name": "joint indices accessor" + } + ], + "asset": { + "generator": "glTF Asset Generator", + "version": "2.0" + }, + "buffers": [ + { + "uri": "Instancing_07.bin", + "byteLength": 752 + } + ], + "bufferViews": [ + { + "buffer": 0, + "byteLength": 72, + "name": "Positions" + }, + { + "buffer": 0, + "byteOffset": 72, + "byteLength": 48, + "name": "Texture Coords 0" + }, + { + "buffer": 0, + "byteOffset": 120, + "byteLength": 48, + "name": "Indices" + }, + { + "buffer": 0, + "byteOffset": 168, + "byteLength": 96, + "name": "weights buffer view" + }, + { + "buffer": 0, + "byteOffset": 264, + "byteLength": 48, + "name": "joint indices buffer view" + }, + { + "buffer": 0, + "byteOffset": 312, + "byteLength": 128, + "name": "Inverse Bind Matrix" + }, + { + "buffer": 0, + "byteOffset": 440, + "byteLength": 72, + "name": "Positions" + }, + { + "buffer": 0, + "byteOffset": 512, + "byteLength": 48, + "name": "Texture Coords 0" + }, + { + "buffer": 0, + "byteOffset": 560, + "byteLength": 48, + "name": "Indices" + }, + { + "buffer": 0, + "byteOffset": 608, + "byteLength": 96, + "name": "weights buffer view" + }, + { + "buffer": 0, + "byteOffset": 704, + "byteLength": 48, + "name": "joint indices buffer view" + } + ], + "images": [ + { + "uri": "Textures/BaseColor_A.png" + }, + { + "uri": "Textures/BaseColor_B.png" + } + ], + "materials": [ + { + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 0 + } + } + }, + { + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 1 + } + } + } + ], + "meshes": [ + { + "primitives": [ + { + "attributes": { + "POSITION": 0, + "TEXCOORD_0": 1, + "WEIGHTS_0": 3, + "JOINTS_0": 4 + }, + "indices": 2, + "material": 0 + } + ] + }, + { + "primitives": [ + { + "attributes": { + "POSITION": 6, + "TEXCOORD_0": 7, + "WEIGHTS_0": 9, + "JOINTS_0": 10 + }, + "indices": 8, + "material": 1 + } + ] + } + ], + "nodes": [ + { + "skin": 0, + "mesh": 0, + "name": "plane0" + }, + { + "children": [ + 2 + ], + "rotation": [ + -0.7071067, + 0.0, + 0.0, + 0.707106769 + ], + "translation": [ + 0.0, + -0.2, + 0.0 + ], + "name": "joint0" + }, + { + "rotation": [ + -0.258819044, + 0.0, + 0.0, + 0.9659258 + ], + "translation": [ + 0.0, + 0.0, + 0.2 + ], + "name": "joint1" + }, + { + "skin": 0, + "mesh": 1, + "name": "plane1" + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0, + 1, + 3 + ] + } + ], + "skins": [ + { + "inverseBindMatrices": 5, + "joints": [ + 1, + 2 + ], + "name": "skinA" + } + ], + "textures": [ + { + "source": 0 + }, + { + "source": 1 + } + ] +} \ No newline at end of file diff --git a/Output/Positive/Instancing/Instancing_08.bin b/Output/Positive/Instancing/Instancing_08.bin new file mode 100644 index 00000000..dace1f9a Binary files /dev/null and b/Output/Positive/Instancing/Instancing_08.bin differ diff --git a/Output/Positive/Instancing/Instancing_08.gltf b/Output/Positive/Instancing/Instancing_08.gltf new file mode 100644 index 00000000..333b281a --- /dev/null +++ b/Output/Positive/Instancing/Instancing_08.gltf @@ -0,0 +1,324 @@ +{ + "accessors": [ + { + "bufferView": 0, + "componentType": 5126, + "count": 6, + "type": "VEC3", + "max": [ + -0.0500000119, + 0.0, + 0.2 + ], + "min": [ + -0.55, + 0.0, + -0.2 + ], + "name": "Positions Accessor" + }, + { + "bufferView": 1, + "componentType": 5126, + "count": 6, + "type": "VEC2", + "name": "UV Accessor 0" + }, + { + "bufferView": 2, + "componentType": 5125, + "count": 12, + "type": "SCALAR", + "name": "Indices Accessor" + }, + { + "bufferView": 3, + "componentType": 5126, + "count": 6, + "type": "VEC4", + "name": "weights accessor" + }, + { + "bufferView": 4, + "componentType": 5123, + "count": 6, + "type": "VEC4", + "name": "joint indices accessor" + }, + { + "bufferView": 5, + "componentType": 5126, + "count": 2, + "type": "MAT4", + "name": "IBM" + }, + { + "bufferView": 6, + "componentType": 5126, + "count": 6, + "type": "VEC3", + "max": [ + 0.55, + 0.0, + 0.2 + ], + "min": [ + 0.0500000119, + 0.0, + -0.2 + ], + "name": "Positions Accessor" + }, + { + "bufferView": 7, + "componentType": 5126, + "count": 6, + "type": "VEC2", + "name": "UV Accessor 0" + }, + { + "bufferView": 8, + "componentType": 5125, + "count": 12, + "type": "SCALAR", + "name": "Indices Accessor" + }, + { + "bufferView": 9, + "componentType": 5126, + "count": 6, + "type": "VEC4", + "name": "weights accessor" + }, + { + "bufferView": 10, + "componentType": 5123, + "count": 6, + "type": "VEC4", + "name": "joint indices accessor" + }, + { + "bufferView": 11, + "componentType": 5126, + "count": 2, + "type": "MAT4", + "name": "IBM" + } + ], + "asset": { + "generator": "glTF Asset Generator", + "version": "2.0" + }, + "buffers": [ + { + "uri": "Instancing_08.bin", + "byteLength": 880 + } + ], + "bufferViews": [ + { + "buffer": 0, + "byteLength": 72, + "name": "Positions" + }, + { + "buffer": 0, + "byteOffset": 72, + "byteLength": 48, + "name": "Texture Coords 0" + }, + { + "buffer": 0, + "byteOffset": 120, + "byteLength": 48, + "name": "Indices" + }, + { + "buffer": 0, + "byteOffset": 168, + "byteLength": 96, + "name": "weights buffer view" + }, + { + "buffer": 0, + "byteOffset": 264, + "byteLength": 48, + "name": "joint indices buffer view" + }, + { + "buffer": 0, + "byteOffset": 312, + "byteLength": 128, + "name": "Inverse Bind Matrix" + }, + { + "buffer": 0, + "byteOffset": 440, + "byteLength": 72, + "name": "Positions" + }, + { + "buffer": 0, + "byteOffset": 512, + "byteLength": 48, + "name": "Texture Coords 0" + }, + { + "buffer": 0, + "byteOffset": 560, + "byteLength": 48, + "name": "Indices" + }, + { + "buffer": 0, + "byteOffset": 608, + "byteLength": 96, + "name": "weights buffer view" + }, + { + "buffer": 0, + "byteOffset": 704, + "byteLength": 48, + "name": "joint indices buffer view" + }, + { + "buffer": 0, + "byteOffset": 752, + "byteLength": 128, + "name": "Inverse Bind Matrix" + } + ], + "images": [ + { + "uri": "Textures/BaseColor_A.png" + }, + { + "uri": "Textures/BaseColor_B.png" + } + ], + "materials": [ + { + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 0 + } + } + }, + { + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 1 + } + } + } + ], + "meshes": [ + { + "primitives": [ + { + "attributes": { + "POSITION": 0, + "TEXCOORD_0": 1, + "WEIGHTS_0": 3, + "JOINTS_0": 4 + }, + "indices": 2, + "material": 0 + } + ] + }, + { + "primitives": [ + { + "attributes": { + "POSITION": 6, + "TEXCOORD_0": 7, + "WEIGHTS_0": 9, + "JOINTS_0": 10 + }, + "indices": 8, + "material": 1 + } + ] + } + ], + "nodes": [ + { + "skin": 0, + "mesh": 0, + "name": "plane0" + }, + { + "children": [ + 2 + ], + "rotation": [ + -0.7071067, + 0.0, + 0.0, + 0.707106769 + ], + "translation": [ + 0.0, + -0.2, + 0.0 + ], + "name": "joint0" + }, + { + "rotation": [ + -0.258819044, + 0.0, + 0.0, + 0.9659258 + ], + "translation": [ + 0.0, + 0.0, + 0.2 + ], + "name": "joint1" + }, + { + "skin": 1, + "mesh": 1, + "name": "plane1" + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0, + 1, + 3 + ] + } + ], + "skins": [ + { + "inverseBindMatrices": 5, + "joints": [ + 1, + 2 + ], + "name": "skinA" + }, + { + "inverseBindMatrices": 11, + "joints": [ + 1, + 2 + ], + "name": "skinA" + } + ], + "textures": [ + { + "source": 0 + }, + { + "source": 1 + } + ] +} \ No newline at end of file diff --git a/Output/Positive/Instancing/Instancing_09.bin b/Output/Positive/Instancing/Instancing_09.bin new file mode 100644 index 00000000..f0bc5d38 Binary files /dev/null and b/Output/Positive/Instancing/Instancing_09.bin differ diff --git a/Output/Positive/Instancing/Instancing_09.gltf b/Output/Positive/Instancing/Instancing_09.gltf new file mode 100644 index 00000000..bf10f6a1 --- /dev/null +++ b/Output/Positive/Instancing/Instancing_09.gltf @@ -0,0 +1,343 @@ +{ + "accessors": [ + { + "bufferView": 0, + "componentType": 5126, + "count": 6, + "type": "VEC3", + "max": [ + 0.25, + 0.0, + 0.2 + ], + "min": [ + -0.25, + 0.0, + -0.2 + ], + "name": "Positions Accessor" + }, + { + "bufferView": 1, + "componentType": 5126, + "count": 6, + "type": "VEC2", + "name": "UV Accessor 0" + }, + { + "bufferView": 2, + "componentType": 5125, + "count": 12, + "type": "SCALAR", + "name": "Indices Accessor" + }, + { + "bufferView": 3, + "componentType": 5126, + "count": 6, + "type": "VEC4", + "name": "weights accessor" + }, + { + "bufferView": 4, + "componentType": 5123, + "count": 6, + "type": "VEC4", + "name": "joint indices accessor" + }, + { + "bufferView": 5, + "componentType": 5126, + "count": 2, + "type": "MAT4", + "name": "IBM" + }, + { + "bufferView": 6, + "componentType": 5126, + "count": 6, + "type": "VEC3", + "max": [ + 0.25, + 0.0, + 0.2 + ], + "min": [ + -0.25, + 0.0, + -0.2 + ], + "name": "Positions Accessor" + }, + { + "bufferView": 7, + "componentType": 5126, + "count": 6, + "type": "VEC2", + "name": "UV Accessor 0" + }, + { + "bufferView": 8, + "componentType": 5125, + "count": 12, + "type": "SCALAR", + "name": "Indices Accessor" + }, + { + "bufferView": 9, + "componentType": 5126, + "count": 6, + "type": "VEC4", + "name": "weights accessor" + }, + { + "bufferView": 10, + "componentType": 5123, + "count": 6, + "type": "VEC4", + "name": "joint indices accessor" + } + ], + "asset": { + "generator": "glTF Asset Generator", + "version": "2.0" + }, + "buffers": [ + { + "uri": "Instancing_09.bin", + "byteLength": 752 + } + ], + "bufferViews": [ + { + "buffer": 0, + "byteLength": 72, + "name": "Positions" + }, + { + "buffer": 0, + "byteOffset": 72, + "byteLength": 48, + "name": "Texture Coords 0" + }, + { + "buffer": 0, + "byteOffset": 120, + "byteLength": 48, + "name": "Indices" + }, + { + "buffer": 0, + "byteOffset": 168, + "byteLength": 96, + "name": "weights buffer view" + }, + { + "buffer": 0, + "byteOffset": 264, + "byteLength": 48, + "name": "joint indices buffer view" + }, + { + "buffer": 0, + "byteOffset": 312, + "byteLength": 128, + "name": "Inverse Bind Matrix" + }, + { + "buffer": 0, + "byteOffset": 440, + "byteLength": 72, + "name": "Positions" + }, + { + "buffer": 0, + "byteOffset": 512, + "byteLength": 48, + "name": "Texture Coords 0" + }, + { + "buffer": 0, + "byteOffset": 560, + "byteLength": 48, + "name": "Indices" + }, + { + "buffer": 0, + "byteOffset": 608, + "byteLength": 96, + "name": "weights buffer view" + }, + { + "buffer": 0, + "byteOffset": 704, + "byteLength": 48, + "name": "joint indices buffer view" + } + ], + "images": [ + { + "uri": "Textures/BaseColor_A.png" + }, + { + "uri": "Textures/BaseColor_B.png" + } + ], + "materials": [ + { + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 0 + } + } + }, + { + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 1 + } + } + } + ], + "meshes": [ + { + "primitives": [ + { + "attributes": { + "POSITION": 0, + "TEXCOORD_0": 1, + "WEIGHTS_0": 3, + "JOINTS_0": 4 + }, + "indices": 2, + "material": 0 + } + ] + }, + { + "primitives": [ + { + "attributes": { + "POSITION": 6, + "TEXCOORD_0": 7, + "WEIGHTS_0": 9, + "JOINTS_0": 10 + }, + "indices": 8, + "material": 1 + } + ] + } + ], + "nodes": [ + { + "skin": 0, + "mesh": 0, + "name": "plane0" + }, + { + "children": [ + 2 + ], + "rotation": [ + -0.7071067, + 0.0, + 0.0, + 0.707106769 + ], + "translation": [ + -0.3, + -0.2, + 0.0 + ], + "name": "joint0" + }, + { + "rotation": [ + -0.258819044, + 0.0, + 0.0, + 0.9659258 + ], + "translation": [ + 0.0, + 0.0, + 0.2 + ], + "name": "joint1" + }, + { + "skin": 1, + "mesh": 1, + "name": "plane1" + }, + { + "children": [ + 5 + ], + "rotation": [ + -0.7071067, + 0.0, + 0.0, + 0.707106769 + ], + "translation": [ + 0.3, + -0.2, + 0.0 + ], + "name": "joint0" + }, + { + "rotation": [ + -0.258819044, + 0.0, + 0.0, + 0.9659258 + ], + "translation": [ + 0.0, + 0.0, + 0.2 + ], + "name": "joint1" + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0, + 1, + 3, + 4 + ] + } + ], + "skins": [ + { + "inverseBindMatrices": 5, + "joints": [ + 1, + 2 + ], + "name": "skinA" + }, + { + "inverseBindMatrices": 5, + "joints": [ + 4, + 5 + ], + "name": "skinA" + } + ], + "textures": [ + { + "source": 0 + }, + { + "source": 1 + } + ] +} \ No newline at end of file diff --git a/Output/Positive/Instancing/Instancing_10.bin b/Output/Positive/Instancing/Instancing_10.bin new file mode 100644 index 00000000..8c9261aa Binary files /dev/null and b/Output/Positive/Instancing/Instancing_10.bin differ diff --git a/Output/Positive/Instancing/Instancing_10.gltf b/Output/Positive/Instancing/Instancing_10.gltf new file mode 100644 index 00000000..b34db30d --- /dev/null +++ b/Output/Positive/Instancing/Instancing_10.gltf @@ -0,0 +1,278 @@ +{ + "accessors": [ + { + "bufferView": 0, + "componentType": 5126, + "count": 24, + "type": "VEC3", + "max": [ + 0.3, + 0.3, + 0.3 + ], + "min": [ + -0.3, + -0.3, + -0.3 + ], + "name": "Positions Accessor" + }, + { + "bufferView": 1, + "componentType": 5126, + "count": 24, + "type": "VEC3", + "name": "Normals Accessor" + }, + { + "bufferView": 2, + "componentType": 5126, + "count": 24, + "type": "VEC2", + "name": "UV Accessor 0" + }, + { + "bufferView": 3, + "componentType": 5125, + "count": 36, + "type": "SCALAR", + "name": "Indices Accessor" + }, + { + "bufferView": 4, + "componentType": 5126, + "count": 24, + "type": "VEC3", + "max": [ + 0.3, + 0.3, + 0.3 + ], + "min": [ + -0.3, + -0.3, + -0.3 + ], + "name": "Positions Accessor" + }, + { + "bufferView": 5, + "componentType": 5126, + "count": 24, + "type": "VEC3", + "name": "Normals Accessor" + }, + { + "bufferView": 6, + "componentType": 5126, + "count": 24, + "type": "VEC2", + "name": "UV Accessor 0" + }, + { + "bufferView": 7, + "componentType": 5125, + "count": 36, + "type": "SCALAR", + "name": "Indices Accessor" + }, + { + "bufferView": 8, + "componentType": 5126, + "count": 5, + "type": "SCALAR", + "max": [ + 4.0 + ], + "min": [ + 0.0 + ], + "name": "Animation Sampler Input" + }, + { + "bufferView": 9, + "componentType": 5126, + "count": 5, + "type": "VEC4", + "name": "Animation Sampler Output" + } + ], + "animations": [ + { + "channels": [ + { + "sampler": 0, + "target": { + "node": 0, + "path": "rotation" + } + }, + { + "sampler": 0, + "target": { + "node": 1, + "path": "rotation" + } + } + ], + "samplers": [ + { + "input": 8, + "output": 9 + } + ] + } + ], + "asset": { + "generator": "glTF Asset Generator", + "version": "2.0" + }, + "buffers": [ + { + "uri": "Instancing_10.bin", + "byteLength": 1924 + } + ], + "bufferViews": [ + { + "buffer": 0, + "byteLength": 288, + "name": "Positions" + }, + { + "buffer": 0, + "byteOffset": 288, + "byteLength": 288, + "name": "Normals" + }, + { + "buffer": 0, + "byteOffset": 576, + "byteLength": 192, + "name": "Texture Coords 0" + }, + { + "buffer": 0, + "byteOffset": 768, + "byteLength": 144, + "name": "Indices" + }, + { + "buffer": 0, + "byteOffset": 912, + "byteLength": 288, + "name": "Positions" + }, + { + "buffer": 0, + "byteOffset": 1200, + "byteLength": 288, + "name": "Normals" + }, + { + "buffer": 0, + "byteOffset": 1488, + "byteLength": 192, + "name": "Texture Coords 0" + }, + { + "buffer": 0, + "byteOffset": 1680, + "byteLength": 144, + "name": "Indices" + }, + { + "buffer": 0, + "byteOffset": 1824, + "byteLength": 20, + "name": "Animation Sampler Input" + }, + { + "buffer": 0, + "byteOffset": 1844, + "byteLength": 80, + "name": "Animation Sampler Output" + } + ], + "images": [ + { + "uri": "Textures/BaseColor_Cube.png" + } + ], + "materials": [ + { + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 0 + } + } + }, + { + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 0 + } + } + } + ], + "meshes": [ + { + "primitives": [ + { + "attributes": { + "POSITION": 0, + "NORMAL": 1, + "TEXCOORD_0": 2 + }, + "indices": 3, + "material": 0 + } + ] + }, + { + "primitives": [ + { + "attributes": { + "POSITION": 4, + "NORMAL": 5, + "TEXCOORD_0": 6 + }, + "indices": 7, + "material": 1 + } + ] + } + ], + "nodes": [ + { + "mesh": 0, + "translation": [ + -0.6, + 0.0, + 0.0 + ] + }, + { + "mesh": 1, + "translation": [ + 0.6, + 0.0, + 0.0 + ] + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0, + 1 + ] + } + ], + "textures": [ + { + "source": 0 + } + ] +} \ No newline at end of file diff --git a/Output/Positive/Instancing/Instancing_11.bin b/Output/Positive/Instancing/Instancing_11.bin new file mode 100644 index 00000000..e53f9691 Binary files /dev/null and b/Output/Positive/Instancing/Instancing_11.bin differ diff --git a/Output/Positive/Instancing/Instancing_11.gltf b/Output/Positive/Instancing/Instancing_11.gltf new file mode 100644 index 00000000..66d355db --- /dev/null +++ b/Output/Positive/Instancing/Instancing_11.gltf @@ -0,0 +1,295 @@ +{ + "accessors": [ + { + "bufferView": 0, + "componentType": 5126, + "count": 24, + "type": "VEC3", + "max": [ + 0.3, + 0.3, + 0.3 + ], + "min": [ + -0.3, + -0.3, + -0.3 + ], + "name": "Positions Accessor" + }, + { + "bufferView": 1, + "componentType": 5126, + "count": 24, + "type": "VEC3", + "name": "Normals Accessor" + }, + { + "bufferView": 2, + "componentType": 5126, + "count": 24, + "type": "VEC2", + "name": "UV Accessor 0" + }, + { + "bufferView": 3, + "componentType": 5125, + "count": 36, + "type": "SCALAR", + "name": "Indices Accessor" + }, + { + "bufferView": 4, + "componentType": 5126, + "count": 24, + "type": "VEC3", + "max": [ + 0.3, + 0.3, + 0.3 + ], + "min": [ + -0.3, + -0.3, + -0.3 + ], + "name": "Positions Accessor" + }, + { + "bufferView": 5, + "componentType": 5126, + "count": 24, + "type": "VEC3", + "name": "Normals Accessor" + }, + { + "bufferView": 6, + "componentType": 5126, + "count": 24, + "type": "VEC2", + "name": "UV Accessor 0" + }, + { + "bufferView": 7, + "componentType": 5125, + "count": 36, + "type": "SCALAR", + "name": "Indices Accessor" + }, + { + "bufferView": 8, + "componentType": 5126, + "count": 5, + "type": "SCALAR", + "max": [ + 4.0 + ], + "min": [ + 0.0 + ], + "name": "Animation Sampler Input" + }, + { + "bufferView": 9, + "componentType": 5126, + "count": 5, + "type": "VEC4", + "name": "Animation Sampler Output" + }, + { + "bufferView": 10, + "componentType": 5126, + "count": 5, + "type": "VEC4", + "name": "Animation Sampler Output" + } + ], + "animations": [ + { + "channels": [ + { + "sampler": 0, + "target": { + "node": 0, + "path": "rotation" + } + }, + { + "sampler": 1, + "target": { + "node": 1, + "path": "rotation" + } + } + ], + "samplers": [ + { + "input": 8, + "output": 9 + }, + { + "input": 8, + "output": 10 + } + ] + } + ], + "asset": { + "generator": "glTF Asset Generator", + "version": "2.0" + }, + "buffers": [ + { + "uri": "Instancing_11.bin", + "byteLength": 2004 + } + ], + "bufferViews": [ + { + "buffer": 0, + "byteLength": 288, + "name": "Positions" + }, + { + "buffer": 0, + "byteOffset": 288, + "byteLength": 288, + "name": "Normals" + }, + { + "buffer": 0, + "byteOffset": 576, + "byteLength": 192, + "name": "Texture Coords 0" + }, + { + "buffer": 0, + "byteOffset": 768, + "byteLength": 144, + "name": "Indices" + }, + { + "buffer": 0, + "byteOffset": 912, + "byteLength": 288, + "name": "Positions" + }, + { + "buffer": 0, + "byteOffset": 1200, + "byteLength": 288, + "name": "Normals" + }, + { + "buffer": 0, + "byteOffset": 1488, + "byteLength": 192, + "name": "Texture Coords 0" + }, + { + "buffer": 0, + "byteOffset": 1680, + "byteLength": 144, + "name": "Indices" + }, + { + "buffer": 0, + "byteOffset": 1824, + "byteLength": 20, + "name": "Animation Sampler Input" + }, + { + "buffer": 0, + "byteOffset": 1844, + "byteLength": 80, + "name": "Animation Sampler Output" + }, + { + "buffer": 0, + "byteOffset": 1924, + "byteLength": 80, + "name": "Animation Sampler Output" + } + ], + "images": [ + { + "uri": "Textures/BaseColor_Cube.png" + } + ], + "materials": [ + { + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 0 + } + } + }, + { + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 0 + } + } + } + ], + "meshes": [ + { + "primitives": [ + { + "attributes": { + "POSITION": 0, + "NORMAL": 1, + "TEXCOORD_0": 2 + }, + "indices": 3, + "material": 0 + } + ] + }, + { + "primitives": [ + { + "attributes": { + "POSITION": 4, + "NORMAL": 5, + "TEXCOORD_0": 6 + }, + "indices": 7, + "material": 1 + } + ] + } + ], + "nodes": [ + { + "mesh": 0, + "translation": [ + -0.6, + 0.0, + 0.0 + ] + }, + { + "mesh": 1, + "translation": [ + 0.6, + 0.0, + 0.0 + ] + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0, + 1 + ] + } + ], + "textures": [ + { + "source": 0 + } + ] +} \ No newline at end of file diff --git a/Output/Positive/Instancing/Instancing_12.bin b/Output/Positive/Instancing/Instancing_12.bin new file mode 100644 index 00000000..c0e78067 Binary files /dev/null and b/Output/Positive/Instancing/Instancing_12.bin differ diff --git a/Output/Positive/Instancing/Instancing_12.gltf b/Output/Positive/Instancing/Instancing_12.gltf new file mode 100644 index 00000000..01eb960d --- /dev/null +++ b/Output/Positive/Instancing/Instancing_12.gltf @@ -0,0 +1,301 @@ +{ + "accessors": [ + { + "bufferView": 0, + "componentType": 5126, + "count": 24, + "type": "VEC3", + "max": [ + 0.3, + 0.3, + 0.3 + ], + "min": [ + -0.3, + -0.3, + -0.3 + ], + "name": "Positions Accessor" + }, + { + "bufferView": 1, + "componentType": 5126, + "count": 24, + "type": "VEC3", + "name": "Normals Accessor" + }, + { + "bufferView": 2, + "componentType": 5126, + "count": 24, + "type": "VEC2", + "name": "UV Accessor 0" + }, + { + "bufferView": 3, + "componentType": 5125, + "count": 36, + "type": "SCALAR", + "name": "Indices Accessor" + }, + { + "bufferView": 4, + "componentType": 5126, + "count": 24, + "type": "VEC3", + "max": [ + 0.3, + 0.3, + 0.3 + ], + "min": [ + -0.3, + -0.3, + -0.3 + ], + "name": "Positions Accessor" + }, + { + "bufferView": 5, + "componentType": 5126, + "count": 24, + "type": "VEC3", + "name": "Normals Accessor" + }, + { + "bufferView": 6, + "componentType": 5126, + "count": 24, + "type": "VEC2", + "name": "UV Accessor 0" + }, + { + "bufferView": 7, + "componentType": 5125, + "count": 36, + "type": "SCALAR", + "name": "Indices Accessor" + }, + { + "bufferView": 8, + "componentType": 5126, + "count": 5, + "type": "SCALAR", + "max": [ + 4.0 + ], + "min": [ + 0.0 + ], + "name": "Animation Sampler Input" + }, + { + "bufferView": 9, + "componentType": 5126, + "count": 5, + "type": "VEC4", + "name": "Animation Sampler Output" + }, + { + "bufferView": 10, + "componentType": 5126, + "count": 5, + "type": "SCALAR", + "max": [ + 4.0 + ], + "min": [ + 0.0 + ], + "name": "Animation Sampler Input" + } + ], + "animations": [ + { + "channels": [ + { + "sampler": 0, + "target": { + "node": 0, + "path": "rotation" + } + }, + { + "sampler": 1, + "target": { + "node": 1, + "path": "rotation" + } + } + ], + "samplers": [ + { + "input": 8, + "output": 9 + }, + { + "input": 10, + "output": 9 + } + ] + } + ], + "asset": { + "generator": "glTF Asset Generator", + "version": "2.0" + }, + "buffers": [ + { + "uri": "Instancing_12.bin", + "byteLength": 1944 + } + ], + "bufferViews": [ + { + "buffer": 0, + "byteLength": 288, + "name": "Positions" + }, + { + "buffer": 0, + "byteOffset": 288, + "byteLength": 288, + "name": "Normals" + }, + { + "buffer": 0, + "byteOffset": 576, + "byteLength": 192, + "name": "Texture Coords 0" + }, + { + "buffer": 0, + "byteOffset": 768, + "byteLength": 144, + "name": "Indices" + }, + { + "buffer": 0, + "byteOffset": 912, + "byteLength": 288, + "name": "Positions" + }, + { + "buffer": 0, + "byteOffset": 1200, + "byteLength": 288, + "name": "Normals" + }, + { + "buffer": 0, + "byteOffset": 1488, + "byteLength": 192, + "name": "Texture Coords 0" + }, + { + "buffer": 0, + "byteOffset": 1680, + "byteLength": 144, + "name": "Indices" + }, + { + "buffer": 0, + "byteOffset": 1824, + "byteLength": 20, + "name": "Animation Sampler Input" + }, + { + "buffer": 0, + "byteOffset": 1844, + "byteLength": 80, + "name": "Animation Sampler Output" + }, + { + "buffer": 0, + "byteOffset": 1924, + "byteLength": 20, + "name": "Animation Sampler Input" + } + ], + "images": [ + { + "uri": "Textures/BaseColor_Cube.png" + } + ], + "materials": [ + { + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 0 + } + } + }, + { + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 0 + } + } + } + ], + "meshes": [ + { + "primitives": [ + { + "attributes": { + "POSITION": 0, + "NORMAL": 1, + "TEXCOORD_0": 2 + }, + "indices": 3, + "material": 0 + } + ] + }, + { + "primitives": [ + { + "attributes": { + "POSITION": 4, + "NORMAL": 5, + "TEXCOORD_0": 6 + }, + "indices": 7, + "material": 1 + } + ] + } + ], + "nodes": [ + { + "mesh": 0, + "translation": [ + -0.6, + 0.0, + 0.0 + ] + }, + { + "mesh": 1, + "translation": [ + 0.6, + 0.0, + 0.0 + ] + } + ], + "scene": 0, + "scenes": [ + { + "nodes": [ + 0, + 1 + ] + } + ], + "textures": [ + { + "source": 0 + } + ] +} \ No newline at end of file diff --git a/Output/Positive/Instancing/Manifest.json b/Output/Positive/Instancing/Manifest.json new file mode 100644 index 00000000..cdc3f173 --- /dev/null +++ b/Output/Positive/Instancing/Manifest.json @@ -0,0 +1,162 @@ +{ + "folder": "Instancing", + "id": 24, + "models": [ + { + "fileName": "Instancing_00.gltf", + "loadable": true, + "sampleImageName": "Figures/SampleImages/Instancing_00.png", + "camera": { + "translation": [ + 0.0, + 0.0, + 2.7 + ] + } + }, + { + "fileName": "Instancing_01.gltf", + "loadable": true, + "sampleImageName": "Figures/SampleImages/Instancing_01.png", + "camera": { + "translation": [ + 0.0, + 0.0, + 2.7 + ] + } + }, + { + "fileName": "Instancing_02.gltf", + "loadable": true, + "sampleImageName": "Figures/SampleImages/Instancing_02.png", + "camera": { + "translation": [ + 0.0, + 0.0, + 2.7 + ] + } + }, + { + "fileName": "Instancing_03.gltf", + "loadable": true, + "sampleImageName": "Figures/SampleImages/Instancing_03.png", + "camera": { + "translation": [ + 0.0, + 0.0, + 2.7 + ] + } + }, + { + "fileName": "Instancing_04.gltf", + "loadable": true, + "sampleImageName": "Figures/SampleImages/Instancing_04.png", + "camera": { + "translation": [ + 0.0, + 0.0, + 2.7 + ] + } + }, + { + "fileName": "Instancing_05.gltf", + "loadable": true, + "sampleImageName": "Figures/SampleImages/Instancing_05.png", + "camera": { + "translation": [ + 0.0, + 0.0, + 2.7 + ] + } + }, + { + "fileName": "Instancing_06.gltf", + "loadable": true, + "sampleImageName": "Figures/SampleImages/Instancing_06.png", + "camera": { + "translation": [ + 0.0, + 0.0, + 2.7 + ] + } + }, + { + "fileName": "Instancing_07.gltf", + "loadable": true, + "sampleImageName": "Figures/SampleImages/Instancing_07.png", + "camera": { + "translation": [ + 0.0, + 0.0, + 1.3 + ] + } + }, + { + "fileName": "Instancing_08.gltf", + "loadable": true, + "sampleImageName": "Figures/SampleImages/Instancing_08.png", + "camera": { + "translation": [ + 0.0, + 0.0, + 1.3 + ] + } + }, + { + "fileName": "Instancing_09.gltf", + "loadable": true, + "sampleImageName": "Figures/SampleImages/Instancing_09.png", + "camera": { + "translation": [ + 0.0, + 0.0, + 1.3 + ] + } + }, + { + "fileName": "Instancing_10.gltf", + "loadable": true, + "sampleImageName": "Figures/SampleImages/Instancing_10.gif", + "camera": { + "translation": [ + 0.0, + 0.0, + 2.7 + ] + } + }, + { + "fileName": "Instancing_11.gltf", + "loadable": true, + "sampleImageName": "Figures/SampleImages/Instancing_11.gif", + "camera": { + "translation": [ + 0.0, + 0.0, + 2.7 + ] + } + }, + { + "fileName": "Instancing_12.gltf", + "loadable": true, + "sampleImageName": "Figures/SampleImages/Instancing_12.gif", + "camera": { + "translation": [ + 0.0, + 0.0, + 2.7 + ] + } + } + ] +} \ No newline at end of file diff --git a/Output/Positive/Instancing/README.md b/Output/Positive/Instancing/README.md new file mode 100644 index 00000000..399a11af --- /dev/null +++ b/Output/Positive/Instancing/README.md @@ -0,0 +1,20 @@ +These models are intended to test instancing of various properties. + +The following table shows the properties that are set for a given model. + +| | Sample Image | Description | Difference | +| :---: | :---: | :---: | :---: | +| [00](Instancing_00.gltf)
[View](https://bghgary.github.io/glTF-Assets-Viewer/?type=Positive&folder=24&model=0) | [](Figures/SampleImages/Instancing_00.png) | Two textures using the same image as their source. | The texture sampler `WrapT` and `WrapS` are set to `CLAMP_TO_EDGE` for one and `MIRRORED_REPEAT` for the other. | +| [01](Instancing_01.gltf)
[View](https://bghgary.github.io/glTF-Assets-Viewer/?type=Positive&folder=24&model=1) | [](Figures/SampleImages/Instancing_01.png) | Two textures using the same sampler. | One texture uses image A while the other uses image B. | +| [02](Instancing_02.gltf)
[View](https://bghgary.github.io/glTF-Assets-Viewer/?type=Positive&folder=24&model=2) | [](Figures/SampleImages/Instancing_02.png) | Two textures using the same source image. | One material does not have a baseColorFactor and the other has a blue baseColorFactor. | +| [03](Instancing_03.gltf)
[View](https://bghgary.github.io/glTF-Assets-Viewer/?type=Positive&folder=24&model=3) | [](Figures/SampleImages/Instancing_03.png) | Two primitives using the same material. | One primitive has texture coordinates that displays all of texture A, while the other primitive has textures coordinates that don't display the border. | +| [04](Instancing_04.gltf)
[View](https://bghgary.github.io/glTF-Assets-Viewer/?type=Positive&folder=24&model=4) | [](Figures/SampleImages/Instancing_04.png) | Two primitives using the same accessors for the `POSITION` attribute. | One primitive uses texture A while the other primitive uses texture B. | +| [05](Instancing_05.gltf)
[View](https://bghgary.github.io/glTF-Assets-Viewer/?type=Positive&folder=24&model=5) | [](Figures/SampleImages/Instancing_05.png) | Two primitives using the same accessors for indices. | One primitive uses texture A while the other primitive uses texture B. | +| [06](Instancing_06.gltf)
[View](https://bghgary.github.io/glTF-Assets-Viewer/?type=Positive&folder=24&model=6) | [](Figures/SampleImages/Instancing_06.png) | Two nodes using the same mesh. | The two nodes have different translations. | +| [07](Instancing_07.gltf)
[View](https://bghgary.github.io/glTF-Assets-Viewer/?type=Positive&folder=24&model=7) | [](Figures/SampleImages/Instancing_07.png) | Two nodes using the same skin. | The two mesh primitives have different `POSITION` values. | +| [08](Instancing_08.gltf)
[View](https://bghgary.github.io/glTF-Assets-Viewer/?type=Positive&folder=24&model=8) | [](Figures/SampleImages/Instancing_08.png) | Two skins using the same joints. | The skin with texture B has inverseBindMatrices that fold twice as far as the skin with texture A. | +| [09](Instancing_09.gltf)
[View](https://bghgary.github.io/glTF-Assets-Viewer/?type=Positive&folder=24&model=9) | [](Figures/SampleImages/Instancing_09.png) | Two skins using the same inverseBindMatrices. | The base joint for the two skins have different translations. | +| [10](Instancing_10.gltf)
[View](https://bghgary.github.io/glTF-Assets-Viewer/?type=Positive&folder=24&model=10) | [](Figures/SampleImages/Instancing_10.gif) | Two animation channels using the same sampler. | The two animation channels target different nodes. | +| [11](Instancing_11.gltf)
[View](https://bghgary.github.io/glTF-Assets-Viewer/?type=Positive&folder=24&model=11) | [](Figures/SampleImages/Instancing_11.gif) | Two animation samplers using the same input accessors. | The two animation samplers have different output values. | +| [12](Instancing_12.gltf)
[View](https://bghgary.github.io/glTF-Assets-Viewer/?type=Positive&folder=24&model=12) | [](Figures/SampleImages/Instancing_12.gif) | Two animation samplers using the same output accessors. | The two animation samplers have different input values. | + diff --git a/Output/Positive/Instancing/Textures/BaseColor_A.png b/Output/Positive/Instancing/Textures/BaseColor_A.png new file mode 100644 index 00000000..98175651 Binary files /dev/null and b/Output/Positive/Instancing/Textures/BaseColor_A.png differ diff --git a/Output/Positive/Instancing/Textures/BaseColor_B.png b/Output/Positive/Instancing/Textures/BaseColor_B.png new file mode 100644 index 00000000..53d9981a Binary files /dev/null and b/Output/Positive/Instancing/Textures/BaseColor_B.png differ diff --git a/Output/Positive/Instancing/Textures/BaseColor_Cube.png b/Output/Positive/Instancing/Textures/BaseColor_Cube.png new file mode 100644 index 00000000..fd169ab3 Binary files /dev/null and b/Output/Positive/Instancing/Textures/BaseColor_Cube.png differ diff --git a/Output/Positive/Instancing/ValidatorResults/Instancing_00.json b/Output/Positive/Instancing/ValidatorResults/Instancing_00.json new file mode 100644 index 00000000..ef9bb78d --- /dev/null +++ b/Output/Positive/Instancing/ValidatorResults/Instancing_00.json @@ -0,0 +1,46 @@ +{ + "uri": "Instancing_00.gltf", + "mimeType": "model/gltf+json", + "validatorVersion": "2.0.0-dev.2.7", + "issues": { + "numErrors": 0, + "numWarnings": 0, + "numInfos": 0, + "numHints": 0, + "messages": [], + "truncated": false + }, + "info": { + "version": "2.0", + "generator": "glTF Asset Generator", + "resources": [ + { + "pointer": "/buffers/0", + "mimeType": "application/gltf-buffer", + "storage": "external", + "uri": "Instancing_00.bin", + "byteLength": 208 + }, + { + "pointer": "/images/0", + "mimeType": "image/png", + "storage": "external", + "uri": "Textures/BaseColor_A.png", + "image": { + "width": 1024, + "height": 1024, + "format": "RGBA", + "bits": 8 + } + } + ], + "hasAnimations": false, + "hasMaterials": true, + "hasMorphTargets": false, + "hasSkins": false, + "hasTextures": true, + "hasDefaultScene": true, + "primitivesCount": 2, + "maxAttributesUsed": 2 + } +} \ No newline at end of file diff --git a/Output/Positive/Instancing/ValidatorResults/Instancing_01.json b/Output/Positive/Instancing/ValidatorResults/Instancing_01.json new file mode 100644 index 00000000..18ba5910 --- /dev/null +++ b/Output/Positive/Instancing/ValidatorResults/Instancing_01.json @@ -0,0 +1,58 @@ +{ + "uri": "Instancing_01.gltf", + "mimeType": "model/gltf+json", + "validatorVersion": "2.0.0-dev.2.7", + "issues": { + "numErrors": 0, + "numWarnings": 0, + "numInfos": 0, + "numHints": 0, + "messages": [], + "truncated": false + }, + "info": { + "version": "2.0", + "generator": "glTF Asset Generator", + "resources": [ + { + "pointer": "/buffers/0", + "mimeType": "application/gltf-buffer", + "storage": "external", + "uri": "Instancing_01.bin", + "byteLength": 208 + }, + { + "pointer": "/images/0", + "mimeType": "image/png", + "storage": "external", + "uri": "Textures/BaseColor_A.png", + "image": { + "width": 1024, + "height": 1024, + "format": "RGBA", + "bits": 8 + } + }, + { + "pointer": "/images/1", + "mimeType": "image/png", + "storage": "external", + "uri": "Textures/BaseColor_B.png", + "image": { + "width": 1024, + "height": 1024, + "format": "RGBA", + "bits": 8 + } + } + ], + "hasAnimations": false, + "hasMaterials": true, + "hasMorphTargets": false, + "hasSkins": false, + "hasTextures": true, + "hasDefaultScene": true, + "primitivesCount": 2, + "maxAttributesUsed": 2 + } +} \ No newline at end of file diff --git a/Output/Positive/Instancing/ValidatorResults/Instancing_02.json b/Output/Positive/Instancing/ValidatorResults/Instancing_02.json new file mode 100644 index 00000000..65411831 --- /dev/null +++ b/Output/Positive/Instancing/ValidatorResults/Instancing_02.json @@ -0,0 +1,46 @@ +{ + "uri": "Instancing_02.gltf", + "mimeType": "model/gltf+json", + "validatorVersion": "2.0.0-dev.2.7", + "issues": { + "numErrors": 0, + "numWarnings": 0, + "numInfos": 0, + "numHints": 0, + "messages": [], + "truncated": false + }, + "info": { + "version": "2.0", + "generator": "glTF Asset Generator", + "resources": [ + { + "pointer": "/buffers/0", + "mimeType": "application/gltf-buffer", + "storage": "external", + "uri": "Instancing_02.bin", + "byteLength": 208 + }, + { + "pointer": "/images/0", + "mimeType": "image/png", + "storage": "external", + "uri": "Textures/BaseColor_A.png", + "image": { + "width": 1024, + "height": 1024, + "format": "RGBA", + "bits": 8 + } + } + ], + "hasAnimations": false, + "hasMaterials": true, + "hasMorphTargets": false, + "hasSkins": false, + "hasTextures": true, + "hasDefaultScene": true, + "primitivesCount": 2, + "maxAttributesUsed": 2 + } +} \ No newline at end of file diff --git a/Output/Positive/Instancing/ValidatorResults/Instancing_03.json b/Output/Positive/Instancing/ValidatorResults/Instancing_03.json new file mode 100644 index 00000000..2a9327fe --- /dev/null +++ b/Output/Positive/Instancing/ValidatorResults/Instancing_03.json @@ -0,0 +1,46 @@ +{ + "uri": "Instancing_03.gltf", + "mimeType": "model/gltf+json", + "validatorVersion": "2.0.0-dev.2.7", + "issues": { + "numErrors": 0, + "numWarnings": 0, + "numInfos": 0, + "numHints": 0, + "messages": [], + "truncated": false + }, + "info": { + "version": "2.0", + "generator": "glTF Asset Generator", + "resources": [ + { + "pointer": "/buffers/0", + "mimeType": "application/gltf-buffer", + "storage": "external", + "uri": "Instancing_03.bin", + "byteLength": 208 + }, + { + "pointer": "/images/0", + "mimeType": "image/png", + "storage": "external", + "uri": "Textures/BaseColor_A.png", + "image": { + "width": 1024, + "height": 1024, + "format": "RGBA", + "bits": 8 + } + } + ], + "hasAnimations": false, + "hasMaterials": true, + "hasMorphTargets": false, + "hasSkins": false, + "hasTextures": true, + "hasDefaultScene": true, + "primitivesCount": 2, + "maxAttributesUsed": 2 + } +} \ No newline at end of file diff --git a/Output/Positive/Instancing/ValidatorResults/Instancing_04.json b/Output/Positive/Instancing/ValidatorResults/Instancing_04.json new file mode 100644 index 00000000..601f1a01 --- /dev/null +++ b/Output/Positive/Instancing/ValidatorResults/Instancing_04.json @@ -0,0 +1,58 @@ +{ + "uri": "Instancing_04.gltf", + "mimeType": "model/gltf+json", + "validatorVersion": "2.0.0-dev.2.7", + "issues": { + "numErrors": 0, + "numWarnings": 0, + "numInfos": 0, + "numHints": 0, + "messages": [], + "truncated": false + }, + "info": { + "version": "2.0", + "generator": "glTF Asset Generator", + "resources": [ + { + "pointer": "/buffers/0", + "mimeType": "application/gltf-buffer", + "storage": "external", + "uri": "Instancing_04.bin", + "byteLength": 160 + }, + { + "pointer": "/images/0", + "mimeType": "image/png", + "storage": "external", + "uri": "Textures/BaseColor_A.png", + "image": { + "width": 1024, + "height": 1024, + "format": "RGBA", + "bits": 8 + } + }, + { + "pointer": "/images/1", + "mimeType": "image/png", + "storage": "external", + "uri": "Textures/BaseColor_B.png", + "image": { + "width": 1024, + "height": 1024, + "format": "RGBA", + "bits": 8 + } + } + ], + "hasAnimations": false, + "hasMaterials": true, + "hasMorphTargets": false, + "hasSkins": false, + "hasTextures": true, + "hasDefaultScene": true, + "primitivesCount": 2, + "maxAttributesUsed": 2 + } +} \ No newline at end of file diff --git a/Output/Positive/Instancing/ValidatorResults/Instancing_05.json b/Output/Positive/Instancing/ValidatorResults/Instancing_05.json new file mode 100644 index 00000000..81888a86 --- /dev/null +++ b/Output/Positive/Instancing/ValidatorResults/Instancing_05.json @@ -0,0 +1,58 @@ +{ + "uri": "Instancing_05.gltf", + "mimeType": "model/gltf+json", + "validatorVersion": "2.0.0-dev.2.7", + "issues": { + "numErrors": 0, + "numWarnings": 0, + "numInfos": 0, + "numHints": 0, + "messages": [], + "truncated": false + }, + "info": { + "version": "2.0", + "generator": "glTF Asset Generator", + "resources": [ + { + "pointer": "/buffers/0", + "mimeType": "application/gltf-buffer", + "storage": "external", + "uri": "Instancing_05.bin", + "byteLength": 184 + }, + { + "pointer": "/images/0", + "mimeType": "image/png", + "storage": "external", + "uri": "Textures/BaseColor_A.png", + "image": { + "width": 1024, + "height": 1024, + "format": "RGBA", + "bits": 8 + } + }, + { + "pointer": "/images/1", + "mimeType": "image/png", + "storage": "external", + "uri": "Textures/BaseColor_B.png", + "image": { + "width": 1024, + "height": 1024, + "format": "RGBA", + "bits": 8 + } + } + ], + "hasAnimations": false, + "hasMaterials": true, + "hasMorphTargets": false, + "hasSkins": false, + "hasTextures": true, + "hasDefaultScene": true, + "primitivesCount": 2, + "maxAttributesUsed": 2 + } +} \ No newline at end of file diff --git a/Output/Positive/Instancing/ValidatorResults/Instancing_06.json b/Output/Positive/Instancing/ValidatorResults/Instancing_06.json new file mode 100644 index 00000000..23349463 --- /dev/null +++ b/Output/Positive/Instancing/ValidatorResults/Instancing_06.json @@ -0,0 +1,46 @@ +{ + "uri": "Instancing_06.gltf", + "mimeType": "model/gltf+json", + "validatorVersion": "2.0.0-dev.2.7", + "issues": { + "numErrors": 0, + "numWarnings": 0, + "numInfos": 0, + "numHints": 0, + "messages": [], + "truncated": false + }, + "info": { + "version": "2.0", + "generator": "glTF Asset Generator", + "resources": [ + { + "pointer": "/buffers/0", + "mimeType": "application/gltf-buffer", + "storage": "external", + "uri": "Instancing_06.bin", + "byteLength": 104 + }, + { + "pointer": "/images/0", + "mimeType": "image/png", + "storage": "external", + "uri": "Textures/BaseColor_A.png", + "image": { + "width": 1024, + "height": 1024, + "format": "RGBA", + "bits": 8 + } + } + ], + "hasAnimations": false, + "hasMaterials": true, + "hasMorphTargets": false, + "hasSkins": false, + "hasTextures": true, + "hasDefaultScene": true, + "primitivesCount": 1, + "maxAttributesUsed": 2 + } +} \ No newline at end of file diff --git a/Output/Positive/Instancing/ValidatorResults/Instancing_07.json b/Output/Positive/Instancing/ValidatorResults/Instancing_07.json new file mode 100644 index 00000000..6a7a6d7b --- /dev/null +++ b/Output/Positive/Instancing/ValidatorResults/Instancing_07.json @@ -0,0 +1,58 @@ +{ + "uri": "Instancing_07.gltf", + "mimeType": "model/gltf+json", + "validatorVersion": "2.0.0-dev.2.7", + "issues": { + "numErrors": 0, + "numWarnings": 0, + "numInfos": 0, + "numHints": 0, + "messages": [], + "truncated": false + }, + "info": { + "version": "2.0", + "generator": "glTF Asset Generator", + "resources": [ + { + "pointer": "/buffers/0", + "mimeType": "application/gltf-buffer", + "storage": "external", + "uri": "Instancing_07.bin", + "byteLength": 752 + }, + { + "pointer": "/images/0", + "mimeType": "image/png", + "storage": "external", + "uri": "Textures/BaseColor_A.png", + "image": { + "width": 1024, + "height": 1024, + "format": "RGBA", + "bits": 8 + } + }, + { + "pointer": "/images/1", + "mimeType": "image/png", + "storage": "external", + "uri": "Textures/BaseColor_B.png", + "image": { + "width": 1024, + "height": 1024, + "format": "RGBA", + "bits": 8 + } + } + ], + "hasAnimations": false, + "hasMaterials": true, + "hasMorphTargets": false, + "hasSkins": true, + "hasTextures": true, + "hasDefaultScene": true, + "primitivesCount": 2, + "maxAttributesUsed": 4 + } +} \ No newline at end of file diff --git a/Output/Positive/Instancing/ValidatorResults/Instancing_08.json b/Output/Positive/Instancing/ValidatorResults/Instancing_08.json new file mode 100644 index 00000000..e36cc199 --- /dev/null +++ b/Output/Positive/Instancing/ValidatorResults/Instancing_08.json @@ -0,0 +1,58 @@ +{ + "uri": "Instancing_08.gltf", + "mimeType": "model/gltf+json", + "validatorVersion": "2.0.0-dev.2.7", + "issues": { + "numErrors": 0, + "numWarnings": 0, + "numInfos": 0, + "numHints": 0, + "messages": [], + "truncated": false + }, + "info": { + "version": "2.0", + "generator": "glTF Asset Generator", + "resources": [ + { + "pointer": "/buffers/0", + "mimeType": "application/gltf-buffer", + "storage": "external", + "uri": "Instancing_08.bin", + "byteLength": 880 + }, + { + "pointer": "/images/0", + "mimeType": "image/png", + "storage": "external", + "uri": "Textures/BaseColor_A.png", + "image": { + "width": 1024, + "height": 1024, + "format": "RGBA", + "bits": 8 + } + }, + { + "pointer": "/images/1", + "mimeType": "image/png", + "storage": "external", + "uri": "Textures/BaseColor_B.png", + "image": { + "width": 1024, + "height": 1024, + "format": "RGBA", + "bits": 8 + } + } + ], + "hasAnimations": false, + "hasMaterials": true, + "hasMorphTargets": false, + "hasSkins": true, + "hasTextures": true, + "hasDefaultScene": true, + "primitivesCount": 2, + "maxAttributesUsed": 4 + } +} \ No newline at end of file diff --git a/Output/Positive/Instancing/ValidatorResults/Instancing_09.json b/Output/Positive/Instancing/ValidatorResults/Instancing_09.json new file mode 100644 index 00000000..a7455479 --- /dev/null +++ b/Output/Positive/Instancing/ValidatorResults/Instancing_09.json @@ -0,0 +1,58 @@ +{ + "uri": "Instancing_09.gltf", + "mimeType": "model/gltf+json", + "validatorVersion": "2.0.0-dev.2.7", + "issues": { + "numErrors": 0, + "numWarnings": 0, + "numInfos": 0, + "numHints": 0, + "messages": [], + "truncated": false + }, + "info": { + "version": "2.0", + "generator": "glTF Asset Generator", + "resources": [ + { + "pointer": "/buffers/0", + "mimeType": "application/gltf-buffer", + "storage": "external", + "uri": "Instancing_09.bin", + "byteLength": 752 + }, + { + "pointer": "/images/0", + "mimeType": "image/png", + "storage": "external", + "uri": "Textures/BaseColor_A.png", + "image": { + "width": 1024, + "height": 1024, + "format": "RGBA", + "bits": 8 + } + }, + { + "pointer": "/images/1", + "mimeType": "image/png", + "storage": "external", + "uri": "Textures/BaseColor_B.png", + "image": { + "width": 1024, + "height": 1024, + "format": "RGBA", + "bits": 8 + } + } + ], + "hasAnimations": false, + "hasMaterials": true, + "hasMorphTargets": false, + "hasSkins": true, + "hasTextures": true, + "hasDefaultScene": true, + "primitivesCount": 2, + "maxAttributesUsed": 4 + } +} \ No newline at end of file diff --git a/Output/Positive/Instancing/ValidatorResults/Instancing_10.json b/Output/Positive/Instancing/ValidatorResults/Instancing_10.json new file mode 100644 index 00000000..65c94464 --- /dev/null +++ b/Output/Positive/Instancing/ValidatorResults/Instancing_10.json @@ -0,0 +1,46 @@ +{ + "uri": "Instancing_10.gltf", + "mimeType": "model/gltf+json", + "validatorVersion": "2.0.0-dev.2.7", + "issues": { + "numErrors": 0, + "numWarnings": 0, + "numInfos": 0, + "numHints": 0, + "messages": [], + "truncated": false + }, + "info": { + "version": "2.0", + "generator": "glTF Asset Generator", + "resources": [ + { + "pointer": "/buffers/0", + "mimeType": "application/gltf-buffer", + "storage": "external", + "uri": "Instancing_10.bin", + "byteLength": 1924 + }, + { + "pointer": "/images/0", + "mimeType": "image/png", + "storage": "external", + "uri": "Textures/BaseColor_Cube.png", + "image": { + "width": 1024, + "height": 1024, + "format": "RGBA", + "bits": 8 + } + } + ], + "hasAnimations": true, + "hasMaterials": true, + "hasMorphTargets": false, + "hasSkins": false, + "hasTextures": true, + "hasDefaultScene": true, + "primitivesCount": 2, + "maxAttributesUsed": 3 + } +} \ No newline at end of file diff --git a/Output/Positive/Instancing/ValidatorResults/Instancing_11.json b/Output/Positive/Instancing/ValidatorResults/Instancing_11.json new file mode 100644 index 00000000..520b6c14 --- /dev/null +++ b/Output/Positive/Instancing/ValidatorResults/Instancing_11.json @@ -0,0 +1,46 @@ +{ + "uri": "Instancing_11.gltf", + "mimeType": "model/gltf+json", + "validatorVersion": "2.0.0-dev.2.7", + "issues": { + "numErrors": 0, + "numWarnings": 0, + "numInfos": 0, + "numHints": 0, + "messages": [], + "truncated": false + }, + "info": { + "version": "2.0", + "generator": "glTF Asset Generator", + "resources": [ + { + "pointer": "/buffers/0", + "mimeType": "application/gltf-buffer", + "storage": "external", + "uri": "Instancing_11.bin", + "byteLength": 2004 + }, + { + "pointer": "/images/0", + "mimeType": "image/png", + "storage": "external", + "uri": "Textures/BaseColor_Cube.png", + "image": { + "width": 1024, + "height": 1024, + "format": "RGBA", + "bits": 8 + } + } + ], + "hasAnimations": true, + "hasMaterials": true, + "hasMorphTargets": false, + "hasSkins": false, + "hasTextures": true, + "hasDefaultScene": true, + "primitivesCount": 2, + "maxAttributesUsed": 3 + } +} \ No newline at end of file diff --git a/Output/Positive/Instancing/ValidatorResults/Instancing_12.json b/Output/Positive/Instancing/ValidatorResults/Instancing_12.json new file mode 100644 index 00000000..a3991b42 --- /dev/null +++ b/Output/Positive/Instancing/ValidatorResults/Instancing_12.json @@ -0,0 +1,46 @@ +{ + "uri": "Instancing_12.gltf", + "mimeType": "model/gltf+json", + "validatorVersion": "2.0.0-dev.2.7", + "issues": { + "numErrors": 0, + "numWarnings": 0, + "numInfos": 0, + "numHints": 0, + "messages": [], + "truncated": false + }, + "info": { + "version": "2.0", + "generator": "glTF Asset Generator", + "resources": [ + { + "pointer": "/buffers/0", + "mimeType": "application/gltf-buffer", + "storage": "external", + "uri": "Instancing_12.bin", + "byteLength": 1944 + }, + { + "pointer": "/images/0", + "mimeType": "image/png", + "storage": "external", + "uri": "Textures/BaseColor_Cube.png", + "image": { + "width": 1024, + "height": 1024, + "format": "RGBA", + "bits": 8 + } + } + ], + "hasAnimations": true, + "hasMaterials": true, + "hasMorphTargets": false, + "hasSkins": false, + "hasTextures": true, + "hasDefaultScene": true, + "primitivesCount": 2, + "maxAttributesUsed": 3 + } +} \ No newline at end of file diff --git a/Output/Positive/Manifest.json b/Output/Positive/Manifest.json index 5c268d6d..d5c0babd 100644 --- a/Output/Positive/Manifest.json +++ b/Output/Positive/Manifest.json @@ -333,7 +333,7 @@ "sampleImageName": "Figures/SampleImages/Animation_Skin_11.png", "camera": { "translation": [ - 0.8, + 1.5, 0.0, 1.0 ] @@ -2247,5 +2247,167 @@ } } ] + }, + { + "folder": "Instancing", + "id": 24, + "models": [ + { + "fileName": "Instancing_00.gltf", + "loadable": true, + "sampleImageName": "Figures/SampleImages/Instancing_00.png", + "camera": { + "translation": [ + 0.0, + 0.0, + 2.7 + ] + } + }, + { + "fileName": "Instancing_01.gltf", + "loadable": true, + "sampleImageName": "Figures/SampleImages/Instancing_01.png", + "camera": { + "translation": [ + 0.0, + 0.0, + 2.7 + ] + } + }, + { + "fileName": "Instancing_02.gltf", + "loadable": true, + "sampleImageName": "Figures/SampleImages/Instancing_02.png", + "camera": { + "translation": [ + 0.0, + 0.0, + 2.7 + ] + } + }, + { + "fileName": "Instancing_03.gltf", + "loadable": true, + "sampleImageName": "Figures/SampleImages/Instancing_03.png", + "camera": { + "translation": [ + 0.0, + 0.0, + 2.7 + ] + } + }, + { + "fileName": "Instancing_04.gltf", + "loadable": true, + "sampleImageName": "Figures/SampleImages/Instancing_04.png", + "camera": { + "translation": [ + 0.0, + 0.0, + 2.7 + ] + } + }, + { + "fileName": "Instancing_05.gltf", + "loadable": true, + "sampleImageName": "Figures/SampleImages/Instancing_05.png", + "camera": { + "translation": [ + 0.0, + 0.0, + 2.7 + ] + } + }, + { + "fileName": "Instancing_06.gltf", + "loadable": true, + "sampleImageName": "Figures/SampleImages/Instancing_06.png", + "camera": { + "translation": [ + 0.0, + 0.0, + 2.7 + ] + } + }, + { + "fileName": "Instancing_07.gltf", + "loadable": true, + "sampleImageName": "Figures/SampleImages/Instancing_07.png", + "camera": { + "translation": [ + 0.0, + 0.0, + 1.3 + ] + } + }, + { + "fileName": "Instancing_08.gltf", + "loadable": true, + "sampleImageName": "Figures/SampleImages/Instancing_08.png", + "camera": { + "translation": [ + 0.0, + 0.0, + 1.3 + ] + } + }, + { + "fileName": "Instancing_09.gltf", + "loadable": true, + "sampleImageName": "Figures/SampleImages/Instancing_09.png", + "camera": { + "translation": [ + 0.0, + 0.0, + 1.3 + ] + } + }, + { + "fileName": "Instancing_10.gltf", + "loadable": true, + "sampleImageName": "Figures/SampleImages/Instancing_10.gif", + "camera": { + "translation": [ + 0.0, + 0.0, + 2.7 + ] + } + }, + { + "fileName": "Instancing_11.gltf", + "loadable": true, + "sampleImageName": "Figures/SampleImages/Instancing_11.gif", + "camera": { + "translation": [ + 0.0, + 0.0, + 2.7 + ] + } + }, + { + "fileName": "Instancing_12.gltf", + "loadable": true, + "sampleImageName": "Figures/SampleImages/Instancing_12.gif", + "camera": { + "translation": [ + 0.0, + 0.0, + 2.7 + ] + } + } + ] } ] \ No newline at end of file diff --git a/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_03.bin b/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_03.bin index 8acae6b3..bdd7c887 100644 Binary files a/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_03.bin and b/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_03.bin differ diff --git a/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_03.gltf b/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_03.gltf index bddd9ea8..8f08f2b0 100644 --- a/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_03.gltf +++ b/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_03.gltf @@ -73,32 +73,11 @@ "bufferView": 7, "componentType": 5126, "count": 3, - "type": "VEC3", - "name": "Normals Accessor" - }, - { - "bufferView": 8, - "componentType": 5126, - "count": 3, - "type": "VEC4", - "name": "Tangents Accessor" - }, - { - "bufferView": 9, - "componentType": 5126, - "count": 3, - "type": "VEC3", - "name": "Colors Accessor" - }, - { - "bufferView": 10, - "componentType": 5126, - "count": 3, "type": "VEC2", "name": "UV Accessor 0" }, { - "bufferView": 11, + "bufferView": 8, "componentType": 5125, "count": 3, "type": "SCALAR", @@ -112,7 +91,7 @@ "buffers": [ { "uri": "Mesh_PrimitivesUV_03.bin", - "byteLength": 384 + "byteLength": 264 } ], "bufferViews": [ @@ -160,30 +139,12 @@ { "buffer": 0, "byteOffset": 228, - "byteLength": 36, - "name": "Normals" - }, - { - "buffer": 0, - "byteOffset": 264, - "byteLength": 48, - "name": "Tangents" - }, - { - "buffer": 0, - "byteOffset": 312, - "byteLength": 36, - "name": "Colors" - }, - { - "buffer": 0, - "byteOffset": 348, "byteLength": 24, "name": "Texture Coords 0" }, { "buffer": 0, - "byteOffset": 372, + "byteOffset": 252, "byteLength": 12, "name": "Indices" } @@ -237,12 +198,12 @@ { "attributes": { "POSITION": 6, - "NORMAL": 7, - "TANGENT": 8, - "COLOR_0": 9, - "TEXCOORD_0": 10 + "NORMAL": 1, + "TANGENT": 2, + "COLOR_0": 3, + "TEXCOORD_0": 7 }, - "indices": 11, + "indices": 8, "material": 1 } ] diff --git a/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_06.bin b/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_06.bin index 8edb2eff..4bc05d87 100644 Binary files a/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_06.bin and b/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_06.bin differ diff --git a/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_06.gltf b/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_06.gltf index 7932e328..a81d5228 100644 --- a/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_06.gltf +++ b/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_06.gltf @@ -73,39 +73,18 @@ "bufferView": 7, "componentType": 5126, "count": 3, - "type": "VEC3", - "name": "Normals Accessor" - }, - { - "bufferView": 8, - "componentType": 5126, - "count": 3, - "type": "VEC4", - "name": "Tangents Accessor" - }, - { - "bufferView": 9, - "componentType": 5126, - "count": 3, - "type": "VEC3", - "name": "Colors Accessor" - }, - { - "bufferView": 10, - "componentType": 5126, - "count": 3, "type": "VEC2", "name": "UV Accessor 0" }, { - "bufferView": 11, + "bufferView": 8, "componentType": 5126, "count": 3, "type": "VEC2", "name": "UV Accessor 1" }, { - "bufferView": 12, + "bufferView": 9, "componentType": 5125, "count": 3, "type": "SCALAR", @@ -119,7 +98,7 @@ "buffers": [ { "uri": "Mesh_PrimitivesUV_06.bin", - "byteLength": 408 + "byteLength": 288 } ], "bufferViews": [ @@ -167,36 +146,18 @@ { "buffer": 0, "byteOffset": 228, - "byteLength": 36, - "name": "Normals" - }, - { - "buffer": 0, - "byteOffset": 264, - "byteLength": 48, - "name": "Tangents" - }, - { - "buffer": 0, - "byteOffset": 312, - "byteLength": 36, - "name": "Colors" - }, - { - "buffer": 0, - "byteOffset": 348, "byteLength": 24, "name": "Texture Coords 0" }, { "buffer": 0, - "byteOffset": 372, + "byteOffset": 252, "byteLength": 24, "name": "Texture Coords 1" }, { "buffer": 0, - "byteOffset": 396, + "byteOffset": 276, "byteLength": 12, "name": "Indices" } @@ -252,13 +213,13 @@ { "attributes": { "POSITION": 6, - "NORMAL": 7, - "TANGENT": 8, - "COLOR_0": 9, - "TEXCOORD_0": 10, - "TEXCOORD_1": 11 + "NORMAL": 1, + "TANGENT": 2, + "COLOR_0": 3, + "TEXCOORD_0": 7, + "TEXCOORD_1": 8 }, - "indices": 12, + "indices": 9, "material": 1 } ] diff --git a/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_07.bin b/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_07.bin index 762d7c1d..854accc1 100644 Binary files a/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_07.bin and b/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_07.bin differ diff --git a/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_07.gltf b/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_07.gltf index 01191af4..03fa5971 100644 --- a/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_07.gltf +++ b/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_07.gltf @@ -80,32 +80,11 @@ "bufferView": 8, "componentType": 5126, "count": 3, - "type": "VEC3", - "name": "Normals Accessor" - }, - { - "bufferView": 9, - "componentType": 5126, - "count": 3, - "type": "VEC4", - "name": "Tangents Accessor" - }, - { - "bufferView": 10, - "componentType": 5126, - "count": 3, - "type": "VEC3", - "name": "Colors Accessor" - }, - { - "bufferView": 11, - "componentType": 5126, - "count": 3, "type": "VEC2", "name": "UV Accessor 0" }, { - "bufferView": 12, + "bufferView": 9, "componentType": 5125, "count": 3, "type": "SCALAR", @@ -119,7 +98,7 @@ "buffers": [ { "uri": "Mesh_PrimitivesUV_07.bin", - "byteLength": 408 + "byteLength": 288 } ], "bufferViews": [ @@ -173,30 +152,12 @@ { "buffer": 0, "byteOffset": 252, - "byteLength": 36, - "name": "Normals" - }, - { - "buffer": 0, - "byteOffset": 288, - "byteLength": 48, - "name": "Tangents" - }, - { - "buffer": 0, - "byteOffset": 336, - "byteLength": 36, - "name": "Colors" - }, - { - "buffer": 0, - "byteOffset": 372, "byteLength": 24, "name": "Texture Coords 0" }, { "buffer": 0, - "byteOffset": 396, + "byteOffset": 276, "byteLength": 12, "name": "Indices" } @@ -253,12 +214,12 @@ { "attributes": { "POSITION": 7, - "NORMAL": 8, - "TANGENT": 9, - "COLOR_0": 10, - "TEXCOORD_0": 11 + "NORMAL": 1, + "TANGENT": 2, + "COLOR_0": 3, + "TEXCOORD_0": 8 }, - "indices": 12, + "indices": 9, "material": 1 } ] diff --git a/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_08.bin b/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_08.bin index 12bfddad..1ad7db20 100644 Binary files a/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_08.bin and b/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_08.bin differ diff --git a/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_08.gltf b/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_08.gltf index 29df9a89..6c382e0b 100644 --- a/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_08.gltf +++ b/Output/Positive/Mesh_PrimitivesUV/Mesh_PrimitivesUV_08.gltf @@ -80,39 +80,18 @@ "bufferView": 8, "componentType": 5126, "count": 3, - "type": "VEC3", - "name": "Normals Accessor" - }, - { - "bufferView": 9, - "componentType": 5126, - "count": 3, - "type": "VEC4", - "name": "Tangents Accessor" - }, - { - "bufferView": 10, - "componentType": 5126, - "count": 3, - "type": "VEC3", - "name": "Colors Accessor" - }, - { - "bufferView": 11, - "componentType": 5126, - "count": 3, "type": "VEC2", "name": "UV Accessor 0" }, { - "bufferView": 12, + "bufferView": 9, "componentType": 5126, "count": 3, "type": "VEC2", "name": "UV Accessor 1" }, { - "bufferView": 13, + "bufferView": 10, "componentType": 5125, "count": 3, "type": "SCALAR", @@ -126,7 +105,7 @@ "buffers": [ { "uri": "Mesh_PrimitivesUV_08.bin", - "byteLength": 432 + "byteLength": 312 } ], "bufferViews": [ @@ -180,36 +159,18 @@ { "buffer": 0, "byteOffset": 252, - "byteLength": 36, - "name": "Normals" - }, - { - "buffer": 0, - "byteOffset": 288, - "byteLength": 48, - "name": "Tangents" - }, - { - "buffer": 0, - "byteOffset": 336, - "byteLength": 36, - "name": "Colors" - }, - { - "buffer": 0, - "byteOffset": 372, "byteLength": 24, "name": "Texture Coords 0" }, { "buffer": 0, - "byteOffset": 396, + "byteOffset": 276, "byteLength": 24, "name": "Texture Coords 1" }, { "buffer": 0, - "byteOffset": 420, + "byteOffset": 300, "byteLength": 12, "name": "Indices" } @@ -268,13 +229,13 @@ { "attributes": { "POSITION": 7, - "NORMAL": 8, - "TANGENT": 9, - "COLOR_0": 10, - "TEXCOORD_0": 11, - "TEXCOORD_1": 12 + "NORMAL": 1, + "TANGENT": 2, + "COLOR_0": 3, + "TEXCOORD_0": 8, + "TEXCOORD_1": 9 }, - "indices": 13, + "indices": 10, "material": 1 } ] diff --git a/Output/Positive/Mesh_PrimitivesUV/ValidatorResults/Mesh_PrimitivesUV_03.json b/Output/Positive/Mesh_PrimitivesUV/ValidatorResults/Mesh_PrimitivesUV_03.json index f51f8771..1d81328c 100644 --- a/Output/Positive/Mesh_PrimitivesUV/ValidatorResults/Mesh_PrimitivesUV_03.json +++ b/Output/Positive/Mesh_PrimitivesUV/ValidatorResults/Mesh_PrimitivesUV_03.json @@ -19,7 +19,7 @@ "mimeType": "application/gltf-buffer", "storage": "external", "uri": "Mesh_PrimitivesUV_03.bin", - "byteLength": 384 + "byteLength": 264 }, { "pointer": "/images/0", diff --git a/Output/Positive/Mesh_PrimitivesUV/ValidatorResults/Mesh_PrimitivesUV_06.json b/Output/Positive/Mesh_PrimitivesUV/ValidatorResults/Mesh_PrimitivesUV_06.json index 4b328919..b99517e0 100644 --- a/Output/Positive/Mesh_PrimitivesUV/ValidatorResults/Mesh_PrimitivesUV_06.json +++ b/Output/Positive/Mesh_PrimitivesUV/ValidatorResults/Mesh_PrimitivesUV_06.json @@ -26,7 +26,7 @@ "mimeType": "application/gltf-buffer", "storage": "external", "uri": "Mesh_PrimitivesUV_06.bin", - "byteLength": 408 + "byteLength": 288 }, { "pointer": "/images/0", diff --git a/Output/Positive/Mesh_PrimitivesUV/ValidatorResults/Mesh_PrimitivesUV_07.json b/Output/Positive/Mesh_PrimitivesUV/ValidatorResults/Mesh_PrimitivesUV_07.json index 9b896ba6..999f40b2 100644 --- a/Output/Positive/Mesh_PrimitivesUV/ValidatorResults/Mesh_PrimitivesUV_07.json +++ b/Output/Positive/Mesh_PrimitivesUV/ValidatorResults/Mesh_PrimitivesUV_07.json @@ -26,7 +26,7 @@ "mimeType": "application/gltf-buffer", "storage": "external", "uri": "Mesh_PrimitivesUV_07.bin", - "byteLength": 408 + "byteLength": 288 }, { "pointer": "/images/0", diff --git a/Output/Positive/Mesh_PrimitivesUV/ValidatorResults/Mesh_PrimitivesUV_08.json b/Output/Positive/Mesh_PrimitivesUV/ValidatorResults/Mesh_PrimitivesUV_08.json index 05547487..90f97543 100644 --- a/Output/Positive/Mesh_PrimitivesUV/ValidatorResults/Mesh_PrimitivesUV_08.json +++ b/Output/Positive/Mesh_PrimitivesUV/ValidatorResults/Mesh_PrimitivesUV_08.json @@ -32,7 +32,7 @@ "mimeType": "application/gltf-buffer", "storage": "external", "uri": "Mesh_PrimitivesUV_08.bin", - "byteLength": 432 + "byteLength": 312 }, { "pointer": "/images/0", diff --git a/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_00.png b/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_00.png index c0e46541..f8628478 100644 Binary files a/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_00.png and b/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_00.png differ diff --git a/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_01.png b/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_01.png index 39722d25..d9347d42 100644 Binary files a/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_01.png and b/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_01.png differ diff --git a/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_02.png b/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_02.png index 8a691503..95dc8462 100644 Binary files a/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_02.png and b/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_02.png differ diff --git a/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_03.png b/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_03.png index 9cd84015..4437cfae 100644 Binary files a/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_03.png and b/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_03.png differ diff --git a/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_04.png b/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_04.png index fa94942f..d56c155a 100644 Binary files a/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_04.png and b/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_04.png differ diff --git a/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_05.png b/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_05.png index 78331221..e2d6cf30 100644 Binary files a/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_05.png and b/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_05.png differ diff --git a/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_06.png b/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_06.png index 5134944d..8ecb6553 100644 Binary files a/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_06.png and b/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_06.png differ diff --git a/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_07.png b/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_07.png index fa8553ea..1b68be42 100644 Binary files a/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_07.png and b/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_07.png differ diff --git a/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_08.png b/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_08.png index c879a836..b8baf464 100644 Binary files a/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_08.png and b/Output/Positive/Node_Attribute/Figures/SampleImages/Node_Attribute_08.png differ diff --git a/Output/Positive/Node_Attribute/Figures/Thumbnails/Node_Attribute_03.png b/Output/Positive/Node_Attribute/Figures/Thumbnails/Node_Attribute_03.png index 10541a20..f0dab4c2 100644 Binary files a/Output/Positive/Node_Attribute/Figures/Thumbnails/Node_Attribute_03.png and b/Output/Positive/Node_Attribute/Figures/Thumbnails/Node_Attribute_03.png differ diff --git a/Output/Positive/Node_Attribute/Figures/Thumbnails/Node_Attribute_05.png b/Output/Positive/Node_Attribute/Figures/Thumbnails/Node_Attribute_05.png index 2b8e9d0d..08dc24a7 100644 Binary files a/Output/Positive/Node_Attribute/Figures/Thumbnails/Node_Attribute_05.png and b/Output/Positive/Node_Attribute/Figures/Thumbnails/Node_Attribute_05.png differ diff --git a/Output/Positive/Node_Attribute/Figures/Thumbnails/Node_Attribute_06.png b/Output/Positive/Node_Attribute/Figures/Thumbnails/Node_Attribute_06.png index 70419632..a2858468 100644 Binary files a/Output/Positive/Node_Attribute/Figures/Thumbnails/Node_Attribute_06.png and b/Output/Positive/Node_Attribute/Figures/Thumbnails/Node_Attribute_06.png differ diff --git a/Output/Positive/Node_Attribute/Figures/Thumbnails/Node_Attribute_07.png b/Output/Positive/Node_Attribute/Figures/Thumbnails/Node_Attribute_07.png index 50cd926e..c2e31845 100644 Binary files a/Output/Positive/Node_Attribute/Figures/Thumbnails/Node_Attribute_07.png and b/Output/Positive/Node_Attribute/Figures/Thumbnails/Node_Attribute_07.png differ diff --git a/Output/Positive/Node_Attribute/Figures/Thumbnails/Node_Attribute_08.png b/Output/Positive/Node_Attribute/Figures/Thumbnails/Node_Attribute_08.png index 3c6cbc7e..5b39b7a5 100644 Binary files a/Output/Positive/Node_Attribute/Figures/Thumbnails/Node_Attribute_08.png and b/Output/Positive/Node_Attribute/Figures/Thumbnails/Node_Attribute_08.png differ diff --git a/Output/Positive/Node_Attribute/Node_Attribute_00.bin b/Output/Positive/Node_Attribute/Node_Attribute_00.bin index a4d5decb..e764ea3a 100644 Binary files a/Output/Positive/Node_Attribute/Node_Attribute_00.bin and b/Output/Positive/Node_Attribute/Node_Attribute_00.bin differ diff --git a/Output/Positive/Node_Attribute/Node_Attribute_00.gltf b/Output/Positive/Node_Attribute/Node_Attribute_00.gltf index 92ea4b0c..fd1b2dd7 100644 --- a/Output/Positive/Node_Attribute/Node_Attribute_00.gltf +++ b/Output/Positive/Node_Attribute/Node_Attribute_00.gltf @@ -33,30 +33,6 @@ }, { "bufferView": 3, - "componentType": 5126, - "count": 98, - "type": "VEC3", - "max": [ - 7.5, - 7.5, - 7.5 - ], - "min": [ - -7.5, - -2.5, - -7.5 - ], - "name": "Positions Accessor" - }, - { - "bufferView": 4, - "componentType": 5126, - "count": 98, - "type": "VEC2", - "name": "UV Accessor 0" - }, - { - "bufferView": 5, "componentType": 5125, "count": 144, "type": "SCALAR", @@ -70,7 +46,7 @@ "buffers": [ { "uri": "Node_Attribute_00.bin", - "byteLength": 4568 + "byteLength": 2608 } ], "bufferViews": [ @@ -94,18 +70,6 @@ { "buffer": 0, "byteOffset": 2032, - "byteLength": 1176, - "name": "Positions" - }, - { - "buffer": 0, - "byteOffset": 3208, - "byteLength": 784, - "name": "Texture Coords 0" - }, - { - "buffer": 0, - "byteOffset": 3992, "byteLength": 576, "name": "Indices" } @@ -166,10 +130,10 @@ "primitives": [ { "attributes": { - "POSITION": 3, - "TEXCOORD_0": 4 + "POSITION": 0, + "TEXCOORD_0": 1 }, - "indices": 5, + "indices": 3, "material": 1 } ] diff --git a/Output/Positive/Node_Attribute/Node_Attribute_01.bin b/Output/Positive/Node_Attribute/Node_Attribute_01.bin index a4d5decb..e764ea3a 100644 Binary files a/Output/Positive/Node_Attribute/Node_Attribute_01.bin and b/Output/Positive/Node_Attribute/Node_Attribute_01.bin differ diff --git a/Output/Positive/Node_Attribute/Node_Attribute_01.gltf b/Output/Positive/Node_Attribute/Node_Attribute_01.gltf index c4bafdf4..12d5d75b 100644 --- a/Output/Positive/Node_Attribute/Node_Attribute_01.gltf +++ b/Output/Positive/Node_Attribute/Node_Attribute_01.gltf @@ -33,30 +33,6 @@ }, { "bufferView": 3, - "componentType": 5126, - "count": 98, - "type": "VEC3", - "max": [ - 7.5, - 7.5, - 7.5 - ], - "min": [ - -7.5, - -2.5, - -7.5 - ], - "name": "Positions Accessor" - }, - { - "bufferView": 4, - "componentType": 5126, - "count": 98, - "type": "VEC2", - "name": "UV Accessor 0" - }, - { - "bufferView": 5, "componentType": 5125, "count": 144, "type": "SCALAR", @@ -70,7 +46,7 @@ "buffers": [ { "uri": "Node_Attribute_01.bin", - "byteLength": 4568 + "byteLength": 2608 } ], "bufferViews": [ @@ -94,18 +70,6 @@ { "buffer": 0, "byteOffset": 2032, - "byteLength": 1176, - "name": "Positions" - }, - { - "buffer": 0, - "byteOffset": 3208, - "byteLength": 784, - "name": "Texture Coords 0" - }, - { - "buffer": 0, - "byteOffset": 3992, "byteLength": 576, "name": "Indices" } @@ -166,10 +130,10 @@ "primitives": [ { "attributes": { - "POSITION": 3, - "TEXCOORD_0": 4 + "POSITION": 0, + "TEXCOORD_0": 1 }, - "indices": 5, + "indices": 3, "material": 1 } ] diff --git a/Output/Positive/Node_Attribute/Node_Attribute_02.bin b/Output/Positive/Node_Attribute/Node_Attribute_02.bin index a4d5decb..e764ea3a 100644 Binary files a/Output/Positive/Node_Attribute/Node_Attribute_02.bin and b/Output/Positive/Node_Attribute/Node_Attribute_02.bin differ diff --git a/Output/Positive/Node_Attribute/Node_Attribute_02.gltf b/Output/Positive/Node_Attribute/Node_Attribute_02.gltf index 8ace027c..32cd82a5 100644 --- a/Output/Positive/Node_Attribute/Node_Attribute_02.gltf +++ b/Output/Positive/Node_Attribute/Node_Attribute_02.gltf @@ -33,30 +33,6 @@ }, { "bufferView": 3, - "componentType": 5126, - "count": 98, - "type": "VEC3", - "max": [ - 7.5, - 7.5, - 7.5 - ], - "min": [ - -7.5, - -2.5, - -7.5 - ], - "name": "Positions Accessor" - }, - { - "bufferView": 4, - "componentType": 5126, - "count": 98, - "type": "VEC2", - "name": "UV Accessor 0" - }, - { - "bufferView": 5, "componentType": 5125, "count": 144, "type": "SCALAR", @@ -70,7 +46,7 @@ "buffers": [ { "uri": "Node_Attribute_02.bin", - "byteLength": 4568 + "byteLength": 2608 } ], "bufferViews": [ @@ -94,18 +70,6 @@ { "buffer": 0, "byteOffset": 2032, - "byteLength": 1176, - "name": "Positions" - }, - { - "buffer": 0, - "byteOffset": 3208, - "byteLength": 784, - "name": "Texture Coords 0" - }, - { - "buffer": 0, - "byteOffset": 3992, "byteLength": 576, "name": "Indices" } @@ -166,10 +130,10 @@ "primitives": [ { "attributes": { - "POSITION": 3, - "TEXCOORD_0": 4 + "POSITION": 0, + "TEXCOORD_0": 1 }, - "indices": 5, + "indices": 3, "material": 1 } ] diff --git a/Output/Positive/Node_Attribute/Node_Attribute_03.bin b/Output/Positive/Node_Attribute/Node_Attribute_03.bin index a4d5decb..e764ea3a 100644 Binary files a/Output/Positive/Node_Attribute/Node_Attribute_03.bin and b/Output/Positive/Node_Attribute/Node_Attribute_03.bin differ diff --git a/Output/Positive/Node_Attribute/Node_Attribute_03.gltf b/Output/Positive/Node_Attribute/Node_Attribute_03.gltf index 095c01c4..4bd2d80a 100644 --- a/Output/Positive/Node_Attribute/Node_Attribute_03.gltf +++ b/Output/Positive/Node_Attribute/Node_Attribute_03.gltf @@ -33,30 +33,6 @@ }, { "bufferView": 3, - "componentType": 5126, - "count": 98, - "type": "VEC3", - "max": [ - 7.5, - 7.5, - 7.5 - ], - "min": [ - -7.5, - -2.5, - -7.5 - ], - "name": "Positions Accessor" - }, - { - "bufferView": 4, - "componentType": 5126, - "count": 98, - "type": "VEC2", - "name": "UV Accessor 0" - }, - { - "bufferView": 5, "componentType": 5125, "count": 144, "type": "SCALAR", @@ -70,7 +46,7 @@ "buffers": [ { "uri": "Node_Attribute_03.bin", - "byteLength": 4568 + "byteLength": 2608 } ], "bufferViews": [ @@ -94,18 +70,6 @@ { "buffer": 0, "byteOffset": 2032, - "byteLength": 1176, - "name": "Positions" - }, - { - "buffer": 0, - "byteOffset": 3208, - "byteLength": 784, - "name": "Texture Coords 0" - }, - { - "buffer": 0, - "byteOffset": 3992, "byteLength": 576, "name": "Indices" } @@ -166,10 +130,10 @@ "primitives": [ { "attributes": { - "POSITION": 3, - "TEXCOORD_0": 4 + "POSITION": 0, + "TEXCOORD_0": 1 }, - "indices": 5, + "indices": 3, "material": 1 } ] diff --git a/Output/Positive/Node_Attribute/Node_Attribute_04.bin b/Output/Positive/Node_Attribute/Node_Attribute_04.bin index a4d5decb..e764ea3a 100644 Binary files a/Output/Positive/Node_Attribute/Node_Attribute_04.bin and b/Output/Positive/Node_Attribute/Node_Attribute_04.bin differ diff --git a/Output/Positive/Node_Attribute/Node_Attribute_04.gltf b/Output/Positive/Node_Attribute/Node_Attribute_04.gltf index 1436f247..d1ba91cf 100644 --- a/Output/Positive/Node_Attribute/Node_Attribute_04.gltf +++ b/Output/Positive/Node_Attribute/Node_Attribute_04.gltf @@ -33,30 +33,6 @@ }, { "bufferView": 3, - "componentType": 5126, - "count": 98, - "type": "VEC3", - "max": [ - 7.5, - 7.5, - 7.5 - ], - "min": [ - -7.5, - -2.5, - -7.5 - ], - "name": "Positions Accessor" - }, - { - "bufferView": 4, - "componentType": 5126, - "count": 98, - "type": "VEC2", - "name": "UV Accessor 0" - }, - { - "bufferView": 5, "componentType": 5125, "count": 144, "type": "SCALAR", @@ -70,7 +46,7 @@ "buffers": [ { "uri": "Node_Attribute_04.bin", - "byteLength": 4568 + "byteLength": 2608 } ], "bufferViews": [ @@ -94,18 +70,6 @@ { "buffer": 0, "byteOffset": 2032, - "byteLength": 1176, - "name": "Positions" - }, - { - "buffer": 0, - "byteOffset": 3208, - "byteLength": 784, - "name": "Texture Coords 0" - }, - { - "buffer": 0, - "byteOffset": 3992, "byteLength": 576, "name": "Indices" } @@ -166,10 +130,10 @@ "primitives": [ { "attributes": { - "POSITION": 3, - "TEXCOORD_0": 4 + "POSITION": 0, + "TEXCOORD_0": 1 }, - "indices": 5, + "indices": 3, "material": 1 } ] diff --git a/Output/Positive/Node_Attribute/Node_Attribute_05.bin b/Output/Positive/Node_Attribute/Node_Attribute_05.bin index a4d5decb..e764ea3a 100644 Binary files a/Output/Positive/Node_Attribute/Node_Attribute_05.bin and b/Output/Positive/Node_Attribute/Node_Attribute_05.bin differ diff --git a/Output/Positive/Node_Attribute/Node_Attribute_05.gltf b/Output/Positive/Node_Attribute/Node_Attribute_05.gltf index 63983773..d19bf235 100644 --- a/Output/Positive/Node_Attribute/Node_Attribute_05.gltf +++ b/Output/Positive/Node_Attribute/Node_Attribute_05.gltf @@ -33,30 +33,6 @@ }, { "bufferView": 3, - "componentType": 5126, - "count": 98, - "type": "VEC3", - "max": [ - 7.5, - 7.5, - 7.5 - ], - "min": [ - -7.5, - -2.5, - -7.5 - ], - "name": "Positions Accessor" - }, - { - "bufferView": 4, - "componentType": 5126, - "count": 98, - "type": "VEC2", - "name": "UV Accessor 0" - }, - { - "bufferView": 5, "componentType": 5125, "count": 144, "type": "SCALAR", @@ -70,7 +46,7 @@ "buffers": [ { "uri": "Node_Attribute_05.bin", - "byteLength": 4568 + "byteLength": 2608 } ], "bufferViews": [ @@ -94,18 +70,6 @@ { "buffer": 0, "byteOffset": 2032, - "byteLength": 1176, - "name": "Positions" - }, - { - "buffer": 0, - "byteOffset": 3208, - "byteLength": 784, - "name": "Texture Coords 0" - }, - { - "buffer": 0, - "byteOffset": 3992, "byteLength": 576, "name": "Indices" } @@ -166,10 +130,10 @@ "primitives": [ { "attributes": { - "POSITION": 3, - "TEXCOORD_0": 4 + "POSITION": 0, + "TEXCOORD_0": 1 }, - "indices": 5, + "indices": 3, "material": 1 } ] diff --git a/Output/Positive/Node_Attribute/Node_Attribute_06.bin b/Output/Positive/Node_Attribute/Node_Attribute_06.bin index a4d5decb..e764ea3a 100644 Binary files a/Output/Positive/Node_Attribute/Node_Attribute_06.bin and b/Output/Positive/Node_Attribute/Node_Attribute_06.bin differ diff --git a/Output/Positive/Node_Attribute/Node_Attribute_06.gltf b/Output/Positive/Node_Attribute/Node_Attribute_06.gltf index ef7f3f89..3c7191f5 100644 --- a/Output/Positive/Node_Attribute/Node_Attribute_06.gltf +++ b/Output/Positive/Node_Attribute/Node_Attribute_06.gltf @@ -33,30 +33,6 @@ }, { "bufferView": 3, - "componentType": 5126, - "count": 98, - "type": "VEC3", - "max": [ - 7.5, - 7.5, - 7.5 - ], - "min": [ - -7.5, - -2.5, - -7.5 - ], - "name": "Positions Accessor" - }, - { - "bufferView": 4, - "componentType": 5126, - "count": 98, - "type": "VEC2", - "name": "UV Accessor 0" - }, - { - "bufferView": 5, "componentType": 5125, "count": 144, "type": "SCALAR", @@ -70,7 +46,7 @@ "buffers": [ { "uri": "Node_Attribute_06.bin", - "byteLength": 4568 + "byteLength": 2608 } ], "bufferViews": [ @@ -94,18 +70,6 @@ { "buffer": 0, "byteOffset": 2032, - "byteLength": 1176, - "name": "Positions" - }, - { - "buffer": 0, - "byteOffset": 3208, - "byteLength": 784, - "name": "Texture Coords 0" - }, - { - "buffer": 0, - "byteOffset": 3992, "byteLength": 576, "name": "Indices" } @@ -166,10 +130,10 @@ "primitives": [ { "attributes": { - "POSITION": 3, - "TEXCOORD_0": 4 + "POSITION": 0, + "TEXCOORD_0": 1 }, - "indices": 5, + "indices": 3, "material": 1 } ] diff --git a/Output/Positive/Node_Attribute/Node_Attribute_07.bin b/Output/Positive/Node_Attribute/Node_Attribute_07.bin index a4d5decb..e764ea3a 100644 Binary files a/Output/Positive/Node_Attribute/Node_Attribute_07.bin and b/Output/Positive/Node_Attribute/Node_Attribute_07.bin differ diff --git a/Output/Positive/Node_Attribute/Node_Attribute_07.gltf b/Output/Positive/Node_Attribute/Node_Attribute_07.gltf index e70ef781..58f1060c 100644 --- a/Output/Positive/Node_Attribute/Node_Attribute_07.gltf +++ b/Output/Positive/Node_Attribute/Node_Attribute_07.gltf @@ -33,30 +33,6 @@ }, { "bufferView": 3, - "componentType": 5126, - "count": 98, - "type": "VEC3", - "max": [ - 7.5, - 7.5, - 7.5 - ], - "min": [ - -7.5, - -2.5, - -7.5 - ], - "name": "Positions Accessor" - }, - { - "bufferView": 4, - "componentType": 5126, - "count": 98, - "type": "VEC2", - "name": "UV Accessor 0" - }, - { - "bufferView": 5, "componentType": 5125, "count": 144, "type": "SCALAR", @@ -70,7 +46,7 @@ "buffers": [ { "uri": "Node_Attribute_07.bin", - "byteLength": 4568 + "byteLength": 2608 } ], "bufferViews": [ @@ -94,18 +70,6 @@ { "buffer": 0, "byteOffset": 2032, - "byteLength": 1176, - "name": "Positions" - }, - { - "buffer": 0, - "byteOffset": 3208, - "byteLength": 784, - "name": "Texture Coords 0" - }, - { - "buffer": 0, - "byteOffset": 3992, "byteLength": 576, "name": "Indices" } @@ -166,10 +130,10 @@ "primitives": [ { "attributes": { - "POSITION": 3, - "TEXCOORD_0": 4 + "POSITION": 0, + "TEXCOORD_0": 1 }, - "indices": 5, + "indices": 3, "material": 1 } ] diff --git a/Output/Positive/Node_Attribute/Node_Attribute_08.bin b/Output/Positive/Node_Attribute/Node_Attribute_08.bin index a4d5decb..e764ea3a 100644 Binary files a/Output/Positive/Node_Attribute/Node_Attribute_08.bin and b/Output/Positive/Node_Attribute/Node_Attribute_08.bin differ diff --git a/Output/Positive/Node_Attribute/Node_Attribute_08.gltf b/Output/Positive/Node_Attribute/Node_Attribute_08.gltf index d199fafe..d5091251 100644 --- a/Output/Positive/Node_Attribute/Node_Attribute_08.gltf +++ b/Output/Positive/Node_Attribute/Node_Attribute_08.gltf @@ -33,30 +33,6 @@ }, { "bufferView": 3, - "componentType": 5126, - "count": 98, - "type": "VEC3", - "max": [ - 7.5, - 7.5, - 7.5 - ], - "min": [ - -7.5, - -2.5, - -7.5 - ], - "name": "Positions Accessor" - }, - { - "bufferView": 4, - "componentType": 5126, - "count": 98, - "type": "VEC2", - "name": "UV Accessor 0" - }, - { - "bufferView": 5, "componentType": 5125, "count": 144, "type": "SCALAR", @@ -70,7 +46,7 @@ "buffers": [ { "uri": "Node_Attribute_08.bin", - "byteLength": 4568 + "byteLength": 2608 } ], "bufferViews": [ @@ -94,18 +70,6 @@ { "buffer": 0, "byteOffset": 2032, - "byteLength": 1176, - "name": "Positions" - }, - { - "buffer": 0, - "byteOffset": 3208, - "byteLength": 784, - "name": "Texture Coords 0" - }, - { - "buffer": 0, - "byteOffset": 3992, "byteLength": 576, "name": "Indices" } @@ -166,10 +130,10 @@ "primitives": [ { "attributes": { - "POSITION": 3, - "TEXCOORD_0": 4 + "POSITION": 0, + "TEXCOORD_0": 1 }, - "indices": 5, + "indices": 3, "material": 1 } ] diff --git a/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_00.json b/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_00.json index b2d29778..6c52fedc 100644 --- a/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_00.json +++ b/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_00.json @@ -19,7 +19,7 @@ "mimeType": "application/gltf-buffer", "storage": "external", "uri": "Node_Attribute_00.bin", - "byteLength": 4568 + "byteLength": 2608 }, { "pointer": "/images/0", diff --git a/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_01.json b/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_01.json index 7fd619c6..27b982f0 100644 --- a/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_01.json +++ b/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_01.json @@ -19,7 +19,7 @@ "mimeType": "application/gltf-buffer", "storage": "external", "uri": "Node_Attribute_01.bin", - "byteLength": 4568 + "byteLength": 2608 }, { "pointer": "/images/0", diff --git a/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_02.json b/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_02.json index 2ec9a53e..10b6707e 100644 --- a/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_02.json +++ b/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_02.json @@ -19,7 +19,7 @@ "mimeType": "application/gltf-buffer", "storage": "external", "uri": "Node_Attribute_02.bin", - "byteLength": 4568 + "byteLength": 2608 }, { "pointer": "/images/0", diff --git a/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_03.json b/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_03.json index 1569d2ad..80e74baf 100644 --- a/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_03.json +++ b/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_03.json @@ -19,7 +19,7 @@ "mimeType": "application/gltf-buffer", "storage": "external", "uri": "Node_Attribute_03.bin", - "byteLength": 4568 + "byteLength": 2608 }, { "pointer": "/images/0", diff --git a/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_04.json b/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_04.json index 894e3b9e..12ea5508 100644 --- a/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_04.json +++ b/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_04.json @@ -19,7 +19,7 @@ "mimeType": "application/gltf-buffer", "storage": "external", "uri": "Node_Attribute_04.bin", - "byteLength": 4568 + "byteLength": 2608 }, { "pointer": "/images/0", diff --git a/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_05.json b/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_05.json index be25d581..2f98670e 100644 --- a/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_05.json +++ b/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_05.json @@ -19,7 +19,7 @@ "mimeType": "application/gltf-buffer", "storage": "external", "uri": "Node_Attribute_05.bin", - "byteLength": 4568 + "byteLength": 2608 }, { "pointer": "/images/0", diff --git a/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_06.json b/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_06.json index b7248155..a7d578c8 100644 --- a/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_06.json +++ b/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_06.json @@ -19,7 +19,7 @@ "mimeType": "application/gltf-buffer", "storage": "external", "uri": "Node_Attribute_06.bin", - "byteLength": 4568 + "byteLength": 2608 }, { "pointer": "/images/0", diff --git a/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_07.json b/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_07.json index 46ac639d..28106718 100644 --- a/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_07.json +++ b/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_07.json @@ -19,7 +19,7 @@ "mimeType": "application/gltf-buffer", "storage": "external", "uri": "Node_Attribute_07.bin", - "byteLength": 4568 + "byteLength": 2608 }, { "pointer": "/images/0", diff --git a/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_08.json b/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_08.json index e333c663..7520486e 100644 --- a/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_08.json +++ b/Output/Positive/Node_Attribute/ValidatorResults/Node_Attribute_08.json @@ -19,7 +19,7 @@ "mimeType": "application/gltf-buffer", "storage": "external", "uri": "Node_Attribute_08.bin", - "byteLength": 4568 + "byteLength": 2608 }, { "pointer": "/images/0", diff --git a/Output/Positive/Node_NegativeScale/Node_NegativeScale_00.bin b/Output/Positive/Node_NegativeScale/Node_NegativeScale_00.bin index a4d5decb..e764ea3a 100644 Binary files a/Output/Positive/Node_NegativeScale/Node_NegativeScale_00.bin and b/Output/Positive/Node_NegativeScale/Node_NegativeScale_00.bin differ diff --git a/Output/Positive/Node_NegativeScale/Node_NegativeScale_00.gltf b/Output/Positive/Node_NegativeScale/Node_NegativeScale_00.gltf index 1a252aef..ba607241 100644 --- a/Output/Positive/Node_NegativeScale/Node_NegativeScale_00.gltf +++ b/Output/Positive/Node_NegativeScale/Node_NegativeScale_00.gltf @@ -33,30 +33,6 @@ }, { "bufferView": 3, - "componentType": 5126, - "count": 98, - "type": "VEC3", - "max": [ - 7.5, - 7.5, - 7.5 - ], - "min": [ - -7.5, - -2.5, - -7.5 - ], - "name": "Positions Accessor" - }, - { - "bufferView": 4, - "componentType": 5126, - "count": 98, - "type": "VEC2", - "name": "UV Accessor 0" - }, - { - "bufferView": 5, "componentType": 5125, "count": 144, "type": "SCALAR", @@ -70,7 +46,7 @@ "buffers": [ { "uri": "Node_NegativeScale_00.bin", - "byteLength": 4568 + "byteLength": 2608 } ], "bufferViews": [ @@ -94,18 +70,6 @@ { "buffer": 0, "byteOffset": 2032, - "byteLength": 1176, - "name": "Positions" - }, - { - "buffer": 0, - "byteOffset": 3208, - "byteLength": 784, - "name": "Texture Coords 0" - }, - { - "buffer": 0, - "byteOffset": 3992, "byteLength": 576, "name": "Indices" } @@ -166,10 +130,10 @@ "primitives": [ { "attributes": { - "POSITION": 3, - "TEXCOORD_0": 4 + "POSITION": 0, + "TEXCOORD_0": 1 }, - "indices": 5, + "indices": 3, "material": 1 } ] diff --git a/Output/Positive/Node_NegativeScale/Node_NegativeScale_01.bin b/Output/Positive/Node_NegativeScale/Node_NegativeScale_01.bin index a4d5decb..e764ea3a 100644 Binary files a/Output/Positive/Node_NegativeScale/Node_NegativeScale_01.bin and b/Output/Positive/Node_NegativeScale/Node_NegativeScale_01.bin differ diff --git a/Output/Positive/Node_NegativeScale/Node_NegativeScale_01.gltf b/Output/Positive/Node_NegativeScale/Node_NegativeScale_01.gltf index 9ceb4001..031774dd 100644 --- a/Output/Positive/Node_NegativeScale/Node_NegativeScale_01.gltf +++ b/Output/Positive/Node_NegativeScale/Node_NegativeScale_01.gltf @@ -33,30 +33,6 @@ }, { "bufferView": 3, - "componentType": 5126, - "count": 98, - "type": "VEC3", - "max": [ - 7.5, - 7.5, - 7.5 - ], - "min": [ - -7.5, - -2.5, - -7.5 - ], - "name": "Positions Accessor" - }, - { - "bufferView": 4, - "componentType": 5126, - "count": 98, - "type": "VEC2", - "name": "UV Accessor 0" - }, - { - "bufferView": 5, "componentType": 5125, "count": 144, "type": "SCALAR", @@ -70,7 +46,7 @@ "buffers": [ { "uri": "Node_NegativeScale_01.bin", - "byteLength": 4568 + "byteLength": 2608 } ], "bufferViews": [ @@ -94,18 +70,6 @@ { "buffer": 0, "byteOffset": 2032, - "byteLength": 1176, - "name": "Positions" - }, - { - "buffer": 0, - "byteOffset": 3208, - "byteLength": 784, - "name": "Texture Coords 0" - }, - { - "buffer": 0, - "byteOffset": 3992, "byteLength": 576, "name": "Indices" } @@ -166,10 +130,10 @@ "primitives": [ { "attributes": { - "POSITION": 3, - "TEXCOORD_0": 4 + "POSITION": 0, + "TEXCOORD_0": 1 }, - "indices": 5, + "indices": 3, "material": 1 } ] diff --git a/Output/Positive/Node_NegativeScale/Node_NegativeScale_02.bin b/Output/Positive/Node_NegativeScale/Node_NegativeScale_02.bin index a4d5decb..e764ea3a 100644 Binary files a/Output/Positive/Node_NegativeScale/Node_NegativeScale_02.bin and b/Output/Positive/Node_NegativeScale/Node_NegativeScale_02.bin differ diff --git a/Output/Positive/Node_NegativeScale/Node_NegativeScale_02.gltf b/Output/Positive/Node_NegativeScale/Node_NegativeScale_02.gltf index dcc80543..09c8edec 100644 --- a/Output/Positive/Node_NegativeScale/Node_NegativeScale_02.gltf +++ b/Output/Positive/Node_NegativeScale/Node_NegativeScale_02.gltf @@ -33,30 +33,6 @@ }, { "bufferView": 3, - "componentType": 5126, - "count": 98, - "type": "VEC3", - "max": [ - 7.5, - 7.5, - 7.5 - ], - "min": [ - -7.5, - -2.5, - -7.5 - ], - "name": "Positions Accessor" - }, - { - "bufferView": 4, - "componentType": 5126, - "count": 98, - "type": "VEC2", - "name": "UV Accessor 0" - }, - { - "bufferView": 5, "componentType": 5125, "count": 144, "type": "SCALAR", @@ -70,7 +46,7 @@ "buffers": [ { "uri": "Node_NegativeScale_02.bin", - "byteLength": 4568 + "byteLength": 2608 } ], "bufferViews": [ @@ -94,18 +70,6 @@ { "buffer": 0, "byteOffset": 2032, - "byteLength": 1176, - "name": "Positions" - }, - { - "buffer": 0, - "byteOffset": 3208, - "byteLength": 784, - "name": "Texture Coords 0" - }, - { - "buffer": 0, - "byteOffset": 3992, "byteLength": 576, "name": "Indices" } @@ -166,10 +130,10 @@ "primitives": [ { "attributes": { - "POSITION": 3, - "TEXCOORD_0": 4 + "POSITION": 0, + "TEXCOORD_0": 1 }, - "indices": 5, + "indices": 3, "material": 1 } ] diff --git a/Output/Positive/Node_NegativeScale/Node_NegativeScale_03.bin b/Output/Positive/Node_NegativeScale/Node_NegativeScale_03.bin index a4d5decb..e764ea3a 100644 Binary files a/Output/Positive/Node_NegativeScale/Node_NegativeScale_03.bin and b/Output/Positive/Node_NegativeScale/Node_NegativeScale_03.bin differ diff --git a/Output/Positive/Node_NegativeScale/Node_NegativeScale_03.gltf b/Output/Positive/Node_NegativeScale/Node_NegativeScale_03.gltf index c6a2dfd1..b91c4892 100644 --- a/Output/Positive/Node_NegativeScale/Node_NegativeScale_03.gltf +++ b/Output/Positive/Node_NegativeScale/Node_NegativeScale_03.gltf @@ -33,30 +33,6 @@ }, { "bufferView": 3, - "componentType": 5126, - "count": 98, - "type": "VEC3", - "max": [ - 7.5, - 7.5, - 7.5 - ], - "min": [ - -7.5, - -2.5, - -7.5 - ], - "name": "Positions Accessor" - }, - { - "bufferView": 4, - "componentType": 5126, - "count": 98, - "type": "VEC2", - "name": "UV Accessor 0" - }, - { - "bufferView": 5, "componentType": 5125, "count": 144, "type": "SCALAR", @@ -70,7 +46,7 @@ "buffers": [ { "uri": "Node_NegativeScale_03.bin", - "byteLength": 4568 + "byteLength": 2608 } ], "bufferViews": [ @@ -94,18 +70,6 @@ { "buffer": 0, "byteOffset": 2032, - "byteLength": 1176, - "name": "Positions" - }, - { - "buffer": 0, - "byteOffset": 3208, - "byteLength": 784, - "name": "Texture Coords 0" - }, - { - "buffer": 0, - "byteOffset": 3992, "byteLength": 576, "name": "Indices" } @@ -166,10 +130,10 @@ "primitives": [ { "attributes": { - "POSITION": 3, - "TEXCOORD_0": 4 + "POSITION": 0, + "TEXCOORD_0": 1 }, - "indices": 5, + "indices": 3, "material": 1 } ] diff --git a/Output/Positive/Node_NegativeScale/Node_NegativeScale_04.bin b/Output/Positive/Node_NegativeScale/Node_NegativeScale_04.bin index a4d5decb..e764ea3a 100644 Binary files a/Output/Positive/Node_NegativeScale/Node_NegativeScale_04.bin and b/Output/Positive/Node_NegativeScale/Node_NegativeScale_04.bin differ diff --git a/Output/Positive/Node_NegativeScale/Node_NegativeScale_04.gltf b/Output/Positive/Node_NegativeScale/Node_NegativeScale_04.gltf index 024089fe..5cbe8459 100644 --- a/Output/Positive/Node_NegativeScale/Node_NegativeScale_04.gltf +++ b/Output/Positive/Node_NegativeScale/Node_NegativeScale_04.gltf @@ -33,30 +33,6 @@ }, { "bufferView": 3, - "componentType": 5126, - "count": 98, - "type": "VEC3", - "max": [ - 7.5, - 7.5, - 7.5 - ], - "min": [ - -7.5, - -2.5, - -7.5 - ], - "name": "Positions Accessor" - }, - { - "bufferView": 4, - "componentType": 5126, - "count": 98, - "type": "VEC2", - "name": "UV Accessor 0" - }, - { - "bufferView": 5, "componentType": 5125, "count": 144, "type": "SCALAR", @@ -70,7 +46,7 @@ "buffers": [ { "uri": "Node_NegativeScale_04.bin", - "byteLength": 4568 + "byteLength": 2608 } ], "bufferViews": [ @@ -94,18 +70,6 @@ { "buffer": 0, "byteOffset": 2032, - "byteLength": 1176, - "name": "Positions" - }, - { - "buffer": 0, - "byteOffset": 3208, - "byteLength": 784, - "name": "Texture Coords 0" - }, - { - "buffer": 0, - "byteOffset": 3992, "byteLength": 576, "name": "Indices" } @@ -166,10 +130,10 @@ "primitives": [ { "attributes": { - "POSITION": 3, - "TEXCOORD_0": 4 + "POSITION": 0, + "TEXCOORD_0": 1 }, - "indices": 5, + "indices": 3, "material": 1 } ] diff --git a/Output/Positive/Node_NegativeScale/Node_NegativeScale_05.bin b/Output/Positive/Node_NegativeScale/Node_NegativeScale_05.bin index a4d5decb..e764ea3a 100644 Binary files a/Output/Positive/Node_NegativeScale/Node_NegativeScale_05.bin and b/Output/Positive/Node_NegativeScale/Node_NegativeScale_05.bin differ diff --git a/Output/Positive/Node_NegativeScale/Node_NegativeScale_05.gltf b/Output/Positive/Node_NegativeScale/Node_NegativeScale_05.gltf index 905e42bc..f6f8053d 100644 --- a/Output/Positive/Node_NegativeScale/Node_NegativeScale_05.gltf +++ b/Output/Positive/Node_NegativeScale/Node_NegativeScale_05.gltf @@ -33,30 +33,6 @@ }, { "bufferView": 3, - "componentType": 5126, - "count": 98, - "type": "VEC3", - "max": [ - 7.5, - 7.5, - 7.5 - ], - "min": [ - -7.5, - -2.5, - -7.5 - ], - "name": "Positions Accessor" - }, - { - "bufferView": 4, - "componentType": 5126, - "count": 98, - "type": "VEC2", - "name": "UV Accessor 0" - }, - { - "bufferView": 5, "componentType": 5125, "count": 144, "type": "SCALAR", @@ -70,7 +46,7 @@ "buffers": [ { "uri": "Node_NegativeScale_05.bin", - "byteLength": 4568 + "byteLength": 2608 } ], "bufferViews": [ @@ -94,18 +70,6 @@ { "buffer": 0, "byteOffset": 2032, - "byteLength": 1176, - "name": "Positions" - }, - { - "buffer": 0, - "byteOffset": 3208, - "byteLength": 784, - "name": "Texture Coords 0" - }, - { - "buffer": 0, - "byteOffset": 3992, "byteLength": 576, "name": "Indices" } @@ -166,10 +130,10 @@ "primitives": [ { "attributes": { - "POSITION": 3, - "TEXCOORD_0": 4 + "POSITION": 0, + "TEXCOORD_0": 1 }, - "indices": 5, + "indices": 3, "material": 1 } ] diff --git a/Output/Positive/Node_NegativeScale/Node_NegativeScale_06.bin b/Output/Positive/Node_NegativeScale/Node_NegativeScale_06.bin index a4d5decb..e764ea3a 100644 Binary files a/Output/Positive/Node_NegativeScale/Node_NegativeScale_06.bin and b/Output/Positive/Node_NegativeScale/Node_NegativeScale_06.bin differ diff --git a/Output/Positive/Node_NegativeScale/Node_NegativeScale_06.gltf b/Output/Positive/Node_NegativeScale/Node_NegativeScale_06.gltf index 73045770..745874ed 100644 --- a/Output/Positive/Node_NegativeScale/Node_NegativeScale_06.gltf +++ b/Output/Positive/Node_NegativeScale/Node_NegativeScale_06.gltf @@ -33,30 +33,6 @@ }, { "bufferView": 3, - "componentType": 5126, - "count": 98, - "type": "VEC3", - "max": [ - 7.5, - 7.5, - 7.5 - ], - "min": [ - -7.5, - -2.5, - -7.5 - ], - "name": "Positions Accessor" - }, - { - "bufferView": 4, - "componentType": 5126, - "count": 98, - "type": "VEC2", - "name": "UV Accessor 0" - }, - { - "bufferView": 5, "componentType": 5125, "count": 144, "type": "SCALAR", @@ -70,7 +46,7 @@ "buffers": [ { "uri": "Node_NegativeScale_06.bin", - "byteLength": 4568 + "byteLength": 2608 } ], "bufferViews": [ @@ -94,18 +70,6 @@ { "buffer": 0, "byteOffset": 2032, - "byteLength": 1176, - "name": "Positions" - }, - { - "buffer": 0, - "byteOffset": 3208, - "byteLength": 784, - "name": "Texture Coords 0" - }, - { - "buffer": 0, - "byteOffset": 3992, "byteLength": 576, "name": "Indices" } @@ -166,10 +130,10 @@ "primitives": [ { "attributes": { - "POSITION": 3, - "TEXCOORD_0": 4 + "POSITION": 0, + "TEXCOORD_0": 1 }, - "indices": 5, + "indices": 3, "material": 1 } ] diff --git a/Output/Positive/Node_NegativeScale/Node_NegativeScale_07.bin b/Output/Positive/Node_NegativeScale/Node_NegativeScale_07.bin index 12c87c62..ed8113bb 100644 Binary files a/Output/Positive/Node_NegativeScale/Node_NegativeScale_07.bin and b/Output/Positive/Node_NegativeScale/Node_NegativeScale_07.bin differ diff --git a/Output/Positive/Node_NegativeScale/Node_NegativeScale_07.gltf b/Output/Positive/Node_NegativeScale/Node_NegativeScale_07.gltf index ed0339bc..bf72361a 100644 --- a/Output/Positive/Node_NegativeScale/Node_NegativeScale_07.gltf +++ b/Output/Positive/Node_NegativeScale/Node_NegativeScale_07.gltf @@ -40,37 +40,6 @@ }, { "bufferView": 4, - "componentType": 5126, - "count": 98, - "type": "VEC3", - "max": [ - 7.5, - 7.5, - 7.5 - ], - "min": [ - -7.5, - -2.5, - -7.5 - ], - "name": "Positions Accessor" - }, - { - "bufferView": 5, - "componentType": 5126, - "count": 98, - "type": "VEC3", - "name": "Normals Accessor" - }, - { - "bufferView": 6, - "componentType": 5126, - "count": 98, - "type": "VEC2", - "name": "UV Accessor 0" - }, - { - "bufferView": 7, "componentType": 5125, "count": 144, "type": "SCALAR", @@ -84,7 +53,7 @@ "buffers": [ { "uri": "Node_NegativeScale_07.bin", - "byteLength": 6920 + "byteLength": 3784 } ], "bufferViews": [ @@ -114,24 +83,6 @@ { "buffer": 0, "byteOffset": 3208, - "byteLength": 1176, - "name": "Positions" - }, - { - "buffer": 0, - "byteOffset": 4384, - "byteLength": 1176, - "name": "Normals" - }, - { - "buffer": 0, - "byteOffset": 5560, - "byteLength": 784, - "name": "Texture Coords 0" - }, - { - "buffer": 0, - "byteOffset": 6344, "byteLength": 576, "name": "Indices" } @@ -193,11 +144,11 @@ "primitives": [ { "attributes": { - "POSITION": 4, - "NORMAL": 5, - "TEXCOORD_0": 6 + "POSITION": 0, + "NORMAL": 1, + "TEXCOORD_0": 2 }, - "indices": 7, + "indices": 4, "material": 1 } ] diff --git a/Output/Positive/Node_NegativeScale/Node_NegativeScale_08.bin b/Output/Positive/Node_NegativeScale/Node_NegativeScale_08.bin index 12c87c62..ed8113bb 100644 Binary files a/Output/Positive/Node_NegativeScale/Node_NegativeScale_08.bin and b/Output/Positive/Node_NegativeScale/Node_NegativeScale_08.bin differ diff --git a/Output/Positive/Node_NegativeScale/Node_NegativeScale_08.gltf b/Output/Positive/Node_NegativeScale/Node_NegativeScale_08.gltf index 9dd72101..79bdc9dd 100644 --- a/Output/Positive/Node_NegativeScale/Node_NegativeScale_08.gltf +++ b/Output/Positive/Node_NegativeScale/Node_NegativeScale_08.gltf @@ -40,37 +40,6 @@ }, { "bufferView": 4, - "componentType": 5126, - "count": 98, - "type": "VEC3", - "max": [ - 7.5, - 7.5, - 7.5 - ], - "min": [ - -7.5, - -2.5, - -7.5 - ], - "name": "Positions Accessor" - }, - { - "bufferView": 5, - "componentType": 5126, - "count": 98, - "type": "VEC3", - "name": "Normals Accessor" - }, - { - "bufferView": 6, - "componentType": 5126, - "count": 98, - "type": "VEC2", - "name": "UV Accessor 0" - }, - { - "bufferView": 7, "componentType": 5125, "count": 144, "type": "SCALAR", @@ -84,7 +53,7 @@ "buffers": [ { "uri": "Node_NegativeScale_08.bin", - "byteLength": 6920 + "byteLength": 3784 } ], "bufferViews": [ @@ -114,24 +83,6 @@ { "buffer": 0, "byteOffset": 3208, - "byteLength": 1176, - "name": "Positions" - }, - { - "buffer": 0, - "byteOffset": 4384, - "byteLength": 1176, - "name": "Normals" - }, - { - "buffer": 0, - "byteOffset": 5560, - "byteLength": 784, - "name": "Texture Coords 0" - }, - { - "buffer": 0, - "byteOffset": 6344, "byteLength": 576, "name": "Indices" } @@ -193,11 +144,11 @@ "primitives": [ { "attributes": { - "POSITION": 4, - "NORMAL": 5, - "TEXCOORD_0": 6 + "POSITION": 0, + "NORMAL": 1, + "TEXCOORD_0": 2 }, - "indices": 7, + "indices": 4, "material": 1 } ] diff --git a/Output/Positive/Node_NegativeScale/Node_NegativeScale_09.bin b/Output/Positive/Node_NegativeScale/Node_NegativeScale_09.bin index 12c87c62..ed8113bb 100644 Binary files a/Output/Positive/Node_NegativeScale/Node_NegativeScale_09.bin and b/Output/Positive/Node_NegativeScale/Node_NegativeScale_09.bin differ diff --git a/Output/Positive/Node_NegativeScale/Node_NegativeScale_09.gltf b/Output/Positive/Node_NegativeScale/Node_NegativeScale_09.gltf index 27b32f8e..7bf1895a 100644 --- a/Output/Positive/Node_NegativeScale/Node_NegativeScale_09.gltf +++ b/Output/Positive/Node_NegativeScale/Node_NegativeScale_09.gltf @@ -40,37 +40,6 @@ }, { "bufferView": 4, - "componentType": 5126, - "count": 98, - "type": "VEC3", - "max": [ - 7.5, - 7.5, - 7.5 - ], - "min": [ - -7.5, - -2.5, - -7.5 - ], - "name": "Positions Accessor" - }, - { - "bufferView": 5, - "componentType": 5126, - "count": 98, - "type": "VEC3", - "name": "Normals Accessor" - }, - { - "bufferView": 6, - "componentType": 5126, - "count": 98, - "type": "VEC2", - "name": "UV Accessor 0" - }, - { - "bufferView": 7, "componentType": 5125, "count": 144, "type": "SCALAR", @@ -84,7 +53,7 @@ "buffers": [ { "uri": "Node_NegativeScale_09.bin", - "byteLength": 6920 + "byteLength": 3784 } ], "bufferViews": [ @@ -114,24 +83,6 @@ { "buffer": 0, "byteOffset": 3208, - "byteLength": 1176, - "name": "Positions" - }, - { - "buffer": 0, - "byteOffset": 4384, - "byteLength": 1176, - "name": "Normals" - }, - { - "buffer": 0, - "byteOffset": 5560, - "byteLength": 784, - "name": "Texture Coords 0" - }, - { - "buffer": 0, - "byteOffset": 6344, "byteLength": 576, "name": "Indices" } @@ -193,11 +144,11 @@ "primitives": [ { "attributes": { - "POSITION": 4, - "NORMAL": 5, - "TEXCOORD_0": 6 + "POSITION": 0, + "NORMAL": 1, + "TEXCOORD_0": 2 }, - "indices": 7, + "indices": 4, "material": 1 } ] diff --git a/Output/Positive/Node_NegativeScale/Node_NegativeScale_10.bin b/Output/Positive/Node_NegativeScale/Node_NegativeScale_10.bin index f45e02e0..963436c9 100644 Binary files a/Output/Positive/Node_NegativeScale/Node_NegativeScale_10.bin and b/Output/Positive/Node_NegativeScale/Node_NegativeScale_10.bin differ diff --git a/Output/Positive/Node_NegativeScale/Node_NegativeScale_10.gltf b/Output/Positive/Node_NegativeScale/Node_NegativeScale_10.gltf index d227e7e7..ba68e9bf 100644 --- a/Output/Positive/Node_NegativeScale/Node_NegativeScale_10.gltf +++ b/Output/Positive/Node_NegativeScale/Node_NegativeScale_10.gltf @@ -47,44 +47,6 @@ }, { "bufferView": 5, - "componentType": 5126, - "count": 98, - "type": "VEC3", - "max": [ - 7.5, - 7.5, - 7.5 - ], - "min": [ - -7.5, - -2.5, - -7.5 - ], - "name": "Positions Accessor" - }, - { - "bufferView": 6, - "componentType": 5126, - "count": 98, - "type": "VEC3", - "name": "Normals Accessor" - }, - { - "bufferView": 7, - "componentType": 5126, - "count": 98, - "type": "VEC4", - "name": "Tangents Accessor" - }, - { - "bufferView": 8, - "componentType": 5126, - "count": 98, - "type": "VEC2", - "name": "UV Accessor 0" - }, - { - "bufferView": 9, "componentType": 5125, "count": 144, "type": "SCALAR", @@ -98,7 +60,7 @@ "buffers": [ { "uri": "Node_NegativeScale_10.bin", - "byteLength": 10056 + "byteLength": 5352 } ], "bufferViews": [ @@ -134,30 +96,6 @@ { "buffer": 0, "byteOffset": 4776, - "byteLength": 1176, - "name": "Positions" - }, - { - "buffer": 0, - "byteOffset": 5952, - "byteLength": 1176, - "name": "Normals" - }, - { - "buffer": 0, - "byteOffset": 7128, - "byteLength": 1568, - "name": "Tangents" - }, - { - "buffer": 0, - "byteOffset": 8696, - "byteLength": 784, - "name": "Texture Coords 0" - }, - { - "buffer": 0, - "byteOffset": 9480, "byteLength": 576, "name": "Indices" } @@ -220,12 +158,12 @@ "primitives": [ { "attributes": { - "POSITION": 5, - "NORMAL": 6, - "TANGENT": 7, - "TEXCOORD_0": 8 + "POSITION": 0, + "NORMAL": 1, + "TANGENT": 2, + "TEXCOORD_0": 3 }, - "indices": 9, + "indices": 5, "material": 1 } ] diff --git a/Output/Positive/Node_NegativeScale/Node_NegativeScale_11.bin b/Output/Positive/Node_NegativeScale/Node_NegativeScale_11.bin index f45e02e0..963436c9 100644 Binary files a/Output/Positive/Node_NegativeScale/Node_NegativeScale_11.bin and b/Output/Positive/Node_NegativeScale/Node_NegativeScale_11.bin differ diff --git a/Output/Positive/Node_NegativeScale/Node_NegativeScale_11.gltf b/Output/Positive/Node_NegativeScale/Node_NegativeScale_11.gltf index 5c90b80d..0ca5b6c7 100644 --- a/Output/Positive/Node_NegativeScale/Node_NegativeScale_11.gltf +++ b/Output/Positive/Node_NegativeScale/Node_NegativeScale_11.gltf @@ -47,44 +47,6 @@ }, { "bufferView": 5, - "componentType": 5126, - "count": 98, - "type": "VEC3", - "max": [ - 7.5, - 7.5, - 7.5 - ], - "min": [ - -7.5, - -2.5, - -7.5 - ], - "name": "Positions Accessor" - }, - { - "bufferView": 6, - "componentType": 5126, - "count": 98, - "type": "VEC3", - "name": "Normals Accessor" - }, - { - "bufferView": 7, - "componentType": 5126, - "count": 98, - "type": "VEC4", - "name": "Tangents Accessor" - }, - { - "bufferView": 8, - "componentType": 5126, - "count": 98, - "type": "VEC2", - "name": "UV Accessor 0" - }, - { - "bufferView": 9, "componentType": 5125, "count": 144, "type": "SCALAR", @@ -98,7 +60,7 @@ "buffers": [ { "uri": "Node_NegativeScale_11.bin", - "byteLength": 10056 + "byteLength": 5352 } ], "bufferViews": [ @@ -134,30 +96,6 @@ { "buffer": 0, "byteOffset": 4776, - "byteLength": 1176, - "name": "Positions" - }, - { - "buffer": 0, - "byteOffset": 5952, - "byteLength": 1176, - "name": "Normals" - }, - { - "buffer": 0, - "byteOffset": 7128, - "byteLength": 1568, - "name": "Tangents" - }, - { - "buffer": 0, - "byteOffset": 8696, - "byteLength": 784, - "name": "Texture Coords 0" - }, - { - "buffer": 0, - "byteOffset": 9480, "byteLength": 576, "name": "Indices" } @@ -220,12 +158,12 @@ "primitives": [ { "attributes": { - "POSITION": 5, - "NORMAL": 6, - "TANGENT": 7, - "TEXCOORD_0": 8 + "POSITION": 0, + "NORMAL": 1, + "TANGENT": 2, + "TEXCOORD_0": 3 }, - "indices": 9, + "indices": 5, "material": 1 } ] diff --git a/Output/Positive/Node_NegativeScale/Node_NegativeScale_12.bin b/Output/Positive/Node_NegativeScale/Node_NegativeScale_12.bin index f45e02e0..963436c9 100644 Binary files a/Output/Positive/Node_NegativeScale/Node_NegativeScale_12.bin and b/Output/Positive/Node_NegativeScale/Node_NegativeScale_12.bin differ diff --git a/Output/Positive/Node_NegativeScale/Node_NegativeScale_12.gltf b/Output/Positive/Node_NegativeScale/Node_NegativeScale_12.gltf index 1434875d..d3c829ec 100644 --- a/Output/Positive/Node_NegativeScale/Node_NegativeScale_12.gltf +++ b/Output/Positive/Node_NegativeScale/Node_NegativeScale_12.gltf @@ -47,44 +47,6 @@ }, { "bufferView": 5, - "componentType": 5126, - "count": 98, - "type": "VEC3", - "max": [ - 7.5, - 7.5, - 7.5 - ], - "min": [ - -7.5, - -2.5, - -7.5 - ], - "name": "Positions Accessor" - }, - { - "bufferView": 6, - "componentType": 5126, - "count": 98, - "type": "VEC3", - "name": "Normals Accessor" - }, - { - "bufferView": 7, - "componentType": 5126, - "count": 98, - "type": "VEC4", - "name": "Tangents Accessor" - }, - { - "bufferView": 8, - "componentType": 5126, - "count": 98, - "type": "VEC2", - "name": "UV Accessor 0" - }, - { - "bufferView": 9, "componentType": 5125, "count": 144, "type": "SCALAR", @@ -98,7 +60,7 @@ "buffers": [ { "uri": "Node_NegativeScale_12.bin", - "byteLength": 10056 + "byteLength": 5352 } ], "bufferViews": [ @@ -134,30 +96,6 @@ { "buffer": 0, "byteOffset": 4776, - "byteLength": 1176, - "name": "Positions" - }, - { - "buffer": 0, - "byteOffset": 5952, - "byteLength": 1176, - "name": "Normals" - }, - { - "buffer": 0, - "byteOffset": 7128, - "byteLength": 1568, - "name": "Tangents" - }, - { - "buffer": 0, - "byteOffset": 8696, - "byteLength": 784, - "name": "Texture Coords 0" - }, - { - "buffer": 0, - "byteOffset": 9480, "byteLength": 576, "name": "Indices" } @@ -220,12 +158,12 @@ "primitives": [ { "attributes": { - "POSITION": 5, - "NORMAL": 6, - "TANGENT": 7, - "TEXCOORD_0": 8 + "POSITION": 0, + "NORMAL": 1, + "TANGENT": 2, + "TEXCOORD_0": 3 }, - "indices": 9, + "indices": 5, "material": 1 } ] diff --git a/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_00.json b/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_00.json index 654f22da..c8741b43 100644 --- a/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_00.json +++ b/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_00.json @@ -19,7 +19,7 @@ "mimeType": "application/gltf-buffer", "storage": "external", "uri": "Node_NegativeScale_00.bin", - "byteLength": 4568 + "byteLength": 2608 }, { "pointer": "/images/0", diff --git a/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_01.json b/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_01.json index 02a75628..cf105110 100644 --- a/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_01.json +++ b/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_01.json @@ -19,7 +19,7 @@ "mimeType": "application/gltf-buffer", "storage": "external", "uri": "Node_NegativeScale_01.bin", - "byteLength": 4568 + "byteLength": 2608 }, { "pointer": "/images/0", diff --git a/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_02.json b/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_02.json index bdd190fd..e11b6d1c 100644 --- a/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_02.json +++ b/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_02.json @@ -19,7 +19,7 @@ "mimeType": "application/gltf-buffer", "storage": "external", "uri": "Node_NegativeScale_02.bin", - "byteLength": 4568 + "byteLength": 2608 }, { "pointer": "/images/0", diff --git a/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_03.json b/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_03.json index b1789580..aafd5b2e 100644 --- a/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_03.json +++ b/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_03.json @@ -19,7 +19,7 @@ "mimeType": "application/gltf-buffer", "storage": "external", "uri": "Node_NegativeScale_03.bin", - "byteLength": 4568 + "byteLength": 2608 }, { "pointer": "/images/0", diff --git a/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_04.json b/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_04.json index 89802473..626c0e3e 100644 --- a/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_04.json +++ b/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_04.json @@ -19,7 +19,7 @@ "mimeType": "application/gltf-buffer", "storage": "external", "uri": "Node_NegativeScale_04.bin", - "byteLength": 4568 + "byteLength": 2608 }, { "pointer": "/images/0", diff --git a/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_05.json b/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_05.json index db00ccc3..f32065ae 100644 --- a/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_05.json +++ b/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_05.json @@ -19,7 +19,7 @@ "mimeType": "application/gltf-buffer", "storage": "external", "uri": "Node_NegativeScale_05.bin", - "byteLength": 4568 + "byteLength": 2608 }, { "pointer": "/images/0", diff --git a/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_06.json b/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_06.json index 90071371..56a41fcf 100644 --- a/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_06.json +++ b/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_06.json @@ -19,7 +19,7 @@ "mimeType": "application/gltf-buffer", "storage": "external", "uri": "Node_NegativeScale_06.bin", - "byteLength": 4568 + "byteLength": 2608 }, { "pointer": "/images/0", diff --git a/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_07.json b/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_07.json index 159c4090..6c8db40e 100644 --- a/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_07.json +++ b/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_07.json @@ -19,7 +19,7 @@ "mimeType": "application/gltf-buffer", "storage": "external", "uri": "Node_NegativeScale_07.bin", - "byteLength": 6920 + "byteLength": 3784 }, { "pointer": "/images/0", diff --git a/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_08.json b/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_08.json index af7751c6..df8407df 100644 --- a/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_08.json +++ b/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_08.json @@ -19,7 +19,7 @@ "mimeType": "application/gltf-buffer", "storage": "external", "uri": "Node_NegativeScale_08.bin", - "byteLength": 6920 + "byteLength": 3784 }, { "pointer": "/images/0", diff --git a/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_09.json b/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_09.json index 26269463..01d98bc9 100644 --- a/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_09.json +++ b/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_09.json @@ -19,7 +19,7 @@ "mimeType": "application/gltf-buffer", "storage": "external", "uri": "Node_NegativeScale_09.bin", - "byteLength": 6920 + "byteLength": 3784 }, { "pointer": "/images/0", diff --git a/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_10.json b/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_10.json index f56965c8..2358952f 100644 --- a/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_10.json +++ b/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_10.json @@ -19,7 +19,7 @@ "mimeType": "application/gltf-buffer", "storage": "external", "uri": "Node_NegativeScale_10.bin", - "byteLength": 10056 + "byteLength": 5352 }, { "pointer": "/images/0", diff --git a/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_11.json b/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_11.json index 13088ed5..66636537 100644 --- a/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_11.json +++ b/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_11.json @@ -19,7 +19,7 @@ "mimeType": "application/gltf-buffer", "storage": "external", "uri": "Node_NegativeScale_11.bin", - "byteLength": 10056 + "byteLength": 5352 }, { "pointer": "/images/0", diff --git a/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_12.json b/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_12.json index ef27327b..069611d0 100644 --- a/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_12.json +++ b/Output/Positive/Node_NegativeScale/ValidatorResults/Node_NegativeScale_12.json @@ -19,7 +19,7 @@ "mimeType": "application/gltf-buffer", "storage": "external", "uri": "Node_NegativeScale_12.bin", - "byteLength": 10056 + "byteLength": 5352 }, { "pointer": "/images/0", diff --git a/Output/Positive/README.md b/Output/Positive/README.md index 0f90f7a0..30691b19 100644 --- a/Output/Positive/README.md +++ b/Output/Positive/README.md @@ -240,4 +240,20 @@ | :---: | :---: | :---: | :---: | :---: | :---: | | [00](Animation_SamplerType/ValidatorResults/Animation_SamplerType_00.json) | :white_check_mark: | 0 | 0 | 0 | 0 | | [01](Animation_SamplerType/ValidatorResults/Animation_SamplerType_01.json) | :x: | 3 | 0 | 0 | 0 | -| [02](Animation_SamplerType/ValidatorResults/Animation_SamplerType_02.json) | :white_check_mark: | 0 | 0 | 0 | 0 | \ No newline at end of file +| [02](Animation_SamplerType/ValidatorResults/Animation_SamplerType_02.json) | :white_check_mark: | 0 | 0 | 0 | 0 | +# Instancing +| Model | Status | Errors | Warnings | Infos | Hints | +| :---: | :---: | :---: | :---: | :---: | :---: | +| [00](Instancing/ValidatorResults/Instancing_00.json) | :white_check_mark: | 0 | 0 | 0 | 0 | +| [01](Instancing/ValidatorResults/Instancing_01.json) | :white_check_mark: | 0 | 0 | 0 | 0 | +| [02](Instancing/ValidatorResults/Instancing_02.json) | :white_check_mark: | 0 | 0 | 0 | 0 | +| [03](Instancing/ValidatorResults/Instancing_03.json) | :white_check_mark: | 0 | 0 | 0 | 0 | +| [04](Instancing/ValidatorResults/Instancing_04.json) | :white_check_mark: | 0 | 0 | 0 | 0 | +| [05](Instancing/ValidatorResults/Instancing_05.json) | :white_check_mark: | 0 | 0 | 0 | 0 | +| [06](Instancing/ValidatorResults/Instancing_06.json) | :white_check_mark: | 0 | 0 | 0 | 0 | +| [07](Instancing/ValidatorResults/Instancing_07.json) | :white_check_mark: | 0 | 0 | 0 | 0 | +| [08](Instancing/ValidatorResults/Instancing_08.json) | :white_check_mark: | 0 | 0 | 0 | 0 | +| [09](Instancing/ValidatorResults/Instancing_09.json) | :white_check_mark: | 0 | 0 | 0 | 0 | +| [10](Instancing/ValidatorResults/Instancing_10.json) | :white_check_mark: | 0 | 0 | 0 | 0 | +| [11](Instancing/ValidatorResults/Instancing_11.json) | :white_check_mark: | 0 | 0 | 0 | 0 | +| [12](Instancing/ValidatorResults/Instancing_12.json) | :white_check_mark: | 0 | 0 | 0 | 0 | \ No newline at end of file diff --git a/README.md b/README.md index 9c282b5b..8d9bc558 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ This project covers these requirements, with more to come: - [Node Negative Scale](Output/Positive/Node_NegativeScale/README.md) - [Texture Sampler](Output/Positive/Texture_Sampler/README.md) - [Animation Sampler Type](Output/Positive/Animation_SamplerType/README.md) +- [Instancing](Output/Positive/Instancing/README.md) ## Negative Tests - [Mesh Primitive Restart](Output/Negative/Mesh_PrimitiveRestart/README.md) diff --git a/Source/AssetGenerator.csproj b/Source/AssetGenerator.csproj index 5da59865..7281b75a 100644 --- a/Source/AssetGenerator.csproj +++ b/Source/AssetGenerator.csproj @@ -52,6 +52,7 @@ + @@ -101,6 +102,12 @@ PreserveNewest + + PreserveNewest + + + PreserveNewest + PreserveNewest @@ -164,6 +171,12 @@ PreserveNewest + + PreserveNewest + + + PreserveNewest + PreserveNewest diff --git a/Source/ModelGroup.cs b/Source/ModelGroup.cs index e63943f2..1e044d5a 100644 --- a/Source/ModelGroup.cs +++ b/Source/ModelGroup.cs @@ -77,32 +77,26 @@ protected static Runtime.GLTF CreateGLTF(Func createScene, List> textureCoords = null; - List indices = null; - - if (includeTextureCoords) - { - textureCoords = GetSinglePlaneTextureCoordSets(); - } - - if (includeIndices) - { - indices = GetSinglePlaneIndices(); - } + List> textureCoords = includeTextureCoords ? GetSinglePlaneTextureCoordSets() : null; + List indices = includeIndices ? GetSinglePlaneIndices() : null; + List normals = includeNormals ? GetSinglePlaneNormals() : null; + List tangents = includeTangents ? GetSinglePlaneTangents() : null; return new Runtime.MeshPrimitive { Positions = GetSinglePlanePositions(), TextureCoordSets = textureCoords, Indices = indices, + Normals = normals, + Tangents = tangents }; } public static List GetSinglePlanePositions() { - return new List() + return new List { new Vector3( 0.5f, -0.5f, 0.0f), new Vector3(-0.5f, -0.5f, 0.0f), @@ -134,13 +128,35 @@ public static List GetSinglePlaneIndices() }; } + public static List GetSinglePlaneNormals() + { + return new List + { + new Vector3(0.0f, 0.0f, 1.0f), + new Vector3(0.0f, 0.0f, 1.0f), + new Vector3(0.0f, 0.0f, 1.0f), + new Vector3(0.0f, 0.0f, 1.0f) + }; + } + + public static List GetSinglePlaneTangents() + { + return new List + { + new Vector4(1.0f, 0.0f, 0.0f, 1.0f), + new Vector4(1.0f, 0.0f, 0.0f, 1.0f), + new Vector4(1.0f, 0.0f, 0.0f, 1.0f), + new Vector4(1.0f, 0.0f, 0.0f, 1.0f) + }; + } + public static List CreateMultiPrimitivePlane(bool includeTextureCoords = true) { return new List { new Runtime.MeshPrimitive { - Positions = new List() + Positions = new List { new Vector3(-0.5f, -0.5f, 0.0f), new Vector3( 0.5f, 0.5f, 0.0f), @@ -163,7 +179,7 @@ public static List GetSinglePlaneIndices() new Runtime.MeshPrimitive { - Positions = new List() + Positions = new List { new Vector3(-0.5f, -0.5f, 0.0f), new Vector3( 0.5f, -0.5f, 0.0f), @@ -257,5 +273,6 @@ internal enum ModelGroupId Texture_Sampler = 21, Mesh_NoPosition = 22, Animation_SamplerType = 23, + Instancing = 24, } } diff --git a/Source/ModelGroup_SkinB.cs b/Source/ModelGroup_SkinB.cs index 132c4c22..c465c09b 100644 --- a/Source/ModelGroup_SkinB.cs +++ b/Source/ModelGroup_SkinB.cs @@ -13,26 +13,6 @@ protected static partial class Nodes var colorInner = new Vector4(0.8f, 0.8f, 0.8f, 1.0f); var colorOuter = new Vector4(0.0f, 0.0f, 1.0f, 1.0f); - var nodeInnerPrism = new Runtime.Node - { - Name = "innerPrism", - Skin = new Runtime.Skin() - { - Name = "innerPrismSkinB", - }, - Mesh = Mesh.CreatePrism(colorInner), - }; - - var nodeOuterPrism = new Runtime.Node - { - Name = "outerPrism", - Skin = new Runtime.Skin() - { - Name = "outerPrismSkinB", - }, - Mesh = Mesh.CreatePrism(colorOuter, Scale: new Vector3(1.6f, 1.6f, 0.3f)), - }; - Matrix4x4 rotation = Matrix4x4.CreateFromYawPitchRoll(0.0f, FloatMath.ConvertDegreesToRadians(90.0f), 0.0f); var translationVectorJoint1 = new Vector3(0.0f, 0.0f, -0.6f); var translationVectorJoint0 = new Vector3(0.0f, 0.0f, 0.3f); @@ -59,33 +39,41 @@ protected static partial class Nodes }, }; - var joint1 = new Runtime.SkinJoint - ( - inverseBindMatrix: invertedJoint1, - node: nodeJoint1 - ); - var joint0 = new Runtime.SkinJoint - ( - inverseBindMatrix: invertedJoint0, - node: nodeJoint0 - ); + var jointsList = new List + { + nodeJoint0, + nodeJoint1 + }; + var inverseBindMatricesList = new List + { + invertedJoint0, + invertedJoint1 + }; + var skin = new Runtime.Skin() + { + Joints = jointsList, + InverseBindMatrices = inverseBindMatricesList + }; - nodeInnerPrism.Skin.SkinJoints = new[] + var nodeInnerPrism = new Runtime.Node { - joint0, - joint1, + Name = "innerPrism", + Skin = skin, + Mesh = Mesh.CreatePrism(colorInner), }; - nodeOuterPrism.Skin.SkinJoints = new[] + + var nodeOuterPrism = new Runtime.Node { - joint0, - joint1, + Name = "outerPrism", + Skin = skin, + Mesh = Mesh.CreatePrism(colorOuter, Scale: new Vector3(1.6f, 1.6f, 0.3f)), }; var weightsListInnerPrism = new List>(); var weightsListOuterPrism = new List>(); for (var i = 0; i < 3; i++) { - var weight = new List() + var weight = new List { new Runtime.JointWeight { @@ -103,7 +91,7 @@ protected static partial class Nodes } for (var i = 0; i < 3; i++) { - var weight = new List() + var weight = new List { new Runtime.JointWeight { diff --git a/Source/ModelGroup_SkinBuilder.cs b/Source/ModelGroup_SkinBuilder.cs index 80ce89fe..d8783f8a 100644 --- a/Source/ModelGroup_SkinBuilder.cs +++ b/Source/ModelGroup_SkinBuilder.cs @@ -98,27 +98,21 @@ protected static partial class Nodes jointHierarchyNodes[nodeIndex - 1].Children = new[] { jointHierarchyNodes[nodeIndex] }; } - // Create the skinjoint for the root node, since it is a special case. - var skinJoints = new List + // Assembles the joints and inverseBindMatrices to create the skin. + var joints = new List { - new Runtime.SkinJoint - ( - inverseBindMatrix: invertedJoint0, - node: jointHierarchyNodes[0] - ) + jointHierarchyNodes[0] + }; + var inverseBindMatrices = new List + { + invertedJoint0 }; - - // Create the skinjoints for the rest of the joints. for (int nodeIndex = 1, translationMultiplier = 1; nodeIndex < numberOfNodesInJointHierarchy; nodeIndex++) { - // Create the skinjoint. Transform node is skipped. if (nodeIndex != indexOfTransformNode) { - skinJoints.Add(new Runtime.SkinJoint - ( - inverseBindMatrix: Matrix4x4.CreateTranslation(new Vector3(0.0f, 0.0f, -positions[nodeIndex * 2].Z)), - node: jointHierarchyNodes[nodeIndex] - )); + joints.Add(jointHierarchyNodes[nodeIndex]); + inverseBindMatrices.Add(Matrix4x4.CreateTranslation(new Vector3(0.0f, 0.0f, -positions[nodeIndex * 2].Z))); } translationMultiplier--; } @@ -135,12 +129,12 @@ protected static partial class Nodes { jointIndexToUse = jointIndexToUse - 1; } - else if (i > skinJoints.Count - 1) + else if (i > joints.Count - 1) { - jointIndexToUse = skinJoints.Count - 1; + jointIndexToUse = joints.Count - 1; } - weights.Add(new List() + weights.Add(new List { new Runtime.JointWeight { @@ -148,7 +142,7 @@ protected static partial class Nodes Weight = 1, }, }); - weights.Add(new List() + weights.Add(new List { new Runtime.JointWeight { @@ -161,10 +155,11 @@ protected static partial class Nodes var nodePlane = new Runtime.Node { Name = "plane", - Skin = new Runtime.Skin() + Skin = new Runtime.Skin { Name = skinName, - SkinJoints = skinJoints + Joints = joints, + InverseBindMatrices = inverseBindMatrices }, Mesh = new Runtime.Mesh { @@ -194,6 +189,22 @@ protected static partial class Nodes jointHierarchyNodes[0] }; } + + public static List> GetSkinATextureCoordSets() + { + return new List> + { + new List + { + new Vector2(0.0f, 1.0f), + new Vector2(1.0f, 1.0f), + new Vector2(0.0f, 0.5f), + new Vector2(1.0f, 0.5f), + new Vector2(0.0f, 0.0f), + new Vector2(1.0f, 0.0f), + }, + }; + } } } } diff --git a/Source/ModelGroup_SkinE.cs b/Source/ModelGroup_SkinE.cs index a1417ca6..20f4b282 100644 --- a/Source/ModelGroup_SkinE.cs +++ b/Source/ModelGroup_SkinE.cs @@ -13,17 +13,13 @@ protected static partial class Nodes var nodePlane = new Runtime.Node { Name = "plane", - Skin = new Runtime.Skin() - { - Name = "skinE", - }, Mesh = new Runtime.Mesh { MeshPrimitives = new[] { new Runtime.MeshPrimitive { - Positions = new List() + Positions = new List { // Trunk new Vector3(-0.125f, 0.000f, -0.250f), @@ -134,33 +130,23 @@ protected static partial class Nodes } }; - var joint3 = new Runtime.SkinJoint - ( - inverseBindMatrix: invertedTranslationMatrixJoint3, - node: nodeJoint3 - ); - var joint2 = new Runtime.SkinJoint - ( - inverseBindMatrix: invertedTranslationMatrixJoint2, - node: nodeJoint2 - ); - var joint1 = new Runtime.SkinJoint - ( - inverseBindMatrix: invertedJoint1, - node: nodeJoint1 - ); - var joint0 = new Runtime.SkinJoint - ( - inverseBindMatrix: invertedJoint0, - node: nodeJoint0 - ); - - nodePlane.Skin.SkinJoints = new[] + nodePlane.Skin = new Runtime.Skin { - joint0, - joint1, - joint2, - joint3 + Name = "skinE", + Joints = new List + { + nodeJoint0, + nodeJoint1, + nodeJoint2, + nodeJoint3 + }, + InverseBindMatrices = new List + { + invertedJoint0, + invertedJoint1, + invertedTranslationMatrixJoint2, + invertedTranslationMatrixJoint3 + } }; // Top four vertexes of each arm have a weight for the relevant joint. Otherwise the vertex has a weight from the root. @@ -168,7 +154,7 @@ protected static partial class Nodes // Base of trunk for (var vertexIndex = 0; vertexIndex < 2; vertexIndex++) { - jointWeights.Add(new List() + jointWeights.Add(new List { new Runtime.JointWeight { @@ -195,7 +181,7 @@ protected static partial class Nodes // Top of trunk for (var vertexIndex = 0; vertexIndex < 3; vertexIndex++) { - jointWeights.Add(new List() + jointWeights.Add(new List { new Runtime.JointWeight { @@ -223,7 +209,7 @@ protected static partial class Nodes for (var vertexIndex = 0; vertexIndex < 4; vertexIndex++) { - jointWeights.Add(new List() + jointWeights.Add(new List { new Runtime.JointWeight { @@ -250,7 +236,7 @@ protected static partial class Nodes // Right arm for (var vertexIndex = 0; vertexIndex < 4; vertexIndex++) { - jointWeights.Add(new List() + jointWeights.Add(new List { new Runtime.JointWeight { @@ -333,28 +319,23 @@ protected static partial class Nodes } }; - nodePlane.Skin.SkinJoints = new[] + nodePlane.Skin = new Runtime.Skin { - new Runtime.SkinJoint - ( - inverseBindMatrix: invertedJoint0, - node: nodeJoint0 - ), - new Runtime.SkinJoint - ( - inverseBindMatrix: invertedJoint1, - node: nodeJoint1 - ), - new Runtime.SkinJoint - ( - inverseBindMatrix: invertedJoint2, - node: nodeJoint2 - ), - new Runtime.SkinJoint - ( - inverseBindMatrix: invertedJoint3, - node: nodeJoint3 - ) + Name = "skinE", + Joints = new List + { + nodeJoint0, + nodeJoint1, + nodeJoint2, + nodeJoint3 + }, + InverseBindMatrices = new List + { + invertedJoint0, + invertedJoint1, + invertedJoint2, + invertedJoint3 + } }; // Top four vertexes of each arm have a weight for the relevant joint. Otherwise the vertex has a weight from the root. @@ -362,7 +343,7 @@ protected static partial class Nodes // Base of trunk for (var vertexIndex = 0; vertexIndex < 2; vertexIndex++) { - jointWeights.Add(new List() + jointWeights.Add(new List { new Runtime.JointWeight { @@ -389,7 +370,7 @@ protected static partial class Nodes // Top of trunk for (var vertexIndex = 0; vertexIndex < 3; vertexIndex++) { - jointWeights.Add(new List() + jointWeights.Add(new List { new Runtime.JointWeight { @@ -417,7 +398,7 @@ protected static partial class Nodes for (var vertexIndex = 0; vertexIndex < 4; vertexIndex++) { - jointWeights.Add(new List() + jointWeights.Add(new List { new Runtime.JointWeight { @@ -444,7 +425,7 @@ protected static partial class Nodes // Right arm for (var vertexIndex = 0; vertexIndex < 4; vertexIndex++) { - jointWeights.Add(new List() + jointWeights.Add(new List { new Runtime.JointWeight { diff --git a/Source/ModelGroups/Animation_NodeMisc.cs b/Source/ModelGroups/Animation_NodeMisc.cs index 70fbcd8c..4086a2cb 100644 --- a/Source/ModelGroups/Animation_NodeMisc.cs +++ b/Source/ModelGroups/Animation_NodeMisc.cs @@ -21,14 +21,14 @@ Model CreateModel(Action, List, List() + var channels = new List { new Runtime.AnimationChannel() }; diff --git a/Source/ModelGroups/Animation_Skin.cs b/Source/ModelGroups/Animation_Skin.cs index eb5deda7..579c27f0 100644 --- a/Source/ModelGroups/Animation_Skin.cs +++ b/Source/ModelGroups/Animation_Skin.cs @@ -189,10 +189,11 @@ Runtime.Animation CreateFoldingAnimation(Runtime.Node jointRootNode, List { model.Camera = closeCamera; }), @@ -278,7 +279,11 @@ Runtime.Animation CreateFoldingAnimation(Runtime.Node jointRootNode, List { model.Camera = closeCamera; }), @@ -322,12 +327,12 @@ Runtime.Animation CreateFoldingAnimation(Runtime.Node jointRootNode, List skinJointList = (List)nodes[0].Skin.SkinJoints; - for (var skinJointIndex = 1; skinJointIndex < skinJointList.Count(); skinJointIndex++) + List inverseBindMatrixList = (List)nodes[0].Skin.InverseBindMatrices; + for (var i = 1; i < inverseBindMatrixList.Count; i++) { - var translationInverseBindMatrix = skinJointList[skinJointIndex].InverseBindMatrix; - Matrix4x4.Invert(Matrix4x4.CreateRotationX(rotationRadian * (skinJointIndex + 1)), out Matrix4x4 invertedRotation); - skinJointList[skinJointIndex].InverseBindMatrix = Matrix4x4.Multiply(translationInverseBindMatrix, invertedRotation); + var translationInverseBindMatrix = inverseBindMatrixList[i]; + Matrix4x4.Invert(Matrix4x4.CreateRotationX(rotationRadian * (i + 1)), out Matrix4x4 invertedRotation); + inverseBindMatrixList[i] = Matrix4x4.Multiply(translationInverseBindMatrix, invertedRotation); } properties.Add(new Property(PropertyName.Description, "`skinC` where all of the joints have a local rotation of -10 degrees, except the root which is rotated -90 degrees.")); @@ -440,7 +445,7 @@ Runtime.Animation CreateFoldingAnimation(Runtime.Node jointRootNode, List { model.Camera = midCamera; }), + }, (model) => { model.Camera = distantCamera; }), }; GenerateUsedPropertiesList(); diff --git a/Source/ModelGroups/Instancing.cs b/Source/ModelGroups/Instancing.cs new file mode 100644 index 00000000..5340138e --- /dev/null +++ b/Source/ModelGroups/Instancing.cs @@ -0,0 +1,479 @@ +using System; +using System.Collections.Generic; +using System.Numerics; +using System.Linq; +using static glTFLoader.Schema.Sampler; +using static AssetGenerator.Runtime.AnimationChannelTarget.PathEnum; + +namespace AssetGenerator +{ + internal class Instancing : ModelGroup + { + public override ModelGroupId Id => ModelGroupId.Instancing; + + public Instancing(List imageList) + { + Runtime.Image baseColorTextureImageA = UseTexture(imageList, "BaseColor_A"); + Runtime.Image baseColorTextureImageB = UseTexture(imageList, "BaseColor_B"); + Runtime.Image baseColorTextureImageCube = UseTexture(imageList, "BaseColor_Cube"); + var distantCamera = new Manifest.Camera(new Vector3(0.0f, 0.0f, 2.7f)); + + // There are no common properties in this model group that are reported in the readme. + + Model CreateModel(Action, List, List> setProperties, Action setCamera) + { + var properties = new List(); + var animations = new List(); + var animated = true; + var nodes = new List(); + + // Apply the properties that are specific to this gltf. + setProperties(properties, nodes, animations); + + // If no animations are used, null out that property. + if (!animations.Any()) + { + animations = null; + animated = false; + } + + // Create the gltf object. + var model = new Model + { + Properties = properties, + GLTF = CreateGLTF(() => new Runtime.Scene() { Nodes = nodes }, animations: animations), + Animated = animated, + }; + + setCamera(model); + + return model; + } + + var SamplerInputLinear = new[] + { + 0.0f, + 1.0f, + 2.0f, + 3.0f, + 4.0f, + }; + + var SamplerInputCurve = new[] + { + 0.0f, + 0.5f, + 1.0f, + 2.0f, + 4.0f, + }; + + var SamplerOutput = new[] + { + Quaternion.CreateFromYawPitchRoll(0.0f, FloatMath.ConvertDegreesToRadians(90), 0.0f), + Quaternion.Identity, + Quaternion.CreateFromYawPitchRoll(0.0f, FloatMath.ConvertDegreesToRadians(-90), 0.0f), + Quaternion.Identity, + Quaternion.CreateFromYawPitchRoll(0.0f, FloatMath.ConvertDegreesToRadians(90), 0.0f), + }; + + var SamplerOutputReverse = new[] + { + Quaternion.CreateFromYawPitchRoll(0.0f, FloatMath.ConvertDegreesToRadians(-90), 0.0f), + Quaternion.Identity, + Quaternion.CreateFromYawPitchRoll(0.0f, FloatMath.ConvertDegreesToRadians(90), 0.0f), + Quaternion.Identity, + Quaternion.CreateFromYawPitchRoll(0.0f, FloatMath.ConvertDegreesToRadians(-90), 0.0f), + }; + + Runtime.Texture CreateTexture(Runtime.Image image) + { + return new Runtime.Texture { Source = image }; + } + + Runtime.Material CreateMaterial(Runtime.Texture texture) + { + return new Runtime.Material + { + MetallicRoughnessMaterial = new Runtime.PbrMetallicRoughness + { + BaseColorTexture = texture + } + }; + } + + void AddMeshPrimitivesToSingleNode(List nodes, List meshPrimitives) + { + // If there are multiple mesh primitives, offset their position so they don't overlap. + if (meshPrimitives.Count > 1) + { + meshPrimitives[0].Positions = meshPrimitives[0].Positions.Select(position => { return new Vector3(position.X - 0.6f, position.Y, position.Z); } ); + meshPrimitives[1].Positions = meshPrimitives[1].Positions.Select(position => { return new Vector3(position.X + 0.6f, position.Y, position.Z); } ); + } + + nodes.Add( + new Runtime.Node + { + Mesh = new Runtime.Mesh + { + MeshPrimitives = meshPrimitives + } + } + ); + } + + void AddMeshPrimitivesToMultipleNodes(List nodes, Runtime.MeshPrimitive meshPrimitives0, Runtime.MeshPrimitive meshPrimitives1) + { + nodes.AddRange(new[] + { + new Runtime.Node + { + Translation = new Vector3(-0.6f, 0.0f, 0.0f), + Mesh = new Runtime.Mesh + { + MeshPrimitives = new List + { + meshPrimitives0 + } + } + }, + new Runtime.Node + { + Translation = new Vector3(0.6f, 0.0f, 0.0f), + Mesh = new Runtime.Mesh + { + MeshPrimitives = new List + { + meshPrimitives1 + } + } + } + } + ); + } + + void AddAnimation(List animations, List nodes, Runtime.AnimationSampler sampler0, Runtime.AnimationSampler sampler1, bool samplerInstanced) + { + animations.Add(new Runtime.Animation + { + Channels = new List + { + new Runtime.AnimationChannel + { + Target = new Runtime.AnimationChannelTarget + { + Node = nodes[0], + Path = ROTATION, + }, + Sampler = sampler0 + }, + new Runtime.AnimationChannel + { + Target = new Runtime.AnimationChannelTarget + { + Node = nodes[1], + Path = ROTATION, + }, + Sampler = sampler1 + }, + } + }); + } + + Models = new List + { + CreateModel((properties, nodes, animations) => { + var meshPrimitives = new List + { + MeshPrimitive.CreateSinglePlane(includeTextureCoords: false), + MeshPrimitive.CreateSinglePlane(includeTextureCoords: false) + }; + + foreach (Runtime.MeshPrimitive meshPrimitive in meshPrimitives) + { + // This non-standard set of texture coordinates is larger than the texture but not an exact multiple, so it allows texture sampler settings to be visible. + meshPrimitive.TextureCoordSets = new List> + { + new List + { + new Vector2( 1.3f, 1.3f), + new Vector2(-0.3f, 1.3f), + new Vector2(-0.3f, -0.3f), + new Vector2( 1.3f, -0.3f), + } + }; + } + + meshPrimitives[0].Material = CreateMaterial(CreateTexture(baseColorTextureImageA)); + meshPrimitives[1].Material = CreateMaterial(CreateTexture(baseColorTextureImageA)); + + meshPrimitives[0].Material.MetallicRoughnessMaterial.BaseColorTexture.Sampler = new Runtime.Sampler + { + WrapT = WrapTEnum.CLAMP_TO_EDGE, + WrapS = WrapSEnum.CLAMP_TO_EDGE + }; + meshPrimitives[1].Material.MetallicRoughnessMaterial.BaseColorTexture.Sampler = new Runtime.Sampler + { + WrapT = WrapTEnum.MIRRORED_REPEAT, + WrapS = WrapSEnum.MIRRORED_REPEAT + }; + + AddMeshPrimitivesToSingleNode(nodes, meshPrimitives); + + properties.Add(new Property(PropertyName.Description, "Two textures using the same image as their source.")); + properties.Add(new Property(PropertyName.Difference, "The texture sampler `WrapT` and `WrapS` are set to `CLAMP_TO_EDGE` for one and `MIRRORED_REPEAT` for the other.")); + }, (model) => { model.Camera = distantCamera; }), + CreateModel((properties, nodes, animations) => { + var meshPrimitives = new List + { + MeshPrimitive.CreateSinglePlane(includeTextureCoords: false), + MeshPrimitive.CreateSinglePlane(includeTextureCoords: false) + }; + + meshPrimitives[0].Material = CreateMaterial(CreateTexture(baseColorTextureImageA)); + meshPrimitives[1].Material = CreateMaterial(CreateTexture(baseColorTextureImageB)); + + var sampler = new Runtime.Sampler + { + WrapT = WrapTEnum.CLAMP_TO_EDGE, + WrapS = WrapSEnum.CLAMP_TO_EDGE + }; + foreach (Runtime.MeshPrimitive meshPrimitive in meshPrimitives) + { + meshPrimitive.Material.MetallicRoughnessMaterial.BaseColorTexture.Sampler = sampler; + // This non-standard set of texture coordinates is larger than the texture but not an exact multiple, so it allows texture sampler settings to be visible. + meshPrimitive.TextureCoordSets = new List> + { + new List + { + new Vector2( 1.3f, 1.3f), + new Vector2(-0.3f, 1.3f), + new Vector2(-0.3f, -0.3f), + new Vector2( 1.3f, -0.3f), + } + }; + } + + AddMeshPrimitivesToSingleNode(nodes, meshPrimitives); + + properties.Add(new Property(PropertyName.Description, "Two textures using the same sampler.")); + properties.Add(new Property(PropertyName.Difference, "One texture uses image A while the other uses image B.")); + }, (model) => { model.Camera = distantCamera; }), + CreateModel((properties, nodes, animations) => { + var meshPrimitives = new List + { + MeshPrimitive.CreateSinglePlane(), + MeshPrimitive.CreateSinglePlane() + }; + + var texture = CreateTexture(baseColorTextureImageA); + foreach (Runtime.MeshPrimitive meshPrimitive in meshPrimitives) + { + meshPrimitive.Material = CreateMaterial(texture); + } + meshPrimitives[0].Material.MetallicRoughnessMaterial.BaseColorTexture = meshPrimitives[1].Material.MetallicRoughnessMaterial.BaseColorTexture; + meshPrimitives[1].Material.MetallicRoughnessMaterial.BaseColorFactor = new Vector4(0.5f, 0.5f, 1.0f, 1.0f); + + AddMeshPrimitivesToSingleNode(nodes, meshPrimitives); + + properties.Add(new Property(PropertyName.Description, "Two textures using the same source image.")); + properties.Add(new Property(PropertyName.Difference, "One material does not have a baseColorFactor and the other has a blue baseColorFactor.")); + }, (model) => { model.Camera = distantCamera; }), + CreateModel((properties, nodes, animations) => { + var meshPrimitives = new List + { + MeshPrimitive.CreateSinglePlane(), + MeshPrimitive.CreateSinglePlane(includeTextureCoords: false) + }; + var material = CreateMaterial(CreateTexture(baseColorTextureImageA)); + foreach (Runtime.MeshPrimitive meshPrimitive in meshPrimitives) + { + meshPrimitive.Material = material; + } + + // One of the primitives has a 'zoomed in' texture coordinate set. + meshPrimitives[1].TextureCoordSets = new List> + { + new List + { + new Vector2(0.9f, 0.9f), + new Vector2(0.1f, 0.9f), + new Vector2(0.1f, 0.1f), + new Vector2(0.9f, 0.1f), + } + }; + + AddMeshPrimitivesToSingleNode(nodes, meshPrimitives); + + properties.Add(new Property(PropertyName.Description, "Two primitives using the same material.")); + properties.Add(new Property(PropertyName.Difference, "One primitive has texture coordinates that displays all of texture A, while the other primitive has textures coordinates that don't display the border.")); + }, (model) => { model.Camera = distantCamera; }), + CreateModel((properties, nodes, animations) => { + var meshPrimitive0 = MeshPrimitive.CreateSinglePlane(); + var meshPrimitive1 = MeshPrimitive.CreateSinglePlane(); + meshPrimitive0.Material = CreateMaterial(CreateTexture(baseColorTextureImageA)); + meshPrimitive1.Material = CreateMaterial(CreateTexture(baseColorTextureImageB)); + + meshPrimitive0.Positions = meshPrimitive1.Positions; + + AddMeshPrimitivesToMultipleNodes(nodes, meshPrimitive0, meshPrimitive1); + + properties.Add(new Property(PropertyName.Description, "Two primitives using the same accessors for the `POSITION` attribute.")); + properties.Add(new Property(PropertyName.Difference, "One primitive uses texture A while the other primitive uses texture B.")); + }, (model) => { model.Camera = distantCamera; }), + CreateModel((properties, nodes, animations) => { + var meshPrimitive0 = MeshPrimitive.CreateSinglePlane(includeIndices: false); + var meshPrimitive1 = MeshPrimitive.CreateSinglePlane(); + meshPrimitive0.Material = CreateMaterial(CreateTexture(baseColorTextureImageA)); + meshPrimitive1.Material = CreateMaterial(CreateTexture(baseColorTextureImageB)); + + meshPrimitive0.Indices = meshPrimitive1.Indices; + + AddMeshPrimitivesToMultipleNodes(nodes, meshPrimitive0, meshPrimitive1); + + properties.Add(new Property(PropertyName.Description, "Two primitives using the same accessors for indices.")); + properties.Add(new Property(PropertyName.Difference, "One primitive uses texture A while the other primitive uses texture B.")); + }, (model) => { model.Camera = distantCamera; }), + CreateModel((properties, nodes, animations) => { + var meshPrimitive = MeshPrimitive.CreateSinglePlane(); + meshPrimitive.Material = CreateMaterial(CreateTexture(baseColorTextureImageA)); + + AddMeshPrimitivesToMultipleNodes(nodes, meshPrimitive, meshPrimitive); + nodes[1].Mesh = nodes[0].Mesh; + + properties.Add(new Property(PropertyName.Description, "Two nodes using the same mesh.")); + properties.Add(new Property(PropertyName.Difference, "The two nodes have different translations.")); + }, (model) => { model.Camera = distantCamera; }), + CreateModel((properties, nodes, animations) => { + nodes.AddRange(Nodes.CreateFoldingPlaneSkin("skinA", 2, 3)); + nodes[0].Name = "plane0"; + nodes[0].Mesh.MeshPrimitives.ElementAt(0).Material = CreateMaterial(CreateTexture(baseColorTextureImageA)); + nodes[0].Mesh.MeshPrimitives.ElementAt(0).TextureCoordSets = Nodes.GetSkinATextureCoordSets(); + + // Adds just the node containing the mesh, dropping the data for a second set of joints. + nodes.Add(Nodes.CreateFoldingPlaneSkin("skinA", 2, 3)[0]); + nodes[2].Name = "plane1"; + nodes[2].Mesh.MeshPrimitives.ElementAt(0).Material = CreateMaterial(CreateTexture(baseColorTextureImageB)); + nodes[2].Mesh.MeshPrimitives.ElementAt(0).TextureCoordSets = Nodes.GetSkinATextureCoordSets(); + nodes[2].Skin = nodes[0].Skin; + + // Offsets the position of both meshes so they don't overlap. + nodes[0].Mesh.MeshPrimitives.ElementAt(0).Positions = nodes[0].Mesh.MeshPrimitives.ElementAt(0).Positions.Select(position => { return new Vector3(position.X - 0.3f, position.Y, position.Z); } ); + nodes[2].Mesh.MeshPrimitives.ElementAt(0).Positions = nodes[2].Mesh.MeshPrimitives.ElementAt(0).Positions.Select(position => { return new Vector3(position.X + 0.3f, position.Y, position.Z); } ); + + properties.Add(new Property(PropertyName.Description, "Two nodes using the same skin.")); + properties.Add(new Property(PropertyName.Difference, "The two mesh primitives have different `POSITION` values.")); + }, (model) => { model.Camera = null; }), + CreateModel((properties, nodes, animations) => { + nodes.AddRange(Nodes.CreateFoldingPlaneSkin("skinA", 2, 3)); + nodes[0].Name = "plane0"; + nodes[0].Mesh.MeshPrimitives.ElementAt(0).Material = CreateMaterial(CreateTexture(baseColorTextureImageA)); + nodes[0].Mesh.MeshPrimitives.ElementAt(0).TextureCoordSets = Nodes.GetSkinATextureCoordSets(); + + // Adds just the node containing the mesh, dropping the data for a second set of joints. + nodes.Add(Nodes.CreateFoldingPlaneSkin("skinA", 2, 3)[0]); + nodes[2].Name = "plane1"; + nodes[2].Mesh.MeshPrimitives.ElementAt(0).Material = CreateMaterial(CreateTexture(baseColorTextureImageB)); + nodes[2].Mesh.MeshPrimitives.ElementAt(0).TextureCoordSets = Nodes.GetSkinATextureCoordSets(); + nodes[2].Skin.Joints = nodes[0].Skin.Joints; + + // Creates new inverseBindMatrices for the second skin, rotating the flap further than the default value would. + nodes[2].Skin.InverseBindMatrices = new[] + { + nodes[2].Skin.InverseBindMatrices.First(), + Matrix4x4.Multiply(nodes[2].Skin.InverseBindMatrices.ElementAt(1), Matrix4x4.CreateRotationX(FloatMath.ConvertDegreesToRadians(-30))), + }; + + // Offsets the position of both meshes so they don't overlap. + nodes[0].Mesh.MeshPrimitives.ElementAt(0).Positions = nodes[0].Mesh.MeshPrimitives.ElementAt(0).Positions.Select(position => { return new Vector3(position.X - 0.3f, position.Y, position.Z); } ); + nodes[2].Mesh.MeshPrimitives.ElementAt(0).Positions = nodes[2].Mesh.MeshPrimitives.ElementAt(0).Positions.Select(position => { return new Vector3(position.X + 0.3f, position.Y, position.Z); } ); + + properties.Add(new Property(PropertyName.Description, "Two skins using the same joints.")); + properties.Add(new Property(PropertyName.Difference, "The skin with texture B has inverseBindMatrices that fold twice as far as the skin with texture A.")); + }, (model) => { model.Camera = null; }), + CreateModel((properties, nodes, animations) => { + nodes.AddRange(Nodes.CreateFoldingPlaneSkin("skinA", 2, 3)); + nodes[0].Name = "plane0"; + nodes[0].Mesh.MeshPrimitives.ElementAt(0).Material = CreateMaterial(CreateTexture(baseColorTextureImageA)); + nodes[0].Mesh.MeshPrimitives.ElementAt(0).TextureCoordSets = Nodes.GetSkinATextureCoordSets(); + nodes[1].Translation = Vector3.Add((Vector3)nodes[1].Translation, new Vector3(-0.3f, 0.0f, 0.0f)); + + nodes.AddRange(Nodes.CreateFoldingPlaneSkin("skinA", 2, 3)); + nodes[2].Name = "plane1"; + nodes[2].Mesh.MeshPrimitives.ElementAt(0).Material = CreateMaterial(CreateTexture(baseColorTextureImageB)); + nodes[2].Mesh.MeshPrimitives.ElementAt(0).TextureCoordSets = Nodes.GetSkinATextureCoordSets(); + nodes[3].Translation = Vector3.Add((Vector3)nodes[3].Translation, new Vector3(0.3f, 0.0f, 0.0f)); + + nodes[2].Skin.InverseBindMatrices = nodes[0].Skin.InverseBindMatrices; + + properties.Add(new Property(PropertyName.Description, "Two skins using the same inverseBindMatrices.")); + properties.Add(new Property(PropertyName.Difference, "The base joint for the two skins have different translations.")); + }, (model) => { model.Camera = null; }), + CreateModel((properties, nodes, animations) => { + var meshPrimitive0 = MeshPrimitive.CreateCube(); + var meshPrimitive1 = MeshPrimitive.CreateCube(); + meshPrimitive0.Material = CreateMaterial(CreateTexture(baseColorTextureImageCube)); + meshPrimitive1.Material = CreateMaterial(CreateTexture(baseColorTextureImageCube)); + AddMeshPrimitivesToMultipleNodes(nodes, meshPrimitive0, meshPrimitive1); + + var sampler = new Runtime.LinearAnimationSampler(SamplerInputLinear, SamplerOutput); + AddAnimation(animations, nodes, sampler, sampler, true); + + properties.Add(new Property(PropertyName.Description, "Two animation channels using the same sampler.")); + properties.Add(new Property(PropertyName.Difference, "The two animation channels target different nodes.")); + }, (model) => { model.Camera = distantCamera; }), + CreateModel((properties, nodes, animations) => { + var meshPrimitive0 = MeshPrimitive.CreateCube(); + var meshPrimitive1 = MeshPrimitive.CreateCube(); + meshPrimitive0.Material = CreateMaterial(CreateTexture(baseColorTextureImageCube)); + meshPrimitive1.Material = CreateMaterial(CreateTexture(baseColorTextureImageCube)); + AddMeshPrimitivesToMultipleNodes(nodes, meshPrimitive0, meshPrimitive1); + + var inputKeys = SamplerInputLinear; + var sampler0 = new Runtime.LinearAnimationSampler(inputKeys, SamplerOutput); + var sampler1 = new Runtime.LinearAnimationSampler(inputKeys, SamplerOutputReverse); + AddAnimation(animations, nodes, sampler0, sampler1, false); + + properties.Add(new Property(PropertyName.Description, "Two animation samplers using the same input accessors.")); + properties.Add(new Property(PropertyName.Difference, "The two animation samplers have different output values.")); + }, (model) => { model.Camera = distantCamera; }), + CreateModel((properties, nodes, animations) => { + var meshPrimitive0 = MeshPrimitive.CreateCube(); + var meshPrimitive1 = MeshPrimitive.CreateCube(); + meshPrimitive0.Material = CreateMaterial(CreateTexture(baseColorTextureImageCube)); + meshPrimitive1.Material = CreateMaterial(CreateTexture(baseColorTextureImageCube)); + AddMeshPrimitivesToMultipleNodes(nodes, meshPrimitive0, meshPrimitive1); + + var output = SamplerOutput; + var sampler0 = new Runtime.LinearAnimationSampler(SamplerInputLinear, output); + var sampler1 = new Runtime.LinearAnimationSampler(SamplerInputCurve, output); + AddAnimation(animations, nodes, sampler0, sampler1, false); + + properties.Add(new Property(PropertyName.Description, "Two animation samplers using the same output accessors.")); + properties.Add(new Property(PropertyName.Difference, "The two animation samplers have different input values.")); + }, (model) => { model.Camera = distantCamera; }), + // To be implemented later. Needs to work as a type of interleaving. + //CreateModel((properties, nodes, animations) => { + // var meshPrimitives = new List + // { + // MeshPrimitive.CreateSinglePlane(includeTextureCoords: false), + // MeshPrimitive.CreateSinglePlane(includeTextureCoords: false) + // }; + // meshPrimitives[0].TextureCoordSets = meshPrimitives[1].TextureCoordSets = MeshPrimitive.GetSinglePlaneTextureCoordSets(); + // meshPrimitives[0].Normals = meshPrimitives[1].Normals = MeshPrimitive.GetSinglePlaneNormals(); + + // foreach (Runtime.MeshPrimitive meshPrimitive in meshPrimitives) + // { + // meshPrimitive.BufferViewsInstanced = true; + // meshPrimitive.Material = CreateMaterial(); + // } + // AddMeshPrimitivesToSingleNode(nodes, meshPrimitives); + + // properties.Add(new Property(PropertyName.Description, "Two accessors using the same buffer view.")); + //}, (model) => { model.Camera = null; }), + }; + + GenerateUsedPropertiesList(); + } + } +} diff --git a/Source/ModelGroups/Material.cs b/Source/ModelGroups/Material.cs index 646f7e58..12c6a44a 100644 --- a/Source/ModelGroups/Material.cs +++ b/Source/ModelGroups/Material.cs @@ -63,14 +63,7 @@ Model CreateModel(Action, Runtime.MeshPrimitive, Runtime.Material void SetNormalTexture(List properties, Runtime.MeshPrimitive meshPrimitive) { - var planeNormalsValue = new[] - { - new Vector3(0.0f, 0.0f, 1.0f), - new Vector3(0.0f, 0.0f, 1.0f), - new Vector3(0.0f, 0.0f, 1.0f), - new Vector3(0.0f, 0.0f, 1.0f), - }; - meshPrimitive.Normals = planeNormalsValue; + meshPrimitive.Normals = MeshPrimitive.GetSinglePlaneNormals(); meshPrimitive.Material.NormalTexture = new Runtime.Texture { Source = normalImage }; properties.Add(new Property(PropertyName.NormalTexture, normalImage)); } diff --git a/Source/ModelGroups/Material_DoubleSided.cs b/Source/ModelGroups/Material_DoubleSided.cs index 0d61bc81..e12f02ee 100644 --- a/Source/ModelGroups/Material_DoubleSided.cs +++ b/Source/ModelGroups/Material_DoubleSided.cs @@ -57,26 +57,14 @@ Model CreateModel(Action, Runtime.MeshPrimitive> setProperties) void SetVertexNormal(List properties, Runtime.MeshPrimitive meshPrimitive) { - var planeNormalsValue = new List() - { - new Vector3(0.0f, 0.0f, 1.0f), - new Vector3(0.0f, 0.0f, 1.0f), - new Vector3(0.0f, 0.0f, 1.0f), - new Vector3(0.0f, 0.0f, 1.0f) - }; + var planeNormalsValue = MeshPrimitive.GetSinglePlaneNormals(); meshPrimitive.Normals = planeNormalsValue; properties.Add(new Property(PropertyName.VertexNormal, planeNormalsValue)); } void SetVertexTangent(List properties, Runtime.MeshPrimitive meshPrimitive) { - var planeTangentValue = new List() - { - new Vector4(1.0f, 0.0f, 0.0f, 1.0f), - new Vector4(1.0f, 0.0f, 0.0f, 1.0f), - new Vector4(1.0f, 0.0f, 0.0f, 1.0f), - new Vector4(1.0f, 0.0f, 0.0f, 1.0f) - }; + var planeTangentValue = MeshPrimitive.GetSinglePlaneTangents(); meshPrimitive.Tangents = planeTangentValue; properties.Add(new Property(PropertyName.VertexTangent, planeTangentValue)); } diff --git a/Source/ModelGroups/Mesh_PrimitiveAttribute.cs b/Source/ModelGroups/Mesh_PrimitiveAttribute.cs index 6b84b57a..beb59041 100644 --- a/Source/ModelGroups/Mesh_PrimitiveAttribute.cs +++ b/Source/ModelGroups/Mesh_PrimitiveAttribute.cs @@ -78,13 +78,7 @@ void SetVertexUVShort(List properties, Runtime.MeshPrimitive meshPrimi void SetVertexNormal(List properties, Runtime.MeshPrimitive meshPrimitive) { - var planeNormalsValue = new List() - { - new Vector3(0.0f, 0.0f, 1.0f), - new Vector3(0.0f, 0.0f, 1.0f), - new Vector3(0.0f, 0.0f, 1.0f), - new Vector3(0.0f, 0.0f, 1.0f) - }; + var planeNormalsValue = MeshPrimitive.GetSinglePlaneNormals(); meshPrimitive.Normals = planeNormalsValue; properties.Add(new Property(PropertyName.VertexNormal, planeNormalsValue)); } diff --git a/Source/Program.cs b/Source/Program.cs index 55855ff7..e690d971 100644 --- a/Source/Program.cs +++ b/Source/Program.cs @@ -54,6 +54,7 @@ private static void Main(string[] args) new Node_NegativeScale(imageList), new Texture_Sampler(imageList), new Animation_SamplerType(imageList), + new Instancing(imageList), }; var negativeTests = new List { diff --git a/Source/Property.cs b/Source/Property.cs index 3d8e61ca..fe11363d 100644 --- a/Source/Property.cs +++ b/Source/Property.cs @@ -163,6 +163,7 @@ internal enum PropertyName WeightComponentType, SamplerOutputComponentType, LeftPrimitiveIndices, - RightPrimitiveIndices + RightPrimitiveIndices, + Difference } } diff --git a/Source/ReadmeTemplates/Instancing.md b/Source/ReadmeTemplates/Instancing.md new file mode 100644 index 00000000..ceeb84f3 --- /dev/null +++ b/Source/ReadmeTemplates/Instancing.md @@ -0,0 +1,5 @@ +These models are intended to test instancing of various properties. + +The following table shows the properties that are set for a given model. + +~~Table~~ diff --git a/Source/Resources/Figures/Thumbnails/BaseColor_A.png b/Source/Resources/Figures/Thumbnails/BaseColor_A.png new file mode 100644 index 00000000..5772f4e4 Binary files /dev/null and b/Source/Resources/Figures/Thumbnails/BaseColor_A.png differ diff --git a/Source/Resources/Figures/Thumbnails/BaseColor_B.png b/Source/Resources/Figures/Thumbnails/BaseColor_B.png new file mode 100644 index 00000000..073399f8 Binary files /dev/null and b/Source/Resources/Figures/Thumbnails/BaseColor_B.png differ diff --git a/Source/Resources/Textures/BaseColor_A.png b/Source/Resources/Textures/BaseColor_A.png new file mode 100644 index 00000000..98175651 Binary files /dev/null and b/Source/Resources/Textures/BaseColor_A.png differ diff --git a/Source/Resources/Textures/BaseColor_B.png b/Source/Resources/Textures/BaseColor_B.png new file mode 100644 index 00000000..53d9981a Binary files /dev/null and b/Source/Resources/Textures/BaseColor_B.png differ diff --git a/Source/Runtime/AnimationSampler.cs b/Source/Runtime/AnimationSampler.cs index 0f3435cb..d83f31e9 100644 --- a/Source/Runtime/AnimationSampler.cs +++ b/Source/Runtime/AnimationSampler.cs @@ -1,35 +1,42 @@ -using System.Collections.Generic; +using System.Collections; +using System.Collections.Generic; namespace AssetGenerator.Runtime { - internal class AnimationSampler + internal abstract class AnimationSampler { - public IEnumerable InputKeys { get; protected set; } + public IEnumerable InputKeys { get; } + public IEnumerable OutputKeys { get; } public enum ComponentTypeEnum { FLOAT, NORMALIZED_BYTE, NORMALIZED_UNSIGNED_BYTE, NORMALIZED_SHORT, NORMALIZED_UNSIGNED_SHORT }; - public ComponentTypeEnum OutputComponentType { get; protected set; } + public ComponentTypeEnum OutputComponentType { get; } + + public AnimationSampler(IEnumerable inputKeys, IEnumerable outputKeys, ComponentTypeEnum outputComponentType) + { + InputKeys = inputKeys; + OutputKeys = outputKeys; + OutputComponentType = outputComponentType; + } } internal class StepAnimationSampler : AnimationSampler { - public IEnumerable OutputKeys { get; } + public new IEnumerable OutputKeys { get; } public StepAnimationSampler(IEnumerable inputKeys, IEnumerable outputKeys, ComponentTypeEnum outputComponentType = ComponentTypeEnum.FLOAT) + : base(inputKeys, outputKeys, outputComponentType) { - InputKeys = inputKeys; OutputKeys = outputKeys; - OutputComponentType = outputComponentType; } } internal class LinearAnimationSampler : AnimationSampler { - public IEnumerable OutputKeys { get; } + public new IEnumerable OutputKeys { get; } public LinearAnimationSampler(IEnumerable inputKeys, IEnumerable outputKeys, ComponentTypeEnum outputComponentType = ComponentTypeEnum.FLOAT) + : base(inputKeys, outputKeys, outputComponentType) { - InputKeys = inputKeys; OutputKeys = outputKeys; - OutputComponentType = outputComponentType; } } @@ -49,13 +56,12 @@ public Key(T inTangent, T value, T outTangent) } } - public IEnumerable OutputKeys { get; } + public new IEnumerable OutputKeys { get; } public CubicSplineAnimationSampler(IEnumerable inputKeys, IEnumerable outputKeys, ComponentTypeEnum outputComponentType = ComponentTypeEnum.FLOAT) + : base(inputKeys, outputKeys, outputComponentType) { - InputKeys = inputKeys; OutputKeys = outputKeys; - OutputComponentType = outputComponentType; } } -} +} \ No newline at end of file diff --git a/Source/Runtime/GLTFConverter.cs b/Source/Runtime/GLTFConverter.cs index 4a97aa9a..1794442e 100644 --- a/Source/Runtime/GLTFConverter.cs +++ b/Source/Runtime/GLTFConverter.cs @@ -1,5 +1,6 @@ using AssetGenerator.Runtime.ExtensionMethods; using System; +using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.IO; @@ -29,16 +30,16 @@ internal class GLTFConverter private List animations = new List(); private List skins = new List(); - private Dictionary nodeToIndexCache = new Dictionary(); - private Dictionary textureToTextureIndicesCache = new Dictionary(); - private Dictionary imageToIndexCache = new Dictionary(); + private Dictionary textureToTextureIndicesCache = new Dictionary(); private Dictionary meshToSchemaCache = new Dictionary(); private Dictionary imageToSchemaCache = new Dictionary(); private Dictionary samplerToSchemaCache = new Dictionary(); - private Dictionary animationToSchemaCache = new Dictionary(); private Dictionary meshPrimitiveToSchemaCache = new Dictionary(); private Dictionary materialToSchemaCache = new Dictionary(); - private Dictionary skinsToIndexCache = new Dictionary(); + private Dictionary nodeToIndexCache = new Dictionary(); + private Dictionary animationSamplerToIndexCache = new Dictionary(); + private Dictionary skinToIndexCache = new Dictionary(); + private Dictionary enumerableToIndexCache = new Dictionary(); private enum AttributeEnum { POSITION, NORMAL, TANGENT, COLOR, TEXCOORDS_0, TEXCOORDS_1, JOINTS_0, WEIGHTS_0 }; /// @@ -47,10 +48,11 @@ private enum AttributeEnum { POSITION, NORMAL, TANGENT, COLOR, TEXCOORDS_0, TEXC public Func CreateInstanceOverride = type => Activator.CreateInstance(type); /// - /// Utility struct for holding sampler, image and texture coord indices. + /// Utility struct for holding texture information. /// - private struct TextureIndices + private struct TextureInfo { + public int Index; public int? SamplerIndex; public int? ImageIndex; public int? TextureCoordIndex; @@ -263,9 +265,9 @@ private Loader.Sampler ConvertSamplerToSchema(Sampler runtimeSampler) /// Adds a texture to the property components of the GLTFWrapper. /// /// Returns the indices of the texture and the texture coordinate as an array of two integers if created. Can also return null if the index is not defined. - private TextureIndices AddTexture(Texture runtimeTexture) + private TextureInfo AddTexture(Texture runtimeTexture) { - if (textureToTextureIndicesCache.TryGetValue(runtimeTexture, out TextureIndices textureIndices)) + if (textureToTextureIndicesCache.TryGetValue(runtimeTexture, out TextureInfo textureIndices)) { return textureIndices; } @@ -274,6 +276,7 @@ private TextureIndices AddTexture(Texture runtimeTexture) int? samplerIndex = null; int? imageIndex = null; int? textureCoordIndex = null; + int index = -1; if (runtimeTexture != null) { @@ -300,28 +303,24 @@ private TextureIndices AddTexture(Texture runtimeTexture) texture.Name = runtimeTexture.Name; } // If an equivalent texture has already been created, re-use that texture's index instead of creating a new texture. - var findTextureIndex = -1; if (textures.Count > 0) { - for (var i = 0; i < textures.Count(); ++i) + for (var i = 0; i < textures.Count; ++i) { if (textures[i].TexturesEqual(texture)) { - findTextureIndex = i; + index = i; break; } } } - if (findTextureIndex > -1) - { - indices.Add(findTextureIndex); - } - else + if (index == -1) { + index = textures.Count; textures.Add(texture); - indices.Add(textures.Count() - 1); } + indices.Add(index); if (runtimeTexture.TexCoordIndex.HasValue) { @@ -330,11 +329,12 @@ private TextureIndices AddTexture(Texture runtimeTexture) } } - textureIndices = new TextureIndices + textureIndices = new TextureInfo { SamplerIndex = samplerIndex, ImageIndex = imageIndex, - TextureCoordIndex = textureCoordIndex + TextureCoordIndex = textureCoordIndex, + Index = index }; textureToTextureIndicesCache.Add(runtimeTexture, textureIndices); @@ -472,8 +472,8 @@ private int ConvertNodeToSchema(Node runtimeNode, GLTF gltf, Loader.Buffer buffe } var node = CreateInstance(); + nodeIndex = nodes.Count; nodes.Add(node); - nodeIndex = nodes.Count() - 1; if (runtimeNode.Name != null) { node.Name = runtimeNode.Name; @@ -486,11 +486,11 @@ private int ConvertNodeToSchema(Node runtimeNode, GLTF gltf, Loader.Buffer buffe { var schemaMesh = ConvertMeshToSchema(runtimeNode, gltf, buffer, geometryData, bufferIndex); - int meshIndex = meshes.IndexOf(schemaMesh); + int meshIndex = meshes.IndexOf(schemaMesh); if (meshIndex == -1) { + node.Mesh = meshes.Count(); meshes.Add(schemaMesh); - node.Mesh = meshes.Count() - 1; } else { @@ -520,34 +520,46 @@ private int ConvertNodeToSchema(Node runtimeNode, GLTF gltf, Loader.Buffer buffe } node.Children = childrenIndices.ToArray(); } - if (runtimeNode.Skin?.SkinJoints?.Any() == true) + if (runtimeNode.Skin?.Joints?.Any() == true) { - if (skinsToIndexCache.TryGetValue(runtimeNode.Skin, out int skinIndex)) + if (skinToIndexCache.TryGetValue(runtimeNode.Skin, out int skinIndex)) { node.Skin = skinIndex; } else { - var inverseBindMatrices = runtimeNode.Skin.SkinJoints.Select(skinJoint => skinJoint.InverseBindMatrix); + // Verify that the Joints and InverseBindMatrices lists are the same length. Different lenghts break our assumtion of a 1:1 correlation. + if (runtimeNode.Skin.Joints.Count() != runtimeNode.Skin.InverseBindMatrices.Count()) + { + throw new InvalidEnumArgumentException("Mismatch between the number of joints and number of inverseBindMatrices!"); + } int? inverseBindMatricesAccessorIndex = null; - if (inverseBindMatrices.Any(inverseBindMatrix => !inverseBindMatrix.IsIdentity)) + if (enumerableToIndexCache.TryGetValue(runtimeNode.Skin.InverseBindMatrices, out int index)) { - var inverseBindMatricesByteOffset = (int)geometryData.Writer.BaseStream.Position; - geometryData.Writer.Write(inverseBindMatrices); - var inverseBindMatricesByteLength = (int)geometryData.Writer.BaseStream.Position - inverseBindMatricesByteOffset; - - // Create bufferview - var inverseBindMatricesBufferView = CreateBufferView(bufferIndex, "Inverse Bind Matrix", inverseBindMatricesByteLength, inverseBindMatricesByteOffset, null); - bufferViews.Add(inverseBindMatricesBufferView); - - // Create accessor - var inverseBindMatricesAccessor = CreateAccessor(bufferViews.Count() - 1, 0, ComponentTypeEnum.FLOAT, inverseBindMatrices.Count(), "IBM", TypeEnum.MAT4); - accessors.Add(inverseBindMatricesAccessor); - inverseBindMatricesAccessorIndex = accessors.Count() - 1; + inverseBindMatricesAccessorIndex = index; + } + else + { + if (runtimeNode.Skin.InverseBindMatrices.Any(inverseBindMatrix => !inverseBindMatrix.IsIdentity)) + { + var inverseBindMatricesByteOffset = (int)geometryData.Writer.BaseStream.Position; + geometryData.Writer.Write(runtimeNode.Skin.InverseBindMatrices); + var inverseBindMatricesByteLength = (int)geometryData.Writer.BaseStream.Position - inverseBindMatricesByteOffset; + + // Create accessor + var inverseBindMatricesAccessor = CreateAccessor(bufferViews.Count(), 0, ComponentTypeEnum.FLOAT, runtimeNode.Skin.InverseBindMatrices.Count(), "IBM", TypeEnum.MAT4); + inverseBindMatricesAccessorIndex = accessors.Count(); + accessors.Add(inverseBindMatricesAccessor); + enumerableToIndexCache.Add(runtimeNode.Skin.InverseBindMatrices, inverseBindMatricesAccessorIndex.Value); + + // Create bufferview + var inverseBindMatricesBufferView = CreateBufferView(bufferIndex, "Inverse Bind Matrix", inverseBindMatricesByteLength, inverseBindMatricesByteOffset, null); + bufferViews.Add(inverseBindMatricesBufferView); + } } - var jointIndices = runtimeNode.Skin.SkinJoints.Select(SkinJoint => ConvertNodeToSchema(SkinJoint.Node, gltf, buffer, geometryData, bufferIndex)); + var jointIndices = runtimeNode.Skin.Joints.Select(Joint => ConvertNodeToSchema(Joint, gltf, buffer, geometryData, bufferIndex)); var skin = new Loader.Skin { @@ -555,9 +567,9 @@ private int ConvertNodeToSchema(Node runtimeNode, GLTF gltf, Loader.Buffer buffe Joints = jointIndices.ToArray(), InverseBindMatrices = inverseBindMatricesAccessorIndex, }; + node.Skin = skins.Count(); skins.Add(skin); - skinsToIndexCache.Add(runtimeNode.Skin, skins.Count() - 1); - node.Skin = skinsToIndexCache[runtimeNode.Skin]; + skinToIndexCache.Add(runtimeNode.Skin, node.Skin.Value); } } nodeToIndexCache.Add(runtimeNode, nodeIndex); @@ -586,14 +598,14 @@ private IEnumerable> GetMeshPrimitiveMorphTargets(MeshPr var byteOffset = (int)geometryData.Writer.BaseStream.Position; var bufferView = CreateBufferView(bufferIndex, "Positions", byteLength, byteOffset, null); + var bufferviewIndex = bufferViews.Count; bufferViews.Add(bufferView); - var bufferviewIndex = bufferViews.Count() - 1; // Create an accessor for the bufferView var accessor = CreateAccessor(bufferviewIndex, 0, ComponentTypeEnum.FLOAT, morphTarget.Positions.Count(), "Positions Accessor", TypeEnum.VEC3); - accessors.Add(accessor); geometryData.Writer.Write(morphTarget.Positions.ToArray()); - morphTargetAttributes.Add("POSITION", accessors.Count() - 1); + morphTargetAttributes.Add("POSITION", accessors.Count()); + accessors.Add(accessor); } } if (morphTarget.Normals != null && morphTarget.Normals.Any()) @@ -603,15 +615,15 @@ private IEnumerable> GetMeshPrimitiveMorphTargets(MeshPr var byteOffset = (int)geometryData.Writer.BaseStream.Position; var bufferView = CreateBufferView(bufferIndex, "Normals", byteLength, byteOffset, null); + int bufferviewIndex = bufferViews.Count; bufferViews.Add(bufferView); - int bufferviewIndex = bufferViews.Count() - 1; // Create an accessor for the bufferView var accessor = CreateAccessor(bufferviewIndex, 0, ComponentTypeEnum.FLOAT, morphTarget.Normals.Count(), "Normals Accessor", TypeEnum.VEC3); - accessors.Add(accessor); geometryData.Writer.Write(morphTarget.Normals.ToArray()); - morphTargetAttributes.Add("NORMAL", accessors.Count() - 1); + morphTargetAttributes.Add("NORMAL", accessors.Count()); + accessors.Add(accessor); } if (morphTarget.Tangents != null && morphTarget.Tangents.Any()) { @@ -620,15 +632,15 @@ private IEnumerable> GetMeshPrimitiveMorphTargets(MeshPr var byteOffset = (int)geometryData.Writer.BaseStream.Position; var bufferView = CreateBufferView(bufferIndex, "Tangents", byteLength, byteOffset, null); + int bufferviewIndex = bufferViews.Count; bufferViews.Add(bufferView); - int bufferviewIndex = bufferViews.Count() - 1; // Create an accessor for the bufferView var accessor = CreateAccessor(bufferviewIndex, 0, ComponentTypeEnum.FLOAT, morphTarget.Tangents.Count(), "Tangents Accessor", TypeEnum.VEC3); - accessors.Add(accessor); geometryData.Writer.Write(morphTarget.Tangents.ToArray()); - morphTargetAttributes.Add("TANGENT", accessors.Count() - 1); + morphTargetAttributes.Add("TANGENT", accessors.Count); + accessors.Add(accessor); } morphTargetDicts.Add(new Dictionary(morphTargetAttributes)); weights.Add(meshPrimitive.MorphTargetWeight); @@ -706,13 +718,10 @@ private Loader.Material ConvertMaterialToSchema(Material runtimeMaterial, GLTF g if (runtimeMaterial.MetallicRoughnessMaterial.BaseColorTexture != null) { - TextureIndices baseColorIndices = AddTexture(runtimeMaterial.MetallicRoughnessMaterial.BaseColorTexture); + TextureInfo baseColorIndices = AddTexture(runtimeMaterial.MetallicRoughnessMaterial.BaseColorTexture); schemaMaterial.PbrMetallicRoughness.BaseColorTexture = CreateInstance(); - if (baseColorIndices.ImageIndex.HasValue) - { - schemaMaterial.PbrMetallicRoughness.BaseColorTexture.Index = baseColorIndices.ImageIndex.Value; - } + schemaMaterial.PbrMetallicRoughness.BaseColorTexture.Index = baseColorIndices.Index; if (baseColorIndices.TextureCoordIndex.HasValue) { schemaMaterial.PbrMetallicRoughness.BaseColorTexture.TexCoord = baseColorIndices.TextureCoordIndex.Value; @@ -720,13 +729,10 @@ private Loader.Material ConvertMaterialToSchema(Material runtimeMaterial, GLTF g } if (runtimeMaterial.MetallicRoughnessMaterial.MetallicRoughnessTexture != null) { - TextureIndices metallicRoughnessIndices = AddTexture(runtimeMaterial.MetallicRoughnessMaterial.MetallicRoughnessTexture); + TextureInfo metallicRoughnessIndices = AddTexture(runtimeMaterial.MetallicRoughnessMaterial.MetallicRoughnessTexture); schemaMaterial.PbrMetallicRoughness.MetallicRoughnessTexture = CreateInstance(); - if (metallicRoughnessIndices.ImageIndex.HasValue) - { - schemaMaterial.PbrMetallicRoughness.MetallicRoughnessTexture.Index = metallicRoughnessIndices.ImageIndex.Value; - } + schemaMaterial.PbrMetallicRoughness.MetallicRoughnessTexture.Index = metallicRoughnessIndices.Index; if (metallicRoughnessIndices.TextureCoordIndex.HasValue) { schemaMaterial.PbrMetallicRoughness.MetallicRoughnessTexture.TexCoord = metallicRoughnessIndices.TextureCoordIndex.Value; @@ -752,14 +758,9 @@ private Loader.Material ConvertMaterialToSchema(Material runtimeMaterial, GLTF g } if (runtimeMaterial.NormalTexture != null) { - TextureIndices normalIndices = AddTexture(runtimeMaterial.NormalTexture); + TextureInfo normalIndices = AddTexture(runtimeMaterial.NormalTexture); schemaMaterial.NormalTexture = CreateInstance(); - - if (normalIndices.ImageIndex.HasValue) - { - schemaMaterial.NormalTexture.Index = normalIndices.ImageIndex.Value; - - } + schemaMaterial.NormalTexture.Index = normalIndices.Index; if (normalIndices.TextureCoordIndex.HasValue) { schemaMaterial.NormalTexture.TexCoord = normalIndices.TextureCoordIndex.Value; @@ -771,12 +772,9 @@ private Loader.Material ConvertMaterialToSchema(Material runtimeMaterial, GLTF g } if (runtimeMaterial.OcclusionTexture != null) { - TextureIndices occlusionIndices = AddTexture(runtimeMaterial.OcclusionTexture); + TextureInfo occlusionIndices = AddTexture(runtimeMaterial.OcclusionTexture); schemaMaterial.OcclusionTexture = CreateInstance(); - if (occlusionIndices.ImageIndex.HasValue) - { - schemaMaterial.OcclusionTexture.Index = occlusionIndices.ImageIndex.Value; - } + schemaMaterial.OcclusionTexture.Index = occlusionIndices.Index; if (occlusionIndices.TextureCoordIndex.HasValue) { schemaMaterial.OcclusionTexture.TexCoord = occlusionIndices.TextureCoordIndex.Value; @@ -788,12 +786,9 @@ private Loader.Material ConvertMaterialToSchema(Material runtimeMaterial, GLTF g } if (runtimeMaterial.EmissiveTexture != null) { - TextureIndices emissiveIndices = AddTexture(runtimeMaterial.EmissiveTexture); + TextureInfo emissiveIndices = AddTexture(runtimeMaterial.EmissiveTexture); schemaMaterial.EmissiveTexture = CreateInstance(); - if (emissiveIndices.ImageIndex.HasValue) - { - schemaMaterial.EmissiveTexture.Index = emissiveIndices.ImageIndex.Value; - } + schemaMaterial.EmissiveTexture.Index = emissiveIndices.Index; if (emissiveIndices.TextureCoordIndex.HasValue) { schemaMaterial.EmissiveTexture.TexCoord = emissiveIndices.TextureCoordIndex.Value; @@ -868,12 +863,9 @@ private Loader.MaterialPbrSpecularGlossiness ConvertPbrSpecularGlossinessExtensi } if (specGloss.DiffuseTexture != null) { - TextureIndices textureIndices = AddTexture(specGloss.DiffuseTexture); + TextureInfo textureIndices = AddTexture(specGloss.DiffuseTexture); materialPbrSpecularGlossiness.DiffuseTexture = CreateInstance(); - if (textureIndices.ImageIndex.HasValue) - { - materialPbrSpecularGlossiness.DiffuseTexture.Index = textureIndices.ImageIndex.Value; - } + materialPbrSpecularGlossiness.DiffuseTexture.Index = textureIndices.Index; if (textureIndices.TextureCoordIndex.HasValue) { materialPbrSpecularGlossiness.DiffuseTexture.TexCoord = textureIndices.TextureCoordIndex.Value; @@ -889,12 +881,9 @@ private Loader.MaterialPbrSpecularGlossiness ConvertPbrSpecularGlossinessExtensi } if (specGloss.SpecularGlossinessTexture != null) { - TextureIndices textureIndices = AddTexture(specGloss.SpecularGlossinessTexture); + TextureInfo textureIndices = AddTexture(specGloss.SpecularGlossinessTexture); materialPbrSpecularGlossiness.SpecularGlossinessTexture = CreateInstance(); - if (textureIndices.ImageIndex.HasValue) - { - materialPbrSpecularGlossiness.SpecularGlossinessTexture.Index = textureIndices.ImageIndex.Value; - } + materialPbrSpecularGlossiness.SpecularGlossinessTexture.Index = textureIndices.Index; if (textureIndices.TextureCoordIndex.HasValue) { materialPbrSpecularGlossiness.SpecularGlossinessTexture.TexCoord = textureIndices.TextureCoordIndex.Value; @@ -921,12 +910,9 @@ private Loader.FAKE_materials_quantumRendering ConvertExtQuantumRenderingToSchem } if (quantumRendering.CopenhagenTexture != null) { - TextureIndices textureIndices = AddTexture(quantumRendering.CopenhagenTexture); + TextureInfo textureIndices = AddTexture(quantumRendering.CopenhagenTexture); materialEXT_QuantumRendering.CopenhagenTexture = CreateInstance(); - if (textureIndices.ImageIndex.HasValue) - { - materialEXT_QuantumRendering.CopenhagenTexture.Index = textureIndices.ImageIndex.Value; - } + materialEXT_QuantumRendering.CopenhagenTexture.Index = textureIndices.Index; if (textureIndices.TextureCoordIndex.HasValue) { materialEXT_QuantumRendering.CopenhagenTexture.TexCoord = textureIndices.TextureCoordIndex.Value; @@ -942,12 +928,9 @@ private Loader.FAKE_materials_quantumRendering ConvertExtQuantumRenderingToSchem } if (quantumRendering.SuperpositionCollapseTexture != null) { - TextureIndices textureIndices = AddTexture(quantumRendering.SuperpositionCollapseTexture); + TextureInfo textureIndices = AddTexture(quantumRendering.SuperpositionCollapseTexture); materialEXT_QuantumRendering.SuperpositionCollapseTexture = CreateInstance(); - if (textureIndices.ImageIndex.HasValue) - { - materialEXT_QuantumRendering.SuperpositionCollapseTexture.Index = textureIndices.ImageIndex.Value; - } + materialEXT_QuantumRendering.SuperpositionCollapseTexture.Index = textureIndices.Index; if (textureIndices.TextureCoordIndex.HasValue) { materialEXT_QuantumRendering.SuperpositionCollapseTexture.TexCoord = textureIndices.TextureCoordIndex.Value; @@ -973,8 +956,8 @@ private Dictionary InterleaveMeshPrimitiveAttributes(MeshPrimitive // Create bufferview var bufferView = CreateBufferView(bufferIndex, "Interleaved attributes", 1, 0, null); + int bufferviewIndex = bufferViews.Count; bufferViews.Add(bufferView); - int bufferviewIndex = bufferViews.Count() - 1; var byteOffset = 0; @@ -986,24 +969,24 @@ private Dictionary InterleaveMeshPrimitiveAttributes(MeshPrimitive var min = new[] { minMaxPositions[0].X, minMaxPositions[0].Y, minMaxPositions[0].Z }; var max = new[] { minMaxPositions[1].X, minMaxPositions[1].Y, minMaxPositions[1].Z }; var positionAccessor = CreateAccessor(bufferviewIndex, byteOffset, ComponentTypeEnum.FLOAT, meshPrimitive.Positions.Count(), "Position Accessor", TypeEnum.VEC3, null, max, min); + attributes.Add("POSITION", accessors.Count); accessors.Add(positionAccessor); - attributes.Add("POSITION", accessors.Count() - 1); availableAttributes.Add(AttributeEnum.POSITION); byteOffset += sizeof(float) * 3; } if (meshPrimitive.Normals != null && meshPrimitive.Normals.Any()) { var normalAccessor = CreateAccessor(bufferviewIndex, byteOffset, ComponentTypeEnum.FLOAT, meshPrimitive.Normals.Count(), "Normal Accessor", TypeEnum.VEC3); + attributes.Add("NORMAL", accessors.Count); accessors.Add(normalAccessor); - attributes.Add("NORMAL", accessors.Count() - 1); availableAttributes.Add(AttributeEnum.NORMAL); byteOffset += sizeof(float) * 3; } if (meshPrimitive.Tangents != null && meshPrimitive.Tangents.Any()) { var tangentAccessor = CreateAccessor(bufferviewIndex, byteOffset, ComponentTypeEnum.FLOAT, meshPrimitive.Tangents.Count(), "Tangent Accessor", TypeEnum.VEC4); + attributes.Add("TANGENT", accessors.Count); accessors.Add(tangentAccessor); - attributes.Add("TANGENT", accessors.Count() - 1); availableAttributes.Add(AttributeEnum.TANGENT); byteOffset += sizeof(float) * 4; } @@ -1050,8 +1033,8 @@ private Dictionary InterleaveMeshPrimitiveAttributes(MeshPrimitive var totalByteLength = (int)geometryData.Writer.BaseStream.Position; offset = GetPaddedSize(offset, 4); var colorAccessor = CreateAccessor(bufferviewIndex, byteOffset, colorAccessorComponentType, meshPrimitive.Colors.Count(), "Color Accessor", vectorType, normalized); + attributes.Add("COLOR_0", accessors.Count); accessors.Add(colorAccessor); - attributes.Add("COLOR_0", accessors.Count() - 1); availableAttributes.Add(AttributeEnum.COLOR); byteOffset += offset; } @@ -1083,8 +1066,8 @@ private Dictionary InterleaveMeshPrimitiveAttributes(MeshPrimitive throw new NotImplementedException($"Accessor component type {meshPrimitive.TextureCoordsComponentType} not supported!"); } var textureCoordAccessor = CreateAccessor(bufferviewIndex, byteOffset, accessorComponentType, textureCoordSet.Count(), $"Texture Coord {textureCoordSetIndex}", TypeEnum.VEC2, normalized); + attributes.Add($"TEXCOORD_{textureCoordSetIndex}", accessors.Count); accessors.Add(textureCoordAccessor); - attributes.Add($"TEXCOORD_{textureCoordSetIndex}", accessors.Count() - 1); availableAttributes.Add(textureCoordSetIndex == 0 ? AttributeEnum.TEXCOORDS_0 : AttributeEnum.TEXCOORDS_1); offset = GetPaddedSize(offset, 4); byteOffset += offset; @@ -1233,12 +1216,7 @@ private int WriteColors(MeshPrimitive meshPrimitive, int min, int max, Data geom /// private Loader.Animation ConvertAnimationToSchema(Animation runtimeAnimation, Loader.Buffer buffer, GLTF gltf, Data geometryData, int bufferIndex) { - if (animationToSchemaCache.TryGetValue(runtimeAnimation, out Loader.Animation schemaAnimation)) - { - return schemaAnimation; - } - - schemaAnimation = CreateInstance(); + var schemaAnimation = CreateInstance(); var animationChannels = new List(); var animationSamplers = new List(); @@ -1252,8 +1230,6 @@ private Loader.Animation ConvertAnimationToSchema(Animation runtimeAnimation, Lo sceneIndex = gltf.Scene.Value; } - AnimationSampler runtimeSampler = runtimeAnimationChannel.Sampler; - // Create Animation Channel. animationChannel.Target = new Loader.AnimationChannelTarget(); @@ -1279,194 +1255,207 @@ private Loader.Animation ConvertAnimationToSchema(Animation runtimeAnimation, Lo default: throw new NotSupportedException($"Animation target path {runtimeAnimationChannel.Target.Path} not supported!"); } + animationChannels.Add(animationChannel); - var inputByteOffset = (int)geometryData.Writer.BaseStream.Position; - - geometryData.Writer.Write(runtimeSampler.InputKeys); - - // Write Input Key frames - var inputByteLength = (int)geometryData.Writer.BaseStream.Position - inputByteOffset; - var inputBufferView = CreateBufferView(bufferIndex, "Animation Sampler Input", inputByteLength, inputByteOffset, null); - bufferViews.Add(inputBufferView); - - var min = new[] { runtimeSampler.InputKeys.Min() }; - var max = new[] { runtimeSampler.InputKeys.Max() }; - var inputAccessor = CreateAccessor(bufferViews.Count - 1, 0, ComponentTypeEnum.FLOAT, runtimeSampler.InputKeys.Count(), "Animation Sampler Input", TypeEnum.SCALAR, null, max, min); - accessors.Add(inputAccessor); - - int inputAccessorIndex = accessors.Count - 1; - - // Write the output key frame data - var outputByteOffset = (int)geometryData.Writer.BaseStream.Position; - - Type runtimeSamplerType = runtimeSampler.GetType(); - Type runtimeSamplerGenericTypeDefinition = runtimeSamplerType.GetGenericTypeDefinition(); - Type runtimeSamplerGenericTypeArgument = runtimeSamplerType.GenericTypeArguments[0]; - - TypeEnum outputAccessorType; - if (runtimeSamplerGenericTypeArgument == typeof(Vector3)) + if (animationSamplerToIndexCache.TryGetValue(runtimeAnimationChannel.Sampler, out int animationSamplerIndex)) { - outputAccessorType = TypeEnum.VEC3; - } - else if (runtimeSamplerGenericTypeArgument == typeof(Quaternion)) - { - outputAccessorType = TypeEnum.VEC4; + animationChannel.Sampler = animationSamplerIndex; } else { - throw new ArgumentException("Unsupported animation accessor type!"); - } - - // We need to align if the texture coord accessor type is not float. - bool normalized = runtimeSampler.OutputComponentType != AnimationSampler.ComponentTypeEnum.FLOAT; - ComponentTypeEnum accessorComponentType; - Action writeKeys; - switch (runtimeSampler.OutputComponentType) - { - case AnimationSampler.ComponentTypeEnum.FLOAT: - accessorComponentType = ComponentTypeEnum.FLOAT; - writeKeys = value => geometryData.Writer.Write(value); - break; - case AnimationSampler.ComponentTypeEnum.NORMALIZED_BYTE: - accessorComponentType = ComponentTypeEnum.BYTE; - writeKeys = value => geometryData.Writer.Write(Convert.ToSByte(Math.Round(value * sbyte.MaxValue))); - break; - case AnimationSampler.ComponentTypeEnum.NORMALIZED_UNSIGNED_BYTE: - // Unsigned is valid per the spec, but won't work except with positive rotation values. - accessorComponentType = ComponentTypeEnum.UNSIGNED_BYTE; - writeKeys = value => geometryData.Writer.Write(Convert.ToByte(Math.Round(value * byte.MaxValue))); - break; - case AnimationSampler.ComponentTypeEnum.NORMALIZED_SHORT: - accessorComponentType = ComponentTypeEnum.SHORT; - writeKeys = value => geometryData.Writer.Write(Convert.ToInt16(Math.Round(value * Int16.MaxValue))); - break; - case AnimationSampler.ComponentTypeEnum.NORMALIZED_UNSIGNED_SHORT: - // Unsigned is valid per the spec, but won't work except with positive rotation values. - accessorComponentType = ComponentTypeEnum.UNSIGNED_SHORT; - writeKeys = value => geometryData.Writer.Write(Convert.ToUInt16(Math.Round(value * UInt16.MaxValue))); - break; - default: // Default to Float - throw new ArgumentException("Unsupported accessor component type!"); - } - - Loader.AnimationSampler.InterpolationEnum samplerInterpolation; - if (runtimeSamplerGenericTypeDefinition == typeof(StepAnimationSampler<>)) - { - samplerInterpolation = Loader.AnimationSampler.InterpolationEnum.STEP; + // Create Animation Channel Sampler. + AnimationSampler runtimeSampler = runtimeAnimationChannel.Sampler; + var animationSampler = new Loader.AnimationSampler(); - if (runtimeSamplerGenericTypeArgument == typeof(Vector3)) - { - var specificRuntimeSampler = (StepAnimationSampler)runtimeSampler; - geometryData.Writer.Write(specificRuntimeSampler.OutputKeys); - } - else if (runtimeSamplerGenericTypeArgument == typeof(Quaternion)) + if (enumerableToIndexCache.TryGetValue(runtimeSampler.InputKeys, out int animationSamplerInputIndex)) { - var specificRuntimeSampler = (StepAnimationSampler)runtimeSampler; - geometryData.Writer.Write(specificRuntimeSampler.OutputKeys); + animationSampler.Input = animationSamplerInputIndex; } else { - throw new ArgumentException("Unsupported animation sampler component type!"); + // Write Input Key frames + var min = new[] { runtimeSampler.InputKeys.Min() }; + var max = new[] { runtimeSampler.InputKeys.Max() }; + var inputAccessor = CreateAccessor(bufferViews.Count, 0, ComponentTypeEnum.FLOAT, runtimeSampler.InputKeys.Count(), "Animation Sampler Input", TypeEnum.SCALAR, null, max, min); + + var inputByteOffset = (int)geometryData.Writer.BaseStream.Position; + geometryData.Writer.Write(runtimeSampler.InputKeys); + var inputByteLength = (int)geometryData.Writer.BaseStream.Position - inputByteOffset; + var inputBufferView = CreateBufferView(bufferIndex, "Animation Sampler Input", inputByteLength, inputByteOffset, null); + bufferViews.Add(inputBufferView); + + animationSampler.Input = accessors.Count; + accessors.Add(inputAccessor); + enumerableToIndexCache.Add(runtimeSampler.InputKeys, animationSampler.Input); } - } - else if (runtimeSamplerGenericTypeDefinition == typeof(LinearAnimationSampler<>)) - { - samplerInterpolation = Loader.AnimationSampler.InterpolationEnum.LINEAR; - if (runtimeSamplerGenericTypeArgument == typeof(Vector3)) + if (enumerableToIndexCache.TryGetValue(runtimeSampler.OutputKeys, out int animationSamplerOutputIndex)) { - var specificRuntimeSampler = (LinearAnimationSampler)runtimeSampler; - foreach (var value in specificRuntimeSampler.OutputKeys) - { - writeKeys(value.X); - writeKeys(value.Y); - writeKeys(value.Z); - } + animationSampler.Output = animationSamplerOutputIndex; } - else if (runtimeSamplerGenericTypeArgument == typeof(Quaternion)) + else { - var specificRuntimeSampler = (LinearAnimationSampler)runtimeSampler; - foreach (var value in specificRuntimeSampler.OutputKeys) + // Write the output key frame data + var outputByteOffset = (int)geometryData.Writer.BaseStream.Position; + + Type runtimeSamplerType = runtimeSampler.GetType(); + Type runtimeSamplerGenericTypeDefinition = runtimeSamplerType.GetGenericTypeDefinition(); + Type runtimeSamplerGenericTypeArgument = runtimeSamplerType.GenericTypeArguments[0]; + + TypeEnum outputAccessorType; + if (runtimeSamplerGenericTypeArgument == typeof(Vector3)) { - writeKeys(value.X); - writeKeys(value.Y); - writeKeys(value.Z); - writeKeys(value.W); + outputAccessorType = TypeEnum.VEC3; + } + else if (runtimeSamplerGenericTypeArgument == typeof(Quaternion)) + { + outputAccessorType = TypeEnum.VEC4; + } + else + { + throw new ArgumentException("Unsupported animation accessor type!"); } - } - else - { - throw new ArgumentException("Unsupported animation sampler type!"); - } - } - else if (runtimeSamplerGenericTypeDefinition == typeof(CubicSplineAnimationSampler<>)) - { - samplerInterpolation = Loader.AnimationSampler.InterpolationEnum.CUBICSPLINE; - if (runtimeSamplerGenericTypeArgument == typeof(Vector3)) - { - var specificRuntimeSampler = (CubicSplineAnimationSampler)runtimeSampler; - specificRuntimeSampler.OutputKeys.ForEach(key => + // We need to align if the texture coord accessor type is not float. + bool normalized = runtimeSampler.OutputComponentType != AnimationSampler.ComponentTypeEnum.FLOAT; + ComponentTypeEnum accessorComponentType; + Action writeKeys; + switch (runtimeSampler.OutputComponentType) { - geometryData.Writer.Write(key.InTangent); - geometryData.Writer.Write(key.Value); - geometryData.Writer.Write(key.OutTangent); - }); - } - else if (runtimeSamplerGenericTypeArgument == typeof(Quaternion)) - { - var specificRuntimeSampler = (CubicSplineAnimationSampler)runtimeSampler; - specificRuntimeSampler.OutputKeys.ForEach(key => + case AnimationSampler.ComponentTypeEnum.FLOAT: + accessorComponentType = ComponentTypeEnum.FLOAT; + writeKeys = value => geometryData.Writer.Write(value); + break; + case AnimationSampler.ComponentTypeEnum.NORMALIZED_BYTE: + accessorComponentType = ComponentTypeEnum.BYTE; + writeKeys = value => geometryData.Writer.Write(Convert.ToSByte(Math.Round(value * sbyte.MaxValue))); + break; + case AnimationSampler.ComponentTypeEnum.NORMALIZED_UNSIGNED_BYTE: + // Unsigned is valid per the spec, but won't work except with positive rotation values. + accessorComponentType = ComponentTypeEnum.UNSIGNED_BYTE; + writeKeys = value => geometryData.Writer.Write(Convert.ToByte(Math.Round(value * byte.MaxValue))); + break; + case AnimationSampler.ComponentTypeEnum.NORMALIZED_SHORT: + accessorComponentType = ComponentTypeEnum.SHORT; + writeKeys = value => geometryData.Writer.Write(Convert.ToInt16(Math.Round(value * Int16.MaxValue))); + break; + case AnimationSampler.ComponentTypeEnum.NORMALIZED_UNSIGNED_SHORT: + // Unsigned is valid per the spec, but won't work except with positive rotation values. + accessorComponentType = ComponentTypeEnum.UNSIGNED_SHORT; + writeKeys = value => geometryData.Writer.Write(Convert.ToUInt16(Math.Round(value * UInt16.MaxValue))); + break; + default: // Default to Float + throw new ArgumentException("Unsupported accessor component type!"); + } + + Loader.AnimationSampler.InterpolationEnum samplerInterpolation; + if (runtimeSamplerGenericTypeDefinition == typeof(StepAnimationSampler<>)) { - geometryData.Writer.Write(key.InTangent); - geometryData.Writer.Write(key.Value); - geometryData.Writer.Write(key.OutTangent); - }); - } - else - { - throw new ArgumentException(); - } - } - else - { - throw new InvalidOperationException(); - } + samplerInterpolation = Loader.AnimationSampler.InterpolationEnum.STEP; - if (normalized) - { - Align(geometryData.Writer); - } + if (runtimeSamplerGenericTypeArgument == typeof(Vector3)) + { + geometryData.Writer.Write(((StepAnimationSampler)runtimeSampler).OutputKeys); + } + else if (runtimeSamplerGenericTypeArgument == typeof(Quaternion)) + { + geometryData.Writer.Write(((StepAnimationSampler)runtimeSampler).OutputKeys); + } + else + { + throw new ArgumentException("Unsupported animation sampler component type!"); + } + } + else if (runtimeSamplerGenericTypeDefinition == typeof(LinearAnimationSampler<>)) + { + samplerInterpolation = Loader.AnimationSampler.InterpolationEnum.LINEAR; + + if (runtimeSamplerGenericTypeArgument == typeof(Vector3)) + { + foreach (var value in ((LinearAnimationSampler)runtimeSampler).OutputKeys) + { + writeKeys(value.X); + writeKeys(value.Y); + writeKeys(value.Z); + } + } + else if (runtimeSamplerGenericTypeArgument == typeof(Quaternion)) + { + foreach (var value in ((LinearAnimationSampler)runtimeSampler).OutputKeys) + { + writeKeys(value.X); + writeKeys(value.Y); + writeKeys(value.Z); + writeKeys(value.W); + } + } + else + { + throw new ArgumentException("Unsupported animation sampler component type!"); + } + } + else if (runtimeSamplerGenericTypeDefinition == typeof(CubicSplineAnimationSampler<>)) + { + samplerInterpolation = Loader.AnimationSampler.InterpolationEnum.CUBICSPLINE; + + if (runtimeSamplerGenericTypeArgument == typeof(Vector3)) + { + ((CubicSplineAnimationSampler)runtimeSampler).OutputKeys.ForEach(key => + { + geometryData.Writer.Write(key.InTangent); + geometryData.Writer.Write(key.Value); + geometryData.Writer.Write(key.OutTangent); + }); + } + else if (runtimeSamplerGenericTypeArgument == typeof(Quaternion)) + { + ((CubicSplineAnimationSampler)runtimeSampler).OutputKeys.ForEach(key => + { + geometryData.Writer.Write(key.InTangent); + geometryData.Writer.Write(key.Value); + geometryData.Writer.Write(key.OutTangent); + }); + } + else + { + throw new ArgumentException("Unsupported animation sampler component type!"); + } + } + else + { + throw new InvalidOperationException(); + } - int outputCount = samplerInterpolation == Loader.AnimationSampler.InterpolationEnum.CUBICSPLINE ? inputAccessor.Count * 3 : inputAccessor.Count; - var outputByteLength = (int)geometryData.Writer.BaseStream.Position - outputByteOffset; - var outputBufferView = CreateBufferView(bufferIndex, "Animation Sampler Output", outputByteLength, outputByteOffset, null); - bufferViews.Add(outputBufferView); + if (normalized) + { + Align(geometryData.Writer); + } - var outputAccessor = CreateAccessor(bufferViews.Count - 1, 0, accessorComponentType, outputCount, "Animation Sampler Output", outputAccessorType, normalized); - accessors.Add(outputAccessor); - var outputAccessorIndex = accessors.Count - 1; + int outputCount = samplerInterpolation == Loader.AnimationSampler.InterpolationEnum.CUBICSPLINE ? runtimeSampler.InputKeys.Count() * 3 : runtimeSampler.InputKeys.Count(); + var outputAccessor = CreateAccessor(bufferViews.Count, 0, accessorComponentType, outputCount, "Animation Sampler Output", outputAccessorType, normalized); + animationSampler.Interpolation = samplerInterpolation; + animationSampler.Output = accessors.Count; + accessors.Add(outputAccessor); - // Create Animation Sampler - var animationSampler = new Loader.AnimationSampler - { - Interpolation = samplerInterpolation, - Input = inputAccessorIndex, - Output = outputAccessorIndex - }; + var outputByteLength = (int)geometryData.Writer.BaseStream.Position - outputByteOffset; + var outputBufferView = CreateBufferView(bufferIndex, "Animation Sampler Output", outputByteLength, outputByteOffset, null); + bufferViews.Add(outputBufferView); - animationChannels.Add(animationChannel); - animationSamplers.Add(animationSampler); + if (runtimeSampler is LinearAnimationSampler) + { + enumerableToIndexCache.Add(runtimeSampler.OutputKeys, animationSampler.Output); + } + } - // This needs to be improved to support instancing. - animationChannel.Sampler = animationSamplers.Count() - 1; + animationChannel.Sampler = animationSamplers.Count; + animationSamplers.Add(animationSampler); + animationSamplerToIndexCache.Add(runtimeAnimationChannel.Sampler, animationChannel.Sampler); + } } schemaAnimation.Channels = animationChannels.ToArray(); schemaAnimation.Samplers = animationSamplers.ToArray(); - animationToSchemaCache.Add(runtimeAnimation, schemaAnimation); - return schemaAnimation; } @@ -1489,148 +1478,188 @@ private Loader.MeshPrimitive ConvertMeshPrimitiveToSchema(Node runtimeNode, Mesh { if (runtimeMeshPrimitive.Positions != null) { - // Get the max and min values - var minMaxPositions = GetMinMaxPositions(runtimeMeshPrimitive); - float[] min = { minMaxPositions[0].X, minMaxPositions[0].Y, minMaxPositions[0].Z }; - float[] max = { minMaxPositions[1].X, minMaxPositions[1].Y, minMaxPositions[1].Z }; + if (enumerableToIndexCache.TryGetValue(runtimeMeshPrimitive.Positions, out int positionAccessorIndex)) + { + attributes.Add("POSITION", positionAccessorIndex); + } + else + { + // Get the max and min values + var minMaxPositions = GetMinMaxPositions(runtimeMeshPrimitive); + float[] min = { minMaxPositions[0].X, minMaxPositions[0].Y, minMaxPositions[0].Z }; + float[] max = { minMaxPositions[1].X, minMaxPositions[1].Y, minMaxPositions[1].Z }; - // Create BufferView for the position - Align(geometryData.Writer); - int byteLength = sizeof(float) * 3 * runtimeMeshPrimitive.Positions.Count(); - var byteOffset = (int)geometryData.Writer.BaseStream.Position; - var bufferView = CreateBufferView(bufferIndex, "Positions", byteLength, byteOffset, null); - bufferViews.Add(bufferView); - var bufferViewIndex = bufferViews.Count() - 1; + // Create BufferView for the position + Align(geometryData.Writer); + int byteLength = sizeof(float) * 3 * runtimeMeshPrimitive.Positions.Count(); + var byteOffset = (int)geometryData.Writer.BaseStream.Position; + var bufferView = CreateBufferView(bufferIndex, "Positions", byteLength, byteOffset, null); + var bufferViewIndex = bufferViews.Count; + bufferViews.Add(bufferView); - // Create an accessor for the bufferView - var accessor = CreateAccessor(bufferViewIndex, 0, ComponentTypeEnum.FLOAT, runtimeMeshPrimitive.Positions.Count(), "Positions Accessor", TypeEnum.VEC3, null, max, min); - accessors.Add(accessor); - geometryData.Writer.Write(runtimeMeshPrimitive.Positions.ToArray()); - attributes.Add("POSITION", accessors.Count() - 1); + // Create an accessor for the bufferView + var accessor = CreateAccessor(bufferViewIndex, 0, ComponentTypeEnum.FLOAT, runtimeMeshPrimitive.Positions.Count(), "Positions Accessor", TypeEnum.VEC3, null, max, min); + geometryData.Writer.Write(runtimeMeshPrimitive.Positions.ToArray()); + attributes.Add("POSITION", accessors.Count); + enumerableToIndexCache.Add(runtimeMeshPrimitive.Positions, accessors.Count); + accessors.Add(accessor); + } } if (runtimeMeshPrimitive.Normals != null) { - // Create BufferView - Align(geometryData.Writer); - int byteLength = sizeof(float) * 3 * runtimeMeshPrimitive.Normals.Count(); - var byteOffset = (int)geometryData.Writer.BaseStream.Position; - var bufferView = CreateBufferView(bufferIndex, "Normals", byteLength, byteOffset, null); - bufferViews.Add(bufferView); - var bufferViewIndex = bufferViews.Count() - 1; + if (enumerableToIndexCache.TryGetValue(runtimeMeshPrimitive.Normals, out int normalAccessorIndex)) + { + attributes.Add("NORMAL", normalAccessorIndex); + } + else + { + // Write to Buffer and create BufferView + Align(geometryData.Writer); + int byteLength = sizeof(float) * 3 * runtimeMeshPrimitive.Normals.Count(); + var byteOffset = (int)geometryData.Writer.BaseStream.Position; + var bufferView = CreateBufferView(bufferIndex, "Normals", byteLength, byteOffset, null); + int bufferViewIndex = bufferViews.Count; + bufferViews.Add(bufferView); - // Create an accessor for the bufferView - var accessor = CreateAccessor(bufferViewIndex, 0, ComponentTypeEnum.FLOAT, runtimeMeshPrimitive.Normals.Count(), "Normals Accessor", TypeEnum.VEC3); - accessors.Add(accessor); - geometryData.Writer.Write(runtimeMeshPrimitive.Normals.ToArray()); - attributes.Add("NORMAL", accessors.Count() - 1); + // Create an accessor for the bufferView + var accessor = CreateAccessor(bufferViewIndex, 0, ComponentTypeEnum.FLOAT, runtimeMeshPrimitive.Normals.Count(), "Normals Accessor", TypeEnum.VEC3); + geometryData.Writer.Write(runtimeMeshPrimitive.Normals.ToArray()); + attributes.Add("NORMAL", accessors.Count); + enumerableToIndexCache.Add(runtimeMeshPrimitive.Normals, accessors.Count); + accessors.Add(accessor); + } } if (runtimeMeshPrimitive.Tangents != null && runtimeMeshPrimitive.Tangents.Any()) { - // Create BufferView - Align(geometryData.Writer); - int byteLength = sizeof(float) * 4 * runtimeMeshPrimitive.Tangents.Count(); - var byteOffset = (int)geometryData.Writer.BaseStream.Position; - var bufferView = CreateBufferView(bufferIndex, "Tangents", byteLength, byteOffset, null); - bufferViews.Add(bufferView); - var bufferViewIndex = bufferViews.Count() - 1; - - // Create an accessor for the bufferView - var accessor = CreateAccessor(bufferViewIndex, 0, ComponentTypeEnum.FLOAT, runtimeMeshPrimitive.Tangents.Count(), "Tangents Accessor", TypeEnum.VEC4); - accessors.Add(accessor); - geometryData.Writer.Write(runtimeMeshPrimitive.Tangents.ToArray()); - attributes.Add("TANGENT", accessors.Count() - 1); - } - if (runtimeMeshPrimitive.Colors != null) - { - var colorAccessorComponentType = ComponentTypeEnum.FLOAT; - var colorAccessorType = runtimeMeshPrimitive.ColorType == MeshPrimitive.ColorTypeEnum.VEC3 ? TypeEnum.VEC3 : TypeEnum.VEC4; - int vectorSize = runtimeMeshPrimitive.ColorType == MeshPrimitive.ColorTypeEnum.VEC3 ? 3 : 4; - - // Create BufferView - var byteOffset = (int)geometryData.Writer.BaseStream.Position; - - int byteLength = WriteColors(runtimeMeshPrimitive, 0, runtimeMeshPrimitive.Colors.Count() - 1, geometryData); - int? byteStride = null; - switch (runtimeMeshPrimitive.ColorComponentType) + if (enumerableToIndexCache.TryGetValue(runtimeMeshPrimitive.Tangents, out int tangentAccessorIndex)) { - case MeshPrimitive.ColorComponentTypeEnum.NORMALIZED_UBYTE: - colorAccessorComponentType = ComponentTypeEnum.UNSIGNED_BYTE; - if (vectorSize == 3) - { - byteStride = 4; - } - break; - case MeshPrimitive.ColorComponentTypeEnum.NORMALIZED_USHORT: - colorAccessorComponentType = ComponentTypeEnum.UNSIGNED_SHORT; - if (vectorSize == 3) - { - byteStride = 8; - } - break; - default: // Default to ColorComponentTypeEnum.FLOAT: - colorAccessorComponentType = ComponentTypeEnum.FLOAT; - break; + attributes.Add("TANGENT", tangentAccessorIndex); } - - var bufferView = CreateBufferView(bufferIndex, "Colors", byteLength, byteOffset, byteStride); - bufferViews.Add(bufferView); - var bufferviewIndex = bufferViews.Count() - 1; - - // Create an accessor for the bufferView - // We normalize if the color accessor mode is not set to FLOAT. - bool normalized = runtimeMeshPrimitive.ColorComponentType != MeshPrimitive.ColorComponentTypeEnum.FLOAT; - var accessor = CreateAccessor(bufferviewIndex, 0, colorAccessorComponentType, runtimeMeshPrimitive.Colors.Count(), "Colors Accessor", colorAccessorType, normalized); - accessors.Add(accessor); - attributes.Add("COLOR_0", accessors.Count() - 1); - if (normalized) + else { + // Create BufferView Align(geometryData.Writer); + int byteLength = sizeof(float) * 4 * runtimeMeshPrimitive.Tangents.Count(); + var byteOffset = (int)geometryData.Writer.BaseStream.Position; + var bufferView = CreateBufferView(bufferIndex, "Tangents", byteLength, byteOffset, null); + var bufferViewIndex = bufferViews.Count; + bufferViews.Add(bufferView); + + // Create an accessor for the bufferView + var accessor = CreateAccessor(bufferViewIndex, 0, ComponentTypeEnum.FLOAT, runtimeMeshPrimitive.Tangents.Count(), "Tangents Accessor", TypeEnum.VEC4); + geometryData.Writer.Write(runtimeMeshPrimitive.Tangents.ToArray()); + attributes.Add("TANGENT", accessors.Count); + enumerableToIndexCache.Add(runtimeMeshPrimitive.Tangents, accessors.Count); + accessors.Add(accessor); } } - if (runtimeMeshPrimitive.TextureCoordSets != null) + if (runtimeMeshPrimitive.Colors != null) { - var i = 0; - foreach (var textureCoordSet in runtimeMeshPrimitive.TextureCoordSets) + if (enumerableToIndexCache.TryGetValue(runtimeMeshPrimitive.Colors, out int colorsAccessorIndex)) + { + attributes.Add("COLOR_0", colorsAccessorIndex); + } + else { + var colorAccessorComponentType = ComponentTypeEnum.FLOAT; + var colorAccessorType = runtimeMeshPrimitive.ColorType == MeshPrimitive.ColorTypeEnum.VEC3 ? TypeEnum.VEC3 : TypeEnum.VEC4; + int vectorSize = runtimeMeshPrimitive.ColorType == MeshPrimitive.ColorTypeEnum.VEC3 ? 3 : 4; + + // Create BufferView var byteOffset = (int)geometryData.Writer.BaseStream.Position; - int byteLength = WriteTextureCoords(runtimeMeshPrimitive, textureCoordSet, 0, runtimeMeshPrimitive.TextureCoordSets.ElementAt(i).Count() - 1, geometryData); - Loader.Accessor accessor; - ComponentTypeEnum accessorComponentType; - // We normalize only if the texture coord accessor type is not float. - bool normalized = runtimeMeshPrimitive.TextureCoordsComponentType != MeshPrimitive.TextureCoordsComponentTypeEnum.FLOAT; + int byteLength = WriteColors(runtimeMeshPrimitive, 0, runtimeMeshPrimitive.Colors.Count() - 1, geometryData); int? byteStride = null; - switch (runtimeMeshPrimitive.TextureCoordsComponentType) + switch (runtimeMeshPrimitive.ColorComponentType) { - case MeshPrimitive.TextureCoordsComponentTypeEnum.FLOAT: - accessorComponentType = ComponentTypeEnum.FLOAT; + case MeshPrimitive.ColorComponentTypeEnum.NORMALIZED_UBYTE: + colorAccessorComponentType = ComponentTypeEnum.UNSIGNED_BYTE; + if (vectorSize == 3) + { + byteStride = 4; + } break; - case MeshPrimitive.TextureCoordsComponentTypeEnum.NORMALIZED_UBYTE: - accessorComponentType = ComponentTypeEnum.UNSIGNED_BYTE; - byteStride = 4; + case MeshPrimitive.ColorComponentTypeEnum.NORMALIZED_USHORT: + colorAccessorComponentType = ComponentTypeEnum.UNSIGNED_SHORT; + if (vectorSize == 3) + { + byteStride = 8; + } break; - case MeshPrimitive.TextureCoordsComponentTypeEnum.NORMALIZED_USHORT: - accessorComponentType = ComponentTypeEnum.UNSIGNED_SHORT; - break; - default: // Default to Float - accessorComponentType = ComponentTypeEnum.FLOAT; + default: // Default to ColorComponentTypeEnum.FLOAT: + colorAccessorComponentType = ComponentTypeEnum.FLOAT; break; } - var bufferView = CreateBufferView(bufferIndex, $"Texture Coords {i}", byteLength, byteOffset, byteStride); + var bufferView = CreateBufferView(bufferIndex, "Colors", byteLength, byteOffset, byteStride); + var bufferviewIndex = bufferViews.Count; bufferViews.Add(bufferView); - var bufferviewIndex = bufferViews.Count() - 1; - // Create Accessor - accessor = CreateAccessor(bufferviewIndex, 0, accessorComponentType, textureCoordSet.Count(), $"UV Accessor {i}", TypeEnum.VEC2, normalized); + // Create an accessor for the bufferView + // We normalize if the color accessor mode is not set to FLOAT. + bool normalized = runtimeMeshPrimitive.ColorComponentType != MeshPrimitive.ColorComponentTypeEnum.FLOAT; + var accessor = CreateAccessor(bufferviewIndex, 0, colorAccessorComponentType, runtimeMeshPrimitive.Colors.Count(), "Colors Accessor", colorAccessorType, normalized); + attributes.Add("COLOR_0", accessors.Count); + enumerableToIndexCache.Add(runtimeMeshPrimitive.Colors, accessors.Count); accessors.Add(accessor); - - // Add any additional bytes if the data is normalized if (normalized) { Align(geometryData.Writer); } - attributes.Add($"TEXCOORD_{i}", accessors.Count() - 1); + } + } + if (runtimeMeshPrimitive.TextureCoordSets != null) + { + var i = 0; + foreach (var textureCoordSet in runtimeMeshPrimitive.TextureCoordSets) + { + if (enumerableToIndexCache.TryGetValue(textureCoordSet, out int textureCoordsAccessorIndex)) + { + attributes.Add($"TEXCOORD_{i}", textureCoordsAccessorIndex); + } + else + { + var byteOffset = (int)geometryData.Writer.BaseStream.Position; + int byteLength = WriteTextureCoords(runtimeMeshPrimitive, textureCoordSet, 0, runtimeMeshPrimitive.TextureCoordSets.ElementAt(i).Count() - 1, geometryData); + + Loader.Accessor accessor; + ComponentTypeEnum accessorComponentType; + // We normalize only if the texture coord accessor type is not float. + bool normalized = runtimeMeshPrimitive.TextureCoordsComponentType != MeshPrimitive.TextureCoordsComponentTypeEnum.FLOAT; + int? byteStride = null; + switch (runtimeMeshPrimitive.TextureCoordsComponentType) + { + case MeshPrimitive.TextureCoordsComponentTypeEnum.FLOAT: + accessorComponentType = ComponentTypeEnum.FLOAT; + break; + case MeshPrimitive.TextureCoordsComponentTypeEnum.NORMALIZED_UBYTE: + accessorComponentType = ComponentTypeEnum.UNSIGNED_BYTE; + byteStride = 4; + break; + case MeshPrimitive.TextureCoordsComponentTypeEnum.NORMALIZED_USHORT: + accessorComponentType = ComponentTypeEnum.UNSIGNED_SHORT; + break; + default: // Default to Float + accessorComponentType = ComponentTypeEnum.FLOAT; + break; + } + + var bufferView = CreateBufferView(bufferIndex, $"Texture Coords {i}", byteLength, byteOffset, byteStride); + var bufferviewIndex = bufferViews.Count; + bufferViews.Add(bufferView); + + // Create Accessor + attributes.Add($"TEXCOORD_{i}", accessors.Count); + enumerableToIndexCache.Add(textureCoordSet, accessors.Count); + accessor = CreateAccessor(bufferviewIndex, 0, accessorComponentType, textureCoordSet.Count(), $"UV Accessor {i}", TypeEnum.VEC2, normalized); + accessors.Add(accessor); + + // Add any additional bytes if the data is normalized + if (normalized) + { + Align(geometryData.Writer); + } + } ++i; } } @@ -1638,58 +1667,66 @@ private Loader.MeshPrimitive ConvertMeshPrimitiveToSchema(Node runtimeNode, Mesh } if (runtimeMeshPrimitive.Indices != null && runtimeMeshPrimitive.Indices.Any()) { - int byteLength; - var byteOffset = (int)geometryData.Writer.BaseStream.Position; - ComponentTypeEnum indexComponentType; - - switch (runtimeMeshPrimitive.IndexComponentType) + if (enumerableToIndexCache.TryGetValue(runtimeMeshPrimitive.Indices, out int indicesAccessorIndex)) { - case MeshPrimitive.IndexComponentTypeEnum.UNSIGNED_BYTE: - indexComponentType = ComponentTypeEnum.UNSIGNED_BYTE; - byteLength = sizeof(byte) * runtimeMeshPrimitive.Indices.Count(); - break; - case MeshPrimitive.IndexComponentTypeEnum.UNSIGNED_SHORT: - byteLength = sizeof(ushort) * runtimeMeshPrimitive.Indices.Count(); - indexComponentType = ComponentTypeEnum.UNSIGNED_SHORT; - break; - case MeshPrimitive.IndexComponentTypeEnum.UNSIGNED_INT: - byteLength = sizeof(uint) * runtimeMeshPrimitive.Indices.Count(); - indexComponentType = ComponentTypeEnum.UNSIGNED_INT; - break; - default: - throw new InvalidEnumArgumentException($"Unrecognized Index Component Type Enum {runtimeMeshPrimitive.IndexComponentType}"); + schemaMeshPrimitive.Indices = indicesAccessorIndex; } - var bufferView = CreateBufferView(bufferIndex, "Indices", byteLength, byteOffset, null); - bufferViews.Add(bufferView); - var bufferviewIndex = bufferViews.Count() - 1; - - var accessor = CreateAccessor(bufferviewIndex, 0, indexComponentType, runtimeMeshPrimitive.Indices.Count(), "Indices Accessor", TypeEnum.SCALAR); - accessors.Add(accessor); - switch (indexComponentType) + else { - case ComponentTypeEnum.UNSIGNED_INT: - foreach (var index in runtimeMeshPrimitive.Indices) - { - geometryData.Writer.Write(Convert.ToUInt32(index)); - } - break; - case ComponentTypeEnum.UNSIGNED_BYTE: - foreach (var index in runtimeMeshPrimitive.Indices) - { - geometryData.Writer.Write(Convert.ToByte(index)); - } - break; - case ComponentTypeEnum.UNSIGNED_SHORT: - foreach (var index in runtimeMeshPrimitive.Indices) - { - geometryData.Writer.Write(Convert.ToUInt16(index)); - } - break; - default: - throw new InvalidEnumArgumentException("Unsupported Index Component Type"); - } + int byteLength; + var byteOffset = (int)geometryData.Writer.BaseStream.Position; + ComponentTypeEnum indexComponentType; + + switch (runtimeMeshPrimitive.IndexComponentType) + { + case MeshPrimitive.IndexComponentTypeEnum.UNSIGNED_BYTE: + indexComponentType = ComponentTypeEnum.UNSIGNED_BYTE; + byteLength = sizeof(byte) * runtimeMeshPrimitive.Indices.Count(); + break; + case MeshPrimitive.IndexComponentTypeEnum.UNSIGNED_SHORT: + byteLength = sizeof(ushort) * runtimeMeshPrimitive.Indices.Count(); + indexComponentType = ComponentTypeEnum.UNSIGNED_SHORT; + break; + case MeshPrimitive.IndexComponentTypeEnum.UNSIGNED_INT: + byteLength = sizeof(uint) * runtimeMeshPrimitive.Indices.Count(); + indexComponentType = ComponentTypeEnum.UNSIGNED_INT; + break; + default: + throw new InvalidEnumArgumentException($"Unrecognized Index Component Type Enum {runtimeMeshPrimitive.IndexComponentType}"); + } + var bufferView = CreateBufferView(bufferIndex, "Indices", byteLength, byteOffset, null); + var bufferviewIndex = bufferViews.Count; + bufferViews.Add(bufferView); + + var accessor = CreateAccessor(bufferviewIndex, 0, indexComponentType, runtimeMeshPrimitive.Indices.Count(), "Indices Accessor", TypeEnum.SCALAR); + switch (indexComponentType) + { + case ComponentTypeEnum.UNSIGNED_INT: + foreach (var index in runtimeMeshPrimitive.Indices) + { + geometryData.Writer.Write(Convert.ToUInt32(index)); + } + break; + case ComponentTypeEnum.UNSIGNED_BYTE: + foreach (var index in runtimeMeshPrimitive.Indices) + { + geometryData.Writer.Write(Convert.ToByte(index)); + } + break; + case ComponentTypeEnum.UNSIGNED_SHORT: + foreach (var index in runtimeMeshPrimitive.Indices) + { + geometryData.Writer.Write(Convert.ToUInt16(index)); + } + break; + default: + throw new InvalidEnumArgumentException("Unsupported Index Component Type"); + } - schemaMeshPrimitive.Indices = accessors.Count() - 1; + schemaMeshPrimitive.Indices = accessors.Count; + enumerableToIndexCache.Add(runtimeMeshPrimitive.Indices, accessors.Count); + accessors.Add(accessor); + } } var vertexJointWeights = runtimeMeshPrimitive.VertexJointWeights; @@ -1805,11 +1842,21 @@ private Loader.MeshPrimitive ConvertMeshPrimitiveToSchema(Node runtimeNode, Mesh } schemaMeshPrimitive.Attributes = attributes; + if (runtimeMeshPrimitive.Material != null) { var nMaterial = ConvertMaterialToSchema(runtimeMeshPrimitive.Material, gltf); - materials.Add(nMaterial); - schemaMeshPrimitive.Material = materials.Count() - 1; + // If an equivalent material has already been created, re-use that material's index instead of creating a new material. + var findMaterialIndex = materials.IndexOf(nMaterial); + if (findMaterialIndex > -1) + { + schemaMeshPrimitive.Material = findMaterialIndex; + } + else + { + schemaMeshPrimitive.Material = materials.Count; + materials.Add(nMaterial); + } } switch (runtimeMeshPrimitive.Mode) diff --git a/Source/Runtime/MeshPrimitive.cs b/Source/Runtime/MeshPrimitive.cs index ee12a01a..401384cd 100644 --- a/Source/Runtime/MeshPrimitive.cs +++ b/Source/Runtime/MeshPrimitive.cs @@ -91,7 +91,7 @@ public enum IndexComponentTypeEnum { UNSIGNED_INT, UNSIGNED_BYTE, UNSIGNED_SHORT public IEnumerable MorphTargets { get; set; } /// - /// morph target weight (when the mesh primitive is used as a morph target) + /// Morph target weight (when the mesh primitive is used as a morph target) /// public float MorphTargetWeight { get; set; } diff --git a/Source/Runtime/Skin.cs b/Source/Runtime/Skin.cs index fb20a21b..0ad5b3e2 100644 --- a/Source/Runtime/Skin.cs +++ b/Source/Runtime/Skin.cs @@ -1,17 +1,23 @@ using System.Collections.Generic; +using System.Numerics; namespace AssetGenerator.Runtime { internal class Skin { /// - /// Name of the node + /// Name of the node. /// public string Name { get; set; } /// - /// joints in the skin + /// Nodes used as joints in the skin. /// - public IEnumerable SkinJoints = null; + public IEnumerable Joints; + + /// + /// InverseBindMatrices for each joint in the skin. + /// + public IEnumerable InverseBindMatrices; } } diff --git a/Source/Runtime/SkinJoint.cs b/Source/Runtime/SkinJoint.cs deleted file mode 100644 index b39130be..00000000 --- a/Source/Runtime/SkinJoint.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Numerics; - -namespace AssetGenerator.Runtime -{ - internal class SkinJoint - { - public Matrix4x4 InverseBindMatrix; - public Node Node; - - public SkinJoint(Matrix4x4 inverseBindMatrix, Node node) - { - InverseBindMatrix = inverseBindMatrix; - Node = node; - } - } -}