Incremental loading and non-blocking parsing and rendering #4397

benbro opened this Issue Feb 9, 2014 · 7 comments

5 participants



I have large models > 20MB which blocks the browser when parsing and rendering them for several minutes.
In my case the 3D viewer is only part of the app and models are loaded in the middle of a session so showing a progressbar is not enough.

What part is the most expensive?

  • Parsing string to JSON
  • Parsing JSON object to three.js objects
  • Rendering

Are there plans to improve the browser responsiveness when loading large models?
Or maybe I'm missing existing features?

Some thoughts:

  • Break the JSON file to multiple chunks. Each file could be a separate geometry or the loader could load a large file with chunk encoding and parse and render geometries when it has enough data. (pdf.js does that).
  • Use a web worker to load and parse the data and pass it as a transferable object. I'm not sure if IE11 support this feature but FF and Chrome do. (pdf.js uses this technique).

Progressive loading of PDFs
Worker with transferable objects


I've experienced similar problems when loading large models. I would guess that the most important optimization would be to reduce the amount of preprocessing done internally in three.js, see #4386


In we use binary objects (like glTF and do) to reduce the need to do JSON parsing of large objects. JSON-based 3D meshes is good for debugging and prototypes, but it isn't a production solution.

Funny thing, Sketchfab and glTF are nearly the same format arrived at independently I believe.

@mrdoob mrdoob added the Enhancement label Feb 10, 2014

Is there a way to use a BufferGeometry with the JSON format or binary format until #4386 will be implemented?


@mrdoob Does the export include materials and textures?
Is there a command line tool to export a BufferGeometry?


@mrdoob Does the export include materials and textures?

There is a MaterialExporter. You can use ObjectExporter with your mesh. Makes sure the geometry is using BufferGeometry though. There is no TextureExporter just yet.

All these exporters is what the editor uses. So you should be able to figure out how to use it by looking at the code.

Is there a command line tool to export a BufferGeometry?

Nope... Maybe you can write a node.js script for that?


we had good results with the ctm loader back last year, how it uses a worker for non- / less blocking loading too.

have been testing with gltf now, looks good so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment