# glTF

**glTF**（GL传输格式）是一种开放、免版税的文件格式，用于高效传输和加载三维场景与模型，由[科纳斯组织](https://www.edgepedia.org/zh/khronos-group)（Khronos Group）发布。其核心是一个JSON文件，描述包含三维模型的场景的结构与组成，而整个资产——包括几何体、纹理和元数据——可以打包为扩展名为.glb的单一二进制文件。<sup>[1](https://www.khronos.org/gltf/)</sup><sup> • </sup><sup>[2](https://www.khronos.org/news/press/khronos-finalizes-gltf-1.0-specification)</sup> 该格式设计为与厂商和运行时无关，可供原生引擎和基于Web的引擎使用，不受底层三维图形API的限制。<sup>[3](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html?initialSessionID=262-7493612-7323838&ld=ASXXSCTFRDirect)</sup>

| 关键事实 | 详情 |
|---|---|
| 全称 | GL传输格式（glTF），科纳斯组织标准 |
| 1.0版定稿 | 2015年10月19日发布，作为免版税规范，用于三维内容的传输与加载<sup>[2](https://www.khronos.org/news/press/khronos-finalizes-gltf-1.0-specification)</sup> |
| 文件编码 | JSON文本（.gltf）与二进制（.glb）；.glb将几何体、纹理和元数据打包进单一文件<sup>[1](https://www.khronos.org/gltf/)</sup><sup> • </sup><sup>[4](https://www.khronos.org/assets/uploads/developers/presentations/glTF_Innovations_SIGGRAPH_2025.pdf)</sup> |
| 材质 | 基于物理的渲染（PBR）金属-粗糙度材质模型，基于Burley（2012）提出的表示方法<sup>[5](https://github.com/KhronosGroup/glTF/blob/main/specification/2.0/Specification.adoc)</sup> |
| 可扩展性 | 通用扩展与厂商特定扩展，包括几何体和纹理压缩；必需扩展须列于`extensionsRequired`中<sup>[3](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html?initialSessionID=262-7493612-7323838&ld=ASXXSCTFRDirect)</sup><sup> • </sup><sup>[6](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html?ld=AmazonStoresLandingPage)</sup> |
| 标准化 | glTF 2.0通过ISO/IEC JTC 1 PAS流程转化为ISO/IEC 12113<sup>[7](https://www.khronos.org/news/press/khronos-gltf-2.0-released-as-an-iso-iec-international-standard)</sup> |
| 缓冲区限制 | 缓冲区大小无硬性上限，但资产不应使用大于\( 2^{53} \)字节的缓冲区，因为部分JSON解析器可能错误解析`byteLength`<sup>[3](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html?initialSessionID=262-7493612-7323838&ld=ASXXSCTFRDirect)</sup> |

## 目的与设计

glTF是一种运行时三维资产交付格式：它压缩三维场景与模型的大小，并尽量减少使用WebGL及其他API的应用程序在运行时的处理开销。<sup>[2](https://www.khronos.org/news/press/khronos-finalizes-gltf-1.0-specification)</sup> 规范将其描述为一种开放、可互操作的三维资产传输格式，紧凑且能在运行时高效处理和渲染。<sup>[3](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html?initialSessionID=262-7493612-7323838&ld=ASXXSCTFRDirect)</sup> 它还为三维内容工具和服务定义了通用的发布格式。<sup>[2](https://www.khronos.org/news/press/khronos-finalizes-gltf-1.0-specification)</sup>

设计目标在工作组自己的表述中被称为“glTF首要原则”：保持一种通用且易于处理的交付格式，在功能需求与该约束之间取得平衡。<sup>[8](https://developer.download.nvidia.com/video/gputechconf/gtc/2020/presentations/s22158-khronos-cross-platform-standards-update-vulkan-spir-v-openxr-gltf-and-opencl.pdf)</sup>

## 文件结构

glTF资产是一个JSON文档，描述场景图、网格、材质、纹理、动画以及存放几何体和其他数据的二进制缓冲区。缓冲区可以外部存储、以base64数据URI嵌入JSON中，或通过GLB容器与JSON一起打包进单一二进制文件，从而避免base64编码带来的体积和处理开销。<sup>[5](https://github.com/KhronosGroup/glTF/blob/main/specification/2.0/Specification.adoc)</sup><sup> • </sup><sup>[9](https://www.runesofmyria.com/docs/manual/en-us/glTF-2.0.pdf)</sup>

**GLB容器。** GLB文件采用小端序，以12字节头部开始：魔数0x46546C67（ASCII字符串“glTF”）、标识容器版本的版本字段，以及文件总字节长度。头部之后是若干块，每块包含块长度、块类型和块数据；块类型0x4E4F534A（“JSON”）存放JSON内容，块类型0x004E4942（“BIN”）存放二进制缓冲区，后者可有0个或1个。<sup>[10](https://www.khronos.org/files/gltf20-reference-guide.pdf)</sup> 加载GLB的客户端必须检查JSON块中的资产版本属性，因为GLB头部中的版本仅指容器版本，而非glTF资产版本。<sup>[6](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html?ld=AmazonStoresLandingPage)</sup>

## 材质与渲染

glTF 2.0定义的材质采用一组基于广泛使用的基于物理的渲染表示法的通用参数，具体为金属-粗糙度模型，其双向反射分布函数借鉴了Burley（2012）提出、并经众多渲染器改编采用的材质模型。这种声明式表示使glTF文件能够在各平台上一致地渲染。<sup>[5](https://github.com/KhronosGroup/glTF/blob/main/specification/2.0/Specification.adoc)</sup><sup> • </sup><sup>[11](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.pdf)</sup> 标准BRDF的WebGL 2.0示例实现可在科纳斯glTF示例查看器中获取。<sup>[12](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html?initialSessionID=262-8275889-9461927&ld=ASXXSCTFRDirect)</sup>

PBR功能集通过已批准的扩展不断扩充；例如，KHR_materials_emissive_strength增加一个标量因子，提高每种材质的自发光强度上限，并可提示渲染器启用泛光后处理。<sup>[13](https://www.khronos.org/gltf/pbr)</sup> KHR_materials_unlit扩展定义了基于物理的渲染之外的材质。<sup>[14](https://www.manuallib.com/download/2023-10-21/glTF%202.0%20API%20Reference%20Guide.pdf)</sup>

## 扩展与压缩

glTF定义了一种扩展机制，允许以新能力扩展基础格式，包括通用扩展和厂商特定扩展，涵盖几何体和纹理压缩。<sup>[6](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html?ld=AmazonStoresLandingPage)</sup><sup> • </sup><sup>[3](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html?initialSessionID=262-7493612-7323838&ld=ASXXSCTFRDirect)</sup> 加载或渲染资产所需的全部扩展必须列于顶层`extensionsRequired`数组中，以便加载器拒绝其无法完全处理的资产。<sup>[6](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html?ld=AmazonStoresLandingPage)</sup>

**几何体压缩。** KHR_draco_mesh_compression扩展使用Draco库压缩glTF几何体，规范上基于Draco比特流2.2版。不支持该扩展的加载器仅可在其未列于`extensionsRequired`时忽略它。<sup>[15](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md)</sup>

**纹理压缩。** KTX（科纳斯纹理）是一种轻量级容器格式，glTF支持用它跨平台分发GPU纹理，减小资产文件大小和GPU内存占用；第二代纹理工作集中于KTX2容器内的Basis Universal编码与转码。<sup>[1](https://www.khronos.org/gltf/)</sup><sup> • </sup><sup>[8](https://developer.download.nvidia.com/video/gputechconf/gtc/2020/presentations/s22158-khronos-cross-platform-standards-update-vulkan-spir-v-openxr-gltf-and-opencl.pdf)</sup>

## 历史与标准化

科纳斯组织是由硬件和软件公司组成的开放联盟，于2015年10月19日在旧金山HTML5DevConf上宣布glTF 1.0规范定稿。发布时可用的工具包括科纳斯、Analytical Graphics Inc.和[摩托罗拉移动](https://www.edgepedia.org/zh/motorola-mobility)制作的离线和在线COLLADA转glTF转换器，Autodesk正在开发的FBX转glTF转换器，以及面向主流WebGL引擎的加载器，包括three.js、微软的Babylon.js、Cesium和X3DOM。<sup>[2](https://www.khronos.org/news/press/khronos-finalizes-gltf-1.0-specification)</sup>

glTF 2.0后来成为国际标准：科纳斯通过ISO/IEC JTC 1公开可用规范（PAS）提交流程完成了转化，成为ISO/IEC 12113，该组织称此举巩固了格式的全球认可度，并加速了行业及其他标准组织的采用。<sup>[7](https://www.khronos.org/news/press/khronos-gltf-2.0-released-as-an-iso-iec-international-standard)</sup> 规范源文件本身以AsciiDoc标记发布于GitHub（自2021年9月23日起），采用CC-BY 4.0许可，以便社区反馈和再混合。<sup>[16](https://github.com/khronosgroup/gltf)</sup><sup> • </sup><sup>[5](https://github.com/KhronosGroup/glTF/blob/main/specification/2.0/Specification.adoc)</sup>

## 在三维格式中的定位

与常见替代方案相比，glTF在单一开放文件中涵盖几何体、PBR金属-粗糙度材质、骨骼动画和Draco压缩，而FBX依赖专有技术栈，OBJ则仅限于静态交换。<sup>[17](https://www.cadinterop.com/en/formats/mesh/gltf.html)</sup> 从业者的指导按用途划分选择：当紧凑、规范化的实时交付格式适合目标时，使用glTF或GLB；当既有的数字内容创作到引擎的工作流依赖其动画和场景交换时，使用FBX；简单静态几何体用OBJ；当更大的合成场景和协作式资产结构值得增加管线复杂度时，使用USD。<sup>[18](https://g3d.ai/research/gltf-vs-fbx-vs-obj-vs-usd)</sup> 因此，glTF被描述为更像是三维内容的运输集装箱，而非供持续创作使用的松散交换格式。<sup>[19](https://formats.jarhalab.com/comparisons/gltf-vs-fbx)</sup>

该格式也出现在Web和游戏管线之外：例如，OpenXR的xrLoadRenderModelFB函数将渲染模型加载为包含GLB数据的字节缓冲区，这些数据必须符合glTF 2.0规范。<sup>[20](https://registry.khronos.org/OpenXR/specs/1.1/man/html/xrLoadRenderModelFB.html)</sup>

## References

1. [glTF – Runtime 3D Asset Delivery, Khronos Group](https://www.khronos.org/gltf/)
2. [Khronos Finalizes glTF 1.0 Specification, Khronos Group press release (October 19, 2015)](https://www.khronos.org/news/press/khronos-finalizes-gltf-1.0-specification)
3. [glTF™ 2.0 Specification, Khronos Registry](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html?initialSessionID=262-7493612-7323838&ld=ASXXSCTFRDirect)
4. [What is glTF? Khronos SIGGRAPH 2025 presentation](https://www.khronos.org/assets/uploads/developers/presentations/glTF_Innovations_SIGGRAPH_2025.pdf)
5. [glTF 2.0 Specification source (Specification.adoc), KhronosGroup/glTF on GitHub](https://github.com/KhronosGroup/glTF/blob/main/specification/2.0/Specification.adoc)
6. [glTF™ 2.0 Specification, Khronos Registry](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html?ld=AmazonStoresLandingPage)
7. [Khronos glTF 2.0 released as an ISO/IEC International Standard, Khronos Group press release](https://www.khronos.org/news/press/khronos-gltf-2.0-released-as-an-iso-iec-international-standard)
8. [Khronos Cross-Platform Standards Update (GTC 2020, S22158), NVIDIA](https://developer.download.nvidia.com/video/gputechconf/gtc/2020/presentations/s22158-khronos-cross-platform-standards-update-vulkan-spir-v-openxr-gltf-and-opencl.pdf)
9. [glTF™ 2.0 Specification (GLB File Format Specification section), mirrored PDF](https://www.runesofmyria.com/docs/manual/en-us/glTF-2.0.pdf)
10. [glTF 2.0 API Reference Guide, Khronos Group](https://www.khronos.org/files/gltf20-reference-guide.pdf)
11. [glTF™ 2.0 Specification PDF, Khronos Registry](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.pdf)
12. [glTF™ 2.0 Specification, Khronos Registry](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html?initialSessionID=262-8275889-9461927&ld=ASXXSCTFRDirect)
13. [PBR – Physically Based Rendering in glTF, Khronos Group](https://www.khronos.org/gltf/pbr)
14. [glTF 2.0 API Reference Guide, manuallib copy](https://www.manuallib.com/download/2023-10-21/glTF%202.0%20API%20Reference%20Guide.pdf)
15. [KHR_draco_mesh_compression extension README, KhronosGroup/glTF on GitHub](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md)
16. [KhronosGroup/glTF repository README, GitHub](https://github.com/khronosgroup/gltf)
17. [CAD interoperability around the glTF mesh format, CAD Interop](https://www.cadinterop.com/en/formats/mesh/gltf.html)
18. [glTF vs FBX vs OBJ vs USD for game assets, G3D.AI](https://g3d.ai/research/gltf-vs-fbx-vs-obj-vs-usd)
19. [glTF vs FBX: Which to Use?, JarhaLab File Formats](https://formats.jarhalab.com/comparisons/gltf-vs-fbx)
20. [xrLoadRenderModelFB(3), OpenXR 1.1 specification manual, Khronos Registry](https://registry.khronos.org/OpenXR/specs/1.1/man/html/xrLoadRenderModelFB.html)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 工程与制造 › 计算机辅助工程与电子设计自动化 › CAD kernels and file formats

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/gltf

English original: https://www.edgepedia.org/gltf
