File export guidelines for 3D models

1. Format description #

glTF – GL Transmission format #

GL Transmission Format (glTF) is an open-source and royalty-free 3D file that supports static models, animation, and moving scenes.

It stores 3D model information in JSON format. The use of JSON minimizes both the size of 3D assets and the runtime processing needed to unpack and use those assets.

.glb – GL Transmission binary file #

A GLB file (.glb), which stands for “GL Transmission Format Binary file”, is a standardized file format used to share 3D data. Precisely, it can contain information about 3D scenes, models, lighting, materials, node hierarchy and animations.

What’s the difference between .glTF and .glb formats #

The GLB format is a version of the GLTF file. The difference is that the GLB format is a binary file format while the GLTF is based on JSON. The GLB locates all of the elements of a 3D scene, including materials, node hierarchy and cameras in one single compressed file.

The main advantage of using a file extension glb is that it is much more lightweight in terms of size than its similar gltf version. This means that the GLB is easy to transfer (great email file format) and takes up less processing space. This is mainly why it is commonly used for mobile applications, video games and AR/VR purposes.

What’s the difference between FBX/OBJ and .glTF/.glb formats #

The FBX format has a number of features, but they’re generally dated. Furthermore, the format itself is proprietary and can only be loaded by a huge proprietary C++ SDK. FBX is difficult to directly load in a web browser.

OBJ has a limited feature set, is also quite dated, and is incredibly inefficient in terms of storage space and the ability to quickly read and write data.

While OBJ files can be loaded in a web browser, it’s a very slow experience.

The .glTF/.glb format is perfect if you want to transmit your 3D scene data efficiently over the internet for viewing in a remote application, such as for the purposes of Snobal’s Sphere VR App.

2) Exporters #

Install the Babylon.js exporter

Maya Autodesk
Image: Maya Autodesk

Go to Releases · BabylonJS/Exporters and download the

Execute the .exe file inside and find product on the list.

Once launched the application should auto-detect all the installation folders from your Autodesk applications.

If it fails to do so, manually locate the targeted software.

Click install and wait for the plugin to finish.

Image: Babylon.js installation

Open Maya and go to (Windows > Settings/Preferences > Plug-in Manager). Maya

Check Loaded and Autoload for Maya2Babylon.nll.dll, and a new tab will appear.

Prepare your models #

Before converting the model and its animations (if any), ensure the model has basic preparation done and is ready to be sent.

Here is a checklist to follow:

1- Transformations and meshes #

Combine all the meshes, ensuring meshes share the same material. Do not combine meshes with different materials (read Materials and textures).

Ensure the model is in the center of the grid.

Freeze all transformations, delete non-deformed history (if your model does not have animations, just delete history), and centre pivot.

2- Materials and textures #

Apply one material per mesh.

Use either Vertex Color techniques (ideal if model only has solid colors), or traditional texture mapping.

Make sure all your combined meshes do not have more than one material.

For example: if the model is a car and you used a material + texture for the entire model, it is safe to combine all. But if the tyres, for example, use another material/texture, then leave them separated from the rest of the model.

Supported materials: Standard materials (Lambert, Phong, PhongE and Blinn)   – Color   – Transparency.

Supported texture types: jpg, bmp, png, gif, tga.

Note: the exporter also supports textures with tif and dds formats. But, those textures will be automatically converted to png by the exporter to ensure compatibility with the Babylon engine.

3- Rigging/Animation #

To ensure maximum compatibility when exporting, we recommend using the Animation Groups from Babylon exporter. Go to (Babylon > Animation Groups).

Image: Babylon.js Animation Groups window

Specify all animations in this window.

Click on “Create” and set the name of the clip, start, and end frame.

Confirm to store that animation group. Add all the animations your model has.

Export the model #

Once all the setup has been done, it is time to convert this model to the .glTF format.

Go to (Babylon > Babylon File Exporter…).

The next window will appear.

Source: Babylon export window

Specify the path where to store the new file.

Select .glb in the Output format dropdown menu.

Export specific models or the entire scene.

In this example there is a simple scene (one model, one rig and simple animation), so export all.

Note: We recommend using Export only selected over Export everything because of the control when working on bigger Maya scenes.

If the model has animations, Bake Animations and Export Animations must be checked. Leave the remainder of the options as in the above image.

Click “Export” and review for any warnings. The model will be exported to the selected path.

Limitations and recommendations #

One current limitation is the use of submeshes (Unity terminology) as described above (refer to Materials and textures). Each individual mesh must have one material only.

We do not recommend exporting meshes above 65,535 vertices (16-bit index buffer). They could look wrong when spawned in the room. Separate the geometry if the model exceeds that quantity of vertices.