glTF vs FBX: Which format should I use?
FBX vs. glTF: What is the difference between these 3D model file formats and which fits best into your workflow? Both are widely used and can store 3D models. But it's their differences that guide their applications.
|Ben Houston's Ultimate Guide to 3D File Formats|
|Part 1: glTF||Part 2: USD/USDZ||Part 3: FBX 3D||Part 4: OBJ 3D||Part 5: STEP||Part 6: glTF v. FBX 3D|
At a high level, the FBX file format is better than glTF if you're transferring your data to a game engine like Unity or Unreal Engine or between 3D tools like Clara.io, Maya or 3DS Max. The glTF format is better than FBX 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 augmented reality.
What is the FBX file format? The Autodesk FBX file format is a popular 3D data interchange format utilized between 3D editors and game engines. It was originally created as the native file format for Kaydara’s Filmbox motion capture tool. The FBX format name and extension is derived from that application name FilmBox. In 2005, Kaydara released a public SDK for the otherwise closed and proprietary FBX file format and engaged in a concerted PR campaign to encourage the adoption of the FBX file format for high quality 3D data interchange between different tools. Filmbox was eventually renamed MotionBuilder and was later acquired by Autodesk.
Separate Position, UV and Normal Topologies
A strength of the FBX file format, which is also shared by the OBJ 3D model format, is that it enables the storage of position, UV, and normal data that has different topology. This is great for high-quality modeling tools and enables complex features like accurate subdivision surfaces. This makes it a bit harder to load these models into g
ame engines as that data needs to be preprocessed in order to unify all of the topologies.
If you are using a language supported by the SDK, it is very powerful and convenient to use. The process of importing and exporting FBX files is a relatively simple and straightforward process of linking the SDK and then using its API to stream data in and out. All the complexity of the file format is hidden from the software developer integrating the SDK. And you don't need to worry if the SDK supports all of the FBX features, because it is the official and one-and-only FBX SDK.
This is a contrast to primarily written standards like glTF and COLLADA, which are complex and relatively easy to implement incorrectly. It is rare that these written standards are implemented by separate teams and are still fully compatible.
TALK TO THREEKIT ABOUT 3D PRODUCT VISUALIZATION
Because the SDK reads all previous versions of the FBX file format, the most modern versions of tools can correctly read the FBX files produced by other tools. Even if the FBX file format changes, the SDK can ensure that it reads both the old format and the new format via different code paths that are transparent to the user of the SDK. As such, FBX is not riddled with the compatibility problems that have plagued similar complex formats such as COLLADA (.dae). If FBX properly supports a feature, it can transfer that data between applications without much concern.
Wide Feature Support
The FBX format is the gold standard in its support of the variety of data in its format. FBX supports 3D models, scene hierarchy, materials lighting, animations, bones, skinning, and blend shapes. Because it is an older format, FBX also supports data that is no longer widely used today, such as NURBS surfaces and curves. When you choose FBX as your interchange format, you know that it can likely represent the geometrical data you need.
Fast and Efficient
The FBX file format, because it utilizes a binary format, is highly efficient. When you store data as binary, it is faster to write and read it, as opposed to a text-based format that must convert binary data to and from human readable numbers. It is also efficient in terms of space, because binary representations of numbers take up less space than human-readable numbers. Binary formats can often be complex if you need to read and write to them directly, but the FBX SDK hides this from the user.
The biggest downside of the FBX format is that it is a closed format. The only official way to access the data in FBX files is to use the official SDKs. You cannot load an FBX on a system that is not officially supported by the FBX SDK (such as in a web browser or an open source application). That said, after a couple years of effort, Blender has successfully reverse engineered most of the current version of the FBX format.
Because FBX is a closed format, it is also not possible for anyone to evolve the format except for its owner's Autodesk, and it has not made any recent updates.
Wide Feature Support
While this was listed in the pros, it can also be a con. The issue with FBX’s wide data support is that many of its support data types are legacy and are no longer regularly used. Besides its dated material and lighting models (which are covered below), FBX also supports NURBS surfaces and curves. These are significantly complex to support, as they require a full CAD kernel to be part of the FBX SDK. Legacy features like NURBS support adds significant complexity to the FBX file format that make it hard and costly to maintain. Its SDK is very large and difficult to integrate into mobile games or other size-restricted applications.
The FBX file format uses a 1990s-era lighting model premised on the Blinn-Phong spec-glossy model along with a single color or texture per material property. While this is sufficient for a minimalist material representation, it does not reflect the capabilities of modern 3D editors or game engines that utilize complex shader networks in concert with the Physically-Based Rendering (PBR) material model centered around roughness-metalness. Simplistic FBX materials also do not support sub-surface scattering, proper layered materials, or anisotropic effects. Because of the severe limits of FBX’s material model, most materials on 3D models have to be redone after they have been transferred between tools via the FBX format.
The lighting model in FBX again uses 1990s-era conventions. Modern games and tools like Threekit use a physically-based lighting model, where all lighting parameters are grounded in physical quantities such as lumens, luminosity and physically-based fall-off. Modern game engines want to transfer global illumination information such as light probes and image-based lighting, but FBX does not support this. FBX uses a more historic and arbitrary lighting model, which makes it difficult to communicate between tools that use the more modern and physically-based approaches. Like with materials, most lighting information transferred using the FBX file format has to be fixed or simply redone once it is imported into its target application.
What is the glTF format? The glTF format is an open 3D model and scene format designed for efficiently transmitting rich scene 3D data. It has been created and managed by The Khronos Group since 2013. glTF is an acronym that stands for Graphics Language Transmission Format.
Easy to Read and Write
You can use one of a number of open source libraries to read glTF files into your custom applications or you can write an importer yourself. The glTF format uses a JSON descriptor file that describes the contents of the glTF and its properties. This is very easy to read and write by a developer directly, even more so than the OBJ file format, because JSON itself is a flexible human-readable file format standard that has parsers available in most languages.
SCHEDULE A DEMO
Fast and Efficient
Like the FBX file format, the GL Transmission Format (glTF) stores the main bulk data of the 3D geometry in a binary file. The reading of the binary file is guided by the JSON descriptor file. This means that glTF is, on average, 5x smaller and can be read more than 10x faster than a file format that stored the bulk 3D geometry in human readable text (like OBJ does.)
Direct Reads for Game Engines
In the context of a game engine, glTF is even faster to read than an FBX because it stores its mesh data in a unified topology. This means that a game engine can read the data in a glTF directly into GPU memory and then render the resulting graphics on the screen without the intermediate processing required on OBJ mesh data.
Guidance from a Standards Group
Standards groups are often viewed as cumbersome and unwieldy bureaucracies, but in the case of file formats, standards groups have a variety of benefits. They ensure that the file format continues to evolve with the technology trends and that various vendors agree on how the file format will be implemented in various tools to ensure compatibility. Additionally, a standard group writes clear specifications and publish conformance testing tools that everyone can reference when there are disagreements. Khronos is doing all of these things to support glTF’s future growth and adoption.
Rich Scene Data
glTF files have the ability to store in addition to just the models and materials, animation data, bones, skinning, scene hierarchy as well as lights (via an extension.) This means that glTF can be used for both individual static models (like OBJ), but it can also be used for animated characters and full complex scenes, similarly to FBX files.
glTF is becoming the standard for streaming data to web-based and app-based augmented reality applications. Google and Facebook are already using it for this purpose. This is because it is fast, efficient, and allows for direct reads by a game engine. Because it is an official standard, that vendors around the world can support writing to this format.
Non-Editable 3D Models
One of the biggest downsides to glTF as compared to FBX is that its storage format for 3D model data is more simplistic. It does not allow for differing topology for positions, UV and normal data. While this is beneficial if you want the speed of direct reads into a game engine, it means that modifying the 3D model can be quite difficult. It is best to view glTF’s current 3D model storage format as a means of publishing a 3D model for viewing rather than as a high-fidelity 3D modeling storage role. If you want to store 3D assets for later editing, it is best to not use glTF.
No Shader Networks
Similar to FBX, the current material definition in glTF is a bit simplistic. It is a bit more modern than the FBX material definition, but barely. It does not compare to the material complexity that can be represented in modern 3D tools such as Maya, Clara.io and Unreal Engine. The current state-of-the-art approach to representing materials in a powerful but flexible method is via shader networks. glTF does not support shader networks, so it is not an optimal file format for materials if you want to edit them. Rather, it's a format you convert to when you want to publish a model for viewing by others.
Non-Backwards Compatible Extensions
The glTF standard committee allows for vendor-specific extensions to the glTF format. These extensions, while they provide additional functionality, do not currently guarantee backwards compatibility with glTF viewers or readers that do not support these vendor specific extensions. This means that the file format is fragmenting each time these non-backwards compatible extensions are adopted by just a single vendor. As more of these vendor-specific extensions come into existence, it will be harder for users to achieve glTF compatibility between vendor tools. This type of fragmentation does not occur with the FBX file format.
If you want complex scenes, animation, lights, and efficiency in distributing 3D models for use in a game engine or viewer, use the glTF format. This is especially ideal when you know exactly what tool will generate the glTF files and which tool will read the glTF files to ensure that they are fully compatible.
If you want to be able to save and load 3D models and scenes that you can edit afterwards, pick FBX. FBX guarantees compatibility between tools, at least for the features it supports, and its data representations are more precise than glTF’s. FBX should not be a go-to choice for communicating with open source tools or for places where simplicity is favored.
Threekit provides product visualization software that creates photorealistic images, interactive 3D and augmented reality experiences that help businesses sell more. To learn more, schedule a demo with one of our teammates.
Download our eBook
If you’re making the business case for 3D and augmented reality product visuals, this is the guide you need. Get real data on how this innovative technology pays off.