▲ | demurgos 6 days ago | |
Sometimes you need to embed binary data in a text format (e.g. JSON). | ||
▲ | naikrovek 6 days ago | parent [-] | |
the amount of data i have stuffed into json as base64 encoded text makes me sick. i wrote a glTF model converter once. 99% of those millions of JSON files I wrote were base64 encoded binary data. a single glTF model sometimes wants to be two files on disk. one for the JSON and one for the binary data, and you use the JSON to describe where in the binary data the vertices are defined, and other windows for the various other bits like the triangles, triangle fans, textures, and other stuff are stored. But you can also base64 encode that data and put it in the JSON file and not have a messy double-file model. so that's what I did and I hated it. but it still felt better than having .gltf files and .bin files which together made up a single model file. |