JBB : Load compilcated resources with a single loader

Hi all,

This topic is about a serialisation library that I developed in order to help me load my scene resources faster and more efficiently:

I a recent project of mine I went through the pain looking for the correct resource type and resource loader in order to handle a variety of resources. After looking to the existing solutions (at the time when I stared the development) I couldn’t find something that would satisfy my needs, so I came up with something that I think might be interesting for all of you out there.

The idea is simple: Eventually you are going to load just some primitives (ex. Mesh, Geometry, etc.), but there is a dozen of formats to describe them. Why could you just load everything, take a memory snapshot of your scene and just dump it into a file? That’s exactly what JBB does (including texture maps and other file types not known to it).

Doing so has a few benefits:

  1. Your client-side loader needs to know only one file format (= smaller distribution size)
  2. You are shipping only one, tightly packed, optimised blob, instead of hundreds of smaller files (= faster loading time)
  3. All the resources are loaded together, so when your scene is launched everything is there (ex. you don’t have some textures that will appear progressively)

How this works?

  1. You describe what resources you want to load and the three.js loader to use for that
  2. You run a packaging command offline to create the binary bundle
  3. You use the JBB loader to load the bundle in the browser

Note that this library was built with three.js r73 in mind, but upgrading to a newer version should not be an issue, if there is enough interest from the community :slight_smile:


Hi! it’s an awesome improve in loading time indeed. Could you point out a hint on how to upgrade the library? when I upgrade the Three js library inside of jbb-profile-three to r89 (latest version), I then get the error
"TypeError: THREE.EventDispatcher.prototype.apply is not a function
at Object. (/jbb-bundler/node_modules/jbb-profile-three/lib/loaders/THREE/MTLLoader.js:473:33)"

Do you think you could help me?