5

I'm looking for a most efficient way to load large polygonal meshes (up to 1M triangles) to Three.js. I'm considering either using a THREE.BufferGeometry object or loading with THREE.BinaryLoader. My questions are:

  • Does BinaryLoader.js create a THREE.BufferGeometry object underneath? Or does it create something similarly efficient?
  • If not, does anyone have a recommendation which one to use?

Some additional info:

  • My models are in a proprietary format on the server, so I need to convert/encode them anyway.
  • I haven't found a Three.js loader that creates a THREE.BufferGeometry. It looks like I need to write my own. But I can prepare the data on the server side to be aligned with THREE.BufferGeometry structure.
  • BinaryLoader.js provides all necessary infrastructure for loading data, but requires data to be prepared in a special way on the server side.
Wilt
  • 41,477
  • 12
  • 152
  • 203
Simon
  • 113
  • 1
  • 8
  • 3
    The CTMLoader creates BufferGeometry when instructed by the parameters argument `useBuffers: true` – gaitat May 28 '13 at 18:53
  • @gaitat - thanks! That brings another option to the table. Is OpenCTM still under development? I've seen no updates for last 15+ months. Another alternative could by [webgl-loader](https://code.google.com/p/webgl-loader/), though I'm not sure if Three.js support is still up to date. I wish I have time to compare all those alternatives... – Simon May 28 '13 at 20:38
  • I think OpenCTM has done what it was supposed to, so no need for updates. The webgl-loader is also implemented inside three.js in the `UTF8Loader()` and also supports BufferGeometry with the same parameter. Additionally OpenCTM supports WebWorkers. – gaitat May 28 '13 at 20:41
  • @gaitat - thanks again! I'll try both and post the results. – Simon May 28 '13 at 21:15
  • If some comment was useful, I would appreciate an up vote (left of comment) – gaitat May 29 '13 at 06:02
  • @gaitat - I'll be happy to, just not sure how to vote up a comment. Perhaps you can edit it as an answer and I'll accept it (if I can). – Simon May 29 '13 at 13:22
  • Up arrow on the left of the comment. You have to move your mouse there to see the arrows. – gaitat May 29 '13 at 15:18
  • hmmm, don't see any arrows for comments, only for the question (Safari on MacOS) – Simon May 29 '13 at 19:48
  • Simon probably had insufficient reputation to upvote your comment. I've just upvoted you both... – foobarbecue Jun 04 '14 at 02:37

1 Answers1

2

Take a look at glTF format and glTFLoader for Three.js. It uses BufferGeometry. Performance is much better; however, it has its own animations implemented (doesn't use THREE.Animation) and I've ran into a few Three.js related problems like cloning the model won't work (at least out of the box)

glTF: https://github.com/KhronosGroup/glTF

glTFLoader: https://github.com/mrdoob/three.js/blob/54a1e789c3a84557d6b05782f5cbd9f1064f5e4f/examples/js/loaders/GLTFLoader.js

Yasha
  • 1,017
  • 11
  • 21