File size + jsZIP

Hello everyone,

I’m working on a commercial project and we want to use BJS in our web app. It’s our first experience with 3D real time.
Therefor we are testing all the pipeline to define specification/feasibility of the project.
The project implies only one human character, no object, no complex shaders, but could include a complex rig.
We have tested performance using pre production rigs and it appears that we could use complex rigs made of more than 100 bones.

It seems that total polygon count do not increase drastically the size of our export. From 4000 polygons to 30 000 we noticed an acceptable increase.

But when it comes to complex rig and animations the size of the babylon file increase quite quick.

Are there some good habits to optimize and reduce file size ? (we have no texture, no complex shader)

I saw that zip file could reduce the file size by 1/5. My question is : is it usual to use library like jsZip ? How this impact performance? I assume that unziping file will lead to some delay in order to put the data into the RAM.

As we will have a lot of animation, i assume that a good way to do is to zip individually each animation file and access it if needed.

Hello and welcome!

You can directly configure your server to gzip the .babylon file straight out of the gate. This is a good habit and all browsers will support the transparent decompression

Other idea could be to use gltf+Draco compression

In fact i’m searching for a user side solution.
I don’t want to compress it on a server and to stream data, i want the user to have those data on his phone and to unzip it when it’s needed to use it in the ram.
Is this possible ?

My project needs a lot of animation, and we need to optimize the total file size.
I made some test trying to define some limits and undestand how the fils size grows.

I am not sure I understand, are the users having the data locally and inputing them in the app ? or are the data stored on the server ?

Excuse me if i had not been clear.
Users having data locally not stored on the server, we want it to be usable offline (no wifi/no 4G)

When you say they have it locally, is it smthg you provided them at some point ? Or can it be random obj, stl, gltf and so on ?

First, I am assuming you’re using a. Babylon format. Not sure if your producer does this, but I found after the first frame, that bones can be excluded, if the value is the same as the previous one.

Next, 4 digits of precision are enough. Plus a dot, a zero, and a comma gives 7. Zip then makes even slightly better than binary like gltf. To add, I also do not do trailing zeroes. This is useful, as certain elements of a bone matrix don’t even have decimals. Scrap the dot in those cases too.

I am not sure Draco compression would help much with animation. Could be wrong, but thought they get much of their gain due to vertex indexing. Babylon format does that. Also don’t know if bone elimination trick works with that path / gltf.

Also, you have too many bones. Sorry, but just because you can render that many, does not mean that there will not be issues. Animation size being the prime one.