Skip to content
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

How many things can a node be (or reference)? #1433

Closed
donmccurdy opened this issue Aug 24, 2018 · 6 comments
Closed

How many things can a node be (or reference)? #1433

donmccurdy opened this issue Aug 24, 2018 · 6 comments
Labels

Comments

@donmccurdy
Copy link
Contributor

donmccurdy commented Aug 24, 2018

My mental model has been that a node referencing a mesh is a mesh in the scene graph. A mesh is a node in most engines, I think (it can have a TRS transform) so appending it as a child of a node would just be needless cruft in the scene graph. However, can a single node be more than one (or all) of the following, simultaneously?

  • mesh
  • camera
  • joint1
  • light

I made a quick test of a mesh-camera (mesh-camera.zip). It passes validation, but the camera is ignored in three.js and BabylonJS.

If this is not the intention, we may want to take the step of disallowing use of KHR_lights_punctual on a node that is already a mesh, camera, or joint before ratifying it.

1 Not entirely sure if joints belong in this list, since they're somewhat implicit in glTF 2.0.

@scurest
Copy link

scurest commented Aug 24, 2018

Since a mesh instance and a camera instance at the same node are currently manifestly allowed, I think a light instance should also be allowed.

Besides, how would you phrase this requirement? You can say that a light cannot be instantiated at a node that instantiates a mesh or a camera, but what if some other extension defines Xs that can be instantiated at nodes. You haven't excluded a node instantiating a light and an X. In order to solve this it seems like extensions would need global knowledge of all other extensions, or you'd have to have some way of formalizing "defines Xs that can be instantiated at nodes" (eg. if a node had had a type property or something you could have easily done this).

(Joints definitely do not belong on that list :) Properly speaking "a node is a joint" refers to a property of the set of joints—that there is one that references the node—not a property of the node in question.)

@lexaknyazev
Copy link
Member

However, can a single node be more than one (or all) of the following, simultaneously?

My understanding is that a node is just a scene transform state applied to "transformable" objects whatever they are.

@bghgary
Copy link
Contributor

bghgary commented Sep 6, 2018

It passes validation, but the camera is ignored in three.js and BabylonJS.

The camera is not ignored in Babylon. Babylon will load the camera but it will not use it by default. I would post a screenshot, but this example seems to place the camera inside the box which doesn't show anything.

@donmccurdy
Copy link
Contributor Author

My understanding is that a node is just a scene transform state applied to "transformable" objects whatever they are.

While conceptually true, all engines I'm familiar with do have a real concept of a node, and preserve node hierarchies. Users may expect meshes grouped under a parent node to remain grouped in some way for runtime behavior; the transform state is not the only meaning associated with a node.

Since a mesh instance and a camera instance at the same node are currently manifestly allowed, I think a light instance should also be allowed.

Agreed, seems like this is the right interpretation of the spec. I'll consider the current behavior of three.js a bug, filed as mrdoob/three.js#14875.

The camera is not ignored in Babylon.

Ah good to know, thanks.

@donmccurdy
Copy link
Contributor Author

Will consider this resolved; no spec change needed.

@donmccurdy
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants