GLB base64 data encoding

Hello Everyone!
I recently developed a web project that required a single file document to run independently from the internet. The project had videos encoded as base64. The use of resources as inline data was something I did not realize was a possibility until recently and had me curious about three.js.
After some searching, I see others have successfully implemented base64 textures in their resources. However, I haven’t seen any examples of successful use of something like this for models.
It would seem to me that encoding the models would be a better approach in terms of security. Is it possible that no one mentions it bc it is problematic? Has anyone else had any experience with this method?

It’s possible, but does add about 30% to the size of the asset, and reduces loading speed. For these reasons people usually don’t use base64 encodings except for very small assets. I don’t think there’s any security tradeoff either way, so long as you’re loading assets from a secure domain.

3 Likes

Do you mean locally, on client machine?

Hello,
Thanks for reply, I also have same issue, Really appreciate for help.

https://base64.guru/converter/encode/file

make sure to use data uri option
Screen Shot 2021-08-15 at 18.14.06