Jump to content

Best Solution For Loading a lot of Mesh in Large Scene


NasimiAsl
 Share

Recommended Posts

hi

what is the best Solution for load a lot of obj and geometry (with texture) ?

the main problems :

when we wanna load all before start render a long time we most wait.

when we start engine Animation and add Mesh with delay   scene is lock a short time per each object 

have any thread for loading (buffering) in babylonjs?

 

 

 

Link to comment
Share on other sites

The wait is impossible to avoid if you need the meshes to be ready and used right away i guess, just use manifests and hope the player doesn't clear his browser cache daily :P
 

@chicagobob123 you don't need a interval, just call a function when the mesh is done loading.

can also, rather easily, be edited to work with progressCallback's.. by checking if loaded amount equals the total size before doing progCount+=1; 

var progCount = 0, totalAssets = /* number of assets you're loading */;

//load meshes..

//on last line of the import code for each mesh, finishedLoading();


function finishedLoading(){
	progCount+=1;
	
	if(progCount === totalAssets){
		//continue with whatever you need to do next.. 
	}
}

Edit:

Also, if using the AssetsManager you can skip above code completely and use the assetsmanager's pre-made function that is called when all meshes have been loaded.. I can't recall the name of it though.

Link to comment
Share on other sites

i always try to minimize  things, in the end only values running trough switches 1 for on  0 for off : 1 0 0 1 1

var a 
var b+=a
var c +=a
a( load b(obj)
render)
user-input
a( load c(obj) //lag 
render)

 

Best Solution For Loading ?
Link to comment
Share on other sites

i wanna have step loading without any latency for render 

i watch the mesh loading the geometry load is fast but the texture (even when that load from IndexedDb ) the requestAnimationFrame function wait to complete the texture loading when the mesh have 10 or more texture you have big latency in step loading

how can buffer texture without latency ? this can be help to make soft step loading i think may be i am wrong at all i don't know

 

 

 

 

Link to comment
Share on other sites

@NasimiAsl  i'm not sure,

one way to "fix" it you could set the meshes isVisible = false; and when it's fully loaded set it to true.. atleast it won't show up without textures and if it's made out of several meshes it won't show up in bits as they get loaded.

and perhaps looking into pre-loading the textures could work.. load textures as babylon.js textures before you start loading the meshes and then set the textures as the meshes gets loaded.. dono.. does sound like a lot of work though :P 

but thats the two ideas i've got, hope you figure it out :)

Link to comment
Share on other sites

@NasimiAsl

I got a project and i already pass the deadline since 2weeks.

Not only Textures also be also thoughtful, where you import a newMesh, and how, this affect Babylonjs

http://www.babylonjs-playground.com/#11MKSY#1

Interesting question! Maybe i catch up later! 

Hope you find a solution, that fits in your Project

EDIT
@NasimiAsl 2Weeks behind my Project.
http://www.babylonjs-playground.com/#11MKSY#2

Best
 

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