-
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
[binary_glTF] First Version #400
[binary_glTF] First Version #400
Conversation
…, changed name to binary_glTF
|
||
## Resources | ||
|
||
* Discussion - [#357](https://github.com/KhronosGroup/glTF/issues/357) | ||
* base64-encoded data in glTF - [#68](https://github.com/KhronosGroup/glTF/issues/68) | ||
* [Faster 3D Models with Binary glTF](http://cesiumjs.org/2015/06/01/Binary-glTF/) article on the Cesium blog | ||
* SRC project page (paper, background, basic writer) - [http://x3dom.org/src/](http://x3dom.org/src/) | ||
|
||
<a name="BenchData"> | ||
* [1] Raw data for benchmarks using compression available in [BenchData](BenchData/README.md) supplemental. |
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.
Can you tweak BenchData/README.md
to say that the tests were done with CESIUM_binary_glTF
, but the difference is insignificant?
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.
Thanks for the hint, I added a remark at the end of the "Experimental Results" section:
https://github.com/mlimper/glTF/tree/header-preamble-naming/extensions/CESIUM_binary_glTF#SRCPaper
@tfili can you confirm that we are OK with removing the |
Do you think we still need this in the context of glTF? What else would the header be? |
Just those comments. It is awesome how remarkably similar our approaches are! |
@pjcozzi We didn't still needed the offset and length in our extension. Making the json first should let us remove that. |
@mlimper do you have an elegant approach for assigning the glTF |
@mlimper we're also not sure that we should call the glTF section the header. AFAIK a file header usually comes first. Is preamble/header widely used? Can you point me to some examples? |
In the paper we mentioned binary JSON (http://bsonspec.org/) and protocol buffers. |
There is something called header in BMP, for example: Wikipedia's definition: The word "preamble" for the "pre-header" was proposed by Leonard in his SRC spec draft, and I liked it, so I just used it in this initial pull request. We are totally open for other proposals. Initially, we just called the glTF-like information "header" as we thought about it as a bit of additional information about the actual data, which was called the "body". We were very focused on transporting raw data (buffers for mesh geometry, plus textures) and the JSON really just served as a description of the data. We have different JSON formats (or X3D) to describe the scene data. In the CESIUM_binary_glTF proposal, what we called "preamble" is called "header": Should I just change my fork to go back to this original idea? Then the question would be how the structured glTF data ("JSON part") is called. I don't like calling it JSON because I would like to keep the possibility to use different (text or binary) encodings later on. Any ideas? |
Ah, I suppose msgpack is another option; however, I would hesitate to use anything that is decoded in JavaScript instead of by the browser. How would this work when adding a new format? Wouldn't we have to release a new binary glTF extension with a new version? Instead of overbuilding this extension, why not wait until we have an implementation that shows the benefit of multiple formats, and then introduce it with a new version of the binary glTF extension? |
Open to suggestions, but perhaps |
I think the main argument for introducing the format word with the very first version of binary_glTF would be that old .bgltf data, and respective parsers, can remain unchanged. Backwards compatibility with older parsers is probably important. The alternative would be that we define "Binary glTF version 1.0 uses JSON and has no word for specifying a different header encoding", but if we define such a word later on, parsers have to adapt to a different header size for this. Clearly both is possible, I would personally vote for an explicit "header format" word right from the beginning. |
…its original state
(ok, there is now a separate directory, and cesium_binary_gltf should be in the original state again: |
Ah, I see, so it would allow current Binary glTF content to be forward compatible with a future Binary glTF version assuming we don't change the header for some other reason. OK with me. Is there anything else to discuss for this? Have you implemented it? |
No, we haven't implemented the current proposal right now. It should not be too much work to adjust our existing implementation. It seems for now there are no open points. I'll use "header-scene-body" for the proposal now, and we'll have a "scene format" entry inside the header. We will now adjust the implementation. We can provide a binary_glTF example file along with this pull request - the ultimate goal would then probably be that we can export this and you can load it, and vice versa ;-) |
All sounds good. @tfili and I will start work on the Cesium loader ASAP. |
Here's a first updated version of the README.md for review. One TODO / question: |
.. ah, and now I also updated the mimetype to |
... one more thing, do you have an up-to-date example file (glTF or binary_glTF) that uses the upcoming glTF 1.0 schema? Just looking for a very simple example (collada duck, stanford bunny or so) to ease my writer implementation. |
@mlimper looks great. I made minor edits in ddf0452 and 3155257. I'm going to do one final read shortly.
I think it is total overkill for this.
Not yet, but I plan to write a 0.8 to 1.0 spec guide (#406). The best thing to look at now is the diff of the schemas. However, there is more very minor changes to come. |
I made some more minor edits in 69b48c4. I am going to merge this so we can reduce the number of branches we have as I finalize the writeup for extensions (#404) in the In the near term, future pull requests for this extension can be opened into that branch, and then into Thanks for your contribution, @mlimper. This is better than the initial CESIUM_binary_glTF extension. I'm looking forward to working with you on more extensions with you. |
@mlimper we usually delete branches after we merge them, but I'll leave it up to you to delete your |
The proposed new types seem logical to me. They would need to be registered with IANA, however. |
Oh yeah, sorry, after checking #167 and wondering why we didn't have this problem, I figured out in our code we only create and use UInt8 TypedArray views, which we then directly pass to the GPU. We never used Float32Arrays or something like that in JS when dealing with GPU buffers. |
All good, thanks. |
Hi all binary_glTF contributors and maintainers :-)
This first pull request contains our modifications on the binary file layout of binary glTF, as done for our SRC format. The changes can be previewed here:
https://github.com/mlimper/glTF/blob/header-preamble-naming/extensions/binary_glTF/README.md
Changes:
Of course, all of these points are open for discussion right now (maybe directly inside this pull request?).