Babylon.js: Add support for loading glb from a base64-encoded string or arraybuffer

Created on 30 Nov 2018  路  8Comments  路  Source: BabylonJS/Babylon.js

Most helpful comment

I guess so. I can't remember why I put array buffer in the title.

All 8 comments

Is it correct, that it is only possible to load GLB files from a Base64 string?
I tried to do this with a base64 encoded stl file (using the FileReader API) and it didn't work...?

Ping @Popov72 which will be the best placed to answer :-)

The PR was only for glb.

You should post to the forum and provide a small PG so that we can have look for stl files.

@Popov72 Just noticed we only added support for base64. Are we adding array buffer support too?

@bghgary do we need array buffers ? Are createObjectURL not enough ? just wondering out loud :-)

I guess so. I can't remember why I put array buffer in the title.

Let s add it if it comes back then

I was thinking array buffers would be useful over base64 due to the 33% overhead(unless once it takes the base64, it does something with it internally and it's GC'ed but unsure).

Then I know on browser there is blob but if doing serverside stuff with nullEngine being able to use array buffers would be better I think. Plus since you need the XHR polyfill in Node(It seems some don't really support file:// - so you are stuck running a server on local host or using some shared storage if loading), this way could write my own code to read from the file system and load the mesh that way. Then plus side that code could be isomorphic then too, and feel like have more control over things that way. Plus this might also be useful in Electron or NW.JS but I think possibility that file:// works ok there.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sebavan picture sebavan  路  4Comments

adergham picture adergham  路  3Comments

Exolun picture Exolun  路  3Comments

Speuta picture Speuta  路  5Comments

phuein picture phuein  路  3Comments