Skip to content

Commit 5bea411

Browse files
committed
Add cube visibility test asset for KHR_node_visibility
1 parent 824ee75 commit 5bea411

8 files changed

Lines changed: 120 additions & 3 deletions

File tree

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Normalize EOL for all files that Git considers text files.
2+
* text=auto eol=lf

Models/CubeVisibility/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Cube Visiblity test for KHR_node_visibility
2+
3+
This model demonstrates the `KHR_node_visibility` extension and its interaction with `KHR_animation_pointer`.
4+
5+
- If your implementation shows either of the red cubes, it is not compliant with `KHR_node_visibility`.
6+
7+
- If your implementation does not have the blue cube hiding and showing every 0.5 seconds, either the animation is not playing, or it does not support using `KHR_animation_pointer` to animate the `KHR_node_visibility` visible property.
8+
9+
Animated screenshot of the test model in action:
10+
11+
![Cube Visibility](screenshot/screenshot_animated.webp)
12+
13+
[Show](https://gltf-interactivity.needle.tools?model=https://raw.GithubUserContent.com/KhronosGroup/glTF-Interactivity-Sample-Assets/main/Models/CubeVisibility/glTF-Binary/cube_visibility.glb)[Download GLB](https://raw.GithubUserContent.com/KhronosGroup/glTF-Interactivity-Sample-Assets/main/Models/CubeVisibility/glTF-Binary/cube_visibility.glb)
11.6 KB
Binary file not shown.
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"accessors": [
3+
{ "bufferView": 0, "componentType": 5126, "count": 24, "max": [0.5, 0.5, 0.5], "min": [-0.5, -0.5, -0.5], "normalized": false, "type": "VEC3" },
4+
{ "bufferView": 1, "componentType": 5126, "count": 24, "max": [1.0, 0.0, 1.0, 1.0], "min": [-1.0, -1.5259254723787308e-5, -1.0, 1.0], "normalized": false, "type": "VEC4" },
5+
{ "bufferView": 2, "componentType": 5126, "count": 24, "max": [1.0, 1.0, 1.0], "min": [-1.0, -1.0, -1.0], "normalized": false, "type": "VEC3" },
6+
{ "bufferView": 3, "componentType": 5126, "count": 24, "max": [1.0, 1.0], "min": [0.0, 0.0], "normalized": false, "type": "VEC2" },
7+
{ "bufferView": 4, "componentType": 5123, "count": 36, "max": [23.0], "min": [0.0], "normalized": false, "type": "SCALAR" },
8+
{ "bufferView": 5, "componentType": 5126, "count": 24, "max": [0.5, 0.5, 0.5], "min": [-0.5, -0.5, -0.5], "normalized": false, "type": "VEC3" },
9+
{ "bufferView": 6, "componentType": 5126, "count": 24, "max": [1.0, 0.0, 1.0, 1.0], "min": [-1.0, -1.5259254723787308e-5, -1.0, 1.0], "normalized": false, "type": "VEC4" },
10+
{ "bufferView": 7, "componentType": 5126, "count": 24, "max": [1.0, 1.0, 1.0], "min": [-1.0, -1.0, -1.0], "normalized": false, "type": "VEC3" },
11+
{ "bufferView": 8, "componentType": 5126, "count": 24, "max": [1.0, 1.0], "min": [0.0, 0.0], "normalized": false, "type": "VEC2" },
12+
{ "bufferView": 9, "componentType": 5123, "count": 36, "max": [23.0], "min": [0.0], "normalized": false, "type": "SCALAR" },
13+
{ "bufferView": 10, "componentType": 5126, "count": 24, "max": [0.5, 0.5, 0.5], "min": [-0.5, -0.5, -0.5], "normalized": false, "type": "VEC3" },
14+
{ "bufferView": 11, "componentType": 5126, "count": 24, "max": [1.0, 0.0, 1.0, 1.0], "min": [-1.0, -1.5259254723787308e-5, -1.0, 1.0], "normalized": false, "type": "VEC4" },
15+
{ "bufferView": 12, "componentType": 5126, "count": 24, "max": [1.0, 1.0, 1.0], "min": [-1.0, -1.0, -1.0], "normalized": false, "type": "VEC3" },
16+
{ "bufferView": 13, "componentType": 5126, "count": 24, "max": [1.0, 1.0], "min": [0.0, 0.0], "normalized": false, "type": "VEC2" },
17+
{ "bufferView": 14, "componentType": 5123, "count": 36, "max": [23.0], "min": [0.0], "normalized": false, "type": "SCALAR" },
18+
{ "bufferView": 15, "componentType": 5126, "count": 24, "max": [0.5, 0.5, 0.5], "min": [-0.5, -0.5, -0.5], "normalized": false, "type": "VEC3" },
19+
{ "bufferView": 16, "componentType": 5126, "count": 24, "max": [1.0, 0.0, 1.0, 1.0], "min": [-1.0, -1.5259254723787308e-5, -1.0, 1.0], "normalized": false, "type": "VEC4" },
20+
{ "bufferView": 17, "componentType": 5126, "count": 24, "max": [1.0, 1.0, 1.0], "min": [-1.0, -1.0, -1.0], "normalized": false, "type": "VEC3" },
21+
{ "bufferView": 18, "componentType": 5126, "count": 24, "max": [1.0, 1.0], "min": [0.0, 0.0], "normalized": false, "type": "VEC2" },
22+
{ "bufferView": 19, "componentType": 5123, "count": 36, "max": [23.0], "min": [0.0], "normalized": false, "type": "SCALAR" },
23+
{ "bufferView": 20, "componentType": 5126, "count": 11, "max": [5.0], "min": [0.0], "normalized": false, "type": "SCALAR" },
24+
{ "bufferView": 21, "componentType": 5126, "count": 11, "max": [1.0], "min": [0.0], "normalized": false, "type": "SCALAR" },
25+
{ "bufferView": 22, "componentType": 5126, "count": 1, "max": [0.0], "min": [0.0], "normalized": false, "type": "SCALAR" },
26+
{ "bufferView": 23, "componentType": 5126, "count": 1, "max": [1.0], "min": [1.0], "normalized": false, "type": "SCALAR" }
27+
],
28+
"animations": [
29+
{
30+
"channels": [{ "sampler": 0, "target": { "extensions": { "KHR_animation_pointer": { "pointer": "/nodes/4/extensions/KHR_node_visibility/visible" } }, "path": "pointer" } }],
31+
"name": "BlinkingBlueCube",
32+
"samplers": [{ "input": 20, "interpolation": "LINEAR", "output": 21 }]
33+
},
34+
{
35+
"channels": [{ "sampler": 0, "target": { "extensions": { "KHR_animation_pointer": { "pointer": "/nodes/4/extensions/KHR_node_visibility/visible" } }, "path": "pointer" } }],
36+
"name": "RESET",
37+
"samplers": [{ "input": 22, "interpolation": "LINEAR", "output": 23 }]
38+
}
39+
],
40+
"asset": { "generator": "Godot Engine v4.6.dev.custom_build@8e14f6877bdabab10586c8a4d71f2cf82519475d", "version": "2.0" },
41+
"bufferViews": [
42+
{ "buffer": 0, "byteLength": 288, "byteStride": 12, "target": 34962 },
43+
{ "buffer": 0, "byteLength": 384, "byteOffset": 288, "byteStride": 16, "target": 34962 },
44+
{ "buffer": 0, "byteLength": 288, "byteOffset": 672, "byteStride": 12, "target": 34962 },
45+
{ "buffer": 0, "byteLength": 192, "byteOffset": 960, "byteStride": 8, "target": 34962 },
46+
{ "buffer": 0, "byteLength": 72, "byteOffset": 1152, "target": 34963 },
47+
{ "buffer": 0, "byteLength": 288, "byteOffset": 1224, "byteStride": 12, "target": 34962 },
48+
{ "buffer": 0, "byteLength": 384, "byteOffset": 1512, "byteStride": 16, "target": 34962 },
49+
{ "buffer": 0, "byteLength": 288, "byteOffset": 1896, "byteStride": 12, "target": 34962 },
50+
{ "buffer": 0, "byteLength": 192, "byteOffset": 2184, "byteStride": 8, "target": 34962 },
51+
{ "buffer": 0, "byteLength": 72, "byteOffset": 2376, "target": 34963 },
52+
{ "buffer": 0, "byteLength": 288, "byteOffset": 2448, "byteStride": 12, "target": 34962 },
53+
{ "buffer": 0, "byteLength": 384, "byteOffset": 2736, "byteStride": 16, "target": 34962 },
54+
{ "buffer": 0, "byteLength": 288, "byteOffset": 3120, "byteStride": 12, "target": 34962 },
55+
{ "buffer": 0, "byteLength": 192, "byteOffset": 3408, "byteStride": 8, "target": 34962 },
56+
{ "buffer": 0, "byteLength": 72, "byteOffset": 3600, "target": 34963 },
57+
{ "buffer": 0, "byteLength": 288, "byteOffset": 3672, "byteStride": 12, "target": 34962 },
58+
{ "buffer": 0, "byteLength": 384, "byteOffset": 3960, "byteStride": 16, "target": 34962 },
59+
{ "buffer": 0, "byteLength": 288, "byteOffset": 4344, "byteStride": 12, "target": 34962 },
60+
{ "buffer": 0, "byteLength": 192, "byteOffset": 4632, "byteStride": 8, "target": 34962 },
61+
{ "buffer": 0, "byteLength": 72, "byteOffset": 4824, "target": 34963 },
62+
{ "buffer": 0, "byteLength": 44, "byteOffset": 4896 },
63+
{ "buffer": 0, "byteLength": 44, "byteOffset": 4940 },
64+
{ "buffer": 0, "byteLength": 4, "byteOffset": 4984 },
65+
{ "buffer": 0, "byteLength": 4, "byteOffset": 4988 }
66+
],
67+
"buffers": [{ "byteLength": 4992, "uri": "cube_visibility0.bin" }],
68+
"extensionsRequired": ["KHR_node_visibility"],
69+
"extensionsUsed": ["GODOT_single_root", "KHR_animation_pointer", "KHR_node_visibility"],
70+
"materials": [
71+
{ "extensions": {}, "pbrMetallicRoughness": { "baseColorFactor": [0.8549925684928894, 0.005605390761047602, 0.005605390761047602, 1.0], "metallicFactor": 0.0, "roughnessFactor": 1.0 } },
72+
{ "extensions": {}, "pbrMetallicRoughness": { "baseColorFactor": [0.005605390761047602, 0.8549925684928894, 0.005605390761047602, 1.0], "metallicFactor": 0.0, "roughnessFactor": 1.0 } },
73+
{ "extensions": {}, "pbrMetallicRoughness": { "baseColorFactor": [0.005605390761047602, 0.005605390761047602, 0.8549925684928894, 1.0], "metallicFactor": 0.0, "roughnessFactor": 1.0 } }
74+
],
75+
"meshes": [
76+
{ "primitives": [{ "attributes": { "NORMAL": 2, "POSITION": 0, "TANGENT": 1, "TEXCOORD_0": 3 }, "indices": 4, "material": 0, "mode": 4 }] },
77+
{ "primitives": [{ "attributes": { "NORMAL": 7, "POSITION": 5, "TANGENT": 6, "TEXCOORD_0": 8 }, "indices": 9, "material": 0, "mode": 4 }] },
78+
{ "primitives": [{ "attributes": { "NORMAL": 12, "POSITION": 10, "TANGENT": 11, "TEXCOORD_0": 13 }, "indices": 14, "material": 1, "mode": 4 }] },
79+
{ "primitives": [{ "attributes": { "NORMAL": 17, "POSITION": 15, "TANGENT": 16, "TEXCOORD_0": 18 }, "indices": 19, "material": 2, "mode": 4 }] }
80+
],
81+
"nodes": [
82+
{ "children": [1, 3, 4], "name": "CubeVisibility" },
83+
{ "children": [2], "extensions": { "KHR_node_visibility": { "visible": false } }, "mesh": 0, "name": "InvisibleCube", "translation": [-1.5, 0.0, 0.0] },
84+
{ "mesh": 1, "name": "ChildOfInvisibleShouldBeInvisible", "translation": [0.0, 1.5, 0.0] },
85+
{ "mesh": 2, "name": "VisibleCube" },
86+
{ "mesh": 3, "name": "AnimatedVisibility", "translation": [1.5, 0.0, 0.0] }
87+
],
88+
"scene": 0,
89+
"scenes": [{ "nodes": [0] }]
90+
}
4.88 KB
Binary file not shown.
224 KB
Loading

