Skip to content

Commit 41549aa

Browse files
authored
KHR_node_visibility (#2410)
1 parent 603619e commit 41549aa

2 files changed

Lines changed: 129 additions & 0 deletions

File tree

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# KHR\_node\_visibility
2+
3+
## Contributors
4+
5+
- Dwight Rodgers, Adobe
6+
- Peter Martin, Adobe
7+
- Emmett Lalish, Google
8+
- Alexey Knyazev, Independent
9+
10+
## Status
11+
12+
Release Candidate
13+
14+
## Dependencies
15+
16+
Written against the glTF 2.0 spec.
17+
18+
## Overview
19+
20+
This extension allows to control visibility of node hierarchies. It is intended for use in conjunction with `KHR_animation_pointer` and/or interactivity extensions but can also be used on its own.
21+
22+
## Extending Nodes
23+
24+
The `KHR_node_visibility` extension object is added to the objects within the `nodes` array. The extension object contains a single boolean `visible` property. This value is mutable through JSON pointers as defined in the glTF 2.0 Asset Object Model and controls visibility of the node that contains it and all its children nodes recursively. A value of `false` causes all nodes below in the hierarchy to be omitted from display, even any nodes below that have a value of `true`.
25+
26+
When a node is not visible, all its visual features including but not limited to meshes, light sources (e.g., attached with `KHR_lights_punctual`), point clouds, particles, billboards, volumetric effects, etc., are not rendered. Visibility affects neither cameras, nor node's interactivity features such as selectability or hoverability.
27+
28+
| Property | Type | Description | Required |
29+
|-------------|-----------|----------------------------------------|---------------------|
30+
| **visible** | `boolean` | Specifies whether the node is visible. | No, default: `true` |
31+
32+
In other words, a node is visible if and only if its own `visible` property is `true` and all its parents are visible. This allows a single change of a `visible` property at a high level of the hierarchy to hide or show complex (multi-node) objects.
33+
34+
In the following example, both nodes (and therefore their meshes) are initially hidden.
35+
36+
```json
37+
{
38+
"nodes": [
39+
{
40+
"children": [1],
41+
"mesh": 0,
42+
"extensions": {
43+
"KHR_node_visibility": {
44+
"visible": false
45+
}
46+
},
47+
},
48+
{
49+
"mesh": 1
50+
}
51+
]
52+
}
53+
```
54+
55+
## Extending glTF 2.0 Asset Object Model
56+
57+
The following pointer template represents the mutable property defined by this extension.
58+
59+
| Pointer | Type |
60+
|----------------------------------------------------|--------|
61+
| `/nodes/{}/extensions/KHR_node_visibility/visible` | `bool` |
62+
63+
## JSON Schema
64+
65+
- [node.KHR_node_visibility.schema.json](schema/node.KHR_node_visibility.schema.json)
66+
67+
## Appendix: Full Khronos Copyright Statement
68+
69+
Copyright 2025 The Khronos Group Inc.
70+
71+
This Specification is protected by copyright laws and contains material proprietary
72+
to Khronos. Except as described by these terms, it or any components
73+
may not be reproduced, republished, distributed, transmitted, displayed, broadcast
74+
or otherwise exploited in any manner without the express prior written permission
75+
of Khronos.
76+
77+
Khronos grants a conditional copyright license to use and reproduce the unmodified
78+
Specification for any purpose, without fee or royalty, EXCEPT no licenses to any patent,
79+
trademark or other intellectual property rights are granted under these terms.
80+
81+
Khronos makes no, and expressly disclaims any, representations or warranties,
82+
express or implied, regarding this Specification, including, without limitation:
83+
merchantability, fitness for a particular purpose, non-infringement of any
84+
intellectual property, correctness, accuracy, completeness, timeliness, and
85+
reliability. Under no circumstances will Khronos, or any of its Promoters,
86+
Contributors or Members, or their respective partners, officers, directors,
87+
employees, agents or representatives be liable for any damages, whether direct,
88+
indirect, special or consequential damages for lost revenues, lost profits, or
89+
otherwise, arising from or in connection with these materials.
90+
91+
This specification has been created under the Khronos Intellectual Property Rights
92+
Policy, which is Attachment A of the Khronos Group Membership Agreement available at
93+
https://www.khronos.org/files/member_agreement.pdf. Khronos grants a conditional
94+
copyright license to use and reproduce the unmodified specification for any purpose,
95+
without fee or royalty, EXCEPT no licenses to any patent, trademark or other
96+
intellectual property rights are granted under these terms. Parties desiring to
97+
implement the specification and make use of Khronos trademarks in relation to that
98+
implementation, and receive reciprocal patent license protection under the Khronos
99+
IP Policy must become Adopters and confirm the implementation as conformant under
100+
the process defined by Khronos for this specification;
101+
see https://www.khronos.org/conformance/adopters/file-format-adopter-program.
102+
103+
Where this Specification identifies specific sections of external references, only those
104+
specifically identified sections define normative functionality. The Khronos Intellectual
105+
Property Rights Policy excludes external references to materials and associated enabling
106+
technology not created by Khronos from the Scope of this Specification, and any licenses
107+
that may be required to implement such referenced materials and associated technologies
108+
must be obtained separately and may involve royalty payments.
109+
110+
Khronos® is a registered trademark, and glTF™ is a trademark of The Khronos Group Inc. All
111+
other product names, trademarks, and/or company names are used solely for identification
112+
and belong to their respective owners.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema",
3+
"title": "KHR_node_visibility glTF Node Extension",
4+
"type": "object",
5+
"description": "glTF extension that defines node's visibility.",
6+
"allOf": [ { "$ref": "glTFProperty.schema.json" } ],
7+
"properties": {
8+
"visible": {
9+
"type": "boolean",
10+
"description": "Specifies whether the node is visible.",
11+
"default": true,
12+
"gltf_detailedDescription": "Specifies whether the node is visible. A value of false means that the node and all its children are hidden."
13+
},
14+
"extensions": { },
15+
"extras": { }
16+
}
17+
}

0 commit comments

Comments
 (0)