Key shot file for Babylon.js

Hello everybody,
is there a way to import files into babylon from keyshot keeping the file weight low? Alternatively can they be exported to other software and then imported into Babylon?
Thank you

I’ve never used Keyshot but as it is written at their page Integration - Simplify Workflow | KeyShot ,
generic 3D file formats is included with .obj export available in KeyShot Pro.
You may check if there are other export options, GLTF for example.

1 Like

Hi, thanks for the reply. We tried to export in gltf, but a folder and a file are created and for the web it is not good. We also tried with glb but the file grows too large. Now let’s try with obj and stl, what is the best way to contain the weight of the file for the web? Thank you

I have tried to do the file with .obj but the file dimension are too large 18mb. are there any solutions?
thanks

At some points 3d requires a lot of data unfortunately so the only way to reduce it would be to reduce quality :frowning:

With GLTF/GLB, you could certainly try draco compression to reduc a part of the geometry data.

2 Likes

Babylon API - DracoCompression | Babylon.js Documentation
Draco - Draco 3D Graphics Compression

2 Likes

@labris amazing as usual, I completely should have linked the doc

2 Likes

Thanks for the suggestions, but not being a programmer I would need to better understand what to do to find collaborators.
Draco reduces the weight of the file, but then can it be imported into babylon like this? When does Draco come into operation? After exporting keyshot? Is it possible to import the file in babylon and make a new export from there to make it lighter and then upload it to the site? Sorry for the questions but I don’t understand who I have to ask the agency that is developing the site has installed the plugin but doesn’t know anything else. Thank you

I talked to my colleague, he tried to use Draco and he had a reduction from 8659 kb to 1600. The weight is high but it is definitely better. The problem, however, is that we can’t get its into babylon. How can I do?
Thank you

Here is one of the examples - https://playground.babylonjs.com/#22MFU2#15
Another example with quite heavy file - https://playground.babylonjs.com/#N3EK4B#95

1 Like

There should be very little difference in overall size between gltf and glb. A glb is typically just the gltf loose files put into a single file. A glb file does not compress or do anything to the content of the gltf.

Another thing to note is that while a glb file can be a single file, it is often not the best way to send data across the wire. Typically, a glTF model consists of these files:

  • model.gtlf - The glTF file itself
  • model.bin - The geometry or animation data (This can also be multiple files)
  • image0.jpg - A texture for baseColor, normal, metallic/roughness, etc.
  • … - More textures

If you combine all of these into a single glb, then the compression you will need on the server for zipping is more difficult since you can only zip the whole glb. Zipping a jpg or png is completely useless. You really only want to zip the gltf and bin file. The problem with loose glTF files is that it requires more requests to load.

The options you have for a server:

  1. Loose files with glTF
  2. Single GLB
  3. GLB with external references

A good way to distribute glTF assets is to use 3 and put the glTF and bin together in a GLB so that they can be zipped and leave the textures loose so that they can be downloaded in parallel unzipped.

4 Likes