GLB export Tips & Tricks
To ensure the same experience on every device, My AR Studio supports only the common features between each platform (Web, Android, IOS). Refer to the following to optimize the GLB export of your scenes for use in Augmented Reality.
Although in this video we will be using Blender, the concepts expressed apply to any other 3d editor.
Geometry
Each mesh can have only one UV set. In case of multiple UV sets only the first one is used.
It is not possible to bind data to vertices. So neither vertex color nor vertex animation are supported (AKA morph targets, blend shapes, shapekeys).
It is possible to instantiate the same geometry to save weight in the export file. Each instance can have its own independent animation.
In Augmented Reality the objects are positioned using the lowest point of the bounding-box which contains all the geometry of the scene. Pay attention that on android and chrome only the bounding-box of the first animation frame is considered, while on IOS the bounding-box of the entire animation is taken into account.
In case of suspended objects, place an object at ground level to lower the base of the bounding-box. To hide it, just shrink it without making it go to zero.
The visibility flag of the objects are not exported in GLB. To make an object appear or disappear just scale it from 0% to 100% in the space of a frame.
Materials
Only one material per object must be used. Multiple objects can share the same material. Multiple instances of the same object can each use a different material.
Supported texture formats are jpeg and png. No other image formats, animated textures or video files can be used.
The parameters of a material and the texture mapping coordinates are not animatable.
Not all material types are always exportable to GLB. For example in Blender it is always necessary to use the principled shader. Any other shader (ex: diffuse, glossy, volume) will be ignored in the export phase. Refer to the documentation of your software to verify the compatibility of the materials with the GLB standard.
Rigging
It is possible to use only one skeleton with only one associated mesh. Each vertex can be deformed by up to 4 bones, the remaining bones are ignored.
The mesh associated with the skeleton will be deformed with linear interpolation. It may be necessary to use support bones to best deform the joints of organic characters. The mesh can be deformed by non-uniformly scaled bones.
Animation
It is recommended to set the animation framerate to 30 frames per second to synchronize the frames with the screen refresh rate of most phones. It is possible to export the animation at lower framerates (eg 24fps) but, since the refresh rate will remain at 30 fps, some flickering or unwanted interpolations may occur.
The beginning and end of an animation will coincide with the first and last exported keyframe. To have moments of pause at the beginning or end of the animation, just duplicate the initial or final keyframes and create the necessary space.
Android and IOS may calculate keyframes interpolations differently. To keep the result as faithful as possible to the original, it will be necessary to bake the animation tracks when exporting to GLB. Baking will also be necessary when using constraints or driven objects.
GLB format does not support particle systems. Refer to the documentation of the software used for the eventual conversion of particles into animated objects.
To export multiple animated objects to a GLB file, make sure to export a single global animation track, rather than multiple independent tracks for each object. Export settings may vary depending on the software used. For example in Blender is necessary to disable "Group by NLA Track".