fbpx

What is the glTF Format: A Complete Guide for AEC Professionals

glTF Format

What is a glTF format?

If you work in the construction industry, you may be familiar with glTF, which stands for “GL Transmission Format.” It’s a file format specifically designed for 3D models to be lightweight and user-friendly. 3D file formats, such as OBJ and FBX, take up more storage space than glTF files. Moreover, glTF files can be loaded easily in web browsers.

Another great comparison is that Gltf is the JPEG of 3D models. This post will analyze its role in the architecture industry and how to use this format.

.

What is glTF Format

One of the key benefits of glTF is that it is an open format. This means that it is free to use and there are no proprietary restrictions. glTF is popular among 3D graphics developers. This is due to the variety of tools and libraries available for working with it.

3d Models
Model courtesy of Sketchfab

glTF Structure

The glTF file format consists of two main components: a JSON component and a binary component. The component JSON data contains information on scenes, nodes, accessors, and materials. The binary component contains all the mesh data, animations, skins, and other 3D model data.

glTF structure
The graph on the structure of a glTF format.

glb vs glTF

Depending on how the glTF file was created, these components can be combined in three ways:

  1. glTF: The glTF format is self-contained. It combines both the binary part and the component JSON into a single file.
  2. glTF + bin: In this case, the JSON part is created separately from the binary part. Depending on the size and complexity of the 3D model that wants to be exported, there can be many binaries.
  3. GLB: The JSON part and the binary will both be stored as binary data. This makes it more efficient than the glTF format, which is self-contained.

    Feature

    GLB

    glTF

    Format

    Binary

    JSON (text-based) and binary

    Extension

    .glb

    .gltf for text, .bin for binary assets

    Usage

    Streamlined, single-file packaging of 3D assets

    Flexible, multi-file format for 3D assets

    Efficiency

    Generally more efficient for transmission

    Can be less efficient due to separate files

    Compatibility

    Simplifies asset loading for engines and viewers

    Wide support, may require additional handling

    Interoperability

    High, due to single file

    High, with proper handling of associated files

    Embedding

    Embeds textures and other assets within the file

    References textures and assets as external files

    Ease of Use

    Simplified deployment and management

    Offers more control over assets, but can be complex

    Optimization

    Well-suited for web and real-time applications

    Flexible, can be optimized for various use cases

Comparison table between the 3 different variations of the glTF format

How to open GLTF files

To open a glTF file, use any of these popular 3D apps for editing after downloading or exporting it:

How to know if my glTF file is correct

    1. Validate your glTF format in the Khronos glTF validator. You will great a green sign if your glTF is valid and a red sign in case it is not.

If your glTF is valid, you will see a green sign, and a red sign if is not.

glTF validation
glTF validation

    2. Try to open the file in e-verse glTF viewer. If a glTF is valid it will load successfully. If there are errors, it may be able to load, but you will get a warning to fix them. If the files are corrupt, you won’t be able to open them.

glTF file

Below is an example of the type of report that you get when opening a glTF file

glTF validation report

    3. Run it through a glTF report like this one, you can analyze it deeper to improve your glTF format.

glTF validation report

Compression for glTF

Compressing is essential to keep the models lightweight and easily shareable. Compressed files take up even less space, making them load faster and easier to share. Several compression methods are available for glTF, including ZIP, Draco, and MeshOpt, each with advantages and disadvantages.

Check out the comparison table below:

Compression methodAuthorYear of creationCompression capacityLoading timeCompression Time
.Ziphttps://www.pkware.com/198975%FastFast
MeshOpthttps://zeux.io/201690%FastMedium
DracoGoogle201695%MediumSlow

You can see a live example of a loading times comparison between Draco and Meshopt here

Meshopt
Draco Compressed

As demonstrated in the example above, Meshopt has a faster loading time than Draco, but the file size is larger.Loading times are key when considering which option to choose. The other option is better when transferring times of the files is more important. An example was taken from View3D website.

We couldn’t find a C# Nuget library to compress the first time we worked with Draco, so we created our own, just in case you need to use it Here.

