question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reference to external .bin buffer

See original GitHub issue

According 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:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
christjtcommented, Aug 22, 2021

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.

0reactions
vpenadescommented, Aug 24, 2021

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found