Models/Models-showcase.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Models that demonstrate interactive features of glTF.
88
|---------|-------------|
99
| [Calculator](Calculator/README.md)<br>[![Calculator](Calculator/screenshot/screenshot.png)](Calculator/README.md)<br>[Show](https://gltf-interactivity.needle.tools?model=https://raw.GithubUserContent.com/KhronosGroup/glTF-Interactivity-Sample-Assets/main/Models/Calculator/glTF-Binary/Calculator.glb)[Download GLB](https://raw.GithubUserContent.com/KhronosGroup/glTF-Interactivity-Sample-Assets/main/Models/Calculator/glTF-Binary/Calculator.glb) | |
1010
| [Construction Site](ConstructionSite/README.md)<br>[![Construction Site](ConstructionSite/screenshot/screenshot.png)](ConstructionSite/README.md)<br>[Show](https://gltf-interactivity.needle.tools?model=https://raw.GithubUserContent.com/KhronosGroup/glTF-Interactivity-Sample-Assets/main/Models/ConstructionSite/glTF-Binary/ConstructionSite.glb)[Download GLB](https://raw.GithubUserContent.com/KhronosGroup/glTF-Interactivity-Sample-Assets/main/Models/ConstructionSite/glTF-Binary/ConstructionSite.glb) | Click the lamps to activate them. |
11+
| [Cube Visibility](CubeVisibility/README.md)<br>[![Cube Visibility](CubeVisibility/screenshot/screenshot_animated.webp)](CubeVisibility/README.md)<br>[Show](https://gltf-interactivity.needle.tools?model=https://raw.GithubUserContent.com/KhronosGroup/glTF-Interactivity-Sample-Assets/main/Models/CubeVisibility/glTF-Binary/cube_visibility.glb)[Download GLB](https://raw.GithubUserContent.com/KhronosGroup/glTF-Interactivity-Sample-Assets/main/Models/CubeVisibility/glTF-Binary/cube_visibility.glb) | Demonstrates KHR_node_visibility and its interaction with KHR_animation_pointer. |
1112
| [Ghost](Ghost/README.md)<br>[![Ghost](Ghost/screenshot/screenshot.png)](Ghost/README.md)<br>[Show](https://gltf-interactivity.needle.tools?model=https://raw.GithubUserContent.com/KhronosGroup/glTF-Interactivity-Sample-Assets/main/Models/Ghost/glTF-Binary/ghost_v2.glb)[Download GLB](https://raw.GithubUserContent.com/KhronosGroup/glTF-Interactivity-Sample-Assets/main/Models/Ghost/glTF-Binary/ghost_v2.glb) | Hover over the ghost to trigger animation |
1213
| [Magic Ball](MagicBall/README.md)<br>[![Magic Ball](MagicBall/screenshot/screenshot.png)](MagicBall/README.md)<br>[Show](https://gltf-interactivity.needle.tools?model=https://raw.GithubUserContent.com/KhronosGroup/glTF-Interactivity-Sample-Assets/main/Models/MagicBall/glTF-Binary/MagicBall.glb)[Download GLB](https://raw.GithubUserContent.com/KhronosGroup/glTF-Interactivity-Sample-Assets/main/Models/MagicBall/glTF-Binary/MagicBall.glb) | Click on the center of the ball to shuffle the texts. |
1314
| [Snail Race](SnailRace/README.md)<br>[![Snail Race](SnailRace/screenshot/screenshot.png)](SnailRace/README.md)<br>[Show](https://gltf-interactivity.needle.tools?model=https://raw.GithubUserContent.com/KhronosGroup/glTF-Interactivity-Sample-Assets/main/Models/SnailRace/glTF-Binary/SnailRace.glb)[Download GLB](https://raw.GithubUserContent.com/KhronosGroup/glTF-Interactivity-Sample-Assets/main/Models/SnailRace/glTF-Binary/SnailRace.glb) | Click on one of the GO-buttons, to trigger a movement. |
@@ -26,4 +27,4 @@ Models that demonstrate interactive features of glTF.
2627

2728
&copy; 2025, The Khronos Group and Needle.
2829

29-
**License:** [Creative Commons Attribtution 4.0 International](https://creativecommons.org/licenses/by/4.0/legalcode)
30+
**License:** [Creative Commons Attribtution 4.0 International](https://creativecommons.org/licenses/by/4.0/legalcode)

Models/model-index.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,18 @@
1818
"glTF-Binary": "ConstructionSite.glb"
1919
}
2020
},
21-
{
21+
{
22+
"label": "Cube Visibility",
23+
"name": "CubeVisibility",
24+
"screenshot": "screenshot/screenshot_animated.webp",
25+
"description": "Demonstrates KHR_node_visibility and its interaction with KHR_animation_pointer.",
26+
"tags": ["animation", "minimal"],
27+
"variants": {
28+
"glTF-Binary": "cube_visibility.glb",
29+
"glTF-Text": "cube_visibility.gltf"
30+
}
31+
},
32+
{
2233
"label": "Ghost",
2334
"name": "Ghost",
2435
"screenshot": "screenshot/screenshot.png",
@@ -127,4 +138,4 @@
127138
}
128139
}
129140

130-
]
141+
]

0 commit comments

Comments
 (0)