GLTF file format analysis, preview, and editing

Introduction to GLTF format

GLTF is a royalty-free specification for engines and applications to efficiently transfer and load 3D scenes and models, minimizing the size of 3D assets and the runtime processing required to unpack and use them. The expanded publishing format streamlines creative workflows and interactive services by enabling interoperable use of 3D content across the industry.

GLTF2.0 has been released as the ISO/IEC 12113:2022 international standard and is maintained by Khronos Group.

The GLTF format has a wide range of applications, such as virtual reality, augmented reality, games, online shopping, scientific visualization and other fields.

GLTF format data composition

The data composition of GLTF format is as follows:

  • .gltfdocument. This is the main file in GLTF format. It is a JSON file that contains a description of the scene and other related data.
  • .bindocument. This is a binary file that contains geometry and animation data as well as other buffer-based data.
  • .jpg, .pngfiles. These are image files used for textures.

Alternatively, data can be included directly in a GLTF-formatted JSON file via a data URI.

GLTF format representation

In addition to the binary format .glb, GLTF also has the following three forms of expression:

  • .gltf, text file, json format, there can be only one file.
  • .gltf+ .bin, the .bin file is referenced through buffers.uri in gltf.
  • .gltf+ .bin+Image files, image files are referenced through images.uri in gltf. Image files can be placed in the same level directory or in a subdirectory. Texture images are usually placed in the textures directory.

The difference between GLTF and GLB

The differences between GLTF and GLB are as follows:

  • The file formats are different  . GLB format is a binary file format; GLTF format is based on JSON.
  • External file dependencies are different  . GLB locates all elements of the 3D scene (including materials, node levels and cameras) in a compressed file and is an independent file; GLTF files require external processing of file formats, such as textures, shaders and animation data and other formats, and are not independent document.
  • File sizes vary  . The file size of GLB format is 33% smaller than that of GLTF format.

How to generate GLTF format

The GLTF format is a format used for 3D scenes and models. Here are the steps to generate the GLTF format through Cesium:

  1. Download the plugin. Visit the Khronos organization's GLTF plugin GitHub page to download the plugin.
  2. Install the plugin. Unzip the downloaded plug-in file and place it in C4D's plug-in directory.
  3. Open C4D. Start the C4D application and open the project file containing the model and animation you want to convert.
  4. Export settings. In the C4D menu bar, select "Extensions"-"COLLADA2GLTF" to open the plug-in settings interface.
  5. Configure export options. In the plug-in settings interface, you can configure parameters such as output path, export options, animation options, and other options.
  6. Execute the export. After the configuration is completed, click the "Export" button in the plug-in interface to start exporting the C4D file to GLTF format.
  7. Wait for the export to complete. The export process may take some time depending on the complexity of the model and animation, waiting for the export to complete.
  8. Verify export results. After the export is complete, you can use the GLTF viewer to open the exported GLTF file to verify whether the model and animation are completely converted and displayed correctly.

GLTF format advantages and disadvantages

The advantages of the GLTF format are:

  • GLTF is a format for 3D scenes and models that uses binary encoding to increase transmission speed.
  • GLTF no longer uses object-oriented thinking to store three-dimensional models and textures, but stores them according to the thinking of a graphics card. It stores the most basic information such as vertices, normals, and vertex colors, but the organizational structure is carefully designed.
  • GLTF optimizes application read efficiency and reduces rendering model runtime.
  • GLTF supports 3D model geometry, materials, animations, scenes, cameras and other information.

The disadvantages of the GLTF format are:

  • It is no longer as easy to edit and convert as fbx and obj.
  • It is end-oriented and has poor editability because the improvement of rendering performance sacrifices editability.

GLTF format viewing and editing

Use the GLTF model editor website for online preview and editing : supports modification of model materials, textures and some basic attributes.

GLTF format application prospects

The GLTF format has broad application prospects, such as in 3D games, virtual reality, 3D advertising, social platforms and other fields.

GLTF is a format used for 3D scenes and models. Many large technology companies, such as Google and Microsoft, have applied the GLTF format in their products. For example, Google is exploring the use of GLTF for its 3D advertising, and Microsoft allows GLTF files to be embedded into Powerpoint or Word documents. Meanwhile, on social platforms such as Facebook, interactive 3D posts can be created using the GLTF format.

Guess you like

Origin blog.csdn.net/ygtu2018/article/details/132900700