Jump to content

Improving my scene


juanmajr93
 Share

Recommended Posts

Hi, I have many questions of the my scene. The first problem that I would have to solve is add more time to symbol (loadingscreen). I load many obj (number of total mesh:300) and I would like that the user couldnt see anything until all buildings whith their textures had been loaded.

Other strange problem is the follow. Sometimes while all objects are loading, firebug console shows this error: "image corrupt or truncated". What can be the cause? (It is not always)

Finally, when I try to probe in Chrome, the scene start to load well but when some seconds spend all my screen is white. After I try to reload website, It says me: "WebGL has detected an error"

 

Thanks you very much.

Link to comment
Share on other sites

If I use this function what must be callbackfuntion? ... I have tested the next code but loadingScreen doesnt appear on my screen

         engine.displayLoadingUI();
         scene.executeWhenReady( engine.hideLoadingUI());

Also, I have done a test with logs and this function is called so fast, I need more time to load models and apply texture... (The solution is that appear a loadingScreen for this time)

JuanMa J.R

Link to comment
Share on other sites

Temechon I have test this function, It is well but the problem is that loadingScreen doesnt appear. Before loading models I have these lines:

var assetsManager = new BABYLON.AssetsManager(scene);
assetsManager.useDefaultLoadingScreen = false;
engine.displayLoadingUI();

 

Link to comment
Share on other sites

Hi again, I have checked differents solutions but I dont get to show LoadingUI until all models with their textures is loaded.Firstly, I have these lines of code:

        var assetsManager = new BABYLON.AssetsManager(scene);
        assetsManager.useDefaultLoadingScreen = false;
        engine.displayLoadingUI();

After I call the main function that loads all models and later I call this function:

scene.executeWhenReady( engine.hideLoadingUI.bind(engine)); but it doesnt work.

 

Link to comment
Share on other sites

 Might be difficult to repro.  I saw scene... it is a "town".  :)  Many textures, many buildings... and quite beautiful.  :)  Textures were being added to scene... for about 45 seconds after first render.

When loading .obj files that ref .mtl files, .mtl file cannot use assetManager textureTask, correct? 

Perhaps, when .obj mesh goes ready, scene.executeWhenReady runs.  But .mtl might still be processing files, yes?

.mtl files load differently than other textures, it seems. They are not really textures, correct?  They are "texturing instructions"... possibly referencing many actual texture files from within one .mtl file, yes?

For example:  https://dl.dropboxusercontent.com/u/17799537/objFileLoader/Bane/Bane_3.mtl

Would scene.executeWhenReady... wait for all those .tga files to finish loading?  Or would EWR trigger when .mtl file finished ITS OWN load?  *shrug*

http://www.babylonjs-playground.com/#RBMUC#7

Here, we see model first, then textures appear later.  Correct behavior?

Not sure about any of this.  I should probably stay non-involved.  Wingnut not qualified to comment.  heh

Link to comment
Share on other sites

Thx Nabs.  I was trying to remove the palm tree texture and let the models load their default .mtl files.  Trying to make a testing playground for Juan's issue.

I needed slower-loading textures, slower and bigger than textures/palm.png. 

Testing if scene.executeWhenReady() is waiting for .mtl to finish it's work. 

Wondering if EWR is properly watching-for texture.isReady() flags from ALL reffed texture files inside .mtl files.

In other words... feeling-around blindly.  :)  Thx for fix, though.... very kind.  But, I wanted a non-palm.png version (and I screwed-up by not removing refs to pos).  :)  Your "palm tree monster" was a good starter PG for testing Juan's issue... because it uses assetsManager to load .obj files.

I found another non-assetsManager .obj loader playground.  (click canvas to see bane model)  No assetsManager and no EWR, but there is a timeout to wait for textures to load.  (lines 26-27).  Perhaps this timeout was added... because EWR was executing too early.  *shrug*

I have strange troubleshooting methods, eh?  *nod*  But sometimes I get lucky and discover something.  :)

Old adage:  "Even a blind squirrel finds an occasional acorn."  heh.  Wingnut being the blind squirrel, of course.

Perhaps assetsManager is checking onSuccess for .obj load, but not waiting for textures from .mtl file... to finish being applied.  *shrug*

Perhaps when Juan loads many .obj files, .obj loading finishes quick, onSuccess triggers, LoadingUI stops, EWR executes... but .mtl files are not yet finished working.  Not sure, though.  Blind squirrel.  :)

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