2

I am working on a web application where the user builds a house he/she wants built and then can preview it in 3D. When the browser doesn't support WebGL, the house is rendered on the server and a few screenshots are sent to the client. However, if the screenshots are taken to soon, some textures won't show and will be replaced by black rectangles.

In three.js, is there an event firing or a way to tell if or when all the textures and fully loaded and shown?

genpfault
  • 51,148
  • 11
  • 85
  • 139
Mickael Bergeron Néron
  • 1,472
  • 1
  • 18
  • 31
  • possible duplicate of [How to wait for textures to finish loading from JSON model in Three.js?](http://stackoverflow.com/questions/20712047/how-to-wait-for-textures-to-finish-loading-from-json-model-in-three-js) – Luigi Oct 27 '14 at 17:53

1 Answers1

2

As of now, this is the best I have found. If someone finds a better solution, please let me know.

THREE.DefaultLoadingManager.onProgress = function ( item, loaded, total ) {
    // All textures are finished loading when loaded === total
};

Thanks to JPS for this answer: How to make a loading screen while using three.js and jsonLoader?

Community
  • 1
  • 1
Mickael Bergeron Néron
  • 1,472
  • 1
  • 18
  • 31