ozRocker

Error with loadFromDataString (preview release)

Recommended Posts

I'm testing out the preview release of babylon.js

When I run this line on desktop and mobile browsers:

diffuseTexture1 = BABYLON.Texture.LoadFromDataString("diffuse",data,scene);                    

I get the errors shown in the image below.  It works fine in current version of babylon.js

draw_image_errors.jpg

Share this post


Link to post
Share on other sites

I'm still stuck on this with both 3.0 and preview release 3.1

I'm simply reading in a .JPG image using XHR with responseType "arraybuffer" and I'm using that as the data string.  I works in 2.5 but not in the later versions

 

Share this post


Link to post
Share on other sites
2 hours ago, sable said:

While this doesn't solve the problem with LoadFromDataString, I thought I'd mention that you can request images as blobs instead of array buffers, https://playground.babylonjs.com/#RLHD87#2, which I found in my projects to be much faster as it means that a conversion to a base64 string isn't needed . 

Woh, nice!!! This is great!  Thanks so much for that :)  Imma change my code right now

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.