Loading resources from IndexedDB will not fire ISceneLoaderProgressEvent?

Hey guys!

I enabled offline support in my project, it works great, but i find the loading progress bar does not response at all when loading resources from IndexedDB, so i try to console.log() the event, but nothing happen.

So, how could we monitor loading progress when loading from IndexedDB?

Thanks to superTigery make the PG.

https://playground.babylonjs.com/#TBY8BZ

Hello!

Have a look at this PG - https://playground.babylonjs.com/#EG2WQE#5
line 108 fires several progress events in console

Thanks for reply!

But you’ve got the image object and create a blob url and give it to SceneLoader, this way makes sure to fire the onProgress event.

My question is under using BJS default offline support way, but not operate IndexedDB myself. See Optimizing Using Cached Resources | Babylon.js Documentation (babylonjs.com)

Yes, loading the model from IndexDB does not trigger onProgress callback, and I ran into the same problem

just set these values

this._engine.enableOfflineSupport = true;
this._engine.disableManifestCheck = true;
Database.IDBStorageEnabled = true;

https://playground.babylonjs.com/#TBY8BZ

2 Likes

One might argue that there is no progress when loading something from cache, as it is already there. The progress is usually the download progress.

Let me see if I can trigger the last “progress” when using offline support.

Run on progress once when using offline support by RaananW · Pull Request #15449 · BabylonJS/Babylon.js (github.com)

2 Likes

Thank you, my lord!

But in my opinion, progress bar is part of UI facing to viewers, the average people, they don’t know what is offline support nor IndexedDB, they just want to know if the resources are loading and when will be finished. And about “it’s already there”, videos games are already there in SSD, but games also have a loading UI. :yum:

1 Like