Skip to content

Commit 6bc3872

Browse files
committed
Add light visibility test model for KHR_node_visibility
1 parent 6da966b commit 6bc3872

6 files changed

Lines changed: 80 additions & 0 deletions

File tree

Models/LightVisibility/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Light 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 any of the red lights, it is not compliant with `KHR_node_visibility`.
6+
7+
- If your implementation does not have the blue light 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+
![Light 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/LightVisibility/glTF-Binary/LightVisibility.glb)[Download GLB](https://raw.githubusercontent.com/KhronosGroup/glTF-Interactivity-Sample-Assets/main/Models/LightVisibility/glTF-Binary/LightVisibility.glb)
2.87 KB
Binary file not shown.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"accessors": [
3+
{ "bufferView": 0, "componentType": 5126, "count": 4, "max": [3.0, 1.5, 0.0], "min": [-3.0, -1.5, 0.0], "normalized": false, "type": "VEC3" },
4+
{
5+
"bufferView": 1,
6+
"componentType": 5126,
7+
"count": 4,
8+
"max": [-1.5259254723787308e-5, -1.5259254723787308e-5, 1.0],
9+
"min": [-1.5259254723787308e-5, -1.5259254723787308e-5, 1.0],
10+
"normalized": false,
11+
"type": "VEC3"
12+
},
13+
{ "bufferView": 2, "componentType": 5121, "count": 6, "max": [3], "min": [0], "normalized": false, "type": "SCALAR" },
14+
{ "bufferView": 3, "componentType": 5126, "count": 11, "max": [5.0], "min": [0.0], "normalized": false, "type": "SCALAR" },
15+
{ "bufferView": 4, "componentType": 5121, "count": 11, "max": [1], "min": [0], "normalized": false, "type": "SCALAR" }
16+
],
17+
"animations": [
18+
{
19+
"channels": [{ "sampler": 0, "target": { "extensions": { "KHR_animation_pointer": { "pointer": "/nodes/5/extensions/KHR_node_visibility/visible" } }, "path": "pointer" } }],
20+
"name": "BlinkingBlueLight",
21+
"samplers": [{ "input": 3, "interpolation": "STEP", "output": 4 }]
22+
}
23+
],
24+
"asset": { "copyright": "2025 The Khronos Group", "generator": "Godot Engine v4.6.dev.custom_build", "version": "2.0" },
25+
"bufferViews": [
26+
{ "buffer": 0, "byteLength": 48, "byteStride": 12, "target": 34962 },
27+
{ "buffer": 0, "byteLength": 48, "byteOffset": 48, "byteStride": 12, "target": 34962 },
28+
{ "buffer": 0, "byteLength": 6, "byteOffset": 96, "target": 34963 },
29+
{ "buffer": 0, "byteLength": 44, "byteOffset": 104 },
30+
{ "buffer": 0, "byteLength": 11, "byteOffset": 148 }
31+
],
32+
"buffers": [{ "byteLength": 159, "uri": "LightVisibility0.bin" }],
33+
"extensions": {
34+
"KHR_lights_punctual": {
35+
"lights": [
36+
{ "color": [1.0, 0.0, 0.0], "intensity": 5.0, "range": 5.0, "spot": { "innerConeAngle": 0.65, "outerConeAngle": 0.8 }, "type": "spot" },
37+
{ "color": [0.0, 1.0, 0.0], "intensity": 5.0, "range": 5.0, "spot": { "innerConeAngle": 0.65, "outerConeAngle": 0.8 }, "type": "spot" },
38+
{ "color": [0.0, 0.125, 1.0], "intensity": 6.0, "range": 5.0, "spot": { "innerConeAngle": 0.65, "outerConeAngle": 0.8 }, "type": "spot" }
39+
]
40+
}
41+
},
42+
"extensionsRequired": ["KHR_lights_punctual", "KHR_node_visibility"],
43+
"extensionsUsed": ["KHR_animation_pointer", "KHR_lights_punctual", "KHR_node_visibility"],
44+
"meshes": [{ "primitives": [{ "attributes": { "NORMAL": 1, "POSITION": 0 }, "indices": 2, "mode": 4 }] }],
45+
"nodes": [
46+
{ "children": [1, 4, 5, 6], "name": "LightVisibility" },
47+
{ "children": [2], "extensions": { "KHR_lights_punctual": { "light": 0 }, "KHR_node_visibility": { "visible": false } }, "name": "InvisibleLight", "translation": [-1.5, 0.0, 1.0] },
48+
{ "children": [3], "extensions": { "KHR_lights_punctual": { "light": 0 } }, "name": "ChildOfInvisibleShouldBeInvisible" },
49+
{ "extensions": { "KHR_lights_punctual": { "light": 0 } }, "name": "DescendantOfInvisibleShouldBeInvisible" },
50+
{ "extensions": { "KHR_lights_punctual": { "light": 1 } }, "name": "VisibleLight", "translation": [0.0, 0.0, 1.0] },
51+
{ "extensions": { "KHR_lights_punctual": { "light": 2 }, "KHR_node_visibility": { "visible": true } }, "name": "AnimatedVisibility", "translation": [1.5, 0.0, 1.0] },
52+
{ "mesh": 0, "name": "QuadMeshNode" }
53+
],
54+
"scene": 0,
55+
"scenes": [{ "nodes": [0] }]
56+
}
159 Bytes
Binary file not shown.
134 KB
Loading

Models/model-index.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@
3939
"glTF-Binary": "ghost_v2.glb"
4040
}
4141
},
42+
{
43+
"label": "Light Visibility",
44+
"name": "LightVisibility",
45+
"screenshot": "screenshot/screenshot_animated.webp",
46+
"description": "Demonstrates KHR_node_visibility and its interaction with KHR_animation_pointer.",
47+
"tags": ["animation", "minimal"],
48+
"variants": {
49+
"glTF-Binary": "LightVisibility.glb",
50+
"glTF": "LightVisibility.gltf"
51+
}
52+
},
4253
{
4354
"label": "Magic Ball",
4455
"name": "MagicBall",

0 commit comments

Comments
 (0)