Reference to external .bin buffer
See original GitHub issueAccording to the GLB specification a .glb can reference one BIN
chunk that will be embedded in the GLB file as well as other buffers specified with a uri
field.
Is there any way to do this using this library? As far as I can tell there is no way to create a Buffer
that specifies a uri
. I’d be willing to contribute this functionality, but just want to make sure this is indeed not possible today.
The case I am trying to solve is that I am creating multiple .glb files that should (among other things) reference the same .bin file.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Error: GLB must have 0–1 buffers. when writing ...
glb is usually self-contained (i.e. does not reference external .bin files) and so any buffers need to be consolidated if there are >1....
Read more >Several buffers - glTF
A .gltf file can reference multiple external .bin files, yes. This can be useful if you want to load parts of the asset...
Read more >Reading binary data from a .bin file into structs in C++
The simplest, non-portable solution is to read a buffer the size of a record and cast it to a struct pointer. – stark....
Read more >How can I write binary file onto external flash received from usb
Hi, I am using lpc4088 custom board with LPCOpen and aim is to use USB CDC to get binary/hex/s19 file from VCOM and...
Read more >pickle — Python object serialization
The pickle module implements binary protocols for serializing and de-serializing a Python object structure. “Pickling” is the process whereby a Python ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That sounds like a good solution, I am not quite sure what that would look like in practice though.
For my specific case I am leveraging the gpu instancing extension and I have multiple assets that share multiple instances of a sub-mesh. And this is indeed to limit the memory footprint.
If you are able to scope out the task I might be able to implement some of it.
@RagingKore SharpGLTF does use System.Text.Json internally for performance.
The idea of using Newtonsoft instead is because what you want is to blindly load the Json into a json DOM, preserving all the original nodes, and adding/removing elements by editing the DOM itself. Buffer and BufferView entries are simple enough to do so without altering the rest of the glTF document.
Actually, if I would be me, I would add this feature that way, because doing so within SharpGLTF architecture would overcomplicate things in the serializer.