-
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
JSON refer other JSON? #37
Comments
potentially, but can we consider after 1.0 ? |
I'd rather look into having a single JSON that can reference glTFs. I think On Fri, Mar 22, 2013 at 7:18 AM, Fabrice Robinet
|
I know it's appealing, and I like the idea. As an aside, I believe in some case scenarios, this would be better handled by having Rest3D API do this for us (splitting scenes...). So in short, I like the feature, but just like everything else here we want an implementation counter side to experiment. So I just want to practical, if someone sign-up to implement this feature with enough visibility so that it doesn't suffer the same fate than with COLLADA, then it's fine. |
@RemiArnaud's suggestion sounds application-specific to me. I'm not sure how this would be part of glTF. Perhaps an example would help me see. As for my original proposal, I am OK with tabling it for post glTF 1.0. |
Can you suggest any work around for JSON refer another JSON... |
Hi fabrobinet, |
@bhoske we hope to finalize a v1.0 for the specification in a few months but as mentioned above referring other JSON will probably not make it for v1.0. I have not been active on the viewer lately but it is still maintained. Thanks for your interest in the project. |
@mlimper let's use this issue to discuss your approach to this with SRC and how we could use it in glTF or an extension (it should probably be core spec though). |
Within SRC, there is a two-level addressing schema for meshes / mesh data and textures:
(also see Figure 7 in the paper, for example: http://x3dom.org/src/files/Web3d2014_SRC.pdf) This assumes that meshes and textures are first-class citizens of the SRC file, which share the same scope (and hence cannot have similar names). For the original idea of using SRC to externalize X3D Shape Data, this was sufficient - but this approach is probably not general enough for glTF, I suppose. |
Thanks @mlimper. I will need to implement this in Cesium before I am comfortable suggesting it for the core glTF spec. I'm not sure I can do that in time for the draft 1.0 spec, but we could propose it as an extension, and then put it in the 1.1 spec. I agree that the SRC approach is not general enough, but I think it generalizes easy enough. Here's an example (assuming an commonMaterials.gltf {
"materials": {
"glass" : {
// ...
}
}
} model.gltf {
"extensions": {
"external_glTF" : {
"commonMaterials" : "commonMaterials.gltf"
}
},
"meshes" : {
"a-geometry" : {
"primitives" : [{
"material" : "commonMaterials#glass"
}]
}
}
} Basically, any referenced property name with an Here's a more complicated example with multiple external files creating the classic diamond of death. commonShaders.gltf {
"shaders": {
"commonShader": {
// ...
}
}
} commonMaterials.gltf {
"extensions": {
"external_glTF" : {
"commonShaders" : "commonShaders.gltf"
}
},
// Reference "commonShaders" somewhere
"materials": {
"glass" : {
// ...
}
}
} commonNodes.gltf {
"extensions": {
"external_glTF" : {
"commonShaders" : "commonShaders.gltf"
}
},
// Reference "commonShaders" somewhere
"nodes": {
"arm": {
// ...
}
}
} model.gltf {
"extensions": {
"external_glTF" : {
"commonMaterials" : "commonMaterials.gltf",
"commonNodes" : "commonNodes.gltf"
}
},
"meshes" : {
"a-geometry" : {
"primitives" : [{
"material" : "commonMaterials#glass"
}]
}
},
"nodes" : {
"left-arm": {
"children": [
"commonNodes#arm"
]
}
}
} Engines would have to be smart about caching to avoid duplicate resource creation. We could also impose restrictions - if we can justify them - like external glTF files can't reference more external glTF files, but this feel artificial. It would also be nice to have an open-source tool that takes a set of glTF files and then optimizes them to reference common external glTF files, e.g., if all the models have the same material. What do you think of the schema proposed above?
What is this used for? |
Although available in COLLADA - an intermediate representation format - and rarely correctly implemented, I would not recommend generic external references in glTF - a presentation format. The reason is that it becomes very hard to reference unique instances. forest1->tree1->tree the only way to differentiate between those 4 trees is to provide their full path. What happen if you want to move the last of those trees, and only that tree? you can't. In a run-time / presentation format, I'd recommend using a 'flat' scene, where instances get a new node. the collada2gltf tool could create such 'flat scenes' from COLLADA documents using external references. |
@RemiArnaud I believe your point is a more general glTF discussion, so I created #401. Please chime in and let's converge on an approach. As for external glTF references, I am open to reducing their scope, but let's decide on #401 first. |
In our paper, this was mentioned as a way to perform data compositing, for example by overriding the original vertex colors of a mesh when using it again in some other place. But this is very advanced, and we don't have an implementation that supports this feature right now. |
I suggest we save it for when have an implementation. Do you have any other feedback on what I proposed here, e.g., restrictions to make the implementation simple, etc.? |
We have only implemented the hash delimiter, I am not aware of any implementation obstacles regarding that |
Requested in #837. |
Closing this issue for now – we're definitely still open to considering glTF files that reference other external glTF files, but that idea isn't well-defined yet. If community members have strong use cases for this and some idea of how it should work, proposals are welcome. |
…extures Add some missing entries to the changelog about property textures
why not follow the standard of JSON references using more on this how it could complement binary-only glTF: #1560 (comment) |
In our quest to balance simplicity and flexibility, I'd like to open the discussion for if glTF JSON should be able to reference other JSON. This would be useful for storing large node hierarchies across several files, where only a few of them may need to be loaded based on visibility, LOD, etc. It would also be useful for sharing parts of the JSON, e.g., materials, among multiple assets, which can reduce overall bandwidth.
I'm happy to draft up some example JSON (probably after GDC).
My feeling on this is yes because of the above use cases and that it matches the flexibility with everything else in glTF - buffers, images, and shaders.
I'm interested in other thoughts...
The text was updated successfully, but these errors were encountered: