-
Notifications
You must be signed in to change notification settings - Fork 1.2k
KHR_animation_pointer #2147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
lexaknyazev
merged 50 commits into
KhronosGroup:main
from
ux3d:extensions/KHR_animation_pointer
Feb 26, 2024
Merged
KHR_animation_pointer #2147
Changes from all commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
d2d2e2f
add transmission specs
jim-ec 36c5432
add thickness spec
jim-ec 03276f9
add absorption spec
jim-ec 8701f10
remove optional dependency on thickness
jim-ec 0aa4f66
fix transmission spec
jim-ec dfda721
Update README.md
2f0a7bf
Update README.md
9b52d13
refactor to refraction extension
jim-ec a87419f
update thickness extension
jim-ec f4f6eba
move thickness extension to its own branch
jim-ec e308ef5
initial draft
jim-ec 6ebfa3c
improve thickness extension
jim-ec d0196ac
Merge pull request #3 from KhronosGroup/master
UX3D-nopper 90c91ea
Merge branch 'master' into extensions/KHR_materials_thickness
jim-ec 36ab973
Merge branch 'master' into extensions/KHR_materials_transmission
jim-ec 5b6a698
remove refraction related files as already present in KHR_materials_r…
jim-ec ed16458
remove absorption related files as already present in KHR_materials_a…
jim-ec 0c9896b
Merge pull request #4 from ux3d/extensions/KHR_materials_transmission
5d7d535
Minor fixes.
UX3D-nopper 285d945
Merge pull request #7 from ux3d/extensions/KHR_materials_thickness
UX3D-nopper 1ac92d0
Merge pull request #8 from KhronosGroup/master
UX3D-nopper 821b165
Initial draft for EXT_lights_environment
UX3D-nopper a2f177c
Removed thickness.
UX3D-nopper 5cd666e
Fixed some typos. Clarified the coordinate system.
UX3D-nopper 969ec0b
Added physical units.
UX3D-nopper 785ce36
Merge pull request #9 from KhronosGroup/master
UX3D-nopper 3a89422
Merge pull request #10 from KhronosGroup/master
UX3D-nopper f4c8f41
Merge pull request #12 from KhronosGroup/master
UX3D-nopper ab25476
Merge pull request #13 from KhronosGroup/master
UX3D-nopper a8510d2
Merge pull request #14 from KhronosGroup/main
UX3D-nopper 9ab4997
Merge pull request #15 from KhronosGroup/main
UX3D-nopper ef0827b
Merge pull request #16 from KhronosGroup/main
UX3D-nopper 869d10a
Merge pull request #18 from KhronosGroup/main
UX3D-nopper cff5737
Clean KHR_animation_pointer
UX3D-nopper 46436ff
Removed not required extensions.
UX3D-nopper ebd91b8
Clean KHR_animation_pointer
UX3D-nopper 30e55a0
Merge branch 'extensions/KHR_animation_pointer' of github.com:ux3d/gl…
UX3D-nopper 7a5fe98
added clarification regarding material animation.
hybridherbst 9ec5cfe
Merge pull request #19 from prefrontalcortex/add-material-anim-notes-…
UX3D-nopper f35e2b2
Fixed required from path to pointer, as the property was renamed.
UX3D-nopper 5004fcf
Renamed path to pointer. Added clarification, when pointer is
UX3D-nopper d5b4ea7
Cleaned up tables and added missing emissive strength.
UX3D-nopper 199bc9c
Clarified name animation in general. Added iridescence.
UX3D-nopper 397a9f7
Added clarifications.
UX3D-nopper 95e28d5
Removed matrix animation.
UX3D-nopper 32de659
Sync KHR_animation_pointer extension spec
lexaknyazev c9a089a
Rename the schema file
lexaknyazev ea5bf27
Tightened valid usage & updated examples
lexaknyazev 16e0975
Update status & fix punctuation
lexaknyazev f801241
Add links
lexaknyazev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,257 @@ | ||
| # KHR\_animation\_pointer | ||
|
|
||
| ## Contributors | ||
|
|
||
| - Alexey Knyazev | ||
| - Ben Houston, Threekit | ||
| - Bryce Hutchings, Microsoft [@brycehutchings](https://twitter.com/brycehutchings) | ||
| - Don McCurdy | ||
| - Ed Mackey, AGI [@emackey](https://github.com/emackey) | ||
| - Felix Herbst, prefrontal cortex [@hybridherbst](https://twitter.com/hybridherbst) | ||
| - Gary Hsu, Microsoft [@bghgary](https://twitter.com/bghgary) | ||
| - Jamie Marconi, Microsoft [@najadojo](https://twitter.com/najadojo) | ||
| - Joe Herdman, [@jbherdman](https://github.com/jbherdman) | ||
| - Lewis Weaver, Microsoft | ||
| - Marco Hutter | ||
| - Norbert Nopper, UX3D [@UX3DGpuSoftware](https://twitter.com/UX3DGpuSoftware) | ||
|
|
||
| Copyright 2024 The Khronos Group Inc. | ||
| See [Appendix](#appendix-full-khronos-copyright-statement) for full Khronos Copyright Statement. | ||
|
|
||
| ## Status | ||
|
|
||
| Release Candidate | ||
|
|
||
| ## Dependencies | ||
|
|
||
| Written against the glTF 2.0 spec. | ||
|
|
||
| ## Overview | ||
|
|
||
| This extension provides a standardized way of animating arbitrary glTF properties according to the [glTF 2.0 Asset Object Model](../../../../specification/2.0/ObjectModel.adoc). | ||
|
|
||
| ### Motivation | ||
|
|
||
| The base glTF 2.0 specification supports animating only node transformation or morph target weights. With this extension, an animation can target any mutable property in a glTF asset, such as material factors or camera field of view. | ||
|
|
||
| The **glTF 2.0 Asset Object Model** defines JSON pointers and data types of the mutable glTF properties. | ||
|
|
||
| ### Operation | ||
|
|
||
| Each animation target specified by the JSON Pointer is resolved to the corresponding glTF asset property and the value of the latter is dynamically updated using values provided by the animation channel output accessor. The property being animated **MUST** be mutable as defined by the **glTF 2.0 Asset Object Model**. | ||
|
|
||
| The JSON Pointer **MUST** point to a property defined in the asset. A property is considered defined if it is present in the asset explicitly or if it has a default value and its enclosing object is present. | ||
|
|
||
| In the following example, both the `/materials/0/pbrMetallicRoughness/baseColorFactor` and `/materials/0/pbrMetallicRoughness/metallicFactor` are valid pointers: the base color factor is defined explicitly while the metallic factor has a spec-defined default value and the `pbrMetallicRoughness` object is defined. | ||
|
|
||
| ```json | ||
| { | ||
| "asset": { | ||
| "version": "2.0" | ||
| }, | ||
| "materials": [ | ||
| { | ||
| "pbrMetallicRoughness": { | ||
| "baseColorFactor": [ 1.0, 0.0, 0.0, 1.0 ], | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| Pointers to the asset properties that do not have a spec-defined default value, such as `/cameras/0/perspective/zfar`, are invalid if the property is not defined in the asset explicitly. | ||
|
|
||
| The same property **MUST NOT** be targeted more than once in one animation, i.e., different channels of the same animation **MUST NOT**: | ||
|
|
||
| - have identical pointers; | ||
| - target an array property and individual elements of the same array; | ||
| - target the same node property with a pointer and with an unextended animation target object. | ||
|
|
||
| The output accessor **MUST** be compatible with the animated property data type (see the table below) and the values provided by it **MUST** be valid for the property being animated. | ||
|
|
||
| | Asset Object Model Data Type | Output Accessor Type | | ||
| |------------|---| | ||
| | `bool` | SCALAR | | ||
| | `float` | SCALAR | | ||
| | `float[]` | SCALAR | | ||
| | `float2` | VEC2 | | ||
| | `float3` | VEC3 | | ||
| | `float4` | VEC4 | | ||
| | `float2x2` | MAT2 | | ||
| | `float3x3` | MAT3 | | ||
| | `float4x4` | MAT4 | | ||
| | `int` | SCALAR | | ||
|
|
||
| > [!NOTE] | ||
| > There are currently no mutable properties of matrix types in the ratified glTF 2.0 specification or extensions. | ||
|
|
||
| #### Output Accessor Component Types | ||
|
|
||
| If the Object Model Data Type is one of the `float*` types, the output accessor values are converted based on the accessor's component type as follows: | ||
|
|
||
| - float accessor values are used as-is; | ||
| - non-normalized integer accessor values are converted to the equal floating-point values, e.g., `1` to `1.0`; | ||
| - normalized integer accessor values are converted using the equations from the [Animations section of the glTF 2.0 specification](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#animations). | ||
|
|
||
| Keyframe interpolation **MUST** happen after type conversions, using floating-point values. | ||
|
|
||
| If the Object Model Data Type is `int`, the output accessor component type **MUST** be one of the non-normalized integer types and its values are used as-is. | ||
|
|
||
| If the Object Model Data Type is `bool`, the output accessor component type **MUST** be _unsigned byte_; `0` is converted to `false`, any other value is converted to `true`. | ||
|
|
||
| Animation samplers used with `int` or `bool` Object Model Data Types **MUST** use `STEP` interpolation. | ||
|
|
||
| #### `extras` | ||
|
|
||
| Properties located in `extras` objects **MAY** be targeted as well, but validity and interpretation of the animated values is entirely application specific. | ||
|
|
||
| ## Extension Usage | ||
|
|
||
| To use this extension, the animation channel target path **MUST** be set to `"pointer"` and the actual JSON pointer value is provided in the extension object's `pointer` property. The animation channel `node` property **MUST NOT** be set. | ||
|
|
||
| > [!NOTE] | ||
| > Implementations not supporting this extension will ignore animation channels with undefined `node` properties according to the base glTF 2.0 specification. | ||
|
|
||
| ## glTF Schema Updates | ||
|
|
||
| - **JSON schema**: [animation.channel.target.KHR_animation_pointer.schema.json](schema/animation.channel.target.KHR_animation_pointer.schema.json) | ||
|
|
||
| ## Examples | ||
|
|
||
| ### Node Rotation | ||
|
|
||
| The following two snippets represent the same animation expressed with an unextended animation target and with the animation pointer extension. | ||
|
|
||
| ```json | ||
| "animations": [ | ||
| { | ||
| "channels": [ | ||
| { | ||
| "sampler": 0, | ||
| "target": { | ||
| "node": 0, | ||
| "path": "rotation" | ||
| } | ||
| } | ||
| ], | ||
| "samplers": [ | ||
| { | ||
| "input": 0, | ||
| "interpolation": "LINEAR", | ||
| "output": 1 | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| ``` | ||
|
|
||
| ```json | ||
| "animations": [ | ||
| { | ||
| "channels": [ | ||
| { | ||
| "sampler": 0, | ||
| "target": { | ||
| "path": "pointer", | ||
| "extensions": { | ||
| "KHR_animation_pointer": { | ||
| "pointer": "/nodes/0/rotation" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ], | ||
| "samplers": [ | ||
| { | ||
| "input": 0, | ||
| "interpolation": "LINEAR", | ||
| "output": 1 | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| ``` | ||
|
|
||
| ### Base Color | ||
|
|
||
| The following animation uses the animation pointer extension to target a base color factor. | ||
|
|
||
| ```json | ||
| "animations": [ | ||
| { | ||
| "channels": [ | ||
| { | ||
| "sampler": 0, | ||
| "target": { | ||
| "path": "pointer", | ||
| "extensions": { | ||
| "KHR_animation_pointer": { | ||
| "pointer": "/materials/0/pbrMetallicRoughness/baseColorFactor" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ], | ||
| "samplers": [ | ||
| { | ||
| "input": 0, | ||
| "interpolation": "LINEAR", | ||
| "output": 1 | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| ``` | ||
|
|
||
| ## References | ||
|
|
||
| - [glTF 2.0 Asset Object Model](../../../../specification/2.0/ObjectModel.adoc) | ||
|
|
||
| - [JavaScript Object Notation (JSON) Pointer, RFC 6901](https://www.rfc-editor.org/info/rfc6901) | ||
|
|
||
| ## Appendix: Full Khronos Copyright Statement | ||
|
|
||
| Copyright 2024 The Khronos Group Inc. | ||
|
|
||
| This Specification is protected by copyright laws and contains material proprietary | ||
| to Khronos. Except as described by these terms, it or any components | ||
| may not be reproduced, republished, distributed, transmitted, displayed, broadcast | ||
| or otherwise exploited in any manner without the express prior written permission | ||
| of Khronos. | ||
|
|
||
| Khronos grants a conditional copyright license to use and reproduce the unmodified | ||
| Specification for any purpose, without fee or royalty, EXCEPT no licenses to any patent, | ||
| trademark or other intellectual property rights are granted under these terms. | ||
|
|
||
| Khronos makes no, and expressly disclaims any, representations or warranties, | ||
| express or implied, regarding this Specification, including, without limitation: | ||
| merchantability, fitness for a particular purpose, non-infringement of any | ||
| intellectual property, correctness, accuracy, completeness, timeliness, and | ||
| reliability. Under no circumstances will Khronos, or any of its Promoters, | ||
| Contributors or Members, or their respective partners, officers, directors, | ||
| employees, agents or representatives be liable for any damages, whether direct, | ||
| indirect, special or consequential damages for lost revenues, lost profits, or | ||
| otherwise, arising from or in connection with these materials. | ||
|
|
||
| This specification has been created under the Khronos Intellectual Property Rights | ||
| Policy, which is Attachment A of the Khronos Group Membership Agreement available at | ||
| https://www.khronos.org/files/member_agreement.pdf. Khronos grants a conditional | ||
| copyright license to use and reproduce the unmodified specification for any purpose, | ||
| without fee or royalty, EXCEPT no licenses to any patent, trademark or other | ||
| intellectual property rights are granted under these terms. Parties desiring to | ||
| implement the specification and make use of Khronos trademarks in relation to that | ||
| implementation, and receive reciprocal patent license protection under the Khronos | ||
| IP Policy must become Adopters and confirm the implementation as conformant under | ||
| the process defined by Khronos for this specification; | ||
| see https://www.khronos.org/conformance/adopters/file-format-adopter-program. | ||
|
|
||
| Where this Specification identifies specific sections of external references, only those | ||
| specifically identified sections define normative functionality. The Khronos Intellectual | ||
| Property Rights Policy excludes external references to materials and associated enabling | ||
| technology not created by Khronos from the Scope of this Specification, and any licenses | ||
| that may be required to implement such referenced materials and associated technologies | ||
| must be obtained separately and may involve royalty payments. | ||
|
|
||
| Khronos® is a registered trademark, and glTF™ is a trademark of The Khronos Group Inc. All | ||
| other product names, trademarks, and/or company names are used solely for identification | ||
| and belong to their respective owners. | ||
17 changes: 17 additions & 0 deletions
17
...s/KHR_animation_pointer/schema/animation.channel.target.KHR_animation_pointer.schema.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "title": "KHR_animation_pointer glTF Animation Channel Target Extension", | ||
| "type": "object", | ||
| "description": "Extension object providing the JSON Pointer to the animated property.", | ||
| "allOf": [ { "$ref": "glTFProperty.schema.json" } ], | ||
| "properties": { | ||
| "pointer": { | ||
| "type": "string", | ||
| "format": "json-pointer", | ||
| "description": "JSON pointer to the animated property. The animation channel path value **MUST** be `pointer`." | ||
| }, | ||
| "extensions": { }, | ||
| "extras": { } | ||
| }, | ||
| "required": [ "pointer" ] | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.