diff --git a/Models/NodeVisibilityTest/README.body.md b/Models/NodeVisibilityTest/README.body.md new file mode 100644 index 00000000..f3dd3d41 --- /dev/null +++ b/Models/NodeVisibilityTest/README.body.md @@ -0,0 +1,32 @@ +## Screenshot + +![screenshot](screenshot/screenshot.png) + +## Description + +A test for the [`KHR_node_visibility`](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_node_visibility) extension. + +## Test cases + +When a viewer properly supports the `KHR_node_visibility` extension, then the asset will be rendered as shown in this screenshot: + +![Positive](screenshot/screenshot.png) + +When a viewer does not support the extension, then the asset will indicate this as shown in this screenshot: + +![NotSupported](screenshot/NotSupported.png) + +When a viewer supports the extension, but falsely defaults the `visible` flag to `false`, then this will be indicated by the asset as shown in the following screenshot: + +![NoProperDefaults](screenshot/NoProperDefaults.png) + +When a viewer supports the extension, but does not follow the rule from the specification that requires a node to be visible only when itself and all its ancestors are visible, then this will be indicated by the asset as shown in this screenshot: + +![NoProperHierarchy](screenshot/NoProperHierarchy.png) + + + + + + + diff --git a/Models/NodeVisibilityTest/glTF-Binary/NodeVisibilityTest.glb b/Models/NodeVisibilityTest/glTF-Binary/NodeVisibilityTest.glb new file mode 100644 index 00000000..a396f99c Binary files /dev/null and b/Models/NodeVisibilityTest/glTF-Binary/NodeVisibilityTest.glb differ diff --git a/Models/NodeVisibilityTest/glTF/NodeVisibilityTest.gltf b/Models/NodeVisibilityTest/glTF/NodeVisibilityTest.gltf new file mode 100644 index 00000000..03194bd0 --- /dev/null +++ b/Models/NodeVisibilityTest/glTF/NodeVisibilityTest.gltf @@ -0,0 +1,662 @@ +{ + "extensionsUsed" : [ "KHR_node_visibility" ], + "accessors" : [ { + "bufferView" : 0, + "byteOffset" : 0, + "componentType" : 5123, + "count" : 6, + "type" : "SCALAR", + "max" : [ 3 ], + "min" : [ 0 ] + }, { + "bufferView" : 1, + "byteOffset" : 0, + "componentType" : 5126, + "count" : 4, + "type" : "VEC3", + "max" : [ 16.0, 1.0, 0.0 ], + "min" : [ 0.0, 0.0, 0.0 ] + }, { + "bufferView" : 1, + "byteOffset" : 48, + "componentType" : 5126, + "count" : 4, + "type" : "VEC3", + "max" : [ 0.0, 0.0, 1.0 ], + "min" : [ 0.0, 0.0, 1.0 ] + }, { + "bufferView" : 1, + "byteOffset" : 96, + "componentType" : 5126, + "count" : 4, + "type" : "VEC2", + "max" : [ 1.0, 1.0 ], + "min" : [ 0.0, 0.0 ] + }, { + "bufferView" : 2, + "byteOffset" : 0, + "componentType" : 5123, + "count" : 6, + "type" : "SCALAR", + "max" : [ 3 ], + "min" : [ 0 ] + }, { + "bufferView" : 3, + "byteOffset" : 0, + "componentType" : 5126, + "count" : 4, + "type" : "VEC3", + "max" : [ 16.0, 1.0, 0.0 ], + "min" : [ 0.0, 0.0, 0.0 ] + }, { + "bufferView" : 3, + "byteOffset" : 48, + "componentType" : 5126, + "count" : 4, + "type" : "VEC3", + "max" : [ 0.0, 0.0, 1.0 ], + "min" : [ 0.0, 0.0, 1.0 ] + }, { + "bufferView" : 3, + "byteOffset" : 96, + "componentType" : 5126, + "count" : 4, + "type" : "VEC2", + "max" : [ 1.0, 1.0 ], + "min" : [ 0.0, 0.0 ] + }, { + "bufferView" : 4, + "byteOffset" : 0, + "componentType" : 5123, + "count" : 6, + "type" : "SCALAR", + "max" : [ 3 ], + "min" : [ 0 ] + }, { + "bufferView" : 5, + "byteOffset" : 0, + "componentType" : 5126, + "count" : 4, + "type" : "VEC3", + "max" : [ 16.0, 1.0, 0.0 ], + "min" : [ 0.0, 0.0, 0.0 ] + }, { + "bufferView" : 5, + "byteOffset" : 48, + "componentType" : 5126, + "count" : 4, + "type" : "VEC3", + "max" : [ 0.0, 0.0, 1.0 ], + "min" : [ 0.0, 0.0, 1.0 ] + }, { + "bufferView" : 5, + "byteOffset" : 96, + "componentType" : 5126, + "count" : 4, + "type" : "VEC2", + "max" : [ 1.0, 1.0 ], + "min" : [ 0.0, 0.0 ] + }, { + "bufferView" : 6, + "byteOffset" : 0, + "componentType" : 5123, + "count" : 6, + "type" : "SCALAR", + "max" : [ 3 ], + "min" : [ 0 ] + }, { + "bufferView" : 7, + "byteOffset" : 0, + "componentType" : 5126, + "count" : 4, + "type" : "VEC3", + "max" : [ 16.0, 1.0, 0.0 ], + "min" : [ 0.0, 0.0, 0.0 ] + }, { + "bufferView" : 7, + "byteOffset" : 48, + "componentType" : 5126, + "count" : 4, + "type" : "VEC3", + "max" : [ 0.0, 0.0, 1.0 ], + "min" : [ 0.0, 0.0, 1.0 ] + }, { + "bufferView" : 7, + "byteOffset" : 96, + "componentType" : 5126, + "count" : 4, + "type" : "VEC2", + "max" : [ 1.0, 1.0 ], + "min" : [ 0.0, 0.0 ] + }, { + "bufferView" : 8, + "byteOffset" : 0, + "componentType" : 5123, + "count" : 6, + "type" : "SCALAR", + "max" : [ 3 ], + "min" : [ 0 ] + }, { + "bufferView" : 9, + "byteOffset" : 0, + "componentType" : 5126, + "count" : 4, + "type" : "VEC3", + "max" : [ 16.0, 1.0, 0.0 ], + "min" : [ 0.0, 0.0, 0.0 ] + }, { + "bufferView" : 9, + "byteOffset" : 48, + "componentType" : 5126, + "count" : 4, + "type" : "VEC3", + "max" : [ 0.0, 0.0, 1.0 ], + "min" : [ 0.0, 0.0, 1.0 ] + }, { + "bufferView" : 9, + "byteOffset" : 96, + "componentType" : 5126, + "count" : 4, + "type" : "VEC2", + "max" : [ 1.0, 1.0 ], + "min" : [ 0.0, 0.0 ] + }, { + "bufferView" : 10, + "byteOffset" : 0, + "componentType" : 5123, + "count" : 6, + "type" : "SCALAR", + "max" : [ 3 ], + "min" : [ 0 ] + }, { + "bufferView" : 11, + "byteOffset" : 0, + "componentType" : 5126, + "count" : 4, + "type" : "VEC3", + "max" : [ 16.0, 1.0, 0.0 ], + "min" : [ 0.0, 0.0, 0.0 ] + }, { + "bufferView" : 11, + "byteOffset" : 48, + "componentType" : 5126, + "count" : 4, + "type" : "VEC3", + "max" : [ 0.0, 0.0, 1.0 ], + "min" : [ 0.0, 0.0, 1.0 ] + }, { + "bufferView" : 11, + "byteOffset" : 96, + "componentType" : 5126, + "count" : 4, + "type" : "VEC2", + "max" : [ 1.0, 1.0 ], + "min" : [ 0.0, 0.0 ] + }, { + "bufferView" : 12, + "byteOffset" : 0, + "componentType" : 5123, + "count" : 6, + "type" : "SCALAR", + "max" : [ 3 ], + "min" : [ 0 ] + }, { + "bufferView" : 13, + "byteOffset" : 0, + "componentType" : 5126, + "count" : 4, + "type" : "VEC3", + "max" : [ 16.0, 1.0, 0.0 ], + "min" : [ 0.0, 0.0, 0.0 ] + }, { + "bufferView" : 13, + "byteOffset" : 48, + "componentType" : 5126, + "count" : 4, + "type" : "VEC3", + "max" : [ 0.0, 0.0, 1.0 ], + "min" : [ 0.0, 0.0, 1.0 ] + }, { + "bufferView" : 13, + "byteOffset" : 96, + "componentType" : 5126, + "count" : 4, + "type" : "VEC2", + "max" : [ 1.0, 1.0 ], + "min" : [ 0.0, 0.0 ] + }, { + "bufferView" : 14, + "byteOffset" : 0, + "componentType" : 5123, + "count" : 6, + "type" : "SCALAR", + "max" : [ 3 ], + "min" : [ 0 ] + }, { + "bufferView" : 15, + "byteOffset" : 0, + "componentType" : 5126, + "count" : 4, + "type" : "VEC3", + "max" : [ 16.0, 1.0, 0.0 ], + "min" : [ 0.0, 0.0, 0.0 ] + }, { + "bufferView" : 15, + "byteOffset" : 48, + "componentType" : 5126, + "count" : 4, + "type" : "VEC3", + "max" : [ 0.0, 0.0, 1.0 ], + "min" : [ 0.0, 0.0, 1.0 ] + }, { + "bufferView" : 15, + "byteOffset" : 96, + "componentType" : 5126, + "count" : 4, + "type" : "VEC2", + "max" : [ 1.0, 1.0 ], + "min" : [ 0.0, 0.0 ] + } ], + "asset" : { + "generator" : "JglTF from https://github.com/javagl/JglTF", + "version" : "2.0" + }, + "buffers" : [ { + "uri" : "buffer0.bin", + "byteLength" : 1248 + } ], + "bufferViews" : [ { + "buffer" : 0, + "byteOffset" : 0, + "byteLength" : 12, + "target" : 34963 + }, { + "buffer" : 0, + "byteOffset" : 12, + "byteLength" : 144, + "byteStride" : 12, + "target" : 34962 + }, { + "buffer" : 0, + "byteOffset" : 156, + "byteLength" : 12, + "target" : 34963 + }, { + "buffer" : 0, + "byteOffset" : 168, + "byteLength" : 144, + "byteStride" : 12, + "target" : 34962 + }, { + "buffer" : 0, + "byteOffset" : 312, + "byteLength" : 12, + "target" : 34963 + }, { + "buffer" : 0, + "byteOffset" : 324, + "byteLength" : 144, + "byteStride" : 12, + "target" : 34962 + }, { + "buffer" : 0, + "byteOffset" : 468, + "byteLength" : 12, + "target" : 34963 + }, { + "buffer" : 0, + "byteOffset" : 480, + "byteLength" : 144, + "byteStride" : 12, + "target" : 34962 + }, { + "buffer" : 0, + "byteOffset" : 624, + "byteLength" : 12, + "target" : 34963 + }, { + "buffer" : 0, + "byteOffset" : 636, + "byteLength" : 144, + "byteStride" : 12, + "target" : 34962 + }, { + "buffer" : 0, + "byteOffset" : 780, + "byteLength" : 12, + "target" : 34963 + }, { + "buffer" : 0, + "byteOffset" : 792, + "byteLength" : 144, + "byteStride" : 12, + "target" : 34962 + }, { + "buffer" : 0, + "byteOffset" : 936, + "byteLength" : 12, + "target" : 34963 + }, { + "buffer" : 0, + "byteOffset" : 948, + "byteLength" : 144, + "byteStride" : 12, + "target" : 34962 + }, { + "buffer" : 0, + "byteOffset" : 1092, + "byteLength" : 12, + "target" : 34963 + }, { + "buffer" : 0, + "byteOffset" : 1104, + "byteLength" : 144, + "byteStride" : 12, + "target" : 34962 + } ], + "images" : [ { + "uri" : "image0.png", + "mimeType" : "image/png" + }, { + "uri" : "image1.png", + "mimeType" : "image/png" + }, { + "uri" : "image2.png", + "mimeType" : "image/png" + }, { + "uri" : "image3.png", + "mimeType" : "image/png" + }, { + "uri" : "image4.png", + "mimeType" : "image/png" + }, { + "uri" : "image5.png", + "mimeType" : "image/png" + }, { + "uri" : "image6.png", + "mimeType" : "image/png" + }, { + "uri" : "image7.png", + "mimeType" : "image/png" + } ], + "materials" : [ { + "pbrMetallicRoughness" : { + "baseColorTexture" : { + "index" : 0 + }, + "metallicFactor" : 0.0, + "roughnessFactor" : 1.0 + }, + "doubleSided" : true + }, { + "pbrMetallicRoughness" : { + "baseColorTexture" : { + "index" : 1 + }, + "metallicFactor" : 0.0, + "roughnessFactor" : 1.0 + }, + "doubleSided" : true + }, { + "pbrMetallicRoughness" : { + "baseColorTexture" : { + "index" : 2 + }, + "metallicFactor" : 0.0, + "roughnessFactor" : 1.0 + }, + "doubleSided" : true + }, { + "pbrMetallicRoughness" : { + "baseColorTexture" : { + "index" : 3 + }, + "metallicFactor" : 0.0, + "roughnessFactor" : 1.0 + }, + "doubleSided" : true + }, { + "pbrMetallicRoughness" : { + "baseColorTexture" : { + "index" : 4 + }, + "metallicFactor" : 0.0, + "roughnessFactor" : 1.0 + }, + "doubleSided" : true + }, { + "pbrMetallicRoughness" : { + "baseColorTexture" : { + "index" : 5 + }, + "metallicFactor" : 0.0, + "roughnessFactor" : 1.0 + }, + "doubleSided" : true + }, { + "pbrMetallicRoughness" : { + "baseColorTexture" : { + "index" : 6 + }, + "metallicFactor" : 0.0, + "roughnessFactor" : 1.0 + }, + "doubleSided" : true + }, { + "pbrMetallicRoughness" : { + "baseColorTexture" : { + "index" : 7 + }, + "metallicFactor" : 0.0, + "roughnessFactor" : 1.0 + }, + "doubleSided" : true + } ], + "meshes" : [ { + "primitives" : [ { + "attributes" : { + "POSITION" : 1, + "NORMAL" : 2, + "TEXCOORD_0" : 3 + }, + "indices" : 0, + "material" : 0, + "mode" : 4 + } ] + }, { + "primitives" : [ { + "attributes" : { + "POSITION" : 5, + "NORMAL" : 6, + "TEXCOORD_0" : 7 + }, + "indices" : 4, + "material" : 1, + "mode" : 4 + } ] + }, { + "primitives" : [ { + "attributes" : { + "POSITION" : 9, + "NORMAL" : 10, + "TEXCOORD_0" : 11 + }, + "indices" : 8, + "material" : 2, + "mode" : 4 + } ] + }, { + "primitives" : [ { + "attributes" : { + "POSITION" : 13, + "NORMAL" : 14, + "TEXCOORD_0" : 15 + }, + "indices" : 12, + "material" : 3, + "mode" : 4 + } ] + }, { + "primitives" : [ { + "attributes" : { + "POSITION" : 17, + "NORMAL" : 18, + "TEXCOORD_0" : 19 + }, + "indices" : 16, + "material" : 4, + "mode" : 4 + } ] + }, { + "primitives" : [ { + "attributes" : { + "POSITION" : 21, + "NORMAL" : 22, + "TEXCOORD_0" : 23 + }, + "indices" : 20, + "material" : 5, + "mode" : 4 + } ] + }, { + "primitives" : [ { + "attributes" : { + "POSITION" : 25, + "NORMAL" : 26, + "TEXCOORD_0" : 27 + }, + "indices" : 24, + "material" : 6, + "mode" : 4 + } ] + }, { + "primitives" : [ { + "attributes" : { + "POSITION" : 29, + "NORMAL" : 30, + "TEXCOORD_0" : 31 + }, + "indices" : 28, + "material" : 7, + "mode" : 4 + } ] + } ], + "nodes" : [ { + "children" : [ 1, 2 ] + }, { + "mesh" : 0 + }, { + "extensions" : { + "KHR_node_visibility" : { + "visible" : false + } + }, + "name" : "visible:false", + "mesh" : 1, + "translation" : [ 0.0, 0.0, 0.009999999776482582 ] + }, { + "children" : [ 4, 5 ], + "translation" : [ 0.0, -1.0, 0.0 ] + }, { + "extensions" : { + "KHR_node_visibility" : { } + }, + "name" : "visible:undefined", + "mesh" : 2, + "translation" : [ 0.0, 0.0, 0.009999999776482582 ] + }, { + "mesh" : 3 + }, { + "extensions" : { + "KHR_node_visibility" : { + "visible" : false + } + }, + "name" : "visible:false", + "mesh" : 4, + "translation" : [ 0.0, -1.0, 0.019999999552965164 ] + }, { + "children" : [ 8, 11 ], + "translation" : [ 0.0, -2.0, 0.0 ] + }, { + "extensions" : { + "KHR_node_visibility" : { + "visible" : false + } + }, + "name" : "visible:false", + "children" : [ 9 ], + "translation" : [ 0.0, 0.0, 0.0 ] + }, { + "extensions" : { + "KHR_node_visibility" : { + "visible" : false + } + }, + "name" : "visible:false", + "children" : [ 10 ] + }, { + "extensions" : { + "KHR_node_visibility" : { + "visible" : true + } + }, + "name" : "visible:true", + "mesh" : 5 + }, { + "extensions" : { + "KHR_node_visibility" : { + "visible" : true + } + }, + "name" : "visible:true", + "children" : [ 12 ], + "translation" : [ 0.0, 0.0, 0.009999999776482582 ] + }, { + "extensions" : { + "KHR_node_visibility" : { + "visible" : true + } + }, + "name" : "visible:true", + "children" : [ 13 ] + }, { + "extensions" : { + "KHR_node_visibility" : { + "visible" : false + } + }, + "name" : "visible:false", + "mesh" : 6 + }, { + "extensions" : { + "KHR_node_visibility" : { + "visible" : false + } + }, + "name" : "visible:false", + "mesh" : 7, + "translation" : [ 0.0, -2.0, 0.019999999552965164 ] + } ], + "scene" : 0, + "scenes" : [ { + "nodes" : [ 0, 3, 6, 7, 14 ] + } ], + "textures" : [ { + "source" : 0 + }, { + "source" : 1 + }, { + "source" : 2 + }, { + "source" : 3 + }, { + "source" : 4 + }, { + "source" : 5 + }, { + "source" : 6 + }, { + "source" : 7 + } ] +} \ No newline at end of file diff --git a/Models/NodeVisibilityTest/glTF/buffer0.bin b/Models/NodeVisibilityTest/glTF/buffer0.bin new file mode 100644 index 00000000..b62702bf Binary files /dev/null and b/Models/NodeVisibilityTest/glTF/buffer0.bin differ diff --git a/Models/NodeVisibilityTest/glTF/image0.png b/Models/NodeVisibilityTest/glTF/image0.png new file mode 100644 index 00000000..67da9960 Binary files /dev/null and b/Models/NodeVisibilityTest/glTF/image0.png differ diff --git a/Models/NodeVisibilityTest/glTF/image1.png b/Models/NodeVisibilityTest/glTF/image1.png new file mode 100644 index 00000000..a4fd38d5 Binary files /dev/null and b/Models/NodeVisibilityTest/glTF/image1.png differ diff --git a/Models/NodeVisibilityTest/glTF/image2.png b/Models/NodeVisibilityTest/glTF/image2.png new file mode 100644 index 00000000..5abff977 Binary files /dev/null and b/Models/NodeVisibilityTest/glTF/image2.png differ diff --git a/Models/NodeVisibilityTest/glTF/image3.png b/Models/NodeVisibilityTest/glTF/image3.png new file mode 100644 index 00000000..6fc9d6ae Binary files /dev/null and b/Models/NodeVisibilityTest/glTF/image3.png differ diff --git a/Models/NodeVisibilityTest/glTF/image4.png b/Models/NodeVisibilityTest/glTF/image4.png new file mode 100644 index 00000000..19dce78d Binary files /dev/null and b/Models/NodeVisibilityTest/glTF/image4.png differ diff --git a/Models/NodeVisibilityTest/glTF/image5.png b/Models/NodeVisibilityTest/glTF/image5.png new file mode 100644 index 00000000..1c19e46a Binary files /dev/null and b/Models/NodeVisibilityTest/glTF/image5.png differ diff --git a/Models/NodeVisibilityTest/glTF/image6.png b/Models/NodeVisibilityTest/glTF/image6.png new file mode 100644 index 00000000..1c19e46a Binary files /dev/null and b/Models/NodeVisibilityTest/glTF/image6.png differ diff --git a/Models/NodeVisibilityTest/glTF/image7.png b/Models/NodeVisibilityTest/glTF/image7.png new file mode 100644 index 00000000..19dce78d Binary files /dev/null and b/Models/NodeVisibilityTest/glTF/image7.png differ diff --git a/Models/NodeVisibilityTest/metadata.json b/Models/NodeVisibilityTest/metadata.json new file mode 100644 index 00000000..4713d6ce --- /dev/null +++ b/Models/NodeVisibilityTest/metadata.json @@ -0,0 +1,24 @@ +{ + "version": 2, + "legal": [ + { + "license": "CC0", + "licenseUrl": "https://creativecommons.org/publicdomain/zero/1.0/legalcode", + "artist": "Marco Hutter (https://github.com/javagl/)", + "year": "2017", + "owner": "Public", + "what": "Everything", + "text": "CC0 1.0 Universal", + "spdx": "CC0-1.0", + "icon": "https://licensebuttons.net/p/zero/1.0/88x31.png" + } + ], + "tags": [ + "testing" + ], + "screenshot": "screenshot/screenshot.png", + "name": "NodeVisibilityTest", + "path": "./Models/NodeVisibilityTest", + "summary": "A test for the KHR_node_visibility extension", + "createReadme": true +} \ No newline at end of file diff --git a/Models/NodeVisibilityTest/screenshot/NoProperDefaults.png b/Models/NodeVisibilityTest/screenshot/NoProperDefaults.png new file mode 100644 index 00000000..2f1209d7 Binary files /dev/null and b/Models/NodeVisibilityTest/screenshot/NoProperDefaults.png differ diff --git a/Models/NodeVisibilityTest/screenshot/NoProperHierarchy.png b/Models/NodeVisibilityTest/screenshot/NoProperHierarchy.png new file mode 100644 index 00000000..4787d821 Binary files /dev/null and b/Models/NodeVisibilityTest/screenshot/NoProperHierarchy.png differ diff --git a/Models/NodeVisibilityTest/screenshot/NotSupported.png b/Models/NodeVisibilityTest/screenshot/NotSupported.png new file mode 100644 index 00000000..b271b0ec Binary files /dev/null and b/Models/NodeVisibilityTest/screenshot/NotSupported.png differ diff --git a/Models/NodeVisibilityTest/screenshot/screenshot.png b/Models/NodeVisibilityTest/screenshot/screenshot.png new file mode 100644 index 00000000..9d6b1763 Binary files /dev/null and b/Models/NodeVisibilityTest/screenshot/screenshot.png differ