glTF Writer

gl Transmission Format
File Extension glTF, GLB
Supported Versions 2.0
Platforms
Tessellation
B-rep N/A
PMI N/A
Assembly N/A
Views N/A

The glTF (GL Transmission Format) file format was created by the Khronos Group in 2015. It is an open standard for 3D scenes and models, designed to be efficient and widely supported across platforms.

The file extensions that you can create when you export to glTF are

  • .gltf
  • .glb

HOOPS Exchange geometry access for glTF includes:

  • Tessellation: Can be written by HOOPS Exchange for visualization.
  • B-rep: This format does not support B-rep

Physically-Based Rendering Material

As of version 2019 HOOPS Exchange now supports physically based rendering (PBR) materials with A3DGraphMaterialData structure. PBR related information are read from glTF formats. See Getting PBR Material Properties for how to retrieve these PBR-specific properties.

Assembly

This concept is not supported by glTF.

B-rep

This concept is not supported by glTF.

Views

This concept is not supported by glTF.

Wireframe

Two kinds of line geometry can be written to a glTF file, and they are controlled differently:

  • Edge wireframe of surfaces and solids: when A3DRWParamsExportGltfData.m_bExportEdgeWires is set to A3D_TRUE, the edges of each tessellated B-rep or polyhedral representation item are written as glTF LINES primitives, overlaid on its triangle mesh. The edges come from the face wire data of the tessellation (A3DTess3DData.m_puiWireIndexes). Wires flagged with kA3DTessFaceDataWireIsNotDrawn are skipped. The edge wireframe is currently written in black. This option is A3D_FALSE by default.
  • Curves and wires of the source model: curve (A3DRiCurve) and polywire (A3DRiPolyWire) representation items are written as glTF LINES primitives regardless of the value of m_bExportEdgeWires.

Setting m_bExportEdgeWires to A3D_FALSE only removes the edge overlay from surfaces and solids. It does not drop curves or wires that exist in the source model.

A3DRWParamsExportGltfData sExportParams;
A3D_INITIALIZE_DATA(A3DRWParamsExportGltfData, sExportParams);
sExportParams.m_bExportEdgeWires = A3D_TRUE; // Add the edge wireframe to surfaces and solids

A3DStatus iRet = A3DAsmModelFileExportToGltfFile(pModelFile, &sExportParams, "model.glb");

Miscellaneous

Supported

  • Version 2.0 files only (tinygltf limitation; only “asset” data is correctly parsed from 1.0 files)
  • Vertex position, normal, color, texture coordinate sets 0 and 1
  • Triangles
  • Full texture support and material data: normal, occlusion, emissive
  • Physically Based Rendering (PBR) textures and constants: base color, metallness, roughness
  • Texture file formats: JPEG, PNG, BMP, GIF (handled by tinygltf)
  • Cameras
  • Wireframe (see Wireframe)

Unsupported

  • Version 1.0 files
  • Vertex tangents
  • Animations
  • Skins
  • Extensions
  • Shaders
  • Sparse accessors (currently not supported by tinygltf)
  • Byte-swapping for Big-Endian platforms