Jump to content

About loading screen streaming items issue


Buzul
 Share

Recommended Posts

hi guys..
I'm here with fresh problem...
I'm doing a loading screen i already read document and  examine samples and also i did something but it's not enought for me

i have a video first; i want to loading and streaming items while video is playing. 
Video is loading and playing and showing %100 loaded but i waiting so long for opening scene.

here my pg link:

https://playground.babylonjs.com/#X4UZJP#1

who can somebody show me the way about this?

thanks in advance

Link to comment
Share on other sites

But let me try still: You have two events in the ImportMesh (onProgress and onSuccess).

You should just display your video and your progress report in the onProgress and use the onSuccess to run something like:

scene.executeWhenReady(function() {
// hide my video
})

 

Link to comment
Share on other sites

@Deltakosh thanks for your quick answer. I'm already using the function you suggest to hide the installation screen.

But my main problem is in loading screen downloading and streaming progresss.

I'm using importmesh method for this action and also i'm using second parameter for importmesh (for onProgress event)

 My code is below, with this code i can see size counting (MB) but when size counting finished percentage counting directly showing %100 

I want to do this screen like sponza's loading screen..

I'm trying to solve this issue since ten days.. I need your suggestions..

var totalDataForLoading;
var loadedData;


BABYLON.SceneLoader.ImportMesh("", "folder/", "file.babylon", scene, function (newMeshes2) {
        //onSuccess function
        // bla bla bla
        // bla bla bla
        // bla bla bla
        var asd = (loadedData * 100) / totalDataForLoading;
        loadingText.innerHTML = "Loading pls Wait..." + asd.toFixed() + "%";
    },function (evt) {
        totalDataForLoading = evt.total;
        loadedData = evt.loaded;
        if (evt.lengthComputable) {
            var cnt = evt.loaded / (1024 * 1024);
            loadingText.innerHTML = "Loading pls Wait..." + Math.floor(cnt * 100.0) /100.0 + " MB Loaded";
        } else {
            
        }
    });

 

Link to comment
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...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...