Sign in to follow this  
hcmetal

How to manage babylon scene texture loading with assets manager

Recommended Posts

Hello everyone,

Consider using a meshTask to load a .babylon file with the assetsManager:

assetsManager.addMeshTask("load meshes", "", "/assets/", "hotel.babylon");

When the meshes are loaded, the textures related with the scene are also automatically loaded. Notice no textureTasks have been manually added.

However, when counting the tasks with:

assetsManager.onProgress = function(remainingCount, totalCount) {
// ... counting logic ...
};

Only one task (the meshTask) is been counted.

I am trying to figure out how to make the assetsManager manage (count) the texture loading associated with the .babylon scene.

Do I have to manually add textureTasks on every texture? This seems like a bad idea, doing the same thing twice.

Hope someone can point me to the right direction.

Thanks alot!

Share this post


Link to post
Share on other sites

Unfortunately, it is not available by default in the asset manager. Actually, one asset is considered with its dependencies.

Maybe you could rely on the scene.onNewTextureAddedObservable to detect the creation of texture and then hook in the onReady of each of the textures you detected ?

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.