-
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
Node hierarchy - DAG or tree? #401
Comments
thus post has been moved from another thread and is now out of context. |
yeah two different issues I think but the issue Patrick raises is a big one. If a DAG in glTF is a valid On Wed, Aug 26, 2015 at 11:16 AM, Rémi Arnaud [email protected]
Tony Parisi [email protected] Read my books! Programming 3D Applications in HTML5 and |
The current structure allows to share the exact same geometry and to implement instancing. it should be a converter option to force the flattening (or the client can do it as a pre-process...). Keeping things as currently define allows both scenarios (instancing or one big batch) and I would recommend to let things this way... |
note in my viewer, I ended in a hybrid solution, where I duplicate the node so it's not a DAG but I kept the same shared geometry in favor of instancing. (which is another benefit of having geometry an attribute of the nodes, and not inherit from it for those wondering). |
@fabrobinet right... what I am saying is that it's a hassle to de-instance nodes in the runtime and might be better done in a tool. the only reason to not do that is if we want to support runtime use of multiple node instances. that seems like an extreme and extravagant use case and puts more burden on people trying to write a simple but compliant viewer |
Here's an idea (1)
(2) Another idea would be to restrict valid gltf content to this 'flat' scene graph, still looking in the details where things can/should be shared. (3) Another idea is to provide a de-instancing javascript (run-time) library, so that its easy to write a viewer? We could write several helper libraries. adding a flag would improve current situation, but not make it so all viewers can visualize all gltf files without implementing full instancing anyways. Which one of (1) or (2) or (3) [other ideas?] is closer to gltf design goals? |
I was implicitly lobbying for (2). it's the simplest and makes for easier implementation and conformance. But this does restrict potential use cases. What I don't have a feel for is if that restriction is a big deal or not. (1) has the problem you mentioned (3) is work, and would have to be justified. Again I wonder if the use cases for DAG in a runtime delivery standard are compelling enough. |
Does anyone know of any runtime formats for specific engines de-instance at runtime? I kinda doubt it. In the spirit of glTF (simple and fast to load), it really feels like the converter should de-instance. De-instancing on the client seems like the exact thing glTF tries to avoid unless:
If we can justify de-instancing client-side, @RemiArnaud's idea for (3) is good, and the Cesium team may be able to contribute since our users are interested in this (CesiumGS/cesium#1754 (comment)). @tfili how hard is this to implement in COLLADA2GLTF? |
We can also make it a tree in glTF 1.0, and then make it a DAG in glTF 1.0.1 (or whatever) if needed. It will be easier to go that direction, then to restrict it later. |
That's a great idea... going once, twice... ? |
hope to state the obvious here: as long as the geometry will be still shared even though the node is a copy to make the tree, then we're good. It means deep copy for node part but references for its attributes. |
Yes by all means we should be able to share geometry or any other objects with large data inside them (animations etc.) I think we can make this very explicit by forbidding a node to have more than one ancestor (as defined by the "children" property) |
All sounds good. We'll make this explicit in the spec and I will discuss with @tfili about adding the flatten feature to the converter. |
Talked with @tfili and he thinks this can be done as an asset modifier in COLLADA2GLTF. |
Also, for reference, OpenGEX has a tree not a DAG:
|
This is part of gltf-pipeline, CesiumGS/gltf-pipeline#42. |
If a glTF model does not follow the spec here and has a DAG, gltf-pipeline will convert it to a tree. This is also integrated into the online COLLADA to glTF converter. |
Currently, the glTF node hierarchy is a DAG (as generated by COLLADA2GLTF and implemented in @fabrobinet's loader, and a bug in Cesium, CesiumGS/cesium#1754 (comment)); however, there is interest from @tparisi and @RemiArnaud to "flatten" at conversion time, which seems better inline with the spirit of glTF.
In #37, @RemiArnaud said:
The text was updated successfully, but these errors were encountered: