diff --git a/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/README.md b/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/README.md new file mode 100644 index 0000000000..a1763a5ee5 --- /dev/null +++ b/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/README.md @@ -0,0 +1,59 @@ +# EXT\_mesh\_gpu\_instancing + +## Contributors + +* John Cooke, OTOY, +* Don McCurdy +* Arseny Kapoulkine + +## Acknowledgments + +## Status + +Experimental + +## Dependencies + +Written against the glTF 2.0 spec. + +## Overview + +This extension is specfically designed to enable GPU instancing which renders many copies of a single mesh at once using a small number of draw calls. It's useful for things +like trees, grass, road signs, etc. The TRANSLATION, ROTATION, and SCALE attributes allows the mesh to be displayed at many different locations with different rotations and scales. +Custom attributes can use the underscore mechanism to achieve other effects (i.e. _ID, _TRANSFORM4x3, etc.). + +## Extending Nodes with per instance attributes + +Instancing is defined by adding the `EXT_mesh_gpu_instancing` extension to any glTF node that has a mesh. Instancing only applies to mesh nodes, there is no defined behavior for a node +with this extension that doesn't also have a mesh. Applying to nodes rather than meshes allows the same mesh to be used by several nodes, instanced or otherwise. The attributes +section contains accessor ids for the TRANSLATION, ROTATION, and SCALE attribute buffers, all of which are optional. The attributes specify an object space transform that should be +multipled by the node's world transform in the shader to produce the final world transform for the instance. For example, the following defines some instancing attributes to a node with mesh. + +```json +{ + "nodes": [ + { + "mesh": 0, + "name": "teapot", + "extensions": { + "EXT_mesh_gpu_instancing": { + "attributes": { + "TRANSLATION": 0, + "ROTATION": 1, + "SCALE": 2, + "_ID" : 3 + }, + } + } + } + ] +} +``` + +## Appendix + + +## Reference + + +### Theory, Documentation and Implementations diff --git a/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore/mesh.bin b/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore/mesh.bin new file mode 100644 index 0000000000..21f644dc01 Binary files /dev/null and b/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore/mesh.bin differ diff --git a/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore/mesh_2.bin b/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore/mesh_2.bin new file mode 100644 index 0000000000..92ccb90f4a Binary files /dev/null and b/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore/mesh_2.bin differ diff --git a/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore/teapots_galore.gltf b/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore/teapots_galore.gltf new file mode 100644 index 0000000000..1ab6923c7a --- /dev/null +++ b/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore/teapots_galore.gltf @@ -0,0 +1,554 @@ +{ + "accessors": [ + { + "bufferView": 0, + "componentType": 5126, + "count": 2204, + "extras": { + "arrayIndex": 0 + }, + "max": [ + 3.433150053024292, + 3.1500000953674316, + 2.0 + ], + "min": [ + -3.0, + 0.0, + -2.0 + ], + "type": "VEC3" + }, + { + "bufferView": 1, + "componentType": 5126, + "count": 2204, + "extras": { + "arrayIndex": 1 + }, + "type": "VEC3" + }, + { + "bufferView": 2, + "componentType": 5125, + "count": 12096, + "extras": { + "arrayIndex": 2 + }, + "type": "SCALAR" + }, + { + "bufferView": 3, + "componentType": 5126, + "count": 958, + "extras": { + "arrayIndex": 3 + }, + "type": "VEC3" + }, + { + "bufferView": 4, + "componentType": 5126, + "count": 958, + "extras": { + "arrayIndex": 4 + }, + "type": "VEC4" + }, + { + "bufferView": 5, + "componentType": 5126, + "count": 958, + "extras": { + "arrayIndex": 5 + }, + "type": "VEC3" + }, + { + "bufferView": 6, + "componentType": 5126, + "count": 941, + "extras": { + "arrayIndex": 6 + }, + "type": "VEC3" + }, + { + "bufferView": 7, + "componentType": 5126, + "count": 941, + "extras": { + "arrayIndex": 7 + }, + "type": "VEC4" + }, + { + "bufferView": 8, + "componentType": 5126, + "count": 941, + "extras": { + "arrayIndex": 8 + }, + "type": "VEC3" + }, + { + "bufferView": 9, + "componentType": 5126, + "count": 4, + "extras": { + "arrayIndex": 9 + }, + "max": [ + 1.0, + 0.0, + 1.0 + ], + "min": [ + -1.0, + 0.0, + -1.0 + ], + "type": "VEC3" + }, + { + "bufferView": 10, + "componentType": 5126, + "count": 4, + "extras": { + "arrayIndex": 10 + }, + "type": "VEC3" + }, + { + "bufferView": 11, + "componentType": 5126, + "count": 4, + "extras": { + "arrayIndex": 11 + }, + "type": "VEC2" + }, + { + "bufferView": 12, + "componentType": 5125, + "count": 6, + "extras": { + "arrayIndex": 12 + }, + "type": "SCALAR" + } + ], + "asset": { + "generator": "OctaneGltfExporter Version:2.2", + "version": "2.0" + }, + "bufferViews": [ + { + "buffer": 0, + "byteLength": 26448, + "extras": { + "arrayIndex": 0 + } + }, + { + "buffer": 0, + "byteLength": 26448, + "byteOffset": 26448, + "extras": { + "arrayIndex": 1 + } + }, + { + "buffer": 0, + "byteLength": 48384, + "byteOffset": 52896, + "extras": { + "arrayIndex": 2 + } + }, + { + "buffer": 1, + "byteLength": 11496, + "extras": { + "arrayIndex": 3 + } + }, + { + "buffer": 1, + "byteLength": 15328, + "byteOffset": 11496, + "extras": { + "arrayIndex": 4 + } + }, + { + "buffer": 1, + "byteLength": 11496, + "byteOffset": 26824, + "extras": { + "arrayIndex": 5 + } + }, + { + "buffer": 1, + "byteLength": 11292, + "byteOffset": 38320, + "extras": { + "arrayIndex": 6 + } + }, + { + "buffer": 1, + "byteLength": 15056, + "byteOffset": 49612, + "extras": { + "arrayIndex": 7 + } + }, + { + "buffer": 1, + "byteLength": 11292, + "byteOffset": 64668, + "extras": { + "arrayIndex": 8 + } + }, + { + "buffer": 2, + "byteLength": 48, + "extras": { + "arrayIndex": 9 + } + }, + { + "buffer": 2, + "byteLength": 48, + "byteOffset": 48, + "extras": { + "arrayIndex": 10 + } + }, + { + "buffer": 2, + "byteLength": 32, + "byteOffset": 96, + "extras": { + "arrayIndex": 11 + } + }, + { + "buffer": 2, + "byteLength": 24, + "byteOffset": 128, + "extras": { + "arrayIndex": 12 + } + } + ], + "buffers": [ + { + "byteLength": 101280, + "extras": { + "arrayIndex": 0 + }, + "uri": "mesh.bin" + }, + { + "byteLength": 75960, + "extras": { + "arrayIndex": 1 + }, + "uri": "transforms.bin" + }, + { + "byteLength": 152, + "extras": { + "arrayIndex": 2 + }, + "uri": "mesh_2.bin" + } + ], + "cameras": [ + { + "extras": { + "arrayIndex": 0 + }, + "name": "Thin lens camera", + "perspective": { + "aspectRatio": 1.3333333730697632, + "yfov": 0.8172757029533386, + "zfar": 10000000000.0, + "znear": 9.999999747378752e-05 + }, + "type": "perspective" + } + ], + "extensionsUsed": [ + "EXT_mesh_gpu_instancing" + ], + "materials": [ + { + "extras": { + "arrayIndex": 0 + }, + "name": "cube", + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.699999988079071, + 0.699999988079071, + 0.699999988079071, + 1.0 + ], + "roughnessFactor": 0.06319999694824219 + } + }, + { + "extras": { + "arrayIndex": 1 + }, + "name": "cube_1", + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.7000000476837158, + 0.0006436262046918273, + 0.03353740647435188, + 1.0 + ], + "roughnessFactor": 0.06319999694824219 + } + }, + { + "extras": { + "arrayIndex": 2 + }, + "name": "cube_2", + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.15800000727176666, + 0.10700000077486038, + 0.09399999678134918, + 1.0 + ], + "metallicFactor": 0.11500000208616257, + "roughnessFactor": 0.13469399511814117 + } + } + ], + "meshes": [ + { + "extras": { + "arrayIndex": 0 + }, + "name": "teapot", + "primitives": [ + { + "attributes": { + "NORMAL": 1, + "POSITION": 0 + }, + "indices": 2, + "material": 0, + "mode": 4 + } + ] + }, + { + "extras": { + "arrayIndex": 1 + }, + "name": "plane", + "primitives": [ + { + "attributes": { + "NORMAL": 10, + "POSITION": 9, + "TEXCOORD_0": 11 + }, + "indices": 12, + "material": 2, + "mode": 4 + } + ] + } + ], + "nodes": [ + { + "children": [ + 1, + 2, + 3, + 4 + ], + "extras": { + "arrayIndex": 0 + }, + "name": "teapots_galore" + }, + { + "camera": 0, + "extras": { + "arrayIndex": 1 + }, + "matrix": [ + 1.0, + -0.0, + 0.0, + -0.0, + -0.0, + 0.9578263163566589, + -0.2873478829860687, + 0.0, + -0.0, + 0.2873478829860687, + 0.9578263163566589, + -0.0, + -0.0, + 20.000001907348633, + -0.0, + 1.0 + ], + "name": "Thin lens camera" + }, + { + "children": [ + 5 + ], + "extras": { + "arrayIndex": 2 + }, + "matrix": [ + 0.7071068286895752, + 0.0, + -0.7071067690849304, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0, + 0.7071067690849304, + 0.0, + 0.7071068286895752, + 0.0, + 0.0, + 0.0, + 0.0, + 1.0 + ], + "name": "Placement" + }, + { + "extensions": { + "EXT_mesh_gpu_instancing": { + "attributes": { + "ROTATION": 4, + "SCALE": 5, + "TRANSLATION": 3 + } + } + }, + "extras": { + "arrayIndex": 3 + }, + "matrix": [ + 1.0, + 0.0, + 0.0, + 0.0, + 0.0, + 1.2999999523162842, + 0.0, + 0.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0, + 0.0, + 0.0, + 1.0 + ], + "mesh": 0, + "name": "teapot" + }, + { + "extensions": { + "EXT_mesh_gpu_instancing": { + "attributes": { + "ROTATION": 7, + "SCALE": 8, + "TRANSLATION": 6 + } + } + }, + "extras": { + "arrayIndex": 4 + }, + "matrix": [ + 1.0, + 0.0, + 0.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0, + 0.0, + 0.0, + 1.0 + ], + "mesh": 0, + "name": "teapot0" + }, + { + "children": [ + 6 + ], + "extras": { + "arrayIndex": 5 + }, + "matrix": [ + 240.0, + 0.0, + 0.0, + 0.0, + 0.0, + 240.0, + 0.0, + 0.0, + 0.0, + 0.0, + 240.0, + 0.0, + 0.0, + 0.0, + 0.0, + 1.0 + ], + "name": "Placement_3" + }, + { + "extras": { + "arrayIndex": 6 + }, + "mesh": 1, + "name": "plane" + } + ], + "scene": 0, + "scenes": [ + { + "extras": { + "arrayIndex": 0 + }, + "name": "teapots_galore", + "nodes": [ + 0 + ] + } + ] +} \ No newline at end of file diff --git a/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore/transforms.bin b/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore/transforms.bin new file mode 100644 index 0000000000..cb0fb4a28a Binary files /dev/null and b/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore/transforms.bin differ diff --git a/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore_T4x3/mesh.bin b/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore_T4x3/mesh.bin new file mode 100644 index 0000000000..21f644dc01 Binary files /dev/null and b/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore_T4x3/mesh.bin differ diff --git a/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore_T4x3/mesh_2.bin b/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore_T4x3/mesh_2.bin new file mode 100644 index 0000000000..92ccb90f4a Binary files /dev/null and b/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore_T4x3/mesh_2.bin differ diff --git a/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore_T4x3/teapots_galore_T4x3.gltf b/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore_T4x3/teapots_galore_T4x3.gltf new file mode 100644 index 0000000000..9f07ba0cce --- /dev/null +++ b/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore_T4x3/teapots_galore_T4x3.gltf @@ -0,0 +1,482 @@ +{ + "accessors": [ + { + "bufferView": 0, + "componentType": 5126, + "count": 2204, + "extras": { + "arrayIndex": 0 + }, + "max": [ + 3.433150053024292, + 3.1500000953674316, + 2.0 + ], + "min": [ + -3.0, + 0.0, + -2.0 + ], + "type": "VEC3" + }, + { + "bufferView": 1, + "componentType": 5126, + "count": 2204, + "extras": { + "arrayIndex": 1 + }, + "type": "VEC3" + }, + { + "bufferView": 2, + "componentType": 5125, + "count": 12096, + "extras": { + "arrayIndex": 2 + }, + "type": "SCALAR" + }, + { + "bufferView": 3, + "componentType": 5126, + "count": 958, + "extras": { + "arrayIndex": 3 + }, + "type": "MAT4x3" + }, + { + "bufferView": 4, + "componentType": 5126, + "count": 941, + "extras": { + "arrayIndex": 4 + }, + "type": "MAT4x3" + }, + { + "bufferView": 5, + "componentType": 5126, + "count": 4, + "extras": { + "arrayIndex": 5 + }, + "max": [ + 1.0, + 0.0, + 1.0 + ], + "min": [ + -1.0, + 0.0, + -1.0 + ], + "type": "VEC3" + }, + { + "bufferView": 6, + "componentType": 5126, + "count": 4, + "extras": { + "arrayIndex": 6 + }, + "type": "VEC3" + }, + { + "bufferView": 7, + "componentType": 5126, + "count": 4, + "extras": { + "arrayIndex": 7 + }, + "type": "VEC2" + }, + { + "bufferView": 8, + "componentType": 5125, + "count": 6, + "extras": { + "arrayIndex": 8 + }, + "type": "SCALAR" + } + ], + "asset": { + "generator": "OctaneGltfExporter Version:2.2", + "version": "2.0" + }, + "bufferViews": [ + { + "buffer": 0, + "byteLength": 26448, + "extras": { + "arrayIndex": 0 + } + }, + { + "buffer": 0, + "byteLength": 26448, + "byteOffset": 26448, + "extras": { + "arrayIndex": 1 + } + }, + { + "buffer": 0, + "byteLength": 48384, + "byteOffset": 52896, + "extras": { + "arrayIndex": 2 + } + }, + { + "buffer": 1, + "byteLength": 45984, + "extras": { + "arrayIndex": 3 + } + }, + { + "buffer": 1, + "byteLength": 45168, + "byteOffset": 45984, + "extras": { + "arrayIndex": 4 + } + }, + { + "buffer": 2, + "byteLength": 48, + "extras": { + "arrayIndex": 5 + } + }, + { + "buffer": 2, + "byteLength": 48, + "byteOffset": 48, + "extras": { + "arrayIndex": 6 + } + }, + { + "buffer": 2, + "byteLength": 32, + "byteOffset": 96, + "extras": { + "arrayIndex": 7 + } + }, + { + "buffer": 2, + "byteLength": 24, + "byteOffset": 128, + "extras": { + "arrayIndex": 8 + } + } + ], + "buffers": [ + { + "byteLength": 101280, + "extras": { + "arrayIndex": 0 + }, + "uri": "mesh.bin" + }, + { + "byteLength": 91152, + "extras": { + "arrayIndex": 1 + }, + "uri": "transforms.bin" + }, + { + "byteLength": 152, + "extras": { + "arrayIndex": 2 + }, + "uri": "mesh_2.bin" + } + ], + "cameras": [ + { + "extras": { + "arrayIndex": 0 + }, + "name": "Thin lens camera", + "perspective": { + "aspectRatio": 1.3333333730697632, + "yfov": 0.8172757029533386, + "zfar": 10000000000.0, + "znear": 9.999999747378752e-05 + }, + "type": "perspective" + } + ], + "extensionsUsed": [ + "EXT_mesh_gpu_instancing" + ], + "materials": [ + { + "extras": { + "arrayIndex": 0 + }, + "name": "cube", + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.699999988079071, + 0.699999988079071, + 0.699999988079071, + 1.0 + ], + "roughnessFactor": 0.06319999694824219 + } + }, + { + "extras": { + "arrayIndex": 1 + }, + "name": "cube_1", + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.7000000476837158, + 0.0006436262046918273, + 0.03353740647435188, + 1.0 + ], + "roughnessFactor": 0.06319999694824219 + } + }, + { + "extras": { + "arrayIndex": 2 + }, + "name": "cube_2", + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.15800000727176666, + 0.10700000077486038, + 0.09399999678134918, + 1.0 + ], + "metallicFactor": 0.11500000208616257, + "roughnessFactor": 0.13469399511814117 + } + } + ], + "meshes": [ + { + "extras": { + "arrayIndex": 0 + }, + "name": "teapot", + "primitives": [ + { + "attributes": { + "NORMAL": 1, + "POSITION": 0 + }, + "indices": 2, + "material": 0, + "mode": 4 + } + ] + }, + { + "extras": { + "arrayIndex": 1 + }, + "name": "plane", + "primitives": [ + { + "attributes": { + "NORMAL": 6, + "POSITION": 5, + "TEXCOORD_0": 7 + }, + "indices": 8, + "material": 2, + "mode": 4 + } + ] + } + ], + "nodes": [ + { + "children": [ + 1, + 2, + 3, + 4 + ], + "extras": { + "arrayIndex": 0 + }, + "name": "teapots_galore_T4x3" + }, + { + "camera": 0, + "extras": { + "arrayIndex": 1 + }, + "matrix": [ + 1.0, + -0.0, + 0.0, + -0.0, + -0.0, + 0.9578263163566589, + -0.2873478829860687, + 0.0, + -0.0, + 0.2873478829860687, + 0.9578263163566589, + -0.0, + -0.0, + 20.000001907348633, + -0.0, + 1.0 + ], + "name": "Thin lens camera" + }, + { + "children": [ + 5 + ], + "extras": { + "arrayIndex": 2 + }, + "matrix": [ + 0.7071068286895752, + 0.0, + -0.7071067690849304, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0, + 0.7071067690849304, + 0.0, + 0.7071068286895752, + 0.0, + 0.0, + 0.0, + 0.0, + 1.0 + ], + "name": "Placement" + }, + { + "extensions": { + "EXT_mesh_gpu_instancing": { + "attributes": { + "_TRANSFORM4x3": 3 + } + } + }, + "extras": { + "arrayIndex": 3 + }, + "matrix": [ + 1.0, + 0.0, + 0.0, + 0.0, + 0.0, + 1.2999999523162842, + 0.0, + 0.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0, + 0.0, + 0.0, + 1.0 + ], + "mesh": 0, + "name": "teapot" + }, + { + "extensions": { + "EXT_mesh_gpu_instancing": { + "attributes": { + "_TRANSFORM4x3": 4 + } + } + }, + "extras": { + "arrayIndex": 4 + }, + "matrix": [ + 1.0, + 0.0, + 0.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0, + 0.0, + 0.0, + 1.0 + ], + "mesh": 0, + "name": "teapot0" + }, + { + "children": [ + 6 + ], + "extras": { + "arrayIndex": 5 + }, + "matrix": [ + 240.0, + 0.0, + 0.0, + 0.0, + 0.0, + 240.0, + 0.0, + 0.0, + 0.0, + 0.0, + 240.0, + 0.0, + 0.0, + 0.0, + 0.0, + 1.0 + ], + "name": "Placement_3" + }, + { + "extras": { + "arrayIndex": 6 + }, + "mesh": 1, + "name": "plane" + } + ], + "scene": 0, + "scenes": [ + { + "extras": { + "arrayIndex": 0 + }, + "name": "teapots_galore_T4x3", + "nodes": [ + 0 + ] + } + ] +} \ No newline at end of file diff --git a/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore_T4x3/transforms.bin b/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore_T4x3/transforms.bin new file mode 100644 index 0000000000..12651ac8ac Binary files /dev/null and b/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore_T4x3/transforms.bin differ diff --git a/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore_id/mesh.bin b/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore_id/mesh.bin new file mode 100644 index 0000000000..21f644dc01 Binary files /dev/null and b/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore_id/mesh.bin differ diff --git a/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore_id/mesh_2.bin b/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore_id/mesh_2.bin new file mode 100644 index 0000000000..92ccb90f4a Binary files /dev/null and b/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore_id/mesh_2.bin differ diff --git a/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore_id/teapots_galore_id.gltf b/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore_id/teapots_galore_id.gltf new file mode 100644 index 0000000000..7e5f7d6d7c --- /dev/null +++ b/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore_id/teapots_galore_id.gltf @@ -0,0 +1,590 @@ +{ + "accessors": [ + { + "bufferView": 0, + "componentType": 5126, + "count": 2204, + "extras": { + "arrayIndex": 0 + }, + "max": [ + 3.433150053024292, + 3.1500000953674316, + 2.0 + ], + "min": [ + -3.0, + 0.0, + -2.0 + ], + "type": "VEC3" + }, + { + "bufferView": 1, + "componentType": 5126, + "count": 2204, + "extras": { + "arrayIndex": 1 + }, + "type": "VEC3" + }, + { + "bufferView": 2, + "componentType": 5125, + "count": 12096, + "extras": { + "arrayIndex": 2 + }, + "type": "SCALAR" + }, + { + "bufferView": 3, + "componentType": 5126, + "count": 958, + "extras": { + "arrayIndex": 3 + }, + "type": "VEC3" + }, + { + "bufferView": 4, + "componentType": 5126, + "count": 958, + "extras": { + "arrayIndex": 4 + }, + "type": "VEC4" + }, + { + "bufferView": 5, + "componentType": 5126, + "count": 958, + "extras": { + "arrayIndex": 5 + }, + "type": "VEC3" + }, + { + "bufferView": 6, + "componentType": 5125, + "count": 958, + "extras": { + "arrayIndex": 6 + }, + "type": "SCALAR" + }, + { + "bufferView": 7, + "componentType": 5126, + "count": 941, + "extras": { + "arrayIndex": 7 + }, + "type": "VEC3" + }, + { + "bufferView": 8, + "componentType": 5126, + "count": 941, + "extras": { + "arrayIndex": 8 + }, + "type": "VEC4" + }, + { + "bufferView": 9, + "componentType": 5126, + "count": 941, + "extras": { + "arrayIndex": 9 + }, + "type": "VEC3" + }, + { + "bufferView": 10, + "componentType": 5125, + "count": 941, + "extras": { + "arrayIndex": 10 + }, + "type": "SCALAR" + }, + { + "bufferView": 11, + "componentType": 5126, + "count": 4, + "extras": { + "arrayIndex": 11 + }, + "max": [ + 1.0, + 0.0, + 1.0 + ], + "min": [ + -1.0, + 0.0, + -1.0 + ], + "type": "VEC3" + }, + { + "bufferView": 12, + "componentType": 5126, + "count": 4, + "extras": { + "arrayIndex": 12 + }, + "type": "VEC3" + }, + { + "bufferView": 13, + "componentType": 5126, + "count": 4, + "extras": { + "arrayIndex": 13 + }, + "type": "VEC2" + }, + { + "bufferView": 14, + "componentType": 5125, + "count": 6, + "extras": { + "arrayIndex": 14 + }, + "type": "SCALAR" + } + ], + "asset": { + "generator": "OctaneGltfExporter Version:2.2", + "version": "2.0" + }, + "bufferViews": [ + { + "buffer": 0, + "byteLength": 26448, + "extras": { + "arrayIndex": 0 + } + }, + { + "buffer": 0, + "byteLength": 26448, + "byteOffset": 26448, + "extras": { + "arrayIndex": 1 + } + }, + { + "buffer": 0, + "byteLength": 48384, + "byteOffset": 52896, + "extras": { + "arrayIndex": 2 + } + }, + { + "buffer": 1, + "byteLength": 11496, + "extras": { + "arrayIndex": 3 + } + }, + { + "buffer": 1, + "byteLength": 15328, + "byteOffset": 11496, + "extras": { + "arrayIndex": 4 + } + }, + { + "buffer": 1, + "byteLength": 11496, + "byteOffset": 26824, + "extras": { + "arrayIndex": 5 + } + }, + { + "buffer": 1, + "byteLength": 11496, + "byteOffset": 38320, + "extras": { + "arrayIndex": 6 + } + }, + { + "buffer": 1, + "byteLength": 11292, + "byteOffset": 42152, + "extras": { + "arrayIndex": 7 + } + }, + { + "buffer": 1, + "byteLength": 15056, + "byteOffset": 53444, + "extras": { + "arrayIndex": 8 + } + }, + { + "buffer": 1, + "byteLength": 11292, + "byteOffset": 68500, + "extras": { + "arrayIndex": 9 + } + }, + { + "buffer": 1, + "byteLength": 11292, + "byteOffset": 79792, + "extras": { + "arrayIndex": 10 + } + }, + { + "buffer": 2, + "byteLength": 48, + "extras": { + "arrayIndex": 11 + } + }, + { + "buffer": 2, + "byteLength": 48, + "byteOffset": 48, + "extras": { + "arrayIndex": 12 + } + }, + { + "buffer": 2, + "byteLength": 32, + "byteOffset": 96, + "extras": { + "arrayIndex": 13 + } + }, + { + "buffer": 2, + "byteLength": 24, + "byteOffset": 128, + "extras": { + "arrayIndex": 14 + } + } + ], + "buffers": [ + { + "byteLength": 101280, + "extras": { + "arrayIndex": 0 + }, + "uri": "mesh.bin" + }, + { + "byteLength": 83556, + "extras": { + "arrayIndex": 1 + }, + "uri": "transforms.bin" + }, + { + "byteLength": 152, + "extras": { + "arrayIndex": 2 + }, + "uri": "mesh_2.bin" + } + ], + "cameras": [ + { + "extras": { + "arrayIndex": 0 + }, + "name": "Thin lens camera", + "perspective": { + "aspectRatio": 1.3333333730697632, + "yfov": 0.8172757029533386, + "zfar": 10000000000.0, + "znear": 9.999999747378752e-05 + }, + "type": "perspective" + } + ], + "extensionsUsed": [ + "EXT_mesh_gpu_instancing" + ], + "materials": [ + { + "extras": { + "arrayIndex": 0 + }, + "name": "cube", + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.699999988079071, + 0.699999988079071, + 0.699999988079071, + 1.0 + ], + "roughnessFactor": 0.06319999694824219 + } + }, + { + "extras": { + "arrayIndex": 1 + }, + "name": "cube_1", + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.7000000476837158, + 0.0006436262046918273, + 0.03353740647435188, + 1.0 + ], + "roughnessFactor": 0.06319999694824219 + } + }, + { + "extras": { + "arrayIndex": 2 + }, + "name": "cube_2", + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.15800000727176666, + 0.10700000077486038, + 0.09399999678134918, + 1.0 + ], + "metallicFactor": 0.11500000208616257, + "roughnessFactor": 0.13469399511814117 + } + } + ], + "meshes": [ + { + "extras": { + "arrayIndex": 0 + }, + "name": "teapot", + "primitives": [ + { + "attributes": { + "NORMAL": 1, + "POSITION": 0 + }, + "indices": 2, + "material": 0, + "mode": 4 + } + ] + }, + { + "extras": { + "arrayIndex": 1 + }, + "name": "plane", + "primitives": [ + { + "attributes": { + "NORMAL": 12, + "POSITION": 11, + "TEXCOORD_0": 13 + }, + "indices": 14, + "material": 2, + "mode": 4 + } + ] + } + ], + "nodes": [ + { + "children": [ + 1, + 2, + 3, + 4 + ], + "extras": { + "arrayIndex": 0 + }, + "name": "teapots_galore_id" + }, + { + "camera": 0, + "extras": { + "arrayIndex": 1 + }, + "matrix": [ + 1.0, + -0.0, + 0.0, + -0.0, + -0.0, + 0.9578263163566589, + -0.2873478829860687, + 0.0, + -0.0, + 0.2873478829860687, + 0.9578263163566589, + -0.0, + -0.0, + 20.000001907348633, + -0.0, + 1.0 + ], + "name": "Thin lens camera" + }, + { + "children": [ + 5 + ], + "extras": { + "arrayIndex": 2 + }, + "matrix": [ + 0.7071068286895752, + 0.0, + -0.7071067690849304, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0, + 0.7071067690849304, + 0.0, + 0.7071068286895752, + 0.0, + 0.0, + 0.0, + 0.0, + 1.0 + ], + "name": "Placement" + }, + { + "extensions": { + "EXT_mesh_gpu_instancing": { + "attributes": { + "ROTATION": 4, + "SCALE": 5, + "TRANSLATION": 3, + "_ID": 6 + } + } + }, + "extras": { + "arrayIndex": 3 + }, + "matrix": [ + 1.0, + 0.0, + 0.0, + 0.0, + 0.0, + 1.2999999523162842, + 0.0, + 0.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0, + 0.0, + 0.0, + 1.0 + ], + "mesh": 0, + "name": "teapot" + }, + { + "extensions": { + "EXT_mesh_gpu_instancing": { + "attributes": { + "ROTATION": 8, + "SCALE": 9, + "TRANSLATION": 7, + "_ID": 10 + } + } + }, + "extras": { + "arrayIndex": 4 + }, + "matrix": [ + 1.0, + 0.0, + 0.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0, + 0.0, + 0.0, + 1.0 + ], + "mesh": 0, + "name": "teapot0" + }, + { + "children": [ + 6 + ], + "extras": { + "arrayIndex": 5 + }, + "matrix": [ + 240.0, + 0.0, + 0.0, + 0.0, + 0.0, + 240.0, + 0.0, + 0.0, + 0.0, + 0.0, + 240.0, + 0.0, + 0.0, + 0.0, + 0.0, + 1.0 + ], + "name": "Placement_3" + }, + { + "extras": { + "arrayIndex": 6 + }, + "mesh": 1, + "name": "plane" + } + ], + "scene": 0, + "scenes": [ + { + "extras": { + "arrayIndex": 0 + }, + "name": "teapots_galore_id", + "nodes": [ + 0 + ] + } + ] +} \ No newline at end of file diff --git a/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore_id/transforms.bin b/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore_id/transforms.bin new file mode 100644 index 0000000000..c2425797cb Binary files /dev/null and b/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/samples/teapots_galore_id/transforms.bin differ diff --git a/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/schema/glTF.EXT_mesh_gpu_instancing.schema.json b/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/schema/glTF.EXT_mesh_gpu_instancing.schema.json new file mode 100644 index 0000000000..7762d05e99 --- /dev/null +++ b/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/schema/glTF.EXT_mesh_gpu_instancing.schema.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema", + "title": "EXT_mesh_gpu_instancing glTF extension", + "type": "object", + "description": "glTF extension defines instance attributes for a node with a mesh.", + "allOf": [ { "$ref": "glTFProperty.schema.json" } ], + "properties": { + "attributes": { + "type": "object", + "description": "A dictionary object, where each key corresponds to mesh attribute semantic and each value is the index of the accessor containing attribute's data (defined optional attribs are TRANSLATION, ROTATION, SCALE. For \"translation\" the values are FLOAT_VEC3's specifying translation along the x, y, and z axes. For \"rotation\" the values are quaternion FLOAT_VEC4's in the order (x, y, z, w), where w is the scalar. For \"scale\" the values are FLOAT_VEC3's specifying scaling factors along the x, y, and z axes.)", + "minProperties": 1, + "additionalProperties": { + "$ref": "glTFid.schema.json" + } + }, + "extensions": { }, + "extras": { } + } +}