The .babylon file is too large. What should I do?

I imported a glb file into an empty scene. The glb file is only 5 MB, but after importing it into the Babylon scene and exporting it as a .babylon file, the .babylon file becomes 20 MB. When I checked the .babylon file, I found that many values are using high precision floating-point numbers, such as “position”: [0.09999833334166665,9.999500004166652,0]. Is there a way to reduce the precision of certain attributes in the saved .babylon file?

(I’ve tried modifying the engine’s useHighPrecisionFloats property, but after exporting it as a .babylon file, it still uses high precision floating-point numbers.)

Always make your scene with manually-optimized glb and code, never export from loaded scene.

Size wise, I would recommend gltf + draco

But I need to integrate various information from the Babylon scene, such as lighting, camera input configuration, sprite manager, particle systems, and so on (all of which are associated with the imported models). The only thing I don’t need is something as large as 0.999999999999998.

Can you provide me with a demo or tutorial?

Just code it, should be smaller and faster than serialized scene

I looked into the glTF + Draco solution, which may be a good option. I have another question: why are the properties in the .babylon file represented as 16-bit high-precision floating-point numbers? Is it specified by SceneSerializer.Serialize() or by the scene itself and exported as-is? Is there a way to reduce precision to decrease the file size?

Yes, but this conflicts with the project I want to do

Well, try to resolve the conflicts if size really matters, or simply compress your babylon file with server-side gzip.

I’ve already optimized it with gzip, but the file is still very large

I think you’re losing Draco compression when using .babylon

You can save scene with all objects + placeholders for glbs