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:
- The JBB Serializer (Check the wiki for details)
- A few Examples as a showcase
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:
- Your client-side loader needs to know only one file format (= smaller distribution size)
- You are shipping only one, tightly packed, optimised blob, instead of hundreds of smaller files (= faster loading time)
- 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?
- You describe what resources you want to load and the three.js loader to use for that
- You run a packaging command offline to create the binary bundle
- 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