Add extension for binary buffers, buffer views, and binary file format#33
Add extension for binary buffers, buffer views, and binary file format#33aaronfranke wants to merge 1 commit intoocwg:mainfrom
Conversation
|
The content of a resource can be base64 encoded, doesn't that cover this? |
|
@devhelpr Please see the files changed in the PR, the paragraph starting with "The second option makes the". |
|
yes, that's clear that base64 data takes more space. My main concern is that the ocif spec gets too complex for people to implement it.. but I also understand that the current spec might be too limiting for some types of apps. |
|
@devhelpr Yes, it is perfectly possible to 100% round-trip without any loss between JSON and the binary format. Assuming that the JSON contains buffers (it would change the data to convert things to base64). |
|
I understand the general idea of wanting to have a more efficient binary format. What really is the memory or runtime penalty of base64, we impose?
|
|
Thanks for proposing this, @aaronfranke! I do think you're hitting on a genuine issue here: how to package up non-text-based assets efficiently and clearly. Here are a few initial thoughts, but let's discuss at today's meeting.
|
There was a problem hiding this comment.
Pull Request Overview
This PR introduces binary data storage capabilities to the OCIF specification, enabling more efficient storage of binary blobs through buffers and buffer views. It also defines a new binary file format (.ocb) for self-contained, compressed OCIF files.
Key Changes:
- Adds buffer, buffer view, and accessor schemas for binary data management
- Defines the OCIF Binary (
.ocb) file format with compression support - Updates spec version from 0.5 to 0.6
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| spec/v0.6/spec.md | Adds Integer type definition to support buffer indices and sizes |
| spec/v0.6/schema.json | Updates title from "OCIF core 0.5" to "OCIF core 0.6" |
| spec/v0.6/extensions/binary-data/buffer.schema.json | Defines JSON schema for binary data buffers with compression support |
| spec/v0.6/extensions/binary-data/buffer-view.schema.json | Defines JSON schema for buffer views (slices of buffers) |
| spec/v0.6/extensions/binary-data/accessor.schema.json | Defines JSON schema for typed accessors with various primitive types |
| spec/v0.6/extensions/binary-data/binary-file-format.md | Specifies the .ocb binary file format structure and chunk layout |
| spec/v0.6/extensions/binary-data/binary-data.md | Provides comprehensive documentation for buffers, buffer views, and accessors |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This PR adds a canvas extension for binary data storage to the specification, specifically in the form of buffers, buffer views, and accessors. A similar structure is used in glTF's buffers and buffer views and G4MF's buffers and buffer views, except that to make it more OCIF-y, accessors and buffer views are referenced by ID instead of by index (however, note that buffer views still reference buffers by index, because the order of those intrinsically matters anyway).
This PR also defines a new file format, OCIF Binary, which uses the
.ocbextension. This is based on glTF's.glbformat and G4MF's.g4bformat.Old discussion questions:
Details
uint8,int16,float32, etc) and the vector size (scalar, Vector2, Vector3, etc).v0.5.