Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Allow moving engines when using offline storage #16567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 5, 2025

Conversation

RaananW
Copy link
Member

@RaananW RaananW commented May 5, 2025

There are a few issues addressed here.

The first - this issue cannot be reproduced on the playground because of the indexOf(".babylon"). In this case any file hostes on our CDNs will be "true", as it has .babylonjs.com in the URL.

The second - when NOT in the playground, WebGPU loads images as array buffers whereas WebGL engine loads images as Blobs. This is the way they are stored in the DB. So when WebGPU is the first engine, the data is stored as array buffer. Now, when moving to WebGL2 engine, the data will be loaded as ArrayBuffer and not a Blob.

This PR adds 2 fallbacks - if the file loaded is a blob and array buffer is needed, it does that, and if the image is loaded and requires a Blob, it will create a blob if the data is an ArrayBuffer.

Solving https://forum.babylonjs.com/t/switching-engines-vs-createobjecturl/58247?u=raananw

@bjsplat
Copy link
Collaborator

bjsplat commented May 5, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented May 5, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented May 5, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented May 5, 2025

@deltakosh deltakosh merged commit 6bd8a96 into BabylonJS:master May 5, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants