-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add KHR_interactivity draft #2293
base: main
Are you sure you want to change the base?
Conversation
Great work! What sections are next? Also what could we release as a draft extension for SIGGRAPH 2023? |
ec4a047
to
09bd2cf
Compare
8e44b46
to
151f3ad
Compare
|=== | ||
| Type | `math/pi` | Ratio of a circle's circumference to its diameter | ||
| Output value sockets | `float value` | 3.141592653589793 | ||
|=== |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we have Pi, we should also have Tau. https://tauday.com/tau-manifesto The value Tau is the circle constant (equal to 2*Pi, or rather, Pi is half of Tau). Using Tau usually results in more readable code. Tau is supported in many programming languages such as C#, Java, Python, GDScript, Rust, Unreal Blueprints, and more, so it's useful for interoperability with other languages, especially Unreal Blueprints which is conceptually similar.
===== Tau
[cols="1h,1,2"]
|===
| Type | `math/tau` | The circle constant, the circumference of the unit circle in radians.
| Output value sockets | `float value` | 6.2831853071795862
|===
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case more justification is needed, the KHR_interactivity document currently contains Degrees-To-Radians (math/rad
) and Radians-To-Degrees (math/deg
). These allow converting between degrees and radians. Tau can be used for a similarly important purpose, dividing or multiplying by this number allows converting between turns and radians, where 1 turn is τ radians. Tau can be used for more than just this, but the point is, if math/rad
and math/deg
are justified as a part of KHR_interactivity for converting angles, then math/tau
is also justified for converting angles.
dc870c5
to
29e8acc
Compare
| `T value` | The custom variable value | ||
|=== | ||
|
||
This node gets a custom variable value using the variable index provided by the `variable` configuration value. The type `T` is determined by the referenced variable. The variable index **MUST** be non-negative and less than the total number of custom variables, otherwise the node is invalid. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are variables accessed by index instead of by name? It would make more sense to me to set a variable called "money"
than one called 27
.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Is it possible to return the value pointed to by a pointer with the behavior graph? /nodes/{nodeIdx}/mesh -> meshIdx |
If configuration value is array of length 2,3,4 or 16 it could be ambiguous if its vec2/vec3/vec4/vec4x4 or int[], this might not be a problem for JS but is a problem for strongly-typed implementations, is there any recommendation for them how to disambiguate? |
For example, how about specifying the type at the time of the call? |
@Hackn0214 you already can get number of materials when using appropriate pointer , check out core pointers |
That's wonderful! |
I would appreciate it if you could add /meshes/{}/primitives.length |
Is there a (reasonably up-to-date) machine-processable representation of this? (I.e. something like a schema or a "repository" of node structure descriptions)? |
Not yet, this document is the only normative source for now. We'll publish regular JSON schemas after confirming that the current early implementations are aligned with them. That said, JSON schemas alone are not enough since most operations have their own predefined socket types and ids. Suggestions on the machine-readable node spec representations are welcome. |
It could be something simple as a starter.... One could/should probably group this based on the Section structure, maybe even include the headers like |
What is the timeline for this and its review (beyond "as quickly as possible")? I have some smaller "pending" review comments, but am not sure when I find the time to continue. Is the preferred way "one complete review", or "comments as soon as they come up"? |
@javagl Feel free to post comments as soon as they come up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, some minor comments inlined (I hope that I can continue here soon)
On the other hand, behavior graphs are a superset of trigger-action lists, meaning that the former can support everything that trigger-action lists can, and more. Behavior graphs support “Queries”, “Logic” and “Control Flow” nodes, making them more expressive and capable of creating more sophisticated behaviors. This makes behavior graphs the preferred method of choice for high-end game engines, as it offers an identical safety model as trigger-action lists while being more expressive. | ||
|
||
=== Turing Completeness | ||
The execution model and node choices for this extension mean that it is Turing-complete. This means that an implementation of this can execute any computation and it is also hard to predict if it will run forever, e.g., halt or not. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not "hard to predict", but rather "not always possible to predict" (I.e. semidecidable)
|
||
[cols="1h,1,2"] | ||
|=== | ||
| Operation | `math/transform` | Vector transformation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These nodes all have the name math/transform
. This will cause trouble and ambiguities. They should be renamed to math/transform2
, 3
, 4
, aligned with the naming of math/combineX
.
The fact that the nodes and their types cannot be "templated" (despite what is suggested in math/transpose...
), and the fact that nodes like math/sub
exist once for int
and once for "all float-based types" are a much broader issues with the type system, beyond the scope of a review comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will cause trouble and ambiguities.
Please elaborate, i.e., propose an example graph that would be ambiguous but still conforming to the spec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There currently does not seem to be a reasonable way to create a graph to begin with (except for a text editor)
The ambiguity mainly refers to the definitions and implementations of the nodes, and the authoring process, and maybe the validation. When there is a math/transform
node, then it is not clear which type of node this is.
While the validation section contains a statement
(6.7, (7))
If the set of input value sockets defined by the declaration referenced by the declaration property does not match the set of input value sockets defined by the values property with regard to socket ids and types, reject the graph.
the declaration does not carry sufficient type information. Using math/transform
with a float2
and a matrix3x3
is not valid, but it is not made explicit.
I know, this is one of the "back to the drawing board" comments, and it's unlikely to be addressed. So feel free to mark it as "resolved". (I'm looking forward to see how the authoring/tooling support will handle all this, eventually).
Rendered version: https://github.com/KhronosGroup/glTF/blob/interactivity/extensions/2.0/Khronos/KHR_interactivity/Specification.adoc