Recommended file formats

Recommended Posts

I am using Blender exporter to `.babylon` file format but lately am noticing more mentions of `.gltf` (and `.glb`) besides your support for others.

What is your recommendation for my use case explained below or more generic rule of thumb on when to to use which format?

My context:

  • We make scenes in Blender with more than 100 smaller pieces with textures and expose those with BJS.
  • We allow users to change textures and materials.
  • We allow users to move objects.
  • We do do not have any animations.

Share this post

Link to post
Share on other sites

Hello and welcome

In your case both formats will work.

.Babylon file can contain almost everything you see in a scene but it is a babylon only format

.glTF on the other hand is an open standard format supported by the Khronos Group. It contains less features but in your case it will be perfectly fine

Share this post

Link to post
Share on other sites

Would be interested in the results.  While a strict 4 bytes for a float might be good, I wonder about how the methods of building indexes between the 2 affect the results.  FYI, look at the .log file for number of vertices exported for a .babylon.

This number of vertices has a big impact, because it affects the # of positions, normals, UVs, vertex colors, matrix weights, matrix indexes, & shape keys (morph targets in BJS terminology).  I thought .glTF was supposed to be non-lossy.  @Deltakosh, does .glTF even index?  The .babylon exporter rounds to 4 decimals prior to testing for equality, making it a lossy process.  If .glTF is strict, very very small differences in values will cause it to export more vertices.  This affects more than just the file size, it will also impact runtime performance.

Many meshes are created with way more vertices than really required for a game.  An example is the teeth mesh from MakeHuman.  Unless you are doing a dentist scene ( @Pryme8 maybe), you do not need all that detail.

FYI, Blender has a 'Limited dissolve' operator which can do a really good job of reducing with minimal impact.    It takes a maximum angle, default 5%, to limit what it keeps.  I have been doing it outside of the exporter, but then I really need to keep multiple versions of the .blend.  Blender also has un-do capability inside of a script.  I will be adding a custom property of 'dissolveAngle' for meshes.  If not 0, it will:

  • set an undo restore point
  • do a limited dissolve of the mesh
  • export the mesh
  • perform an undo

Now no more multiple versions of the .blend, and no more writing down the value you used.  You can experiment with the value to use, undoing as you change.  Once you have a good value, pop it in the field & save the .blend.  This will increase export time, but I got it much faster than before anyway.  5 extra seconds is nothing.

.glTF, unity, 3dsMax, & Maya exporters will not even get close in either vertex nor file size terms, once this is inplace (first quarter).

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.