Rotation, Scale, and Translation

Like any other format we can rotate, scale or translate a model by modifying the vertices of all the meshes, but this can be really time-consuming when exporting it. That is why glTF has a better solution, and it’s the possibility of modifying the properties of each node. So if we change the scale of the root node, the same scale will be applied to all the elements inside that node.

The same goes for the translation and for the rotation, the only difference is that it has to be defined in a quaternion, so if you want more info on how to do it you can check this link.

Root Node
How rotation, translation and scale are applied to a root node.

Units in glTF models

When importing a glTF file into Three.js, understanding units is important. In glTF, units are absolute, so in contrast of other programs like Revit you could use any unit and you would be fine as long as all your models are in the same scale. Typically most people use meters.

glTF models
Comparison of a model exported in feet on the left and a model exporter in meters on the right

glTF file Extensions

Extensions in glTF allow for additional functionality beyond the core specification. They enable developers to add custom features or support for specific use cases, making the format even more powerful.

There are two types of extensions: official extensions, which are maintained by the Khronos Group (like the HRH_materials_volume), and community extensions, which are developed and maintained by the community.

The extension’s properties and values are defined in the JSON component, and the binary component may contain additional data required by the extension.

glTF 3D model of a mosquito using extensions to add reflection and refraction in Babylon.js SandboxModel by Loïc Norgeot and mosquito scan by Geoffrey Marchal for Sketchfab.

What is the role of the glTF in the AEC industry

glTF is important in the AEC industry for visualizing 3D elements. It’s lightweight and compatible with web browsers and game engines, making it a great choice for sharing and collaborating on 3D models. glTF files are smaller and load easily compared to other 3D formats, like IFC, wich is the AEC standard, one of the main differences between IFC and glTF is their intended use. We listed some others below:

  • IFC is a file format designed specifically for the AEC industry, while glTF is a more general-purpose format that can be used across various industries.
  • IFC files are typically much larger and more complex than glTF files, which can make them more difficult to load and work with.
  • IFC files do contain much more detailed information about the building and its components, which is necessary for many AEC-related tasks.
  • glTF files are much smaller and simpler, making them easier to share and load quickly.

Extensions in glTF allow for additional functionality beyond the core specification. They enable developers to add custom features or support for specific use cases, making the format even more powerful.

There are two types of extensions: official extensions, which are maintained by the Khronos Group (like the HRH_materials_volume), and community extensions, which are developed and maintained by the community.

The extension’s properties and values are defined in the JSON component, and the binary component may contain additional data required by the extension.

IFC viewer courtesy of IFC.js

Export glTF out of Revit

If you want to export a glTF out of Autodesk Revit, we have created Leia, our glTF exporter. There are many other great exporters out there, you can find a comparison table below:

CompanyCompressionLinksMaterialsTransparenciesNormalsGLBPrice
Griffel StudioDracoYesYesNoYesYesU$S 129.60
VisionWorkplace SolutionsNoYesYesNoYesYesU$S 149.00
SimLab SoftwareNoYesYesYesNoYesU$S 199
Prototech exporterNoYesYesYesYesYesU$S 99.00
IN9PLUSNoNoYesNoNoNoFree
DiRootsDraco, MeshoptNoNoNoYesYesFree
e-verseDraco, ZipYesYesYesYesYesFree

Conclusion

Overall, glTF is a game-changer for architects, engineers, the construction industry and anyone who works with 3D formats. Its lightweight structure, compatibility with web browsers and game engines, and ease of use make it an ideal choice for anyone who wants to share and collaborate on 3D models.

This format will become more important when this platform gets more users. If you haven’t already, try the glTF format and discover why it has become the go-to standard for 3D graphics on the web.

591 Views

I'm a versatile leader with broad exposure to projects and procedures and an in-depth understanding of technology services/product development. I have a tremendous passion for working in teams driven to provide remarkable software development services that disrupt the status quo. I am a creative problem solver who is equally comfortable rolling up my sleeves or leading teams with a make-it-happen attitude.