Jump to content

task file weight


pichou
 Share

Recommended Posts

Nope to be more specific, the exact thing I am looking for is to know the entire scene weight.

Meaning what is the total of data in bytes that need to be loaded in order to render the scene.
So after everything has been loaded and not during the progress.

Maybe a way to reach the "Content-Length" header of each asset request?

Link to comment
Share on other sites

Hum I see! 

I found we could get the length with the xhr like this :

```parseInt(xhr.getResponseHeader("Content-Length"))```

if you already use it for the progress, I guess we can also have it somehow when the loading is finished?
If some task/file doesn't have Content-Length indicated by the server it is ok because the result I want doesn't have to be exact.

Link to comment
Share on other sites

If you are just using MeshAssetTask , you could use SceneLoader.ImportMesh directly, which has a SceneLoaderProgressEvent, which tells you how many bytes have been downloaded.  If you know already how big your scene is in total, you could then work backwards and build your own custom asset manager with realistic progress based on bytes downloaded/total.

That event has a property 'lengthComputable', which is often false. Progress is, if lengthComputable == true evt.loaded / evt.total.  If not lengthComputable then it's evt.loaded / knownFileSize.  At least that strategy works for models, so maybe that is useful.  Cheers.

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...