glTF™ 2.0 Specification GLTF ™ 2.0规范(AI翻译)

glTF 2.0 Specification GLTF  2.0规范 

The Khronos® 3D Formats Working GroupKhronos ® 3D格式工作组version 2.0.1, 版本2.0.1, 2021-10-11 23:01:57Z 2021-10-11 23:01:57Z from git branch: main commit: 8e798b02d254cea97659a333cfcb20875b62bdd4来自GIT分支:MAIN提交:8E798B02D254CEA97659A333CFCB20875B62BD4

 

 

 

  1. Foreword 1。前言

Copyright 2013-2021 The Khronos Group Inc.版权所有2013-2021 Khronos Group Inc.

This specification is protected by copyright laws and contains material proprietary to Khronos. Except as described by these terms, it or any components may not be reproduced, republished, distributed, transmitted, displayed, broadcast, or otherwise exploited in any manner without the express prior written permission of Khronos.该规范受版权定律的保护,并包含khronos的物质。除了这些条款所述,如果未经Khronos的明确事先书面许可,则不得以任何方式复制,重新出版,分发,传播,展示,广播,广播,广播,广播,广播,广播,广播,广播,广播,广播或以其他方式进行复制,重新出版,传输,展示,广播或其他任何组件。

This specification has been created under the Khronos Intellectual Property Rights Policy, which is Attachment A of the Khronos Group Membership Agreement available at https://www.khronos.org/files/member_agreement.pdf. Khronos grants a conditional copyright license to use and reproduce the unmodified specification for any purpose, without fee or royalty, EXCEPT no licenses to any patent, trademark or other intellectual property rights are granted under these terms. Parties desiring to implement the specification and make use of Khronos trademarks in relation to that implementation, and receive reciprocal patent license protection under the Khronos IP Policy must become Adopters under the process defined by Khronos for this specification; see https://www.khronos.org/conformance/adopters/file-format-adopter-program.该规范是根据Khronos知识产权政策创建的,该政策是https://www.khronos.org/files/member_agreement.pdf的Khronos组成员协议的附件A。 Khronos授予有条件的版权许可,以任何目的使用和复制未修改的规范,无需费用或特许权使用费,除非在本条款下授予任何专利,商标或其他知识产权的许可。希望实施规范并利用与该实施相关的Khronos商标,并根据Khronos IP策略获得相互专利许可保护的当事方必须根据Khronos为此规范定义的流程采用;请参阅https://www.khronos.org/conformance/adopters/file-format-adopter-program。

Some parts of this Specification are non-normative through being explicitly identified as purely informative, and do not define requirements necessary for compliance and so are outside the Scope of this Specification.该规范的某些部分是通过明确识别为纯粹有用的,并且没有定义合规性必要的要求,这是非规定的,因此超出了此规范的范围。

Where this Specification includes normative references to external documents, only the specifically identified sections and functionality of those external documents are in Scope. Requirements defined by external documents not created by Khronos may contain contributions from non-members of Khronos not covered by the Khronos Intellectual Property Rights Policy.如果此规范包括对外部文档的规范性引用,则只有这些外部文档的特定识别部分和功能才在范围内。由Khronos未创建的外部文件定义的要求可能包含Khronos知识产权政策不涵盖的Khronos的非会员的贡献。

Khronos makes no, and expressly disclaims any, representations or warranties, express or implied, regarding this specification, including, without limitation: merchantability, fitness for a particular purpose, non-infringement of any intellectual property, correctness, accuracy, completeness, timeliness, and reliability. Under no circumstances will Khronos, or any of its Promoters, Contributors or Members, or their respective partners, officers, directors, employees, agents or representatives be liable for any damages, whether direct, indirect, special or consequential damages for lost revenues, lost profits, or otherwise, arising from or in connection with these materials.Khronos对此规范无明确或暗示任何明确的陈述或保证,包括但不限于:适销性,适合特定目的的适用性,任何知识产权,正确性,准确性,准确性,完整性,及时性和可靠性。在任何情况下,Khronos或其任何促进者,贡献者或成员,或其各自的合作伙伴,官员,董事,雇员,代理人或代表都对任何损害责任,无论是直接,间接,特殊或后果损失的收入,损失的利润,损失的利润,或其他与这些材料有关的损失。

Khronos® and Vulkan® are registered trademarks, and ANARI™, WebGL™, glTF™, NNEF™, OpenVX™, SPIR™, SPIR‑V™, SYCL™, OpenVG™ and 3D Commerce™ are trademarks of The Khronos Group Inc. OpenXR™ is a trademark owned by The Khronos Group Inc. and is registered as a trademark in China, the European Union, Japan and the United Kingdom. OpenCL™ is a trademark of Apple Inc. and OpenGL® is a registered trademark and the OpenGL ES™ and OpenGL SC™ logos are trademarks of Hewlett Packard Enterprise used under license by Khronos. ASTC is a trademark of ARM Holdings PLC. All other product names, trademarks, and/or company names are used solely for identification and belong to their respective owners.Khronos®和Vulkan®是注册商标,Anari™,WebGL™,GLTF™,NNEF™,OpenVX™,SpirVX™,Spir™,sip -V™,OpenVG™,OpenVG™和3D Commerce™是Khronos Group Ingronos Ingron的商标。中国,欧盟,日本和英国的商标。 OpenCL™是Apple Inc.的商标,OpenGL®是注册商标,OpenGL ES™和OpenGL SC™徽标是Khronos使用许可证使用的Hewlett Packard Enterprise的商标。 ASTC是Arm Holdings Plc的商标。所有其他产品名称,商标和/或公司名称仅用于身份证明,属于其各自的所有者。

  1. Introduction 2。简介

2.1. General 2.1。一般的 

This document, referred to as the “glTF Specification” or just the “Specification” hereafter, describes the glTF file format.该文档(称为“ GLTF规范”或以下“规范”)描述了GLTF文件格式。

glTF is an API-neutral runtime asset delivery format. glTF bridges the gap between 3D content creation tools and modern graphics applications by providing an efficient, extensible, interoperable format for the transmission and loading of 3D content.GLTF是一种API中性运行时资产交付格式。 GLTF通过为3D内容的传输和加载提供有效的,可扩展的,可互操作的格式,从而弥合了3D内容创建工具和现代图形应用程序之间的差距。

2.2. Document Conventions 2.2。文件约定 

The glTF Specification is intended for use by both implementers of the asset exporters or converters (e.g., digital content creation tools) and application developers seeking to import or load glTF assets, forming a basis for interoperability between these parties.GLTF规范旨在使用资产出口商或转换器的实施者(例如,数字内容创建工具)和寻求导入或加载GLTF资产的应用程序开发人员使用,为这些当事方之间的互操作性构成了基础。

Specification text can address either party; typically, the intended audience can be inferred from context, though some sections are defined to address only one of these parties.规格文本可以解决任何一方;通常,可以从上下文中推断出预期的受众,尽管某些部分被定义为仅解决这些当事方之一。

Any requirements, prohibitions, recommendations, or options defined by normative terminology are imposed only on the audience of that text.规范术语定义的任何要求,禁令,建议或选项仅对该文本的受众施加。

2.2.1. Normative Terminology and References2.2.1。规范术语和参考

The key words MUSTMUST NOTREQUIREDSHALLSHALL NOTSHOULDSHOULD NOTRECOMMENDEDMAY, and OPTIONAL in this document are to be interpreted as described in BCP 14.关键词必须,必须,不得应,不得应,不得,不建议,建议,可能,可以在本文档中进行可选,应如BCP 14所述进行解释。

These key words are highlighted in the specification for clarity.这些关键词在规范中突出显示,以确保清晰度。

References to external documents are considered normative if the Specification uses any of the normative terms defined in this section to refer to them or their requirements, either as a whole or in part.如果规范使用本节中定义的任何规范术语来指代他们或其要求,则对外部文档的参考被视为规范。

2.2.2. Informative Language 2.2.2。内容丰富的语言 

Some language in the specification is purely informative, intended to give background or suggestions to implementers or developers.规范中的某些语言纯粹是有益的,旨在为实施者或开发人员提供背景或建议。

If an entire chapter or section contains only informative language, its title is suffixed with “(Informative)”. If not designated as informative, all chapters, sections, and appendices in this document are normative.如果整章或部分仅包含信息性语言,则其标题的后缀为“(信息)”。如果未指定为信息,本文档中的所有章节,部分和附录都是规范性的。

All Notes, Implementation notes, and Examples are purely informative.所有注释,实施笔记和示例纯粹是有益的。

2.2.3. Technical Terminology 2.2.3。技术术语 

The glTF Specification makes use of linear algebra terms such as axismatrixvector, etc. to identify certain math constructs and their behaviors as defined in the International Electrotechnical Vocabulary.GLTF规范利用线性代数术语(例如轴,矩阵,向量等)来确定国际电子技术词汇中定义的某些数学构建体及其行为。

The glTF Specification makes use of common engineering and graphics terms such as imagebuffertexture, etc. to identify and describe certain glTF constructs and their attributes, states, and behaviors. This section defines the basic meanings of these terms in the context of the Specification. The Specification text provides fuller definitions of the terms and elaborates, extends, or clarifies the definitions. When a term defined in this section is used in normative language within the Specification, the definitions within the Specification govern and supersede any meanings the terms may have in other technical contexts (i.e. outside the Specification).GLTF规范利用了常见的工程和图形术语,例如图像,缓冲区,纹理等,以识别和描述某些GLTF构建体及其属性,状态和行为。本节在规范的背景下定义了这些术语的基本含义。规范文本提供了术语和详细说明,扩展或澄清定义的完整定义。当本节中定义的术语在规范的规范语言中使用时,规范中的定义控制并取代了该术语在其他技术环境中可能具有的任何含义(即在规范之外)。

accessor 登录器 

An object describing the number and the format of data elements stored in a binary buffer.描述存储在二进制缓冲区中的数据元素的数字和格式的对象。

animation 动画片 

An object describing the keyframe data, including timestamps, and the target property affected by it.描述关键帧数据的对象,包括时间戳以及受其影响的目标属性。

back-facing 背面 

See facingness. 见面。 

buffer 缓冲 

An external or embedded resource that represents a linear array of bytes.代表字节线性数组的外部或嵌入式资源。

buffer view 缓冲区视图 

An object that represents a range of a specific buffer, and optional metadata that controls how the buffer’s content is interpreted.一个代表一系列特定缓冲区和可选元数据范围的对象,可控制缓冲区内容的解释。

camera 相机 

An object defining the projection parameters that are used to render a scene.定义用于渲染场景的投影参数的对象。

facingness 面对面 

A classification of a triangle as either front-facing or back-facing, depending on the orientation (winding order) of its vertices.根据其顶点的方向(绕组顺序),将三角形的分类为前面或背面。

front-facing 前面 

See facingness. 见面。 

image 图像 

A two dimensional array of pixels encoded as a standardized bitstream, such as PNG.一个二维像素的阵列编码为标准化的bitstream,例如png。

indexed geometry 索引几何形状 

A mesh primitive that uses a separate source of data (index values) to assemble the primitive’s topology.一个使用单独的数据源(索引值)组装原始拓扑的网格原始性。

linear blend skinning 线性混合皮肤 

A skinning method that computes a per-vertex transformation matrix as a linear weighted sum of transformation matrices of the designated nodes.一种剥皮方法,该方法将每个Vertex转换矩阵计算为指定节点的变换矩阵的线性加权总和。

material 材料 

A parametrized approximation of visual properties of the real-world object being represented by a mesh primitive.由网格原始对象表示的现实世界对象的视觉特性的参数化*似。

mesh  

A collection of mesh primitives.网状原始素材的集合。

mesh primitive 网格原始 

An object binding indexed or non-indexed geometry with a material.用材料的对象结合索引或非索引几何形状。

mipmap mipmap 

A set of image representations consecutively reduced by the factor of 2 in each dimension.一组图像表示在每个维度中连续减少2个因子。

morph target 变形靶标 

An altered state of a mesh primitive defined as a set of difference values for its vertex attributes.网格原始态的变化状态定义为其顶点属性的一组差值值。

node 节点 

An object defining the hierarchy relations and the local transform of its content.定义层次关系及其内容的局部变换的对象。

non-indexed geometry 非索引几何形状 

A mesh primitive that uses linear order of vertex attribute values to assemble the primitive’s topology.使用顶点属性值的线性顺序来组装原始拓扑。

normal 普通的 

A unit XYZ vector defining the perpendicular to the surface.XYZ向量定义垂直于表面的单元。

root node 根节点 

A node that is not a child of any other node.不是其他任何节点的孩子的节点。

sampler 采样器 

An object that controls how image data is sampled.一个控制图像数据采样方式的对象。

scene 场景 

An object containing a list of root nodes to render.一个包含渲染根节点列表的对象。

skinning 皮肤 

The process of computing and applying individual transforms for each vertex of a mesh primitive.针对网格原始的每个顶点计算和应用单个变换的过程。

tangent 切线 

A unit XYZ vector defining a tangential direction on the surface.XYZ矢量定义表面上的切向方向。

texture 质地 

An object that combines an image and its sampler.结合图像及其采样器的对象。

topology type 拓扑类型 

State that controls how vertices are assembled, e.g. as lists of triangles, strips of lines, etc.声明控制顶点的组装方式,例如作为三角形,线条等列表。

vertex attribute 顶点属性 

A property associated with a vertex.与顶点相关的属性。

winding order 绕组顺序 

The relative order in which vertices are defined within a triangle三角形内定义顶点的相对顺序

wrapping 包装 

A process of selecting an image pixel based on normalized texture coordinates.基于归一化纹理坐标选择图像像素的过程。

2.2.4. Normative References 2.2.4。规范参考 

The following documents are referenced by normative sections of the specification:以下文档通过规范的规范章节引用:

2.2.4.1. External Specifications2.2.4.1。外部规格

  • Bradner, S., Key words for use in RFCs to Indicate Requirement Levels, BCP 14, RFC 2119, March 1997. Leiba, B., Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words, BCP 14, RFC 8174, May 2017. https://www.rfc-editor.org/info/bcp14布拉德纳(
  • IEC 60050-102 International Electrotechnical Vocabulary (IEV) - Part 102: Mathematics - General concepts and linear algebrahttps://webstore.iec.ch/publication/160IEC 60050-102国际电气技术词汇(IEV) - 第102部分:数学 - 一般概念和线性代数

IEC 60050-103 International Electrotechnical Vocabulary (IEV) - Part 103: Mathematics - Functions https://webstore.iec.ch/publication/161IEC 60050-103国际电子技术词汇(IEV) - 第103部分:数学 - 功能https://webstore.iec.ch/publication/161

 

Note 笔记 

An online version of these standards is available at https://www.electropedia.org/这些标准的在线版本可在https://www.electropedia.org/上获得。

  • The Unicode Consortium, The Unicode Standardhttps://www.unicode.org/versions/latest/Unicode联盟,Unicode标准https://www.unicode.org/versions/latest/
  • Bray, T., Ed., The JavaScript Object Notation (JSON) Data Interchange Format, STD 90, RFC 8259, DOI 10.17487/RFC8259, December 2017, https://www.rfc-editor.org/info/rfc8259Bray,,编辑,JavaScript对象符号(JSON)数据交换格式,STD 90,RFC 8259,DOI 10.17487/RFC8259,2017年12月,https:///wwww.rfc-editor.rfc-editor.or.or.or.or.or.or.or.or.g/info/rfc8259
  • ISO/IEC 60559 Floating-point arithmetichttps://www.iso.org/standard/80985.htmlISO/IEC 60559浮点算术https://www.iso.org/standard/80985.html
  • ISO/IEC 15948 Portable Network Graphics (PNG): Functional specificationhttps://www.iso.org/standard/29581.htmlISO/IEC 15948便携式网络图形(PNG):功能规范https://www.iso.org/standard/29581.html
 

Note 笔记 

A free version of this standard is available from W3C: https://www.w3.org/TR/PNG/该标准的免费版本可从W3C获得:https://www.w3.org/tr/png/

  • ISO/IEC 10918-1 Digital compression and coding of continuous-tone still images: Requirements and guidelineshttps://www.iso.org/standard/18902.htmlISO/IEC 10918-1连续音静止图像的数字压缩和编码:要求和指南https://www.iso.org/standard/18902.html
 

Note 笔记 

An earlier edition of this standard called ITU Recommendation T.81 is available from W3C: https://www.w3.org/Graphics/JPEG/itu-t81.pdf该标准的较早版本称为ITU推荐T.81可从W3C获得:https://www.w3.org/graphics/jpeg/itu-t81.pdf

  • ISO/IEC 10918-5 Digital compression and coding of continuous-tone still images: JPEG File Interchange Format (JFIF)https://www.iso.org/standard/54989.htmlISO/IEC 10918-5连续色调静止图像的数字压缩和编码:JPEG文件互换格式(JFIF)https://www.iso.org/standard/54989.html
 

Note 笔记 

An earlier edition of this standard is available from W3C: https://www.w3.org/Graphics/JPEG/jfif3.pdf该标准的较早版本可从W3C获得:https://www.w3.org/graphics/jpeg/jfif3.pdf

  • CIPA DC-008-Translation-2019 Exchangeable image file format for digital still camerashttps://www.cipa.jp/std/documents/download_e.html?DC-008-Translation-2019-ECIPA DC-008-TRANSLATION-2019数字相机可交换图像文件格式
  • Masinter, L., The "data" URL scheme, RFC 2397, DOI 10.17487/RFC2397, August 1998, https://www.rfc-editor.org/info/rfc2397Masinter,L。,“数据” URL方案,RFC 2397,DOI 10.17487/RFC2397,1998年8月,https://www.rfc-editor.org/info/info/rfc2397
  • Berners-Lee, T., Fielding, R., and L. Masinter, Uniform Resource Identifier (URI): Generic Syntax, STD 66, RFC 3986, DOI 10.17487/RFC3986, January 2005, https://www.rfc-editor.org/info/rfc3986Berners-Lee, T., Fielding, R., and L. Masinter, Uniform Resource Identifier (URI): Generic Syntax , STD 66, RFC 3986, DOI 10.17487/RFC3986, January 2005, https://www.rfc-editor.org/info/rfc3986
  • Duerst, M. and M. Suignard, Internationalized Resource Identifiers (IRIs), RFC 3987, DOI 10.17487/RFC3987, January 2005, https://www.rfc-editor.org/info/rfc3987Duerst,M。和 Suignard,国际化资源标识符(IRIS),RFC 3987,DOI 10.17487/RFC3987,2005年1月,https://wwwwww.rfc-editor.org/inf/info/info/rfc3987
  • Fielding, R., Ed., and J. Reschke, Ed., Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing, RFC 7230, DOI 10.17487/RFC7230, June 2014, https://www.rfc-editor.org/info/rfc7230Fielding,,Ed。和J. Reschke编辑,超文本传输​​协议(HTTP/1.1):消息语法和路由,RFC 7230,DOI 10.17487/RFC7230,2014年6月,https://https:///wwwwwwwwww.rfc-editor.org/infco.org/infco/rfco/rfc7230
  • IEC 61966-2-1 Default RGB colour space - sRGBhttps://webstore.iec.ch/publication/6169IEC 61966-2-1默认RGB颜色空间-SRGB https://webstore.iec.ch/publication/6169
 

Note 笔记 

The encoding characteristics of sRGB are freely available from ICC: https://www.color.org/chardata/rgb/srgb.xalterSRGB的编码特性可从ICC免费获得:https://www.color.org/chardata/rgb/srgb.xalter

  • Recommendation ITU-R BT.709-6 Parameter values for the HDTV standards for production and international programme exchangehttps://www.itu.int/rec/R-REC-BT.709-6-201506-I建议ITU-R BT.709-6 HDTV生产和国际计划交换标准的参数值
  • MikkTSpacehttps://github.com/mmikk/MikkTSpacemikktspace https://github.com/mmikk/mikktspace
  • Thomas Porter and Tom Duff. 1984. Compositing digital images.SIGGRAPH Comput. Graph. 18, 3 (July 1984), 253–259. DOI: https://doi.org/10.1145/964965.808606托马斯波特和汤姆·达夫。 1984。合成数字图像。 Siggraph Comput。图形。 18,3(1984年7月),253-259。 doi:https://doi.org/10.1145/964965.808606
 

Note 笔记 

A free version of this paper is available from Pixar: https://graphics.pixar.com/library/Compositing/Pixar可以免费获得本文的免费版本:https://graphics.pixar.com/library/compositing/

2.2.4.2. Media Type Registrations2.2.4.2。媒体类型注册

2.3. Motivation and Design Goals (Informative)2.3。动机和设计目标(信息丰富)

glTF is an open interoperable 3D asset ‘transmission’ format that is compact, and efficient to process and render at runtime. glTF 2.0 is designed to be vendor- and runtime-neutral, usable by a wide variety of native and web-based engines and applications regardless of underlying platforms and 3D graphics APIs.GLTF是一种打开的互操作3D资产“传输”格式,非常紧凑,并且可以在运行时进行处理和渲染。 GLTF 2.0的设计为供应商和运行时中立,无论基础*台和3D图形API如何,可供多种本地和网络的引擎以及应用程序使用。

glTF’s focus on run-time efficiency is a different design goal than typical 3D ‘authoring’ formats. Authoring formats are typically more verbose, with higher processing overheads, to carry authoring data that is no longer needed after iterative design is complete. glTF is complementary to authoring formats, providing a common, interoperable distillation target for publishing 3D assets to a wide audience of end users.GLTF专注于运行时效率是一个与典型的3D“创作”格式不同的设计目标。创作格式通常更详细,并具有更高的处理开销,以携带迭代设计完成后不再需要的创作数据。 GLTF是对创作格式的补充,为广泛的最终用户提供了一个常见的,可互操作的蒸馏目标,以发布3D资产。

A primary goal of glTF is to be deployable on a wide range of devices and platforms, including the web and mobile devices with limited processing and memory resources. glTF can be evolved, to keep pace with growing compute capabilities over time. This helps to foster broad industry consensus on 3D functionality that can be used ubiquitously, including Physically Based Rendering.GLTF的主要目标是可以在各种设备和*台上进行部署,包括具有有限的处理和内存资源的Web和移动设备。可以进化GLTF,以跟上随着时间的推移的计算功能的增长。这有助于促进对3D功能的广泛共识,该功能可普遍使用,包括基于物理的渲染。

glTF combines an easily parsable JSON scene description with one or more binary resources representing geometry, animations, and other rich data. These binary resources can often be loaded directly into GPU buffers with no additional parsing or processing, combining the faithful preservation of full hierarchical scenes, nodes, meshes, cameras, materials, and animations with efficient delivery and fast loading.GLTF将易于可简洁的JSON场景描述与代表几何,动画和其他丰富数据的一个或多个二进制资源结合在一起。这些二进制资源通常可以直接加载到GPU缓冲液中,没有其他解析或处理,结合了完整的分层场景,节点,网格,摄像头,材料和动画的忠实保存,并有效地交付和快速加载。

glTF has been designed to meet the following goals:GLTF旨在满足以下目标:

  • Compact file sizes.The plain text glTF JSON file description is compact and rapid to parse. All large data such as geometry, textures and animations are stored in binary files that are significantly smaller than equivalent text representations.紧凑的文件大小。 纯文本GLTF JSON文件描述紧凑,可以快速解析。所有大数据,例如几何,纹理和动画都存储在二进制文件中,这些文件明显小于等效文本表示。
  • Runtime-independence.glTF is purely an asset format and does not mandate any runtime behavior. This enables its use by any application for any purpose, including display using any rendering technology, up to and including path tracing renderers.独立于运行时。 GLTF纯粹是一种资产格式,不要求任何运行时行为。这使得其用于任何目的的应用程序都可以使用,包括使用任何渲染技术显示,包括路径跟踪渲染器。
  • Complete 3D scene representation.Not restricted to single objects, glTF can represent entire scenes, including nodes, transformations, transform hierarchy, meshes, materials, cameras, and animations.完整的3D场景表示。 GLTF不限于单个对象,可以表示整个场景,包括节点,转换,变换层次结构,网格,材料,摄像机和动画。
  • glTF is fully extensible, enabling the addition of both general-purpose and vendor-specific extensions, including geometry and texture compression. Widely adopted extensions may be considered for integration into future versions of the glTF specification.可扩展性。 GLTF是完全可扩展的,可以添加通用和供应商特定的扩展,包括几何和纹理压缩。可以考虑广泛采用的扩展名,以集成到GLTF规范的未来版本中。

The following are outside the scope of glTF 2.0:以下在GLTF 2.0的范围之外:

  • glTF is not a streaming format.The binary data in glTF is inherently streamable, and the buffer design allows for fetching data incrementally, but there are no other streaming constructs in glTF 2.0.GLTF不是流格式。 GLTF中的二进制数据本质上是可流的,缓冲区设计允许逐步获取数据,但是GLTF 2.0中没有其他流构建体。
  • glTF is not an authoring format.glTF deliberately does not retain 3D authoring information, in order to preserve runtime efficiency, however glTF files may be ingested by 3D authoring tools for remixing.GLTF不是创作格式。 GLTF故意不保留3D创作信息,以确保运行时效率,但是3D创作工具可能会摄入GLTF文件。
  • glTF is not intended to be human-readable,though by virtue of being represented in JSON, it is developer-friendly.GLTF并非打算是人类可读的,尽管由于在JSON中的代表,它对开发人员友好。

2.4. glTF Basics 2.4。 GLTF基础知识 

A glTF asset is represented by:GLTF资产由:

  • A JSON-formatted file (.gltf) containing a full scene description: node hierarchy, materials, cameras, as well as descriptor information for meshes, animations, and other constructs.包含完整场景的JSON-Formatted文件(.gltf):节点层次结构,材料,摄像机以及用于网格,动画和其他构造的描述符信息。
  • Binary files (.bin) containing geometry, animation, and other buffer-based data.二进制文件(.bin)包含几何形状,动画和其他基于缓冲区的数据。
  • Image files (.jpg, .png) containing texture images.图像文件(.jpg,.png)包含纹理图像。

Binary and image resources MAY also be embedded directly in JSON using Data URI or stored side-by-side with JSON in GLB container.二进制资源和图像资源也可以使用数据URI直接嵌入JSON中,也可以与GLB容器中的JSON并排存储。

A valid glTF asset MUST specify its version.有效的GLTF资产必须指定其版本。

2.5. Versioning 2.5。版本控制 

Any updates made to the glTF Specification in a minor version MUST be backward and forward compatible. Backward compatibility means that any client implementation that supports loading a glTF 2.x asset will also be able to load a glTF 2.0 asset. Forward compatibility means that a client implementation that only supports glTF 2.0 can load glTF 2.x assets while gracefully ignoring any new features it does not understand.次要版本中对GLTF规范的任何更新都必须向后和向前兼容。向后兼容性意味着任何支持加载GLTF 2.x资产的客户实现也将能够加载GLTF 2.0资产。向前的兼容性意味着仅支持GLTF 2.0的客户实现可以加载GLTF 2.x资产,同时优雅地忽略其不了解的任何新功能。

A minor version update MAY introduce new features but MUST NOT change any previously existing behavior. Existing functionality MAY be deprecated in a minor version update, but it MUST NOT be removed.次要版本的更新可能会引入新功能,但不得改变任何以前现有的行为。现有功能可以在次要版本更新中弃用,但不得将其删除。

Major version updates MAY be incompatible with previous versions.主要版本更新可能与以前的版本不相容。

2.6. File Extensions and Media Types2.6。文件扩展和媒体类型

  • JSONglTF files SHOULD use .gltf extension and model/gltf+json Media Type.JSON GLTF文件应使用.gltf扩展名和model/gltf+json媒体类型。
  • glTF files stored in GLBcontainer SHOULD use .glb extension and model/gltf-binary Media Type.GLB容器中存储的GLTF文件应使用.glb扩展名和model/gltf-binary媒体类型。
  • Files representing binary buffers SHOULDuse either:代表二进制缓冲区的文件应使用:
    • .binfile extension with application/octet-stream Media Type;.bin带有application/octet-stream媒体类型的文件扩展名;
    • .bin, .glbin, or .glbuffile extensions with application/gltf-buffer Media Type..bin,.glbin,或.glbuf使用application/gltf-buffer媒体类型的文件扩展。
  • PNGimages SHOULD use .png file extension with image/png Media Type;PNG图像应使用.png使用<b1>> </b1>媒体类型的文件扩展名;
    • PNG images SHOULD NOTcontain animations, non-square pixel ratios, or embedded ICC profiles. Such features, if present, MUST be ignored by client implementations.PNG图像不应包含动画,非方面像素比或嵌入式ICC配置文件。如果存在,则必须通过客户实现忽略此类功能。
  • JPEGimages SHOULD use .jpeg or .jpg file extensions with image/jpeg Media TypeJPEG图像应使用.jpeg或.jpg使用image/jpeg媒体类型的文件扩展
    • JPEG images MUSTbe compatible with JPEG File Interchange Format.JPEG图像必须与JPEG文件互换格式兼容。
    • JPEG images SHOULD NOTcontain embedded ICC profiles. If present, embedded ICC profiles MUST be ignored by client implementations.JPEG图像不应包含嵌入式ICC配置文件。如果存在,则客户实现必须忽略嵌入式ICC配置文件。
    • Exchangeable image file format (Exif)chunks MAY be ignored by client implementations.客户实现可能会忽略可交换图像文件格式(EXIF)块。
 

Implementation Note 实施注释 

Certain Exif chunks, e.g., “Orientation”, may severely impact an asset’s portability.某些EXIF块,例如“方向”,可能会严重影响资产的可移植性。

2.7. JSON Encoding 2.7。 JSON编码 

Although glTF Specification does not define any subset of the JSON format, implementations SHOULD be aware of its peculiar properties that could affect asset interoperability.尽管GLTF规范没有定义JSON格式的任何子集,但实现应意识到其特殊属性,可能会影响资产互操作性。

  1. glTF JSON data SHOULDbe written with UTF-8 encoding without BOM. This requirement is not applied when a glTF implementation does not control string encoding. glTF implementations SHOULD adhere to RFC 8259, Section 8.1. with regards to treating BOM presence.GLTF JSON数据应使用无BOM编码的UTF-8编码编写。当GLTF实现不控制字符串编码时,不会应用此要求。 GLTF实施应遵守RFC 8259,第1节。关于治疗BOM的存在。
  2. ASCII characters stored in glTF JSON SHOULDbe written without JSON escaping.GLTF JSON中存储的ASCII角色应在不逃脱的情况下写入。
 

Example 例子 

"buffer" instead of "\u0062\u0075\u0066\u0066\u0065\u0072". "buffer"而不是"\u0062\u0075\u0066\u0066\u0065\u0072"。 

  1. Non-ASCII characters stored in glTF JSON MAYbe escaped.可以逃脱存储在GLTF JSON中的非ASCII字符。
 

Example 例子 

These two examples represent the same glTF JSON data.这两个示例代表相同的GLTF JSON数据。

{

    "asset": {

        "version": "2.0"

    },

    "nodes": [

        {

            "name": "куб"

        },

        {

            "name": "立方體"

        }

    ]

}

{

    "asset": {

        "version": "2.0"

    },

    "nodes": [

        {

            "name": "\u043a\u0443\u0431"

        },

        {

            "name": "\u7acb\u65b9\u9ad4"

        }

    ]

}

  1. Property names (keys) within JSON objects SHOULDbe unique. glTF client implementations SHOULD override lexically preceding values for the same key.JSON对象中的属性名称(键)应该是唯一的。 GLTF客户端的实现应覆盖同一密钥的词汇先前值。
  2. Some of glTF properties are defined as integers in the schema. Such values MAYbe stored as decimals with a zero fractional part or by using exponent notation. Regardless of encoding, such properties MUST NOT contain any non-zero fractional value.某些GLTF属性定义为模式中的整数。此类值可以作为零部分部分的小数或使用指数表示法存储。无论编码如何,此类属性都不得包含任何非零的分数值。
 

Example 例子 

100, 100.0, and 1e2 represent the same value. See RFC 8259, Section 6 for more details.100,100.0,1e2表示相同的值。有关更多详细信息,请参见RFC 8259,第6节。

  1. Non-integer numbers SHOULDbe written in a way that preserves original values when these numbers are read back, i.e., they SHOULD NOT be altered by JSON serialization / deserialization roundtrip.非整数编号应以保留原始值回复时保留原始值的方式编写,即,不应通过JSON Serialization / delelialization往返进行更改。
 

Implementation Note 实施注释 

This is typically achieved with algorithms like Grisu2 used by common JSON libraries.这通常是通过诸如常见JSON库使用的grisu2之类的算法来实现的。

2.8. URIs 2.8。乌里斯 

glTF assets use URIs or IRIs to reference buffers and image resources. Assets MAY contain at least these two URI types:GLTF资产使用URIS或IRIS参考缓冲区和图像资源。资产可能至少包含这两种URI类型:

  • Data URIsthat embed binary resources in the glTF JSON as defined by the RFC 2397. The Data URI’s mediatype field MUST match the encoded content.RFC 2397定义的GLTF JSON中嵌入二进制资源的数据URI。数据URI的mediatype字段必须与编码内容匹配。
 

Implementation Note 实施注释 

Base64 encoding used in Data URI increases the payload’s byte length by 33%.数据URI中使用的base64编码将有效载荷的字节长度提高了33%。

  • Relative paths — path-noschemeor ipath-noscheme as defined by RFC 3986, Section 4.2 or RFC 3987, Section 2.2 — without scheme, authority, or parameters. Reserved characters (as defined by RFC 3986, Section 2.2. and RFC 3987, Section 2.2.) MUST be percent-encoded.相对路径 - path-noscheme或ipath-noscheme由RFC 3986,第2节或RFC 3987,第2.2节,没有方案,权威或参数。保留字符(如RFC 3986所定义,第2.2节和RFC 3987,第2.2节。)必须为百分比编码。

Paths with non-ASCII characters MAY be written as-is, with JSON string escaping, or with percent-encoding; all these options are valid. For example, the following three paths point to the same resource:具有非ASCII字符的路径可以按原样编写,JSON字符串逃脱或编码百分比;所有这些选项都是有效的。例如,以下三个路径指向相同的资源:

{

    "images": [

        {

            "uri": "grande_sphère.png"

        },

        {

            "uri": "grande_sph\u00E8re.png"

        },

        {

            "uri": "grande_sph%C3%A8re.png"

        }

    ]

}

Client implementations MAY optionally support additional URI components. For example http:// or file:// schemes, authorities, hostnames, absolute paths, and query or fragment parameters. Assets containing these additional URI components would be less portable.客户实现可以选择支持其他URI组件。例如http://或file://方案,当局,主机名,绝对路径以及查询或片段参数。包含这些额外URI组件的资产将不那么便携。

 

Implementation Note 实施注释 

This allows the application to decide the best approach for delivery: if different assets share many of the same geometries, animations, or textures, separate files may be preferred to reduce the total amount of data requested. With separate files, applications may progressively load data and do not need to load data for parts of a model that are not visible. If an application cares more about single-file deployment, embedding data may be preferred even though it increases the overall size due to base64 encoding and does not support progressive or on-demand loading. Alternatively, an asset could use the GLB container to store JSON and binary data in one file without base64 encoding. See GLB File Format Specification for details.这允许应用程序确定最佳交付方法:如果不同的资产共享许多相同的几何,动画或纹理,则可以选择单独的文件以减少所请求的数据总量。使用单独的文件,应用程序可能会逐步加载数据,并且不需要为不可见的模型部分加载数据。如果应用程序更多地关心单文件部署,即使由于基本64编码而增加的总体尺寸,并且不支持渐进式或点播加载,嵌入数据也可能是首选的。另外,资产可以使用GLB容器将JSON和二进制数据存储在一个文件中,而无需base64编码。有关详细信息,请参见GLB文件格式规范。

URIs SHOULD undergo syntax-based normalization as defined by RFC 3986, Section 6.2.2, RFC 3987, Section 5.3.2, and applicable schema rules (e.g., RFC 7230, Section 2.7.3 for HTTP) on export and/or import.URI应进行基于语法的归一化,如RFC 3986,第6.2.2节,RFC 3987,第5.3.2节,并在导出和/或或/或进口上进行适用的架构规则(例如,HTTP的RFC 7230,第2.7.3节,HTTTP第2.7.3节)。

 

Implementation Note 实施注释 

While the specification does not explicitly disallow non-normalized URIs, their use may be unsupported or lead to unwanted side-effects — such as security warnings or cache misses — on some platforms.虽然该规范没有明确禁止非正态化的URI,但在某些*台上,它们的使用可能不受支持或导致不需要的副作用(例如安全警告或高速缓存)。

  1. Concepts 3。概念

3.1. General 3.1。一般的 

The figure below shows relations between top-level arrays in a glTF asset. See the Properties Reference.下图显示了GLTF资产中顶级阵列之间的关系。请参阅属性参考。

Figure 1. glTF Object Hierarchy图1。GLTF对象层次结构

3.2. Asset 3.2。资产 

Each glTF asset MUST have an asset property. The asset object MUST contain a version property that specifies the target glTF version of the asset. Additionally, an optional minVersion property MAY be used to specify the minimum glTF version support required to load the asset. The minVersion property allows asset creators to specify a minimum version that a client implementation MUST support in order to load the asset. This is very similar to the extensionsRequired concept described in Section 3.12, where an asset SHOULD NOT be loaded if the client does not support the specified extension. Additional metadata MAY be stored in optional properties such as generator or copyright. For example,每个GLTF资产必须具有asset属性。 asset对象必须包含version属性,该属性指定了资产的目标GLTF版本。此外,可选的minVersion属性可用于指定加载资产所需的最小GLTF版本支持。 minVersion属性允许资产创建者指定客户实现必须支持以加载资产的最低版本。这与第3.12节中描述的extensionsRequired概念非常相似,如果客户不支持指定的扩展名,则不应加载资产。其他元数据可以存储在可选属性中,例如generator或copyright。例如,

{

    "asset": {

        "version": "2.0",

        "generator": "collada2gltf@f356b99aef8868f74877c7ca545f2cd206b9d3b7",

        "copyright": "2017 (c) Khronos Group"

    }

}

 

Implementation Note 实施注释 

Client implementations should first check whether a minVersion property is specified and ensure both major and minor versions can be supported. If no minVersion is specified, then clients should check the version property and ensure the major version is supported. Clients that load GLB format should also check for the minVersion and version properties in the JSON chunk as the version specified in the GLB header only refers to the GLB container version.客户实现应首先检查是否指定了A minVersion属性,并确保可以支持主要版本和次要版本。如果未指定<b1>> </b1>,则客户应检查version属性并确保支持主要版本。加载GLB格式的客户端还应检查JSON块中minVersion和version属性,因为GLB标头中指定的版本仅指GLB容器版本。

3.3. Indices and Names 3.3。索引和名称 

Entities of a glTF asset are referenced by their indices in corresponding arrays, e.g., a bufferView refers to a buffer by specifying the buffer’s index in buffers array. For example:GLTF资产的实体在相应数组中的索引引用,例如A bufferView是指A buffer来指定buffers数组中的缓冲区索引。例如:

{

    "buffers": [

        {

            "byteLength": 1024,

            "uri": "path-to.bin"

        }

    ],

    "bufferViews": [

        {

            "buffer": 0,

            "byteLength": 512,

            "byteOffset": 0

        }

    ]

}

In this example, buffers and bufferViews arrays have only one element each. The bufferView refers to the buffer using the buffer’s index: "buffer": 0.在此示例中,buffers和bufferViews数组每个元素只有一个元素。 BufferView使用缓冲区的索引是指缓冲区:"buffer": 0。

Indices MUST be non-negative integer numbers. Indices MUST always point to existing elements.索引必须是非负整数数。索引必须始终指向现有元素。

Whereas indices are used for internal glTF references, optional names are used for application-specific uses such as display. Any top-level glTF object MAY have a name string property for this purpose. These property values are not guaranteed to be unique as they are intended to contain values created when the asset was authored.尽管索引用于内部GLTF参考,但可选名称用于应用程序特定用途,例如Display。为此,任何顶级GLTF对象都可以具有name字符串属性。这些属性值不能保证是唯一的,因为它们旨在包含撰写资产时创建的值。

For property names, glTF usually uses camel case, likeThis.对于属性名称,GLTF通常使用骆驼盒,likeThis。

3.4. Coordinate System and Units3.4。坐标系统和单元

glTF uses a right-handed coordinate system. glTF defines +Y as up, +Z as forward, and -X as right; the front of a glTF asset faces +Z.GLTF使用右手坐标系。 GLTF将 +y定义为向上, +z向前,-x为正确; GLTF资产脸部 +Z的前部。

Figure 2. glTF Coordinate System Orientation图2。GLTF坐标系方向

The units for all linear distances are meters.所有线性距离的单位都是米。

All angles are in radians.所有角度都在弧度中。

Positive rotation is counterclockwise.正旋转是逆时针。

Red, Green, and Blue primary colors use Recommendation ITU-R BT.709 chromaticity coordinates.红色,绿色和蓝色原色使用建议ITU-R BT.709色坐标。

 

Implementation Note 实施注释 

Chromaticity coordinates define the interpretation of each primary color channel of the color model. In the context of a typical display, color primaries describe the color of the red, green, and blue phosphors or filters. Unless a wide color gamut output is explicitly used, client implementations usually do not need to convert colors. Future specification versions or extensions may allow other color primaries (such as P3).色度坐标定义了颜色模型的每个主要颜色通道的解释。在典型的显示器的背景下,颜色初选描述了红色,绿色和蓝色磷酸盐或过滤器的颜色。除非明确使用广泛的颜色范围输出,否则客户端实现通常不需要转换颜色。未来的规范版本或扩展可能允许其他颜色初选(例如P3)。

3.5. Scenes 3.5。场景 

3.5.1. Overview 3.5.1。概述 

glTF 2.0 assets MAY contain zero or more scenes, the set of visual objects to render. Scenes are defined in a scenes array. All nodes listed in scene.nodes array MUST be root nodes, i.e., they MUST NOT be listed in a node.children array of any node. The same root node MAY appear in multiple scenes.GLTF 2.0资产可能包含零或更多场景,即呈现的视觉对象集。场景在scenes数组中定义。 <b1>> </b1>数组中列出的所有节点都必须是root节点,即,不得在任何节点的node.children数组中列出它们。相同的根节点可能出现在多个场景中。

An additional root-level property, scene (note singular), identifies which of the scenes in the array SHOULD be displayed at load time. When scene is undefined, client implementations MAY delay rendering until a particular scene is requested.scene(注意单数)的附加根级属性,标识了数组中的哪些场景应在加载时显示。当scene未定义时,客户实现可能会延迟渲染,直到请求特定场景为止。

A glTF asset that does not contain any scenes SHOULD be treated as a library of individual entities such as materials or meshes.不包含任何场景的GLTF资产应被视为材料或网格等各个实体的库。

The following example defines a glTF asset with a single scene that contains a single node.以下示例用一个包含单个节点的单个场景定义了GLTF资产。

{

    "nodes": [

        {

            "name": "singleNode"

        }

    ],

    "scenes": [

        {

            "name": "singleScene",

            "nodes": [

                0

            ]

        }

    ],

    "scene": 0

}

3.5.2. Nodes and Hierarchy 3.5.2。节点和层次结构 

glTF assets MAY define nodes, that is, the objects comprising the scene to render.GLTF资产可以定义节点,即包含场景呈现的对象。

Nodes MAY have transform properties, as described later.如下所述,节点可能具有变换属性。

Nodes are organized in a parent-child hierarchy known informally as the node hierarchy. A node is called a root node when it doesn’t have a parent.节点是在非正式称为节点层次结构的亲子层次结构中组织的。当没有父级时,该节点称为根节点。

The node hierarchy MUST be a set of disjoint strict trees. That is node hierarchy MUST NOT contain cycles and each node MUST have zero or one parent node.节点层次结构必须是一组不连接的严格树。那就是节点层次结构不得包含周期,并且每个节点必须具有零或一个父节点。

The node hierarchy is defined using a node’s children property, as in the following example:节点层次结构是使用节点的children属性定义的,如以下示例:

{

    "nodes": [

        {

            "name": "Car",

            "children": [1, 2, 3, 4]

        },

        {

            "name": "wheel_1"

        },

        {

            "name": "wheel_2"

        },

        {

            "name": "wheel_3"

        },

        {

            "name": "wheel_4"

        }

    ]

}

The node named Car has four children. Each of those nodes could in turn have its own children, creating a hierarchy of nodes.名为Car的节点有四个孩子。这些节点中的每个节点都可以依次拥有自己的孩子,从而创建一个节点的层次结构。

3.5.3. Transformations 3.5.3。转型 

Any node MAY define a local space transform either by supplying a matrix property, or any of translation, rotation, and scale properties (also known as TRS properties). translation and scale are 3D vectors in the local coordinate system. rotation is a unit quaternion value, XYZW, in the local coordinate system, where W is the scalar.任何节点都可以通过提供matrix属性或任何<b1>> </b1>,rotation和scale属性(也称为TRS属性)来定义局部空间变换。 translation和scale是局部坐标系中的3D向量。 rotation是局部坐标系中的单位四元素值,xyzw,其中w是标量。

When matrix is defined, it MUST be decomposable to TRS properties.当定义matrix时,必须分解为TRS属性。

 

Implementation Note 实施注释 

Transformation matrices cannot skew or shear.转换矩阵不能偏斜或剪切。

When a node is targeted for animation (referenced by an animation.channel.target), only TRS properties MAY be present; matrix MUST NOT be present.当一个节点是针对动画的(由animation.channel.target引用)时,只能存在TRS属性。 matrix不得存在。

To compose the local transformation matrix, TRS properties MUST be converted to matrices and postmultiplied in the T * R * S order; first the scale is applied to the vertices, then the rotation, and then the translation.为了构成局部变换矩阵,必须将TRS属性转换为矩阵,并在T * R * S顺序中进行后行为;首先,将刻度应用于顶点,然后是旋转,然后将其应用于翻译。

 

Implementation Note 实施注释 

Non-invertible transforms (e.g., scaling one axis to zero) could lead to lighting and/or visibility artifacts.不可变形的变换(例如,将一个轴缩放到零)可能导致照明和/或可见性伪像。

 

Implementation Note 实施注释 

When the scale is zero on all three axes (by node transform or by animated scale), implementations are free to optimize away rendering of the node’s mesh, and all of the node’s children’s meshes. This provides a mechanism to animate visibility. Skinned meshes must not use this optimization unless all of the joints in the skin are scaled to zero simultaneously.当所有三个轴上的比例为零(通过节点变换或动画量表)时,实现可以优化节点网格的渲染以及所有节点的子女网格。这提供了一种动画可见性的机制。除非将皮肤中的所有关节同时缩放到零,否则不得使用皮肤网眼。

The global transformation matrix of a node is the product of the global transformation matrix of its parent node and its own local transformation matrix. When the node has no parent node, its global transformation matrix is identical to its local transformation matrix.节点的全局变换矩阵是其父节点的全局变换矩阵和其自己的局部变换矩阵的乘积。当节点没有父节点时,其全局变换矩阵与其局部变换矩阵相同。

In the example below, a node named Box defines non-default rotation and translation.在下面的示例中,一个名为Box的节点定义了非默认旋转和翻译。

{

    "nodes": [

        {

            "name": "Box",

            "rotation": [

                0,

                0,

                0,

                1

            ],

            "scale": [

                1,

                1,

                1

            ],

            "translation": [

                -17.7082,

                -11.4156,

                2.0922

            ]

        }

    ]

}

The next example defines the transform for a node with attached camera using the matrix property rather than using the individual TRS values:下一个示例使用matrix属性来定义带有附加相机的节点的转换,而不是使用单个TRS值:

{

    "nodes": [

        {

            "name": "node-camera",

            "camera": 1,

            "matrix": [

                -0.99975,

                -0.00679829,

                0.0213218,

                0,

                0.00167596,

                0.927325,

                0.374254,

                0,

                -0.0223165,

                0.374196,

                -0.927081,

                0,

                -0.0115543,

                0.194711,

                -0.478297,

                1

            ]

        }

    ]

}

3.6. Binary Data Storage 3.6。二进制数据存储 

3.6.1. Buffers and Buffer Views3.6.1。缓冲区和缓冲区视图

3.6.1.1. Overview 3.6.1.1。概述 

buffer is arbitrary data stored as a binary blob. The buffer MAY contain any combination of geometry, animation, skins, and images.缓冲区是任意数据存储为二进制斑点。缓冲区可能包含几何,动画,皮肤和图像的任何组合。

Binary blobs allow efficient creation of GPU buffers and textures since they require no additional parsing, except perhaps decompression.二进制斑点可以有效地创建GPU缓冲液和纹理,因为它们不需要其他解析,但也许是减压。

glTF assets MAY have any number of buffer resources. Buffers are defined in the asset’s buffers array.GLTF资产可能具有许多缓冲资源。缓冲区在资产的buffers数组中定义。

While there’s no hard upper limit on buffer’s size, glTF assets SHOULD NOT use buffers bigger than 253 bytes because some JSON parsers may be unable to parse their byteLength correctly. Buffers stored as GLB binary chunk have an implicit limit of 232-1 bytes.尽管缓冲区大小没有硬上限,但GLTF资产不应使用大于2 53字节的缓冲区,因为某些JSON解析器可能无法正确解析其byteLength。存储为GLB二进制块的缓冲区的隐式极限为2 32 -1字节。

All buffer data defined in this specification (i.e., geometry attributes, geometry indices, sparse accessor data, animation inputs and outputs, inverse bind matrices) MUST use little endian byte order.此规范中定义的所有缓冲区数据(即几何属性,几何索引,稀疏访问者数据,动画输入和输出,逆绑定矩阵)必须使用Little Endian字节顺序。

The following example defines a buffer. The byteLength property specifies the size of the buffer file. The uri property is the URI to the buffer data.以下示例定义了一个缓冲区。 byteLength属性指定缓冲区文件的大小。 uri属性是缓冲区数据的URI。

{

   "buffers": [

       {

           "byteLength": 102040,

           "uri": "duck.bin"

       }

   ]

}

The byte length of the referenced resource MUST be greater than or equal to the buffer.byteLength property.引用资源的字节长度必须大于或等于buffer.byteLength属性。

Buffer data MAY alternatively be embedded in the glTF file via data: URI with base64 encoding. When data: URI is used for buffer storage, its mediatype field MUST be set to application/octet-stream or application/gltf-buffer.缓冲区数据可以通过data: uri和base64编码将缓冲区数据嵌入GLTF文件中。当data: URI用于缓冲区存储时,必须将其mediatype将字段设置为application/octet-stream或application/gltf-buffer </b4>。

buffer view represents a contiguous segment of data in a buffer, defined by a byte offset into the buffer specified in the byteOffset property and a total byte length specified by the byteLength property of the buffer view.缓冲区视图代表缓冲区中数据的连续段,由字节偏移到byteOffset属性中指定的缓冲区中定义,由<b1>> </b1>属性指定的总字节长度。

Buffer views used for images, vertex indices, vertex attributes, or inverse bind matrices MUST contain only one kind of data, i.e., the same buffer view MUST NOT be used both for vertex indices and vertex attributes.用于图像,顶点索引,顶点属性或逆绑定矩阵的缓冲区视图必须仅包含一种数据,即,不得在顶点索引和顶点属性中同时使用相同的缓冲区视图。

When a buffer view is used by vertex indices or attribute accessors it SHOULD specify bufferView.target with a value of element array buffer or array buffer respectively.当顶点索引或属性访问器使用缓冲区视图时,应分别指定bufferView.target的值分别具有元素数组缓冲区或数组缓冲区的值。

 

Implementation Note 实施注释 

This allows client implementations to early designate each buffer view to a proper processing step, e.g, buffer views with vertex indices and attributes would be copied to the appropriate GPU buffers, while buffer views with image data would be passed to format-specific image decoders.这允许客户端实现能够尽早将每个缓冲区视图指定为正确的处理步骤,例如,带有顶点索引和属性的缓冲区视图将被复制到适当的GPU缓冲液,而带有图像数据的缓冲区视图将传递给特定于格式的图像解码器。

The bufferView.target value uses integer enums defined in the Properties Reference.bufferView.target值使用属性参考中定义的整数枚举。

The following example defines two buffer views: the first holds the indices for an indexed triangle set, and the second holds the vertex data for the triangle set.下面的示例定义了两个缓冲区视图:第一个保存索引三角形集的索引,第二个则保存了三角形集的顶点数据。

{

    "bufferViews": [

        {

            "buffer": 0,

            "byteLength": 25272,

            "byteOffset": 0,

            "target": 34963

        },

        {

            "buffer": 0,

            "byteLength": 76768,

            "byteOffset": 25272,

            "byteStride": 32,

            "target": 34962

        }

    ]

}

When a buffer view is used for vertex attribute data, it MAY have a byteStride property. This property defines the stride in bytes between each vertex. Buffer views with other types of data MUST NOT not define byteStride (unless such layout is explicitly enabled by an extension).当缓冲区视图用于顶点属性数据时,它可能具有byteStride属性。此属性定义了每个顶点之间的大步。带有其他类型数据的缓冲区视图不得定义byteStride(除非通过扩展名明确启用这种布局)。

Buffers and buffer views do not contain type information. They simply define the raw data for retrieval from the file. Objects within the glTF asset (meshes, skins, animations) access buffers or buffer views via accessors.缓冲区和缓冲区视图不包含类型信息。他们只是定义从文件中检索的原始数据。 GLTF资产(网格,皮肤,动画)中的对象通过登录访问缓冲区或缓冲区视图。

3.6.1.2. GLB-stored Buffer 3.6.1.2。 GLB存储的缓冲区 

The glTF asset MAY use the GLB file container to pack glTF JSON and one glTF buffer into one file. Data for such a buffer is provided via the GLB-stored BIN chunk.GLTF资产可以使用GLB文件容器将GLTF JSON和一个GLTF缓冲区打包到一个文件中。通过GLB存储的BIN块提供了此类缓冲区的数据。

A buffer with data provided by the GLB-stored BIN chunk, MUST be the first element of buffers array and it MUST have its buffer.uri property undefined. When such a buffer exists, a BIN chunk MUST be present.带有GLB存储BIN块的数据的缓冲区,必须是<b1>> </b1>数组的第一个元素,并且必须具有其buffer.uri属性不确定。当存在这样的缓冲液时,必须存在BIN块。

Any glTF buffer with undefined buffer.uri property that is not the first element of buffers array does not refer to the GLB-stored BIN chunk, and the behavior of such buffers is left undefined to accommodate future extensions and specification versions.任何具有未定义buffer.uri属性的GLTF缓冲区不是<b1>> </b1>数组的第一个元素,都不是指GLB存储的bin块,并且此类缓冲区的行为不确定以适应未来的扩展程序和规格版本。

The byte length of the BIN chunk MAY be up to 3 bytes bigger than JSON-defined buffer.byteLength value to satisfy GLB padding requirements.BIN块的字节长度可能比JSON定义<b1>> </b1>值大3个字节,以满足GLB填充要求。

 

Implementation Note 实施注释 

Not requiring strict equality of chunk’s and buffer’s lengths slightly simplifies glTF to GLB conversion: buffer.byteLength does not need to be updated after applying GLB padding.不需要严格的块和缓冲区长度的*等性会稍微简化GLTF到GLB转换:buffer.byteLength不需要在应用GLB填充后进行更新。

In the following example, the first buffer object refers to GLB-stored data, while the second points to external resource:在下面的示例中,第一个缓冲区对象是指GLB存储的数据,而第二个则指向外部资源:

{

    "buffers": [

        {

            "byteLength": 35884

        },

        {

            "byteLength": 504,

            "uri": "external.bin"

        }

  ]

}

See GLB File Format Specification for details on GLB File Format.有关GLB文件格式的详细信息,请参见GLB文件格式规范。

3.6.2. Accessors 3.6.2。登录 

3.6.2.1. Overview 3.6.2.1。概述 

All binary data for meshes, skins, and animations is stored in buffers and retrieved via accessors.网格,皮肤和动画的所有二进制数据都存储在缓冲区中,并通过登录器检索。

An accessor defines a method for retrieving data as typed arrays from within a buffer view. The accessor specifies a component type (e.g., float) and a data type (e.g., VEC3 for 3D vectors), which when combined define the complete data type for each data element. The number of elements is specified using the count property. Elements could be, e.g., vertex indices, vertex attributes, animation keyframes, etc.登录器定义了一种从缓冲区视图中检索数据作为键入数组的方法。登录器指定组件类型(例如,浮点)和数据类型(例如,对于3D矢量,VEC3),当组合时,该数据类型为每个数据元素定义了完整的数据类型。使用<b1>> </b1>属性指定元素的数量。元素可以是,例如,顶点索引,顶点属性,动画键帧等。

The byteOffset property specifies the location of the first data element within the referenced buffer view. If the accessor is used for vertex attributes (i.e., it is referenced by a mesh primitive or its morph targets), the locations of the subsequent data elements are controlled by the bufferView.byteStride property. If the accessor is used for any other kind of data (vertex indices, animation keyframes, etc.), its data elements are tightly packed.byteOffset属性指定引用的缓冲区视图中第一个数据元素的位置。如果登录器用于顶点属性(即,它由网格原始或其变形目标引用),则随后的数据元素的位置由<b1>> </b1>属性控制。如果登录器用于任何其他类型的数据(顶点索引,动画键帧等),则其数据元素被紧密包装。

All accessors are stored in the asset’s accessors array.所有访问者都存储在资产的accessors数组中。

The following example shows two accessors, the first is a scalar accessor for retrieving a primitive’s indices, and the second is a 3-float-component vector accessor for retrieving the primitive’s position data.下面的示例显示了两个登录器,第一个是用于检索原始索引的标量访问者,第二个是用于检索原始位置数据的3循环组件矢量访问器。

{

    "accessors": [

        {

            "bufferView": 0,

            "byteOffset": 0,

            "componentType": 5123,

            "count": 12636,

            "max": [

                4212

            ],

            "min": [

                0

            ],

            "type": "SCALAR"

        },

        {

            "bufferView": 1,

            "byteOffset": 0,

            "componentType": 5126,

            "count": 2399,

            "max": [

                0.961799,

                1.6397,

                0.539252

            ],

            "min": [

                -0.692985,

                0.0992937,

                -0.613282

            ],

            "type": "VEC3"

        }

    ]

}

3.6.2.2. Accessor Data Types 3.6.2.2。登录数据类型 

componentType

Data Type 数据类型 

Signed 签名 

Bits 位 

5120

signed byte 签名字节 

Signed, two’s complement 签名,两个补充 

8

5121

unsigned byte 未签名的字节 

Unsigned 未签名 

8

5122

signed short 签名 

Signed, two’s complement 签名,两个补充 

16

5123

unsigned short 未签名的短 

Unsigned 未签名 

16

5125

unsigned int 未签名的int 

Unsigned 未签名 

32

5126

float 漂浮 

Signed 签名 

32

Signed 32-bit integer components are not supported.不支持签名的32位整数组件。

Floating-point data MUST use IEEE-754 single precision format.浮点数据必须使用IEEE-754单精度格式。

Values of NaN, +Infinity, and -Infinity MUST NOT be present.NaN,+Infinity和-Infinity的值不得存在。

type

Number of components 组件数量 

"SCALAR"

1

"VEC2"

2

"VEC3"

3

"VEC4"

4

"MAT2"

4

"MAT3"

9

"MAT4"

16

Element size, in bytes, is (size in bytes of the 'componentType') * (number of components defined by 'type').字节中的元素大小为(size in bytes of the 'componentType') * (number of components defined by 'type')。

For example: 例如: 

{

    "accessors": [

        {

            "bufferView": 1,

            "byteOffset": 7032,

            "componentType": 5126,

            "count": 585,

            "type": "VEC3"

        }

    ]

}

In this accessor, the componentType is 5126 (float), so each component is four bytes. The type is "VEC3", so there are three components. The size of each element is 12 bytes (4 * 3). Thus, the accessor takes 7020 bytes ([7032 …​ 14051] inclusive range of the buffer view).在此登录器中,componentType是5126(float),因此每个组件是四个字节。 type是"VEC3",因此有三个组件。每个元素的大小为12个字节(4 * 3)。因此,登录器采用7020字节([7032 …​ 14051]缓冲区视图的包含范围)。

3.6.2.3. Sparse Accessors 3.6.2.3。稀疏的登录器 

Sparse encoding of arrays is often more memory-efficient than dense encoding when describing incremental changes with respect to a reference array. This is often the case when encoding morph targets (it is, in general, more efficient to describe a few displaced vertices in a morph target than transmitting all morph target vertices).在描述相对于参考数组的增量变化时,数组的稀疏编码通常比密集编码更高。当编码变体目标时,通常是这种情况(通常,描述变体目标中的一些位移顶点要比传输所有变形靶点顶点更有效)。

Similar to a standard accessor, a sparse accessor initializes an array of typed elements from data stored in a bufferView. When accessor.bufferView is undefined, the sparse accessor is initialized as an array of zeros of size (size of the accessor element) * (accessor.count) bytes.类似于标准登录器,稀疏登录器从存储在bufferView中的数据中初始化了一个键入元素的数组。当accessor.bufferView未定义时,稀疏登录器被初始化为大小(size of the accessor element) * (accessor.count)字节的零数组。

On top of that, a sparse accessor includes a sparse JSON object describing the elements that are different from their initialization values. The sparse object contains the following REQUIRED properties:最重要的是,稀疏访问器包括sparse JSON对象,描述了与初始化值不同的元素。 sparse对象包含以下所需属性:

  • count: number of displaced elements. This number MUST NOTbe greater than the number of the base accessor elements.count:流离失所元素的数量。该数字不得大于基本登录器元素的数量。
  • indices: object describing the location and the component type of indices of values to be replaced. The indices MUSTform a strictly increasing sequence. The indices MUST NOT be greater than or equal to the number of the base accessor elements.indices:描述要替换值的位置和组件类型的对象。这些指数必须形成严格增加的序列。指数不得大于或等于基本登录器元素的数量。
  • values: object describing the location of displaced elements corresponding to the indices referred from the indices.values:描述与<b1>> </b1>索引相对应的位置元素的位置的对象。

The following example shows an example of a sparse accessor with 10 elements that are different from the initialization array.以下示例显示了一个稀疏访问者的示例,其10个元素与初始化数组不同。

{

    "accessors": [

        {

            "bufferView": 0,

            "byteOffset": 0,

            "componentType": 5123,

            "count": 12636,

            "type": "VEC3",

            "sparse": {

                "count": 10,

                "indices": {

                    "bufferView": 1,

                    "byteOffset": 0,

                    "componentType": 5123

                },

                "values": {

                    "bufferView": 2,

                    "byteOffset": 0

                }

            }

        }

    ]

}

3.6.2.4. Data Alignment 3.6.2.4。数据对齐 

The offset of an accessor into a bufferView (i.e., accessor.byteOffset) and the offset of an accessor into a buffer (i.e., accessor.byteOffset + bufferView.byteOffset) MUST be a multiple of the size of the accessor’s component type.accessor的偏移到bufferView(即accessor.byteOffset)中,accessor偏移到accessor中,必须是buffer(即,accessor.byteOffset + bufferView.byteOffset)必须是coscement compontor types类型的多个倍数。

When byteStride of the referenced bufferView is not defined, it means that accessor elements are tightly packed, i.e., effective stride equals the size of the element. When byteStride is defined, it MUST be a multiple of the size of the accessor’s component type.当未定义引用的bufferView的byteStride时,这意味着登录器元素被紧密包装,即有效的步幅等于元素的大小。当定义byteStride时,它必须是登录器组件类型大小的倍数。

When two or more vertex attribute accessors use the same bufferView, its byteStride MUST be defined.当两个或多个顶点属性配件使用相同的bufferView时,必须定义其byteStride。

Each accessor MUST fit its bufferView, i.e.,每个访问者必须适合其bufferView,即

accessor.byteOffset + EFFECTIVE_BYTE_STRIDE * (accessor.count - 1) + SIZE_OF_COMPONENT * NUMBER_OF_COMPONENTS

MUST be less than or equal to bufferView.length.必须小于或等于bufferView.length。

For performance and compatibility reasons, each element of a vertex attribute MUST be aligned to 4-byte boundaries inside a bufferView (i.e., accessor.byteOffset and bufferView.byteStride MUST be multiples of 4).出于性能和兼容原因,顶点属性的每个元素必须与A bufferView内的4字节边界对齐(即accessor.byteOffset> accessor.byteOffset和bufferView.byteStride必须是4的倍数)。

Accessors of matrix type have data stored in column-major order; start of each column MUST be aligned to 4-byte boundaries. Specifically, when ROWS * SIZE_OF_COMPONENT (where ROWS is the number of rows of the matrix) is not a multiple of 4, then (ROWS * SIZE_OF_COMPONENT) % 4 padding bytes MUST be inserted at the end of each column.矩阵类型的登录器的数据存储在列订单中;每列的启动必须与4字节边界对齐。具体而言,当ROWS * SIZE_OF_COMPONENT(其中ROWS是矩阵的行数)不是4个倍数时,则必须在每列的末端插入(ROWS * SIZE_OF_COMPONENT) % 4填充字节。

Only the following three accessor configurations require padding.只有以下三个登录配置需要填充。

Figure 3. Matrix 2x2, 1-byte Components图3。矩阵2x2,1字节组件

Figure 4. Matrix 3x3, 1-byte Components图4。矩阵3x3,1字节组件

Figure 5. Matrix 3x3, 2-byte Components图5。矩阵3x3,2字节组件

Alignment requirements apply only to the start of each column, so trailing bytes MAY be omitted if there’s no further data.对齐要求仅适用于每列的开始,因此如果没有进一步的数据,则可能会省略字节。

 

Implementation Note 实施注释 

Alignment requirements allow client implementations to more efficiently process binary buffers because creating aligned data views usually does not require extra copying.对齐要求允许客户实现更有效地处理二进制缓冲区,因为创建对齐的数据视图通常不需要额外的复制。

Consider the following example: 考虑以下示例: 

{

    "bufferViews": [

        {

            "buffer": 0,

            "byteLength": 17136,

            "byteOffset": 620

        }

    ],

    "accessors": [

        {

            "bufferView": 0,

            "byteOffset": 4608,

            "componentType": 5123,

            "count": 42,

            "type": "VEC2"

        }

    ]

}

In this example, the accessor describes tightly-packed two-component unsigned short values.在此示例中,登录器描述了紧密包装的两个组件无符号短值。

The corresponding segment of the underlying buffer would start from byte 5228基础缓冲区的相应段将从字节5228开始

start = accessor.byteOffset + accessor.bufferView.byteOffset

and continue until byte 5396 exclusive并继续直到字节5396独家

end = 2 * 2 * accessor.count + start

The unsigned short view for the resulting buffer range could be created without copying: 84 scalar values starting from byte offset 5228.可以在不复制的情况下创建所得缓冲区范围的未符号简短视图:84标量值从字节偏移5228开始。

When accessor values are not tightly-packed (i.e., bufferView.byteStride is greater than element’s byte length), iteration over the created data view would need to take interleaved values into account (i.e., skip them).当访问者值不被紧密包装(即bufferView.byteStride大于元素的字节长度)时,创建的数据视图上的迭代将需要考虑交错值(即跳过它们)。

3.6.2.5. Accessors Bounds 3.6.2.5。登录界 

accessor.min and accessor.max properties are arrays that contain per-component minimum and maximum values, respectively. The length of these arrays MUST be equal to the number of accessor’s components.accessor.min和accessor.max属性分别包含每个成分最小值和最大值的数组。这些阵列的长度必须等于访问者组件的数量。

Values stored in glTF JSON MUST match actual minimum and maximum binary values stored in buffers. The accessor.normalized flag has no effect on these properties.存储在GLTF JSON中的值必须匹配存储在缓冲区中的实际最小值和最大二进制值。 accessor.normalized标志对这些属性没有影响。

A sparse accessor min and max properties correspond, respectively, to the minimum and maximum component values once the sparse substitution is applied.一旦应用了稀疏的替代,稀疏的登录器min和max属性分别与最小和最大分量值相对应。

When neither sparse nor bufferView is defined, min and max properties MAY have any values. This is intended for use cases when binary data is supplied by external means (e.g., via extensions).当定义sparse和bufferView时,min和max属性可能具有任何值。这旨在用于用外部均值提供二进制数据(例如,通过扩展)提供的用例。

For floating-point components, JSON-stored minimum and maximum values represent single precision floats and SHOULD be rounded to single precision before usage to avoid any potential boundary mismatches.对于浮点数组件,JSON存储的最小值和最大值代表单个精度浮子,应在使用前将其四舍五入至单个精度,以避免任何潜在的边界不匹配。

 

ECMAScript Implementation Note ECMAScript实施注释 

Math.fround function could be used to achieve that.Math.fround可以使用功能来实现这一目标。

Animation input and vertex position attribute accessors MUST have accessor.min and accessor.max defined. For all other accessors, these properties are optional.动画输入和顶点位置属性访问器必须具有accessor.min和accessor.max定义。对于所有其他访问者,这些属性都是可选的。

3.7. Geometry 3.7。几何学 

3.7.1. Overview 3.7.1。概述 

Any node MAY contain one mesh, defined in its mesh property. The mesh MAY be skinned using information provided in a referenced skin object. The mesh MAY have morph targets.任何节点都可以包含一个网格,该网格在其mesh属性中定义。可以使用引用<b1>> </b1>对象中提供的信息对网格进行皮肤。网格可能具有变体靶标。

3.7.2. Meshes 3.7.2。网眼 

3.7.2.1. Overview 3.7.2.1。概述 

Meshes are defined as arrays of primitives. Primitives correspond to the data required for GPU draw calls. Primitives specify one or more attributes, corresponding to the vertex attributes used in the draw calls. Indexed primitives also define an indices property. Attributes and indices are defined as references to accessors containing corresponding data. Each primitive MAY also specify a material and a mode that corresponds to the GPU topology type (e.g., triangle set).网格定义为原始阵列。原语对应于GPU绘制呼叫所需的数据。 iminives指定一个或多个attributes,对应于绘制呼叫中使用的顶点属性。索引的原语还定义了indices属性。属性和索引定义为对包含相应数据的访问者的引用。每个原始版本还可以指定material和mode对应于GPU拓扑类型(例如,三角形集)。

 

Implementation Note 实施注释 

Splitting one mesh into several primitives can be useful to limit the number of indices per draw call or to assign different materials to different parts of the mesh.将一个网格分成几个原语可能是有用的,可以限制每个绘制呼叫的索引数量或将不同的材料分配给网格的不同部分。

If material is undefined, then a default material MUST be used.如果material未定义,则必须使用默认材料。

The following example defines a mesh containing one indexed triangle primitive:以下示例定义了一个包含一个索引三角形的网格:

{

    "meshes": [

        {

            "primitives": [

                {

                    "attributes": {

                        "NORMAL": 23,

                        "POSITION": 22,

                        "TANGENT": 24,

                        "TEXCOORD_0": 25

                    },

                    "indices": 21,

                    "material": 3,

                    "mode": 4

                }

            ]

        }

    ]

}

Each attribute is defined as a property of the attributes object. The name of the property corresponds to an enumerated value identifying the vertex attribute, such as POSITION. The value of the property is the index of an accessor that contains the data.每个属性定义为attributes对象的属性。该属性的名称对应于识别顶点属性的枚举值,例如POSITION。属性的值是包含数据的访问者的索引。

The specification defines the following attribute semantics: POSITION, NORMAL, TANGENT, TEXCOORD_n, COLOR_n, JOINTS_n, and WEIGHTS_n.该规范定义了以下属性语义:POSITION,NORMAL,TANGENT,TEXCOORD_n,COLOR_n </b4>,JOINTS_n,JOINTS_n,和<b6> <b6> WEIGHTS_n。

Application-specific attribute semantics MUST start with an underscore, e.g., _TEMPERATURE. Application-specific attribute semantics MUST NOT use unsigned int component type.特定于应用程序的属性语义必须从下划线开始,例如_TEMPERATURE。特定于应用程序的属性语义不能使用未签名的INT组件类型。

Valid accessor type and component type for each attribute semantic property are defined below.下面定义了每个属性语义属性的有效访问类型和组件类型。

Name 姓名 

Accessor Type(s) 访问类型 

Component Type(s) 组件类型 

Description 描述 

POSITION

VEC3 VEC3 

float 漂浮 

Unitless XYZ vertex positions 无单位XYZ顶点位置 

NORMAL

VEC3 VEC3 

float 漂浮 

Normalized XYZ vertex normals 归一化XYZ顶点正常 

TANGENT

VEC4 VEC4 

float 漂浮 

XYZW vertex tangents where the XYZ portion is normalized, and the W component is a sign value (-1 or +1) indicating handedness of the tangent basisXYZW顶点切线,其中XYZ部分的标准化,W分量是符号值(-1或+1),指示切线的手

TEXCOORD_n

VEC2 VEC2 

float漂浮
unsigned byte normalized未签名的字节归一化
unsigned short normalized未签名的短期归一化

ST texture coordinates ST纹理坐标 

COLOR_n

VEC3VEC3
VEC4VEC4

float漂浮
unsigned byte normalized未签名的字节归一化
unsigned short normalized未签名的短期归一化

RGB or RGBA vertex color linear multiplierRGB或RGBA顶点颜色线性乘数

JOINTS_n

VEC4 VEC4 

unsigned byte unsigned short 未签名字节未签名短 

See Skinned Mesh Attributes查看皮肤网状属性

WEIGHTS_n

VEC4 VEC4 

float漂浮
unsigned byte normalized未签名的字节归一化
unsigned short normalized未签名的短期归一化

See Skinned Mesh Attributes查看皮肤网状属性

POSITION accessor MUST have its min and max properties defined.POSITION访问者必须具有其min和max定义的属性。

The W component of each TANGENT accessor element MUST be set to 1.0 or -1.0.每个TANGENT配件元素的W组件必须设置为<b1>> </b1>或-1.0。

When a COLOR_n attribute uses an accessor of "VEC3" type, its alpha component MUST be assumed to have a value of 1.0.当COLOR_n属性使用<b1>> </b1>类型的访问者时,必须假定其alpha组件的值为1.0。

All components of each COLOR_0 accessor element MUST be clamped to [0.0, 1.0] range.每个COLOR_0登录元件的所有组件都必须夹紧到<b1>> </b1>范围。

TEXCOORD_n, COLOR_n, JOINTS_n, and WEIGHTS_n attribute semantic property names MUST be of the form [semantic]_[set_index], e.g., TEXCOORD_0, TEXCOORD_1, COLOR_0. All indices for indexed attribute semantics MUST start with 0 and be consecutive positive integers: TEXCOORD_0, TEXCOORD_1, etc. Indices MUST NOT use leading zeroes to pad the number of digits (e.g., TEXCOORD_01 is not allowed).TEXCOORD_n,COLOR_n,JOINTS_n和WEIGHTS_n属性语义属性名称必须为[semantic]_[set_index],例如索引属性语义的所有索引都必须从0开始,并且是连续的正整数:TEXCOORD_0,TEXCOORD_1等。索引不得使用领先的零来填充数字的数量(例如,TEXCOORD_01不允许使用)。

Client implementations SHOULD support at least two texture coordinate sets, one vertex color, and one joints/weights set.客户端实现应至少支持两个纹理坐标集,一个顶点颜色和一个关节/权重。

All attribute accessors for a given primitive MUST have the same count. When indices property is not defined, attribute accessors' count indicates the number of vertices to render; when indices property is defined, it indicates the upper (exclusive) bound on the index values in the indices accessor, i.e., all index values MUST be less than attribute accessors' count.给定原始的所有属性访问者都必须具有相同的count。当未定义<b1>> </b1>属性时,属性访问者'count指示呈现的顶点数。当定义indices属性时,它指示indices登录器中的索引值的上部(独家)绑定,即,所有索引值必须小于属性访问者'count。

indices accessor MUST NOT contain the maximum possible value for the component type used (i.e., 255 for unsigned bytes, 65535 for unsigned shorts, 4294967295 for unsigned ints).indices访问者不得包含所使用的组件类型的最大可能值(即未签名字节的255,无符号短裤的65535,无符号INTS的4294967295)。

 

Implementation Note 实施注释 

The maximum values trigger primitive restart in some graphics APIs and would require client implementations to rebuild the index buffer.最大值触发了某些图形API中的原始重新启动,并且需要客户实现来重建索引缓冲区。

When indices property is not defined, the number of vertex indices to render is defined by count of attribute accessors (with the implied values from range [0..count)); when indices property is defined, the number of vertex indices to render is defined by count of accessor referred to by indices. In either case, the number of vertex indices MUST be valid for the topology type used:当未定义indices属性时,渲染的顶点索引的数量由属性登录的count定义(带有来自范围[0..count)的隐含值);当定义indices属性时,渲染的顶点索引的数量由indices引用的访问者的count定义。无论哪种情况,顶点索引的数量都必须适用于使用的拓扑类型:

  • For points, it MUSTbe non-zero.对于要点,它必须非零。
  • For line loopsand line strips, it MUST be 2 or greater.对于线路和线条,必须为2个或更高。
  • For triangle stripsand triangle fans, it MUST be 3 or greater.对于三角形和三角形粉丝,必须是3或更高的。
  • For lines, it MUSTbe divisible by 2 and non-zero.对于线条,必须将其除以2和非零。
  • For triangles, it MUSTbe divisible by 3 and non-zero对于三角形,必须由3和非零

Topology types are defined as follows.拓扑类型定义如下。

  • Points 

Each vertex defines a single point primitive, according to the equation:每个顶点都根据公式来定义一个点原始性:

pi = {vi} p i = {v i

  • Line Strips 线条

One line primitive is defined by each vertex and the following vertex, according to the equation:根据等式,每个顶点和以下顶点定义了一条原始的线。

pi = {vi, vi+1}p i = {v i,v i+1}

  • Line Loops 线路循环

Loops are the same as line strips except that a final segment is added from the final specified vertex to the first vertex.循环与线条相同,只是从最终指定的顶点添加了最终段到第一个顶点。

  • Lines 线

Each consecutive pair of vertices defines a single line primitive, according to the equation:根据等式,每个连续的顶点都定义了一条线原始的。

pi = {v2i, v2i+1}p i = {v 2i,v 2i+1}

  • Triangles 三角形

Each consecutive set of three vertices defines a single triangle primitive, according to the equation:根据等式,每个连续三个顶点的连续集定义了一个三角形的原始。

pi = {v3i, v3i+1, v3i+2}p i = {V 3i,V 3i+1,V 3i+2}

  • Triangle Strips 三角条

One triangle primitive is defined by each vertex and the two vertices that follow it, according to the equation:每个顶点定义了一个三角形原始性,并根据公式:

pi = {vi, vi+(1+i%2), vi+(2-i%2)}p i = {V i,V i+(1+i%2),V i+(2-i%2)}

  • Triangle Fans 三角粉丝

Triangle primitives are defined around a shared common vertex, according to the equation:根据等式,围绕共享的共同顶点定义了三角形的原始词:

pi = {vi+1, vi+2, v0}p i = {V i+1,V i+2,V 0}

Mesh geometry SHOULD NOT contain degenerate lines or triangles, i.e., lines or triangles that use the same vertex more than once per topology primitive.网格几何形状不应包含退化的线或三角形,即每个拓扑原始的使用相同顶点的线或三角形。

When positions are not specified, client implementations SHOULD skip primitive’s rendering unless its positions are provided by other means (e.g., by an extension). This applies to both indexed and non-indexed geometry.如果未指定职位,则客户实现应跳过原始渲染,除非其他方式提供其位置(例如,扩展名)。这适用于索引和非索引几何形状。

When tangents are not specified, client implementations SHOULD calculate tangents using default MikkTSpace algorithms with the specified vertex positions, normals, and texture coordinates associated with the normal texture.当未指定切线时,客户端实现应使用默认的Mikktspace算法计算切线,并具有指定的顶点位置,正态和与正常纹理相关的纹理坐标。

When normals are not specified, client implementations MUST calculate flat normals and the provided tangents (if present) MUST be ignored.当未指定正态时,客户实现必须计算*坦的正态,并且必须忽略所提供的切线(如果存在)。

Vertices of the same triangle SHOULD have the same tangent.w value. When vertices of the same triangle have different tangent.w values, its tangent space is considered undefined.同一三角形的顶点应具有相同的tangent.w值。当同一三角形的顶点具有不同的tangent.w值时,其切线空间被认为是不确定的。

The bitangent vectors MUST be computed by taking the cross product of the normal and tangent XYZ vectors and multiplying it against the W component of the tangent: bitangent = cross(normal.xyz, tangent.xyz) * tangent.w.必须通过取下正常和切线XYZ向量的交叉产物来计算bitangent向量,并将其乘以切线的W分量:bitangent = cross(normal.xyz, tangent.xyz) * tangent.w。

Extensions MAY add additional attribute names, accessor types, and/or component types.扩展可能会添加其他属性名称,访问者类型和/或组件类型。

3.7.2.2. Morph Targets 3.7.2.2。变形靶标 

Morph targets are defined by extending the Mesh concept.通过扩展网格概念来定义变体靶标。

A morph target is a morphable Mesh where the primitives' attributes are obtained by adding the original attributes to a weighted sum of the target’s attributes.变体目标是一个可变形的网格,其中通过将原始属性添加到目标属性的加权总和中,可以获得原始属性的属性。

For instance, the morph target vertices POSITION for the primitive at index i are computed in this way:例如,以这种方式计算索引i的原始目标的变形目标顶点POSITION:

primitives[i].attributes.POSITION +

  weights[0] * primitives[i].targets[0].POSITION +

  weights[1] * primitives[i].targets[1].POSITION +

  weights[2] * primitives[i].targets[2].POSITION + ...

Morph targets are specified via the targets property defined in the Mesh primitives. Each target in the targets array is a plain JSON object mapping a primitive attribute to an accessor containing morph target displacement data (deltas).通过在网格<b1>>>中定义的targets属性指定了变体靶标。 targets数组中的每个目标都是一个普通的JSON对象,将原始属性映射到包含Morph目标位移数据(Deltas)的登录器。

For each morph target attribute, an original attribute MUST be present in the mesh primitive.对于每个变形目标属性,必须在网格原始属性中存在一个原始属性。

Attributes present in the base mesh primitive but not included in a given morph target MUST retain their original values for the morph target.基本网格原始中存在但不包含在给定的变体目标中的属性必须保留其对变体目标的原始值。

 

Implementation Note 实施注释 

This allows skipping zero-filled accessors and implies that different morph targets may contain different sets of attributes.这允许跳过零填充的登录器,并暗示不同的变体目标可能包含不同的属性集。

Client implementations SHOULD support at least three attributes — POSITION, NORMAL, and TANGENT — for morphing. Client implementations MAY optionally support morphed TEXCOORD_n and/or COLOR_n attributes.客户实现应至少支持三个属性 - POSITION,NORMAL和TANGENT - 用于变形。客户端实现可以选择支持变形TEXCOORD_n和/或COLOR_n属性。

If morph targets contain application-specific semantics, their names MUST be prefixed with an underscore (e.g., _TEMPERATURE) like the associated attribute semantics.如果变形靶标包含特定于应用的语义,则必须将其名称以下划线(例如,_TEMPERATURE)为前缀,例如相关的属性语义。

All primitives MUST have the same number of morph targets in the same order.所有原语都必须按照相同的顺序具有相同数量的变形靶标。

Accessor type and component type for each morphed attribute semantic property MUST follow the table below. Note that the W component for handedness is omitted when targeting TANGENT data since handedness cannot be displaced.每个变形属性语义属性的访问类型和组件类型必须遵循下表。请注意,当针对TANGENT数据时,省略了手工的W分量,因为无法移位。

Name 姓名 

Accessor Type(s) 访问类型 

Component Type(s) 组件类型 

Description 描述 

POSITION

VEC3 VEC3 

float 漂浮 

XYZ vertex position displacementsXYZ顶点位置位移

NORMAL

VEC3 VEC3 

float 漂浮 

XYZ vertex normal displacements xyz顶点正常位移 

TANGENT

VEC3 VEC3 

float 漂浮 

XYZ vertex tangent displacementsXYZ顶点切线位移

TEXCOORD_n

VEC2 VEC2 

float漂浮
signed byte normalized签名字节归一化
signed short normalized签名短期归一化
unsigned byte normalized未签名的字节归一化
unsigned short normalized未签名的短期归一化

ST texture coordinate displacementsST纹理坐标位移

COLOR_n

VEC3VEC3
VEC4VEC4

float漂浮
signed byte normalized签名字节归一化
signed short normalized签名短期归一化
unsigned byte normalized未签名的字节归一化
unsigned short normalized未签名的短期归一化

RGB or RGBA color deltasRGB或RGBA彩色三角洲

POSITION accessor MUST have its min and max properties defined.POSITION访问者必须具有其min和max定义的属性。

Displacements for POSITION, NORMAL, and TANGENT attributes MUST be applied before any transformation matrices affecting the mesh vertices such as skinning or node transforms.必须在影响网格顶点的任何转换矩阵之前,必须应用POSITION,NORMAL和TANGENT属性的位移。

When the base mesh primitive does not specify tangents, client implementations SHOULD calculate tangents for each morph target using default MikkTSpace algorithms with the updated vertex positions, normals, and texture coordinates associated with the normal texture.当基本网格原始词未指定切线时,客户实现应使用默认的Mikktspace算法计算每个变形目标的切线,并具有更新的顶点位置,正态和纹理坐标与正常纹理相关。

When the base mesh primitive does not specify normals, client implementations MUST calculate flat normals for each morph target; the provided tangents and their displacements (if present) MUST be ignored.当基本网格原始词未指定正态时,客户实现必须为每个变形目标计算*坦的正态;提供的切线及其位移(如果存在)必须忽略。

When COLOR_n deltas use an accessor of "VEC3" type, their alpha components MUST be assumed to have a value of 0.0.当COLOR_n deltas使用<b1>> </b1>类型的登录器时,必须假定其alpha组件的值为0.0。

After applying color deltas, all components of each COLOR_0 morphed accessor element MUST be clamped to [0.0, 1.0] range.应用颜色三角洲后,必须将每个组件的所有组件夹住到<b1>> </b1>范围内。

All morph target accessors MUST have the same count as the accessors of the original primitive.所有变形的目标登录器都必须具有与原始原始配件相同的count。

A mesh with morph targets MAY also define an optional mesh.weights property that stores the default targets' weights. These weights MUST be used when node.weights is undefined. When mesh.weights is undefined, the default targets' weights are zeros.具有变形目标的网格还可以定义可选的mesh.weights属性,该属性存储默认目标的权重。当<b1>> </b1>未定义时,必须使用这些权重。当mesh.weights不确定时,默认目标的权重为零。

The following example extends the Mesh defined in the previous example to a morphable one by adding two morph targets:下面的示例将上一个示例中定义的网格扩展到一个可变形的示例,通过添加两个变体目标:

{

    "primitives": [

        {

            "attributes": {

                "NORMAL": 23,

                "POSITION": 22,

                "TANGENT": 24,

                "TEXCOORD_0": 25

            },

            "indices": 21,

            "material": 3,

            "targets": [

                {

                    "NORMAL": 33,

                    "POSITION": 32,

                    "TANGENT": 34

                },

                {

                    "NORMAL": 43,

                    "POSITION": 42,

                    "TANGENT": 44

                }

            ]

        }

    ],

    "weights": [0, 0.5]

}

The number of morph targets is not limited. Client implementations SHOULD support at least eight morphed attributes. This means that they SHOULD support eight morph targets when each morph target has one attribute, four morph targets where each morph target has two attributes, or two morph targets where each morph target has three or four attributes.变形靶标的数量不限。客户实现应至少支持八个变形属性。这意味着,当每个变体目标具有一个属性,每个变体目标具有两个属性,或两个变形靶标时,它们应支持八个变体目标,其中每个变体目标具有三个或四个属性。

For assets that contain a higher number of morphed attributes, client implementations MAY choose to only use the eight attributes of the morph targets with the highest weights.对于包含较高数量变形属性的资产,客户实现可能仅使用权重最高的变形目标的八个属性。

 

Implementation Note 实施注释 

A significant number of authoring and client implementations associate names with morph targets. While the glTF 2.0 specification currently does not provide a way to specify names, most tools use an array of strings, mesh.extras.targetNames, for this purpose. The targetNames array and all primitive targets arrays must have the same length.大量的创作和客户实现将名称与变形目标关联。尽管GLTF 2.0规范当前没有提供指定名称的方法,但大多数工具为此目的使用mesh.extras.targetNames的字符串数组。 targetNames数组和所有原始targets数组必须具有相同的长度。

3.7.3. Skins 3.7.3。皮肤 

3.7.3.1. Overview 3.7.3.1。概述 

glTF 2.0 meshes support Linear Blend Skinning via skin objects, joint hierarchies, and designated vertex attributes.GLTF 2.0网格支持线性混合皮肤,通过皮肤对象,关节层次结构和指定的顶点属性。

Skins are stored in the skins array of the asset. Each skin is defined by a REQUIRED joints property that lists the indices of nodes used as joints to pose the skin and an OPTIONAL inverseBindMatrices property that points to an accessor with inverse bind matrices data used to bring coordinates being skinned into the same space as each joint.皮肤存储在资产的skins中。每种皮肤都由所需的joints属性定义,该属性列出了用作构成皮肤的节点的索引,并可选的inverseBindMatrices属性,该属性指向带有副矩阵数据的登录器,用于使坐标用于使坐标与每个接头相同的空间。

The order of joints is defined by the skin.joints array and it MUST match the order of inverseBindMatrices accessor elements (when the latter is present). The skeleton property (if present) points to the node that is the common root of a joints hierarchy or to a direct or indirect parent node of the common root.关节的顺序由skin.joints数组定义,它必须与<b1>> </b1>登录器元素的顺序匹配(后者存在时)。 skeleton属性(如果存在)指向关节层次结构的常见根或公共根的直接或间接父节点。

 

Implementation Note 实施注释 

Although the skeleton property is not needed for computing skinning transforms, it may be used to provide a specific “pivot point” for the skinned geometry.尽管计算皮肤变换不需要skeleton属性,但它可用于为皮肤的几何形状提供特定的“枢轴点”。

An accessor referenced by inverseBindMatrices MUST have floating-point components of "MAT4" type. The number of elements of the accessor referenced by inverseBindMatrices MUST greater than or equal to the number of joints elements. The fourth row of each matrix MUST be set to [0.0, 0.0, 0.0, 1.0].由inverseBindMatrices引用的登录器必须具有<b1>>>类型的浮点组件。 inverseBindMatrices引用的登录器的元素数必须大于或等于joints元素的数量。每个矩阵的第四行必须设置为[0.0, 0.0, 0.0, 1.0]。

 

Implementation Note 实施注释 

The matrix defining how to pose the skin’s geometry for use with the joints (also known as “Bind Shape Matrix”) should be premultiplied to mesh data or to Inverse Bind Matrices.定义如何构成皮肤的几何形状以供接头使用的矩阵(也称为“结合形状矩阵”)应在网格数据或逆合矩阵上进行体育锻炼。

3.7.3.2. Joint Hierarchy 3.7.3.2。联合层次结构 

The joint hierarchy used for controlling skinned mesh pose is simply the node hierarchy, with each node designated as a joint by a reference from the skin.joints array. Each skin’s joints MUST have a common parent node (direct or indirect) called common root, which may or may not be a joint node itself. When a skin is referenced by a node within a scene, the common root MUST belong to the same scene.用于控制皮肤网格姿势的关节层次结构仅仅是节点层次结构,每个节点通过skin.joints阵列的引用将每个节点指定为关节。每个皮肤的关节必须具有称为常见根的共同母节(直接或间接),这可能是或可能不是关节节点本身。当一个场景中的节点引用皮肤时,共同的根必须属于同一场景。

 

Implementation Note 实施注释 

A node object does not specify whether it is a joint. Client implementations may need to traverse the skins array first, marking each joint node.节点对象未指定它是否是关节。客户实现可能需要首先穿越skins数组,以标记每个关节节点。

A joint node MAY have other nodes attached to it, even a complete node sub graph with meshes.关节节点可能附加了其他节点,即使是带有网格的完整节点子图。

 

Implementation Note 实施注释 

It’s common to have an entire geometry attached to a joint node without having it being skinned (e.g., a sword attached to a hand). Note that the node transform is the local transform of the node relative to the joint, like any other node in the glTF node hierarchy as described in the Transformations section.通常,将整个几何形状连接到关节节点而不会被剥皮的情况下(例如,绑在手上的剑)。请注意,节点变换是该节点相对于关节的局部变换,就像转换部分中所述的GLTF节点层次结构中的任何其他节点一样。

Only the joint transforms are applied to the skinned mesh; the transform of the skinned mesh node MUST be ignored.只有关节变换应用于皮肤网状网格;必须忽略皮肤网状节点的转换。

In the example below, the translation of node_0 and the scale of node_1 are applied while the translation of node_3 and rotation of node_4 are ignored.在下面的示例中,应用node_0的翻译和node_1的比例,而node_3的翻译和node_4的旋转的翻译被忽略。

{

    "nodes": [

        {

            "name": "node_0",

            "children": [ 1 ],

            "translation": [ 0.0, 1.0, 0.0 ]

        },

        {

            "name": "node_1",

            "children": [ 2 ],

            "scale": [ 0.5, 0.5, 0.5 ]

        },

        {

            "name": "node_2"

        },

        {

            "name": "node_3",

            "children": [ 4 ],

            "translation": [ 1.0, 0.0, 0.0 ]

        },

        {

            "name": "node_4",

            "mesh": 0,

            "rotation": [ 0.0, 1.0, 0.0, 0.0 ],

            "skin": 0

        }

    ],

    "skins": [

        {

            "inverseBindMatrices": 0,

            "joints": [ 1, 2 ],

            "skeleton": 1

        }

    ]

}

3.7.3.3. Skinned Mesh Attributes3.7.3.3。皮肤网状属性

The skinned mesh MUST have vertex attributes that are used in skinning calculations. The JOINTS_n attribute data contains the indices of the joints from the corresponding skin.joints array that affect the vertex. The WEIGHTS_n attribute data defines the weights indicating how strongly the joint influences the vertex.皮肤网格必须具有用于皮肤计算的顶点属性。 JOINTS_n属性数据包含来自影响顶点的相应skin.joints数组的关节索引。 WEIGHTS_n属性数据定义了权重,指示关节对顶点的影响有多强。

To apply skinning, a transformation matrix is computed for each joint. Then, the per-vertex transformation matrices are computed as weighted linear sums of the joint transformation matrices. Note that per-joint inverse bind matrices (when present) MUST be applied before the base node transforms.要涂抹皮肤,为每个接头计算一个转换矩阵。然后,将每个vertex转换矩阵计算为关节转化矩阵的加权线性总和。请注意,在基本节点转换之前,必须应用每个关节逆合矩阵(当存在)。

In the following example, a mesh primitive defines JOINTS_0 and WEIGHTS_0 vertex attributes:在下面的示例中,网格原始性定义JOINTS_0和WEIGHTS_0 vertex属性:

{

    "meshes": [

        {

            "name": "skinned-mesh_1",

            "primitives": [

                {

                    "attributes": {

                        "JOINTS_0": 179,

                        "NORMAL": 165,

                        "POSITION": 163,

                        "TEXCOORD_0": 167,

                        "WEIGHTS_0": 176

                    },

                    "indices": 161,

                    "material": 1,

                    "mode": 4

                }

            ]

        }

    ]

}

The number of joints that influence one vertex is limited to 4 per set, so the referenced accessors MUST have VEC4 type and following component types:影响一个顶点的关节数量限制为每组4个,因此参考的访问者必须具有VEC4类型和以下组件类型:

  • JOINTS_n: unsigned byteor unsigned shortJOINTS_n:未签名的字节或未签名的短
  • WEIGHTS_n: float, or normalized unsigned byte, or normalized unsigned shortWEIGHTS_n:浮动或归一化的未签名字节或归一化的无符号短

The joint weights for each vertex MUST NOT be negative.每个顶点的关节重量不得为负。

Joints MUST NOT contain more than one non-zero weight for a given vertex.对于给定顶点,关节不得包含超过一个非零的重量。

When the weights are stored using float component type, their linear sum SHOULD be as close as reasonably possible to 1.0 for a given vertex.当使用浮点部分类型存储权重时,对于给定顶点,应尽可能接*1.0。

When the weights are stored using normalized unsigned byte, or normalized unsigned short component types, their linear sum before normalization MUST be 255 or 65535 respectively. Without these requirements, vertices would be deformed significantly because the weight error would get multiplied by the joint position. For example, an error of 1/255 in the weight sum would result in an unacceptably large difference in the joint position.当使用归一化的无符号字节或归一化的无符号短组件类型存储权重时,归一化之前的线性总和必须分别为255或65535。没有这些要求,顶点将大幅变形,因为重量误差将乘以关节位置。例如,重量总和中1/255的误差将导致关节位置差异不大。

 

Implementation Note 实施注释 

The threshold in the official validation tool is set to 2e-7 times the number of non-zero weights per vertex.官方验证工具中的阈值设置为2e-7乘以每个顶点的非零重量的数量。

 

Implementation Note 实施注释 

Since the allowed threshold is much lower than minimum possible step for quantized component types, weight sum should be renormalized after quantization.由于允许的阈值远低于量化组件类型的最小步骤,因此重量总和应在量化后重新归一化。

When any of the vertices are influenced by more than four joints, the additional joint and weight information are stored in subsequent sets. For example, JOINTS_1 and WEIGHTS_1 if present will reference the accessor for up to 4 additional joints that influence the vertices. For a given primitive, the number of JOINTS_n attribute sets MUST be equal to the number of WEIGHTS_n attribute sets.当任何顶点受四个关节的影响时,额外的关节和权重信息将存储在随后的集合中。例如,JOINTS_1和WEIGHTS_1如果存在将引用访问者的最多4个影响顶点的其他关节。对于给定的原始性,JOINTS_n属性集的数量必须等于WEIGHTS_n属性集的数量。

Client implementations MAY support only a single set of up to four weights and joints, however not supporting all weight and joint sets present in the file may have an impact on the asset’s animation.客户实现可能仅支持一组最多四个权重和关节,但是不支持文件中存在的所有权重和关节集可能会影响资产的动画。

All joint values MUST be within the range of joints in the skin. Unused joint values (i.e., joints with a weight of zero) SHOULD be set to zero.所有关节值必须在皮肤中关节的范围内。未使用的关节值(即重量为零的关节)应设置为零。

3.7.4. Instantiation 3.7.4。实例化 

A mesh is instantiated by node.mesh property. The same mesh could be used by many nodes, which could have different transforms. For example:网格由node.mesh属性实例化。许多节点可以使用相同的网格,这些节点可能具有不同的变换。例如:

{

    "nodes": [

        {

            "mesh": 11

        },

        {

            "mesh": 11,

            "translation": [

                -20,

                -1,

                0

            ]

        }

    ]

}

After applying the node’s global transform, mesh vertex position values are meters.应用节点的全局变换后,网格顶点位置值为仪表。

When a mesh primitive uses any triangle-based topology (i.e., trianglestriangle strip, or triangle fan), the determinant of the node’s global transform defines the winding order of that primitive. If the determinant is a positive value, the winding order triangle faces is counterclockwise; in the opposite case, the winding order is clockwise.当网格原始性使用任何基于三角形的拓扑(即三角形,三角形或三角形风扇)时,节点全局变换的决定因素定义了该原始的绕组顺序。如果决定因素是正值,则绕组三角形的面是逆时针;在相反的情况下,绕组顺序是顺时针。

 

Implementation Note 实施注释 

Switching the winding order to clockwise enables mirroring geometry via negative scale transforms.将绕组顺时针切换为顺时针启用通过负尺度变换来镜像几何形状。

When an instantiated mesh has morph targets, it MUST use morph weights specified with the node.weights property. When the latter is undefined, mesh.weights property MUST be used instead. When both of these fields are undefined, the mesh is instantiated in a non-morphed state (i.e., with all morph weights set to zeros).当实例化的网格具有变形靶标时,它必须使用node.weights属性指定的变形权重。当后者未定义时,必须使用mesh.weights属性。当这两个场均未定义时,网格将以非变形态实例化(即,所有变形权重设置为零重)。

The example below instantiates a Morph Target with non-default weights.下面的示例实例化了具有非默认权重的变形目标。

{

    "nodes": [

        {

            "mesh": 11,

            "weights": [0, 0.5]

        }

    ]

}

A skin is instantiated within a node using a combination of the node’s mesh and skin properties. The mesh for a skin instance is defined in the mesh property. The skin property contains the index of the skin to instance.使用节点的mesh和<b1>> </b1>属性的组合在节点中实例化皮肤。皮肤实例的网格在mesh属性中定义。 skin属性包含以实例的皮肤索引。

The following example shows a skinned mesh instance: a skin object, a node with a skinned mesh, and two joint nodes.以下示例显示了一个皮肤网状实例:一个皮肤对象,一个带有皮肤网眼的节点和两个关节节点。

{

    "skins": [

        {

            "inverseBindMatrices": 29,

            "joints": [1, 2]

        }

    ],

    "nodes": [

        {

            "name":"Skinned mesh node",

            "mesh": 0,

            "skin": 0

        },

        {

            "name":"Skeleton root joint",

            "children": [2],

            "rotation": [

                0,

                0,

                0.7071067811865475,

                0.7071067811865476

            ],

            "translation": [

                4.61599,

                -2.032e-06,

                -5.08e-08

            ]

        },

        {

            "name":"Head",

            "translation": [

                8.76635,

                0,

                0

            ]

        }

    ]

}

3.8. Texture Data 3.8。纹理数据 

3.8.1. Overview 3.8.1。概述 

glTF 2.0 separates texture access into three distinct types of objects: Textures, Images, and Samplers.GLTF 2.0将纹理访问分为三种不同类型的对象:纹理,图像和采样器。

3.8.2. Textures 3.8.2。纹理 

Textures are stored in the asset’s textures array. A texture is defined by an image index, denoted by the source property and a sampler index (sampler). For example:纹理存储在资产的textures数组中。纹理由图像索引定义,由<b1>> </b1>属性和采样器索引(sampler)表示。例如:

{

    "textures": [

        {

            "sampler": 0,

            "source": 2

        }

    ]

}

glTF 2.0 supports only static 2D textures.GLTF 2.0仅支持静态2D纹理。

When texture.source is undefined, the image SHOULD be provided by an extension or application-specific means, otherwise the texture object is undefined.当texture.source未定义时,应通过扩展或特定于应用程序的方式提供图像,否则纹理对象不确定。

 

Implementation Note 实施注释 

Client implementations may render such textures with a predefined placeholder image or being filled with some error color (usually magenta).客户实现可以用预定义的占位符图像或填充某些错误颜色(通常是洋红色)呈现此类纹理。

When texture.sampler is undefined, a sampler with repeat wrapping (in both directions) and auto filtering MUST be used.当texture.sampler未定义时,必须使用具有重复包装的采样器(在两个方向上)和自动过滤。

3.8.3. Images 3.8.3。图像 

Images referred to by textures are stored in the images array of the asset.纹理提到的图像存储在资产的images中。

Each image contains one of每个图像都包含一个

  • a URI (or IRI) to an external file in one of the supported image formats, or以一种受支持的图像格式之一或
  • a Data URI with embedded data, or带有嵌入式数据的数据URI,或
  • a reference to a bufferView; in that case mimeTypeMUST be defined.对bufferView的引用;在这种情况下,必须定义mimeType。

The following example shows an image pointing to an external PNG image file and another image referencing a bufferView with JPEG data.下面的示例显示了指向外部PNG图像文件的图像,另一个图像用JPEG数据引用A bufferView。

{

    "images": [

        {

            "uri": "duckCM.png"

        },

        {

            "bufferView": 14,

            "mimeType": "image/jpeg"

        }

    ]

}

Client implementations MAY need to manually determine the media type of some images. In such a case, the following table SHOULD be used to check the values of the first few bytes.客户实现可能需要手动确定某些图像的媒体类型。在这种情况下,应使用下表来检查前几个字节的值。

Media Type 媒体类型 

Pattern Length 图案长度 

Pattern Bytes 模式字节 

image/png

8

0x89 0x50 0x4E 0x47 0x0D 0x0A 0x1A 0x0A

image/jpeg

3

0xFF 0xD8 0xFF

The image data MUST match the image.mimeType property when the latter is defined.定义后者时,图像数据必须匹配image.mimeType属性。

The origin of the texture coordinates (0, 0) corresponds to the upper left corner of a texture image. This is illustrated in the following figure, where the respective coordinates are shown for all four corners of a normalized texture space:纹理坐标的起源(0,0)对应于纹理图像的左上角。这在下图中进行了说明,其中显示了归一化纹理空间的所有四个角的各个坐标:

Figure 6. Normalized Texture Coordinates图6。归一化纹理坐标

Any colorspace information (such as ICC profiles, intents, gamma values, etc.) from PNG or JPEG images MUST be ignored. Effective transfer function (encoding) is defined by a glTF object that refers to the image (in most cases it’s a texture that is used by a material).必须忽略来自PNG或JPEG图像的任何Colorspace信息(例如ICC配置文件,意图,伽马值等)。有效的传输函数(编码)由GLTF对象定义,该对象是指图像(在大多数情况下,它是材料使用的纹理)。

 

Web Implementation Note Web实施注释 

To ignore embedded colorspace information when using WebGL API, set UNPACK_COLORSPACE_CONVERSION_WEBGL flag to NONE.要忽略嵌入式Colorspace信息时,使用WebGL API时,将UNPACK_COLORSPACE_CONVERSION_WEBGL标志设置为NONE。

To ignore embedded colorspace information when using ImageBitmap API, set colorSpaceConversion option to none.要忽略嵌入式Colorspace信息时,使用ImageBitMap API时,将colorSpaceConversion选项设置为<b1>> </b1>。

3.8.4. Samplers 3.8.4。采样器 

3.8.4.1. Overview 3.8.4.1。概述 

Samplers are stored in the samplers array of the asset. Each sampler specifies filtering and wrapping modes.采样器存储在资产的samplers中。每个采样器都指定过滤和包装模式。

The sampler properties use integer enums defined in the Properties Reference.采样器属性使用属性参考中定义的整数枚举。

Client implementations SHOULD follow specified filtering modes. When the latter are undefined, client implementations MAY set their own default texture filtering settings.客户实现应遵循指定的过滤模式。当后者未定义时,客户端实现可能会设置自己的默认纹理过滤设置。

Client implementations MUST follow specified wrapping modes.客户实现必须遵循指定的包装模式。

3.8.4.2. Filtering 3.8.4.2。过滤 

Filtering modes control texture’s magnification and minification.过滤模式控制纹理的放大倍率和缩小。

Magnification modes include: 放大模式包括: 

  • Nearest. For each requested texel coordinate, the sampler selects a texel with the nearest coordinates. This process is sometimes called “nearest neighbor”.最*。对于每个请求的Texel坐标,采样器选择具有最*坐标的Texel。这个过程有时称为“最*的邻居”。
  • Linear. For each requested texel coordinate, the sampler computes a weighted sum of several adjacent texels. This process is sometimes called “bilinear interpolation”.线性。对于每个请求的Texel坐标,采样器都计算几个相邻Texels的加权总和。这个过程有时称为“双线性插值”。

Minification modes include: 缩小模式包括: 

  • Nearest. For each requested texel coordinate, the sampler selects a texel with the nearest (in Manhattan distance) coordinates from the original image. This process is sometimes called “nearest neighbor”.最*。对于每个请求的Texel坐标,采样器选择一个从原始图像中的最接*(曼哈顿距离)坐标的Texel。这个过程有时称为“最*的邻居”。
  • Linear. For each requested texel coordinate, the sampler computes a weighted sum of several adjacent texels from the original image. This process is sometimes called “bilinear interpolation”.线性。对于每个请求的Texel坐标,采样器都会从原始图像中计算几个相邻texel的加权总和。这个过程有时称为“双线性插值”。
  • Nearest-mipmap-nearest. For each requested texel coordinate, the sampler first selects one of pre-minified versions of the original image, and then selects a texel with the nearest (in Manhattan distance) coordinates from it.最*的mipmap-neart。对于每个请求的Texel坐标,采样器首先选择原始图像的预先固定版本之一,然后选择与最接*(曼哈顿距离)坐标的Texel。
  • Linear-mipmap-nearest. For each requested texel coordinate, the sampler first selects one of pre-minified versions of the original image, and then computes a weighted sum of several adjacent texels from it.线性mipmap-nearest。对于每个请求的Texel坐标,采样器首先选择原始图像的预先封装版本之一,然后从中计算出几个相邻texels的加权总和。
  • Nearest-mipmap-linear. For each requested texel coordinate, the sampler first selects two pre-minified versions of the original image, selects a texel with the nearest (in Manhattan distance) coordinates from each of them, and performs final linear interpolation between these two intermediate results.最*的mipmap线性。对于每个请求的TEXEL坐标,采样器首先选择两个原始图像的预淘汰版本,从每个图像中选择一个TEXEL,其中每个图像中的每个图像都来自每个图像的最接*(曼哈顿距离)坐标,并在这两个中间结果之间执行最终线性插值。
  • Linear-mipmap-linear. For each requested texel coordinate, the sampler first selects two pre-minified versions of the original image, computes a weighted sum of several adjacent texels from each of them, and performs final linear interpolation between these two intermediate results. This process is sometimes called “trilinear interpolation”.线性胶实线性。对于每个请求的Texel坐标,采样器首先选择两个原始图像的预拆卸版本,计算每个图像中的几个相邻texel的加权总和,并在这两个中间结果之间执行最终线性插值。这个过程有时称为“三线性插值”。

To properly support mipmap modes, client implementations SHOULD generate mipmaps at runtime. When runtime mipmap generation is not possible, client implementations SHOULD override the minification filtering mode as follows:为了正确支持MIPMAP模式,客户端实现应在运行时生成MIPMAP。当无法生成运行时MIPMAP时,客户端实现应覆盖降低过滤模式,如下所示:

Mipmap minification mode MIPMAP缩小模式 

Fallback mode 后备模式 

Nearest-mipmap-nearest最*的mipmap-neart
Nearest-mipmap-linear最*的mipmap线性

Nearest 最* 

Linear-mipmap-nearest线性mipmap-nearest
Linear-mipmap-linear线性胶实线性

Linear 线性 

3.8.4.3. Wrapping 3.8.4.3。包装 

Per-vertex texture coordinates, which are provided via TEXCOORD_n attribute values, are normalized for the image size (not to confuse with the normalized accessor property, the latter refers only to data encoding). That is, the texture coordinate value of (0.0, 0.0) points to the beginning of the first (upper-left) image pixel, while the texture coordinate value of (1.0, 1.0) points to the end of the last (lower-right) image pixel.通过TEXCOORD_n属性值提供的每个vertex纹理坐标对图像大小进行了标准化(不要与<b1>> </b1>辅助属性混淆,后者仅引用数据编码)。也就是说,(0.0, 0.0)的纹理坐标值指向第一个(左上)图像像素的开头,而(1.0, 1.0)的纹理坐标值指向最后一个(下降)图像像素的末端。

Sampler’s wrapping modes define how to handle texture coordinates that are negative or greater than or equal to 1.0, independently for both directions. Supported modes include:Sampler的包装模式定义了如何处理负面或大于或等于1.0的纹理坐标,这两个方向都独立于此。支持模式包括:

  • Repeat. Only the fractional part of texture coordinates is used.重复 。仅使用纹理坐标的分数部分。
 

Example 例子 

2.2 maps to 0.2; -0.4 maps to 0.6.2.2映射到0.2; -0.4映射到0.6。

  • Mirrored Repeat. This mode works as repeatbut flips the direction when the integer part (truncated towards −∞) is odd.镜像重复。此模式可用作重复,但在整数部分(向-∞)截断为奇数时会翻转方向。
 

Example 例子 

2.2 maps to 0.2; -0.4 is treated as 0.4.2.2映射到0.2; -0.4被视为0.4。

  • Clamp to edge. Texture coordinates with values outside the image are clamped to the closest existing image texel at the edge.夹具到边缘。纹理与图像外部值的纹理坐标夹在边缘的最接*的现有图像Texel。

3.8.4.4. Example 3.8.4.4。例子 

The following example defines a sampler with linear magnification filtering, linear-mipmap-linear minification filtering, and repeat wrapping in both directions.以下示例定义了一个用线性放大过滤,线性-MIPMAP线性缩放过滤的采样器,并在两个方向上重复包装。

{

    "samplers": [

        {

            "magFilter": 9729,

            "minFilter": 9987,

            "wrapS": 10497,

            "wrapT": 10497

        }

    ]

}

3.8.4.5. Non-power-of-two Textures3.8.4.5。非功率两个纹理

Client implementations SHOULD resize non-power-of-two textures (so that their horizontal and vertical sizes are powers of two) when running on platforms that have limited support for such texture dimensions.客户实现应调整非功率两次纹理的大小(以便其水*和垂直尺寸是两个功率),而在对此类纹理维度的支持有限的*台上运行时。

 

Implementation Note 实施注释 

Specifically, if the sampler the texture references:具体而言,如果sampler纹理参考:

·        has a wrapping mode (either wrapS or wrapT) equal to repeat or mirrored repeat, or具有包装模式(wrapS或wrapT)等于重复或镜像重复或

·        has a minification filter (minFilter) that uses mipmapping.具有使用MIPMapping的Minification Filter(minFilter)。

3.9. Materials 3.9。材料 

3.9.1. Overview 3.9.1。概述 

glTF defines materials using a common set of parameters that are based on widely used material representations from Physically Based Rendering (PBR). Specifically, glTF uses the metallic-roughness material model. Using this declarative representation of materials enables a glTF file to be rendered consistently across platforms.GLTF使用一组共同的参数定义材料,这些参数基于基于物理渲染(PBR)的广泛使用的材料表示。具体而言,GLTF使用金属 - 粗糙度材料模型。使用此材料的声明表示,使GLTF文件可以跨*台持续渲染。

Figure 7. Physically Based Rendering Example图7。基于物理的渲染示例

3.9.2. Metallic-Roughness Material3.9.2。金属粗糙度材料

All parameters related to the metallic-roughness material model are defined under the pbrMetallicRoughness property of material object. The following example shows how to define a gold-like material using the metallic-roughness parameters:与金属 - 粗糙度材料模型相关的所有参数均在pbrMetallicRoughness属性的属性下定义。<b1>> </b1>对象。下面的示例显示了如何使用金属 - 粗糙度参数来定义类似金色的材料:

{

    "materials": [

        {

            "name": "gold",

            "pbrMetallicRoughness": {

                "baseColorFactor": [ 1.000, 0.766, 0.336, 1.0 ],

                "metallicFactor": 1.0,

                "roughnessFactor": 0.0

            }

        }

    ]

}

The metallic-roughness material model is defined by the following properties:金属 - 粗糙度材料模型由以下属性定义:

  • base color- The base color of the material.底色 - 材料的基颜色。
  • metalness- The metalness of the material; values range from 0 (non-metal) to 1.0 (metal); see Appendix B for the interpretation of intermediate values.金属 - 材料的金属;值范围从0.0(非金属)到1.0(金属);有关中间值的解释,请参见附录B。
  • roughness- The roughness of the material; values range from 0 (smooth) to 1.0 (rough).粗糙度 - 材料的粗糙度;值范围从0.0(*滑)到1.0(粗糙)。

The base color has two different interpretations depending on the value of metalness. When the material is a metal, the base color is the specific measured reflectance value at normal incidence (F0). For a non-metal the base color represents the reflected diffuse color of the material. In this model it is not possible to specify a F0 value for non-metals, and a linear value of 4% (0.04) is used.基本颜色取决于金属的价值,具有两种不同的解释。当材料是金属时,基本颜色是正常入射率下的特定测量反射率值(F0)。对于非金属,基本颜色表示材料的反射弥散颜色。在此模型中,不可能为非金属指定F0值,并且使用4%(0.04)的线性值。

The value for each property MAY be defined using factors and/or textures (e.g., baseColorTexture and baseColorFactor). If a texture is not given, all respective texture components within this material model MUST be assumed to have a value of 1.0. If both factors and textures are present, the factor value acts as a linear multiplier for the corresponding texture values. A texture binding is defined by an index of a texture object and an optional index of texture coordinates.可以使用因子和/或纹理(例如baseColorTexture和<b1>> </b1>)定义每个属性的值。如果没有给出纹理,则必须假定该材料模型中的所有相应纹理组件的值为1.0。如果存在因素和纹理,则因子值充当相应纹理值的线性乘数。纹理绑定由纹理对象的index定义,纹理坐标的可选索引。

The following example shows a material that uses a texture for its base color property.以下示例显示了一种使用纹理的基本色属性的材料。

{

    "materials": [

        {

            "pbrMetallicRoughness": {

                "baseColorTexture": {

                    "index": 0,

                    "texCoord": 1

                },

            }

        }

    ],

    "textures": [

        {

            "source": 0

        }

    ],

    "images": [

        {

            "uri": "base_color.png"

        }

    ]

}

The base color texture MUST contain 8-bit values encoded with the sRGB opto-electronic transfer function so RGB values MUST be decoded to real linear values before they are used for any computations. To achieve correct filtering, the transfer function SHOULD be decoded before performing linear interpolation.基本颜色纹理必须包含用SRGB光电传输函数编码的8位值,因此RGB值必须在将其用于任何计算之前将其解码为实际线性值。为了实现正确的过滤,在执行线性插值之前,应解码传输函数。

The textures for metalness and roughness properties are packed together in a single texture called metallicRoughnessTexture. Its green channel contains roughness values and its blue channel contains metalness values. This texture MUST be encoded with linear transfer function and MAY use more than 8 bits per channel.金属和粗糙度特性的纹理被包装在一个称为metallicRoughnessTexture的单个纹理中。其绿色通道包含粗糙度值,其蓝色通道包含金属度值。该纹理必须使用线性传输函数编码,并且每个通道可能使用8位以上。

For example, assume an 8-bit RGBA value of [64, 124, 231, 255] is sampled from baseColorTexture and assume that baseColorFactor is given as [0.2, 1.0, 0.7, 1.0]. Then, the final base color value would be (after decoding the transfer function and multiplying by the factor)例如,假设从<b1>> </b1>采样的8位RGBA值为[64, 124, 231, 255],并假设baseColorFactor以[0.2, 1.0, 0.7, 1.0]给出。然后,最终的基本颜色值将是(解码传输函数并乘以因子之后)

[0.051 * 0.2, 0.202 * 1.0, 0.799 * 0.7, 1.0 * 1.0] = [0.0102, 0.202, 0.5593, 1.0]

In addition to the material properties, if a primitive specifies a vertex color using the attribute semantic property COLOR_0, then this value acts as an additional linear multiplier to base color.除了材料属性外,如果原始属性使用属性语义属性COLOR_0指定顶点颜色,则此值充当基本颜色的附加线性乘数。

Implementations of the bidirectional reflectance distribution function (BRDF) itself MAY vary based on device performance and resource constraints. See Appendix B for more details on the BRDF calculations.双向反射分配功能(BRDF)的实现本身可能会根据设备性能和资源限制而有所不同。有关BRDF计算的更多详细信息,请参见附录B。

3.9.3. Additional Textures 3.9.3。其他纹理 

The material definition also provides for additional textures that MAY also be used with the metallic-roughness material model as well as other material models, which could be provided via glTF extensions.材料定义还提供了其他纹理,这些纹理也可以与金属 - 粗糙度材料模型以及其他材料模型一起使用,这些模型可以通过GLTF扩展提供。

The following additional textures are supported:支持以下其他纹理:

  • normal: A tangent space normal texture. The texture encodes XYZ components of a normal vector in tangent space as RGB values stored with linear transfer function. Normal textures SHOULD NOT contain alpha channel as it not used anyway. After dequantization, texel values MUST be mapped as follows: red [0.0 .. 1.0] to X [-1 .. 1], green [0.0 .. 1.0] to Y [-1 .. 1], blue (0.5 .. 1.0] maps to Z (0 .. 1]. Normal textures SHOULD NOT contain blue values less than or equal to 5.正常:切线空间正常纹理。纹理在切线空间中编码正常向量的XYZ组件,因为RGB值以线性传递函数存储。普通纹理不应包含α通道,因为它无论如何都不使用。取消定量后,必须将TEXEL值映射如下:红色[0.0 .. 1.0]至X [-1 .. 1],绿色[0.0 .. 1.0]至y [-1 .. 1],蓝色(0.5 .. 1.0]映射到Z(0 .. 1])。正常纹理不应包含蓝色值小于或等于0.5。
 

Implementation Note 实施注释 

This mapping is usually implemented as sampledValue * 2.0 - 1.0.该映射通常以sampledValue * 2.0 - 1.0的形式实现。

  • The texture binding for normal textures MAYadditionally contain a scalar scale value that linearly scales X and Y components of the normal vector.正常纹理的纹理结合可能还包含标量scale值,该值线性地缩放了正常矢量的x和y分量。
  • Normal vectors MUSTbe normalized before being used in lighting equations. When scaling is used, vector normalization happens after scaling.在光线方程式中使用之前,必须将正常向量进行标准化。使用缩放时,量表在缩放后进行矢量归一化。
  • occlusion: The occlusion texture; it indicates areas that receive less indirect lighting from ambient sources. Direct lighting is not affected. The red channel of the texture encodes the occlusion value, where 0 means fully-occluded area (no indirect lighting) and 1.0 means not occluded area (full indirect lighting). Other texture channels (if present) do not affect occlusion.遮挡:遮挡纹理;它表明从环境来源获得较少间接照明的区域。直接照明不受影响。纹理的红色通道编码遮挡值,其中0.0表示完全封闭的区域(无间接照明)和1.0表示不遮挡的区域(完整的间接照明)。其他纹理通道(如果存在)不会影响阻塞。

The texture binding for occlusion maps MAY optionally contain a scalar strength value that is used to reduce the occlusion effect. When present, it affects the occlusion value as 1.0 + strength * (occlusionTexture - 1.0).遮挡图的纹理绑定可以选择包含标量strength值,该值用于减少闭塞效果。当存在时,它会影响闭塞值1.0 + strength * (occlusionTexture - 1.0)。

  • emissive: The emissive texture and factor control the color and intensity of the light being emitted by the material. The texture MUST contain 8-bit values encoded with the sRGB opto-electronic transfer function so RGB values MUST be decoded to real linear values before they are used for any computations. To achieve correct filtering, the transfer function SHOULD be decoded before performing linear interpolation.发射:发射质地和因子控制材料发出的光的颜色和强度。该纹理必须包含用SRGB光电传输函数编码的8位值,因此RGB值必须在将其用于任何计算之前将其解码为实际线性值。为了实现正确的过滤,在执行线性插值之前,应解码传输函数。

For implementations where a physical light unit is needed, the units for the multiplicative product of the emissive texture and factor are candela per square meter (cd / m2), sometimes called nits.对于需要物理光单元的实现,发射纹理和因子的乘积产物的单位是每*方米烛台(CD / M <b0> < / b0>),有时称为Nit。

 

Implementation Note 实施注释 

Because the value is specified per square meter, it indicates the brightness of any given point along the surface. However, the exact conversion from physical light units to the brightness of rendered pixels requires knowledge of the camera’s exposure settings, which are left as an implementation detail unless otherwise defined by a glTF extension.由于该值是指每*方米指定的,因此表示沿表面任何给定点的亮度。但是,从物理光单元到渲染像素的亮度的确切转换需要了解相机的曝光设置,除非GLTF扩展名另外定义,否则将其作为实现细节。

Many rendering engines simplify this calculation by assuming that an emissive factor of 1.0 results in a fully exposed pixel.许多渲染引擎通过假设1.0的发射因子导致完全暴露的像素来简化了这一计算。

The following example shows a material that is defined using pbrMetallicRoughness parameters as well as additional textures:以下示例显示了使用pbrMetallicRoughness参数定义的材料以及其他纹理:

{

    "materials": [

        {

            "name": "Material0",

            "pbrMetallicRoughness": {

                "baseColorFactor": [ 0.5, 0.5, 0.5, 1.0 ],

                "baseColorTexture": {

                    "index": 1,

                    "texCoord": 1

                },

                "metallicFactor": 1,

                "roughnessFactor": 1,

                "metallicRoughnessTexture": {

                    "index": 2,

                    "texCoord": 1

                }

            },

            "normalTexture": {

                "scale": 2,

                "index": 3,

                "texCoord": 1

            },

            "emissiveFactor": [ 0.2, 0.1, 0.0 ]

        }

    ]

}

If a client implementation is resource-bound and cannot support all the textures defined it SHOULD support these additional textures in the following priority order. Resource-bound implementations SHOULD drop textures from the bottom to the top.如果客户端实现是有资源的,并且不能支持所有定义的纹理,则应按以下优先顺序支持这些其他纹理。有资源的实现应将纹理从底部降低到顶部。

Texture 质地 

Rendering impact when feature is not supported当不支持功能时,渲染影响

Normal 普通的 

Geometry will appear less detailed than authored.几何形状似乎不如撰写的详细信息。

Occlusion 阻塞 

Model will appear brighter in areas that are intended to be darker.在打算更黑的区域中,模型看起来更明亮。

Emissive 发射 

Model with lights will not be lit. For example, the headlights of a car model will be off instead of on.带有灯的型号不会点亮。例如,汽车型号的前灯会熄灭而不是开启。

3.9.4. Alpha Coverage 3.9.4。 alpha覆盖范围 

The alphaMode property defines how the alpha value is interpreted. The alpha value is taken from the fourth component of the base color for metallic-roughness material model.alphaMode属性定义了如何解释alpha值。 alpha值取自基本颜色的第四个组成部分,用于金属 - 粗糙度材料模型。

alphaMode can be one of the following values:alphaMode可以是以下值之一:

  • OPAQUE- The rendered output is fully opaque and any alpha value is ignored.OPAQUE - 渲染输出完全不透明,任何alpha值都被忽略。
  • MASK- The rendered output is either fully opaque or fully transparent depending on the alpha value and the specified alpha cutoff value; the exact appearance of the edges MAY be subject to implementation-specific techniques such as “Alpha-to-Coverage”.MASK - 渲染输出是完全不透明的或完全透明的,具体取决于alpha值和指定的alpha截止值;边缘的确切外观可能受到特定于实施技术的影响,例如“ alpha-to-coverage”。
 

Note 笔记 

This mode is used to simulate geometry such as tree leaves or wire fences.此模式用于模拟几何形状,例如树叶或钢丝栅栏。

  • BLEND- The rendered output is combined with the background using the “over” operator as described in Compositing digital images.BLEND - 渲染输出与背景使用“ Over”运算符,如组合数字图像所述。
 

Note 笔记 

This mode is used to simulate geometry such as gauze cloth or animal fur.该模式用于模拟几何形状,例如纱布布或动物毛皮。

When alphaMode is set to MASK the alphaCutoff property specifies the cutoff threshold. If the alpha value is greater than or equal to the alphaCutoff value then it is rendered as fully opaque, otherwise, it is rendered as fully transparent. alphaCutoff value is ignored for other modes.当alphaMode设置为MASK alphaCutoff属性指定截止阈值。如果alpha值大于或等于alphaCutoff值,则将其呈现为完全不透明,否则,它将呈现为完全透明。 alphaCutoff其他模式被忽略。

 

Implementation Note for Real-Time Rasterizers实时栅格设备的实施说明

Real-time rasterizers typically use depth buffers and mesh sorting to support alpha modes. The following describe the expected behavior for these types of renderers.实时栅格式化合物通常使用深度缓冲区和网格排序来支持Alpha模式。以下描述了这些类型的渲染器的预期行为。

·        OPAQUE - A depth value is written for every pixel and mesh sorting is not required for correct output.OPAQUE - 为每个像素编写一个深度值,并且不需要正确的输出。

·        MASK - A depth value is not written for a pixel that is discarded after the alpha test. A depth value is written for all other pixels. Mesh sorting is not required for correct output.MASK - 未为alpha测试后丢弃的像素编写深度值。为所有其他像素编写深度值。正确输出不需要网格排序。

·        BLEND - Support for this mode varies. There is no perfect and fast solution that works for all cases. Client implementations should try to achieve the correct blending output for as many situations as possible. Whether depth value is written or whether to sort is up to the implementation. For example, implementations may discard pixels that have zero or close to zero alpha value to avoid sorting issues.BLEND - 支持此模式的支持有所不同。没有适用于所有情况的完美和快速解决方案。客户实现应尝试在尽可能多的情况下实现正确的混合输出。是否编写深度值或是否对实施进行排序。例如,实现可能会丢弃具有零或接*零alpha值的像素以避免分类问题。

3.9.5. Double Sided 3.9.5。双面 

The doubleSided property specifies whether the material is double sided.doubleSided属性指定材料是否为双面。

When this value is false, back-face culling is enabled, i.e., only front-facing triangles are rendered.当此值是错误的时,启用了后面扣,即仅呈现前面的三角形。

When this value is true, back-face culling is disabled and double sided lighting is enabled. The back-face MUST have its normals reversed before the lighting equation is evaluated.当此值为真时,将禁用后面扣,并启用双面照明。在评估照明方程之前,后面必须使其正态逆转。

3.9.6. Default Material 3.9.6。默认材料 

The default material, used when a mesh does not specify a material, is defined to be a material with no properties specified. All the default values of material apply.当网格未指定材料时,使用的默认材料定义为未指定属性的材料。 material应用的所有默认值。

 

Implementation Note 实施注释 

This material does not emit light and will be black unless some lighting is present in the scene.该材料不会发光,除非现场有一些照明,否则将是黑色的。

3.9.7. Point and Line Materials3.9.7。点和线材料

This specification does not define size or style of non-triangular primitives (such as points or lines), and applications MAY use various techniques to render these primitives as appropriate. However, the following conventions are RECOMMENDED for consistency:该规范不能定义非三角形基原始人的大小或样式(例如要点或线条),并且应用程序可能会使用各种技术来适当地渲染这些原语。但是,建议进行以下公约以保持一致性:

  • Points and Lines SHOULDhave widths of 1px in viewport space.点和线在视口空间中应具有1PX的宽度。
  • Points or Lines with NORMALand TANGENT attributes SHOULD be rendered with standard lighting including normal textures.具有NORMAL和<b1>> </b1>属性的点或行应使用标准照明(包括正常纹理)渲染。
  • Points or Lines with NORMALbut without TANGENT attributes SHOULD be rendered with standard lighting but ignoring any normal textures on the material.具有NORMAL的点或行,但没有TANGENT属性,应使用标准照明呈现,但忽略材料上的任何正常纹理。
  • Points or Lines with no NORMALattribute SHOULD be rendered without lighting and instead use the sum of the base color value (as defined above, multiplied by COLOR_0 when present) and the emissive没有NORMAL属性的点或线应在没有照明的情况下渲染,而是使用基本颜色值的总和(如上所述,在存在时乘以COLOR_0)和发射值。

3.10. Cameras 3.10。相机 

3.10.1. Overview 3.10.1。概述 

Cameras are stored in the asset’s cameras array. Each camera defines a type property that designates the type of projection (perspective or orthographic), and either a perspective or orthographic property that defines the details. A camera is instantiated within a node using the node.camera property.相机存储在资产的cameras数组中。每个摄像机都定义了指定投影类型(透视图或正读)的type属性,以及a perspective或orthographic属性定义了详细信息。使用node.camera属性在节点内实例化相机。

A camera object defines the projection matrix that transforms scene coordinates from the view space to the clip space.相机对象定义了投影矩阵,该矩阵将场景从视图空间转换为剪辑空间。

A node containing the camera instance defines the view matrix that transforms scene coordinates from the global space to the view space.包含相机实例的节点定义了将场景坐标从全局空间转换为视图空间的视图矩阵。

3.10.2. View Matrix 3.10.2。查看矩阵 

The camera is defined such that the local +X axis is to the right, the “lens” looks towards the local -Z axis, and the top of the camera is aligned with the local +Y axis.定义了摄像机,以使局部 +X轴向右,“镜头”朝向局部-Z轴,并且相机的顶部与局部 +Y轴对齐。

The view matrix is derived from the global transform of the node containing the camera with the scaling ignored. If the node’s global transform is identity, the location of the camera is at the origin.视图矩阵源自包含摄像机的节点的全局变换,忽略了缩放尺度。如果节点的全局变换是身份,则相机的位置位于原点。

3.10.3. Projection Matrices 3.10.3。投影矩阵 

3.10.3.1. Overview 3.10.3.1。概述 

The projection can be perspective or orthographic.投影可以是透视图或拼字法。

There are two subtypes of perspective projections: finite and infinite. When the zfar property is undefined, the camera defines an infinite projection. Otherwise, the camera defines a finite projection.观点预测有两个亚型:有限和无限。当zfar属性不确定时,摄像机定义了无限投影。否则,摄像机定义了有限投影。

The following example defines two perspective cameras with supplied values for Y field of view, aspect ratio, and clipping information.以下示例定义了两个透视摄像机,其中提供了Y视野,宽高比和剪辑信息的值。

{

    "cameras": [

        {

            "name": "Finite perspective camera",

            "type": "perspective",

            "perspective": {

                "aspectRatio": 1.5,

                "yfov": 0.660593,

                "zfar": 100,

                "znear": 0.01

            }

        },

        {

            "name": "Infinite perspective camera",

            "type": "perspective",

            "perspective": {

                "aspectRatio": 1.5,

                "yfov": 0.660593,

                "znear": 0.01

            }

        }

    ]

}

Client implementations SHOULD use the following projection matrices.客户实现应使用以下投影矩阵。

3.10.3.2. Infinite perspective projection3.10.3.2。无限的观点投影

Let 让 

  • abe the aspect ratio (width over height) of the field of view, set by perspective.aspectRatio, or the aspect ratio of the viewport;a是视场的纵横比(高度上的宽度),由camera.perspective.aspectRatio设置,或视图的纵横比;
  • ybe the vertical field of view in radians, set by perspective.yfov;y是弧度的垂直视野,由camera.perspective.yfov设置;
  • nbe the distance to the near clipping plane, set by perspective.znear.n是距*剪辑*面的距离,由camera.perspective.znear设置。

Then, the projection matrix is defined as follows.然后,投影矩阵定义如下。

⎡⎣⎢⎢⎢⎢⎢1a×tan(0.5×y)×棕褐色(0.5×y)00001tan(0.5×y)棕褐色(0.5×y)0000−1  - 1 −1  - 1 00−2n -2 n 0⎤⎦⎥⎥⎥⎥⎥[1a×tan⁡(0.5×y)00001tan⁡(0.5×y)0000−1−2n00−10]

When the provided camera’s aspect ratio does not match the aspect ratio of the viewport, client implementations SHOULD NOT crop or perform non-uniform scaling (“stretching”) to fill the viewport.当提供的摄像头的纵横比与视口的纵横比不匹配时,客户实现不应裁剪或执行非均匀缩放(“伸展”)以填补视口。

3.10.3.3. Finite perspective projection3.10.3.3。有限的观点投影

Let 让 

  • abe the aspect ratio (width over height) of the field of view, set by perspective.aspectRatio, or the aspect ratio of the viewport;a是视场的纵横比(高度上的宽度),由camera.perspective.aspectRatio设置,或视图的纵横比;
  • ybe the vertical field of view in radians, set by perspective.yfov;y是弧度的垂直视野,由camera.perspective.yfov设置;
  • fbe the distance to the far clipping plane, set by perspective.zfar;f是距离camera.perspective.zfar设置的距离剪裁*面的距离;
  • nbe the distance to the near clipping plane, set by perspective.znear.n是距*剪辑*面的距离,由camera.perspective.znear设置。

Then, the projection matrix is defined as follows.然后,投影矩阵定义如下。

⎡⎣⎢⎢⎢⎢⎢⎢1a×tan(0.5×y)×棕褐色(0.5×y)00001tan(0.5×y)棕褐色(0.5×y)0000f+n F + n n−f n -f −1  - 1 002fn 2 f n n−f n -f 0⎤⎦⎥⎥⎥⎥⎥⎥[1a×tan⁡(0.5×y)00001tan⁡(0.5×y)0000f+nn−f2fnn−f00−10]

When the provided camera’s aspect ratio does not match the aspect ratio of the viewport, client implementations SHOULD NOT crop or perform non-uniform scaling (“stretching”) to fill the viewport.当提供的摄像头的纵横比与视口的纵横比不匹配时,客户实现不应裁剪或执行非均匀缩放(“伸展”)以填补视口。

3.10.3.4. Orthographic projection3.10.3.4。拼字图

Let 让 

  • rbe half the orthographic width, set by orthographic.xmag;r是拼字宽度的一半,由camera.orthographic.xmag设置;
  • tbe half the orthographic height, set by orthographic.ymag;t是拼字法的一半,由camera.orthographic.ymag设置;
  • fbe the distance to the far clipping plane, set by orthographic.zfar;f是距离camera.orthographic.zfar设置的距离剪裁*面的距离;
  • nbe the distance to the near clipping plane, set by orthographic.znear.n是距*剪辑*面的距离,由camera.orthographic.znear设置。

Then, the projection matrix is defined as follows.然后,投影矩阵定义如下。

⎡⎣⎢⎢⎢⎢⎢1r00001t00002n−f n -f 000f+n F + n n−f n -f 1⎤⎦⎥⎥⎥⎥⎥[1r00001t00002n−ff+nn−f0001]

When r / t does not match the aspect ratio of the viewport, client implementations SHOULD NOT crop or perform non-uniform scaling (“stretching”) to fill the viewport.当r / t与视口的纵横比不匹配时,客户实现不应裁剪或执行非均匀缩放(“伸展”)以填充视口。

3.11. Animations 3.11。动画 

glTF supports articulated and skinned animation via key frame animations of nodes' transforms. Key frame data is stored in buffers and referenced in animations using accessors.GLTF通过节点变换的关键框架动画支持铰接和皮肤动画。关键帧数据存储在缓冲区中,并在动画中使用登录器引用。

glTF 2.0 also supports animation of instantiated morph targets in a similar fashion.GLTF 2.0还以类似的方式支持实例化变形目标的动画。

 

Note 笔记 

glTF 2.0 only supports animating node transforms and morph target weights. Extensions or a future version of the specification may support animating arbitrary properties, such as material colors and texture transformation matrices.GLTF 2.0仅支持动画节点变换和变形目标权重。扩展或未来的规范版本可能支持动画任意属性,例如材料颜色和纹理转换矩阵。

 

Note 笔记 

glTF 2.0 defines only storage of animation keyframes, so this specification doesn’t define any runtime behavior, such as: order of playing, auto-start, loops, mapping of timelines, etc. When loading a glTF 2.0 asset, client implementations may select an animation entry and pause it on the first frame, play it automatically, or ignore all animations until further user requests. When a playing animation is stopped, client implementations may reset the scene to the initial state or freeze it at the current frame.GLTF 2.0仅定义动画键框的存储,因此该规范无法定义任何运行时行为,例如:播放顺序,自动启动,循环,时间表等。当加载GLTF 2.0资产时,客户端实现可能会选择动画输入并在第一个框架上播放,或者在第一个框架上播放,或者忽略所有动画。停止演奏动画时,客户端实现可能会将场景重置为初始状态或在当前帧中冻结。

 

 

Implementation Note 实施注释 

glTF 2.0 does not specifically define how an animation will be used when imported but, as a best practice, it is recommended that each animation is self-contained as an action. For example, “Walk” and “Run” animations might each contain multiple channels targeting a model’s various bones. The client implementation may choose when to play any of the available animations.GLTF 2.0并未明确定义如何在导入时如何使用动画,但是作为最佳实践,建议每个动画都作为一个动作进行独立。例如,“步行”和“运行”动画可能每个都包含针对模型各种骨头的多个通道。客户实现可以选择何时播放任何可用动画。

All animations are stored in the animations array of the asset. An animation is defined as a set of channels (the channels property) and a set of samplers that specify accessors with key frame data and interpolation method (the samplers property).所有动画都存储在资产的animations中。动画定义为一组通道(channels属性)和一组采样器,这些采样器用关键帧数据和插值方法(samplers属性)指定访问者。

The following examples show the expected usage of animations.以下示例显示了动画的预期用法。

{

    "animations": [

        {

            "name": "Animate all properties of one node with different samplers",

            "channels": [

                {

                    "sampler": 0,

                    "target": {

                        "node": 1,

                        "path": "rotation"

                    }

                },

                {

                    "sampler": 1,

                    "target": {

                        "node": 1,

                        "path": "scale"

                    }

                },

                {

                    "sampler": 2,

                    "target": {

                        "node": 1,

                        "path": "translation"

                    }

                }

            ],

            "samplers": [

                {

                    "input": 4,

                    "interpolation": "LINEAR",

                    "output": 5

                },

                {

                    "input": 4,

                    "interpolation": "LINEAR",

                    "output": 6

                },

                {

                    "input": 4,

                    "interpolation": "LINEAR",

                    "output": 7

                }

            ]

        },

        {

            "name": "Animate two nodes with different samplers",

            "channels": [

                {

                    "sampler": 0,

                    "target": {

                        "node": 0,

                        "path": "rotation"

                    }

                },

                {

                    "sampler": 1,

                    "target": {

                        "node": 1,

                        "path": "rotation"

                    }

                }

            ],

            "samplers": [

                {

                    "input": 0,

                    "interpolation": "LINEAR",

                    "output": 1

                },

                {

                    "input": 2,

                    "interpolation": "LINEAR",

                    "output": 3

                }

            ]

        },

        {

            "name": "Animate two nodes with the same sampler",

            "channels": [

                {

                    "sampler": 0,

                    "target": {

                        "node": 0,

                        "path": "rotation"

                    }

                },

                {

                    "sampler": 0,

                    "target": {

                        "node": 1,

                        "path": "rotation"

                    }

                }

            ],

            "samplers": [

                {

                    "input": 0,

                    "interpolation": "LINEAR",

                    "output": 1

                }

            ]

        },

        {

            "name": "Animate a node rotation channel and the weights of a Morph Target it instantiates",

            "channels": [

                {

                    "sampler": 0,

                    "target": {

                        "node": 1,

                        "path": "rotation"

                    }

                },

                {

                    "sampler": 1,

                    "target": {

                        "node": 1,

                        "path": "weights"

                    }

                }

            ],

            "samplers": [

                {

                    "input": 4,

                    "interpolation": "LINEAR",

                    "output": 5

                },

                {

                    "input": 4,

                    "interpolation": "LINEAR",

                    "output": 6

                }

            ]

        }

    ]

}

Channels connect the output values of the key frame animation to a specific node in the hierarchy. A channel’s sampler property contains the index of one of the samplers present in the containing animation’s samplers array. The target property is an object that identifies which node to animate using its node property, and which property of the node to animate using path. Non-animated properties MUST keep their values during animation.通道将关键帧动画的输出值连接到层次结构中的特定节点。通道的sampler属性包含包含动画的<b1>> </b1>数组中的一个采样器的索引。 target属性是一个对象,它标识了使用其node属性动画的节点,以及使用path动画节点的属性。在动画过程中,未取消属性必须保持其价值。

When node isn’t defined, channel SHOULD be ignored. Valid path names are "translation", "rotation", "scale", and "weights".当未定义node时,应忽略频道。有效的路径名是"translation","rotation","scale"和"weights"。

Nodes that do not contain a mesh with morph targets MUST NOT be targeted with "weights" path.不包含带有变形靶标的网格的节点不得用"weights"路径靶向。

Within one animation, each target (a combination of a node and a path) MUST NOT be used more than once.在一个动画中,每个目标(节点和路径的组合)不得多次使用。

 

Implementation Note 实施注释 

This prevents potential ambiguities when one target is affected by two or more overlapping samplers.当一个目标受两个或多个重叠的采样器影响时,这可以防止潜在的歧义。

Each of the animation’s samplers defines the input/output pair: a set of floating-point scalar values representing linear time in seconds; and a set of vectors or scalars representing the animated property. All values are stored in a buffer and accessed via accessors; refer to the table below for output accessor types. Interpolation between keys is performed using the interpolation method specified in the interpolation property. Supported interpolation values include LINEAR, STEP, and CUBICSPLINE. See Appendix C for additional information about interpolation modes.动画的每个采样器都定义input/output对:一组浮点标量值,代表以秒为单位的线性时间;以及一组代表动画属性的向量或标量。所有值都存储在缓冲区中,并通过登录器访问;请参阅下表以获取输出访问者类型。使用<b2>> </b2>属性中指定的插值方法进行键之间的插值。支持的interpolation值包括LINEAR,STEP和CUBICSPLINE。有关插值模式的其他信息,请参见附录C。

The inputs of each sampler are relative to t = 0, defined as the beginning of the parent animations entry. Before and after the provided input range, output MUST be clamped to the nearest end of the input range.每个采样器的输入相对于t = 0,定义为父animations条目的开头。在提供的输入范围之前和之后,必须将输出夹紧到输入范围的最*端。

 

Implementation Note 实施注释 

For example, if the earliest sampler input for an animation is t = 10, a client implementation must begin playback of that animation channel at t = 0 with output clamped to the first available output value.例如,如果动画的最早采样器输入为t = 10,则客户实现必须在<b1>> </b1>上开始播放该动画频道,输出夹紧到第一个可用的输出值。

Samplers within a given animation MAY have different inputs.给定动画中的采样器可能具有不同的输入。

channel.path

Accessor Type 登录类型 

Component Type(s) 组件类型 

Description 描述 

"translation"

"VEC3"

float 漂浮 

XYZ translation vector XYZ翻译矢量 

"rotation"

"VEC4"

float漂浮
signed byte normalized签名字节归一化
unsigned byte normalized未签名的字节归一化
signed short normalized签名短期归一化
unsigned short normalized未签名的短期归一化

XYZW rotation quaternion XYZW旋转四元基因 

"scale"

"VEC3"

float 漂浮 

XYZ scale vector XYZ量表向量 

"weights"

"SCALAR"

float漂浮
signed byte normalized签名字节归一化
unsigned byte normalized未签名的字节归一化
signed short normalized签名短期归一化
unsigned short normalized未签名的短期归一化

Weights of morph targets 变体靶标 

Implementations MUST use following equations to decode real floating-point value f from a normalized integer c and vise-versa:实现必须使用以下方程式来解码实际浮点值f从归一化整数c和Vise-versa:

accessor.componentType

int-to-float int-to-loplat 

float-to-int 浮动到印度 

signed byte 签名字节 

f = max(c / 127.0, -1.0)

c = round(f * 127.0)

unsigned byte 未签名的字节 

f = c / 255.0

c = round(f * 255.0)

signed short 签名 

f = max(c / 32767.0, -1.0)

c = round(f * 32767.0)

unsigned short 未签名的短 

f = c / 65535.0

c = round(f * 65535.0)

Animation sampler’s input accessor MUST have its min and max properties defined.动画采样器的input访问者必须具有定义的min </b1> </b2> </b2>属性。

 

Implementation Note 实施注释 

Animations with non-linear time inputs, such as time warps in Autodesk 3ds Max or Maya, are not directly representable with glTF animations. glTF is a runtime format and non-linear time inputs are expensive to compute at runtime. Exporter implementations should sample a non-linear time animation into linear inputs and outputs for an accurate representation.具有非线性时间输入的动画,例如Autodesk 3ds Max或Maya中的时间扭曲,与GLTF动画无法直接表示。 GLTF是一种运行时格式,非线性时间输入在运行时计算昂贵。出口商的实现应将非线性时间动画采样到线性输入和输出以进行准确表示。

A morph target animation frame is defined by a sequence of scalars of length equal to the number of targets in the animated morph target. These scalar sequences MUST lie end-to-end as a single stream in the output accessor, whose final size is equal to the number of morph targets times the number of animation frames.变体目标动画框架由一系列长度标量序列定义,等于动画变形目标中的目标数量。这些标量序列必须端到端作为输出登录器中的单个流,其最终大小等于动画帧的数量乘以变形目标的数量。

Morph target animation is by nature sparse, consider using Sparse Accessors for storage of morph target animation. When used with CUBICSPLINE interpolation, tangents (ak, bk) and values (vk) are grouped within keyframes:天然目标动画本质上是稀疏的,请考虑使用稀疏的访问器来存储变形目标动画。当与CUBICSPLINE插值一起使用时,切线(a k,b k)和值(v k)分组:

a1,a2,…​an,v1,v2,…​vn,b1,b2,…​bn1,A 2,…a n,V 1,V 2,…V n,B <b6> 1 </b6> </b6>,B7> <b7> 2 </b7>,…B <b8> n </b8>

See Appendix C for additional information about interpolation modes.有关插值模式的其他信息,请参见附录C。

Skinned animation is achieved by animating the joints in the skin’s joint hierarchy.皮肤动画是通过对皮肤关节层次结构中的关节进行动画动画来实现的。

3.12. Specifying Extensions 3.12。指定扩展 

glTF defines an extension mechanism that allows the base format to be extended with new capabilities. Any glTF object MAY have an optional extensions property, as in the following example:GLTF定义了一种扩展机制,该机制允许使用新功能扩展基本格式。任何GLTF对象都可以具有可选的extensions属性,如以下示例:

{

    "material": [

        {

            "extensions": {

                "KHR_materials_sheen": {

                    "sheenColorFactor": [

                        1.0,

                        0.329,

                        0.1

                    ],

                    "sheenRoughnessFactor": 0.8

                }

            }

        }

    ]

}

All extensions used in a glTF asset MUST be listed in the top-level extensionsUsed array object, e.g.,GLTF资产中使用的所有扩展名必须列在顶级extensionsUsed数组对象中,例如

{

    "extensionsUsed": [

        "KHR_materials_sheen",

        "VENDOR_physics"

    ]

}

All glTF extensions required to load and/or render an asset MUST be listed in the top-level extensionsRequired array, e.g.,加载和/或渲染所需的所有GLTF扩展必须在顶级extensionsRequired数组中列出,例如

{

    "extensionsRequired": [

        "KHR_texture_transform"

    ],

    "extensionsUsed": [

        "KHR_texture_transform"

    ]

}

extensionsRequired is a subset of extensionsUsed. All values in extensionsRequired MUST also exist in extensionsUsed.extensionsRequired是<b1>> </b1>的子集。 extensionsRequired中的所有值也必须存在于extensionsUsed中。

  1. GLB File Format Specification4。GLB文件格式规范

4.1. General (Informative) 4.1。一般(信息丰富) 

glTF provides two delivery options that can be used together:GLTF提供了两个可以一起使用的交付选项:

  • glTF JSON points to external binary data (geometry, key frames, skins), and images.GLTF JSON指向外部二进制数据(几何,关键帧,皮肤)和图像。
  • glTF JSON embeds base64-encoded binary data, and images inline using data URIs.GLTF JSON嵌入了基本64编码的二进制数据,并使用数据URI在线图像。

Hence, loading glTF files usually requires either separate requests to fetch all binary data, or extra space due to base64-encoding. Base64-encoding requires extra processing to decode and increases the file size (by ~33% for encoded resources). While transport-layer gzip mitigates the file size increase, decompression and decoding still add significant loading time.因此,加载GLTF文件通常需要单独的请求才能获取所有二进制数据,或者由于base64编码而引起的额外空间。 BASE64编码需要额外的处理来解码并增加文件大小(编码资源对于编码资源的大约33%)。尽管运输层GZIP减轻文件大小的增加,但解压缩和解码仍然增加了大量加载时间。

To avoid this file size and processing overhead, a container format, Binary glTF is introduced that enables a glTF asset, including JSON, buffers, and images, to be stored in a single binary blob.为了避免使用此文件大小和处理开销,引入了容器格式,二进制GLTF允许将GLTF资产(包括JSON,Buffer和Images)存储在单个二进制BLOB中。

A Binary glTF asset can still refer to external resources. For example, an application that wants to keep images as separate files may embed everything needed for a scene, except images, in a Binary glTF.二进制GLTF资产仍然可以参考外部资源。例如,想要将图像保存为单独文件的应用程序可以嵌入场景所需的所有内容,除了图像以外的二进制GLTF中。

4.2. Structure 4.2。结构 

A Binary glTF (which can be a file, for example) has the following structure:二进制GLTF(例如,可以是文件)具有以下结构:

  • A 12-byte preamble, called the header.一个12字节的序言,称为标题。
  • One or more chunksthat contain JSON content and binary data.一个或多个包含JSON内容和二进制数据的块。

The chunk containing JSON MAY refer to external resources as usual, and MAY also reference resources stored within other chunks.包含JSON的块可以像往常一样将外部资源称为外部资源,并且还可以参考存储在其他块中的资源。

4.3. File Extension & Media Type4.3。文件扩展和媒体类型

The file extension to be used with Binary glTF is .glb.与二进制GLTF一起使用的文件扩展名是.glb。

The registered media type is model/gltf-binary.注册媒体类型为model/gltf-binary。

4.4. Binary glTF Layout 4.4。二进制GLTF布局 

4.4.1. Overview 4.4.1。概述 

Binary glTF is little endian. The figure below shows an example of a Binary glTF asset.二进制GLTF是小末日。下图显示了二进制GLTF资产的示例。

Figure 8. Binary glTF Layout图8。二进制GLTF布局

The following sections describe the structure more in detail.以下各节更详细地描述了结构。

4.4.2. Header 4.4.2。标题 

The 12-byte header consists of three 4-byte entries:12个字节的标题由三个4字节条目组成:

uint32 magic

uint32 version

uint32 length

  • magicMUST be equal to equal 0x46546C67. It is ASCII string glTF and can be used to identify data as Binary glTF.magic必须等于0x46546C67。它是ASCII字符串glTF,可用于将数据识别为二进制GLTF。
  • versionindicates the version of the Binary glTF container format. This specification defines version 2.version指示二进制GLTF容器格式的版本。该规范定义了版本2。

Client implementations that load GLB format MUST also check for the asset version properties in the JSON chunk, as the version specified in the GLB header only refers to the GLB container version.加载GLB格式的客户端实现还必须检查JSON块中的资产版本属性,因为GLB标头中指定的版本仅指GLB容器版本。

  • lengthis the total length of the Binary glTF, including header and all chunks, in bytes.length是二进制GLTF的总长度,包括标题和所有块,字节。

4.4.3. Chunks 4.4.3。块 

4.4.3.1. Overview 4.4.3.1。概述 

Each chunk has the following structure:每个块都有以下结构:

uint32 chunkLength

uint32 chunkType

ubyte[] chunkData

  • chunkLengthis the length of chunkData, in bytes.chunkLength是字节中的chunkData的长度。
  • chunkTypeindicates the type of chunk. See Table 1 for details.chunkType指示块的类型。有关详细信息,请参见表1。
  • chunkDatais the binary payload of the chunk.chunkData是块的二进制有效载荷。

The start and the end of each chunk MUST be aligned to a 4-byte boundary. See chunks definitions for padding schemes. Chunks MUST appear in exactly the order given in Table 1.每个块的开始和末端必须对齐到一个4字节边界。请参阅填充方案的块定义。块必须以表1中给出的顺序出现。

Table 1. Chunk types 表1。块类型 

 

Chunk Type 块类型 

ASCII ASCII 

Description 描述 

Occurrences 发生 

1. 1。 

0x4E4F534A 0x4e4f534a 

JSON JSON 

Structured JSON content 结构化的JSON内容 

1

2. 2。 

0x004E4942 0x004E4942 

BIN 垃圾桶 

Binary buffer 二进制缓冲区 

0 or 1 0或1 

Client implementations MUST ignore chunks with unknown types to enable glTF extensions to reference additional chunks with new types following the first two chunks.客户实现必须忽略具有未知类型的块,以使GLTF扩展名在前两个块之后引用具有新类型的其他块。

4.4.3.2. Structured JSON Content4.4.3.2。结构化的JSON内容

This chunk holds the glTF JSON, as it would be provided within a .gltf file.该块保存着GLTF JSON,因为它将在.GLTF文件中提供。

 

ECMAScript Implementation Note ECMAScript实施注释 

In a JavaScript implementation, the TextDecoder API can be used to extract the glTF content from the ArrayBuffer, and then the JSON can be parsed with JSON.parse as usual.在JavaScript实现中,TextDecoder API可用于从ArrayBuffer中提取GLTF内容,然后像往常一样用JSON.parse对JSON进行解析。

This chunk MUST be the very first chunk of a Binary glTF asset. By reading this chunk first, an implementation is able to progressively retrieve resources from subsequent chunks. This way, it is also possible to read only a selected subset of resources from a Binary glTF asset.这块必须是二进制GLTF资产的第一部分。通过首先阅读此块,实现能够从随后的块中逐步检索资源。这样,也可以仅从二进制GLTF资产中读取选定的资源子集。

This chunk MUST be padded with trailing Space chars (0x20) to satisfy alignment requirements.该块必须用尾随Space chars(0x20)填充,以满足对齐要求。

4.4.3.3. Binary buffer 4.4.3.3。二进制缓冲区 

This chunk contains the binary payload for geometry, animation key frames, skins, and images. See GLB-stored Buffer for details on referencing this chunk from JSON.该块包含几何形状,动画键帧,皮肤和图像的二进制有效载荷。有关引用JSON的此块的详细信息,请参见GLB存储的缓冲区。

This chunk MUST be the second chunk of the Binary glTF asset.这个块必须是二进制GLTF资产的第二部分。

This chunk MUST be padded with trailing zeros (0x00) to satisfy alignment requirements.该块必须用尾随的零(0x00)填充,以满足对齐要求。

When the binary buffer is empty or when it is stored by other means, this chunk SHOULD be omitted.当二进制缓冲区为空或用其他方式存储时,应省略此块。

  1. Properties Reference 5。属性参考

 

5.1. Accessor 5.1。登录器 

A typed view into a buffer view that contains raw binary data.输入的视图中包含原始二进制数据的缓冲区视图。

Table 2. Accessor Properties表2。Accessor属性

 

Type 类型 

Description 描述 

Required 必需的 

bufferView Bufferview 

integer

The index of the bufferView.Bufferview的索引。

No 不 

byteOffset 字节offset 

integer

The offset relative to the start of the buffer view in bytes.相对于字节中的缓冲区视图开始的偏移。

No, default:  不,默认值:0。 0

componentType 组成型 

integer

The datatype of the accessor’s components.登录组件的数据类型。

 Yes 是的 

normalized 归一化 

boolean

Specifies whether integer data values are normalized before usage.指定在使用之前是否将整数数据值归一化。

No, default:  不,默认值:false。 false

count 数数 

integer

The number of elements referenced by this accessor.此登录器引用的元素数量。

 Yes 是的 

type 类型 

string

Specifies if the accessor’s elements are scalars, vectors, or matrices.指定登录器的元素是标量,向量或矩阵。

 Yes 是的 

max 最大限度 

number [1-16]

Maximum value of each component in this accessor.此登录器中每个组件的最大值。

No 不 

min 最小 

number [1-16]

Minimum value of each component in this accessor.此登录器中每个组件的最小值。

No 不 

sparse 疏 

accessor.sparse

Sparse storage of elements that deviate from their initialization value.稀疏的元素偏离初始化值的存储。

No 不 

name 姓名 

string

The user-defined name of this object.此对象的用户定义名称。

No 不 

extensions 扩展 

extension

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

No 不 

extras 额外 

extras

Application-specific data. 特定于应用程序的数据。 

No 不 

Additional properties are allowed.允许其他属性。

  • JSON schemaschema.jsonJSON模式:accessor.schema.json。 

5.1.1. accessor.bufferView 5.1.1。 consector.bufferview 

The index of the buffer view. When undefined, the accessor MUST be initialized with zeros; sparse property or extensions MAY override zeros with actual values.缓冲区视图的索引。如果未定义,则必须使用零来初始化登录器; sparse属性或扩展可以覆盖具有实际值的零。

  • Type: integer类型:integer。 
  • Required: No 必需:否
  • Minimum: >= 0最低:>= 0。 

5.1.2. accessor.byteOffset 5.1.2。 consector.byteoffset 

The offset relative to the start of the buffer view in bytes. This MUST be a multiple of the size of the component datatype. This property MUST NOT be defined when bufferView is undefined.相对于字节中的缓冲区视图开始的偏移。这必须是组件数据类型大小的倍数。当bufferView未定义时,不得定义此属性。

  • Type: integer类型:integer。 
  • Required: No, default: 0必需:否,默认值:0。 
  • Minimum: >= 0最低:>= 0。 
  • Related WebGL functions: vertexAttribPointer()offset parameter相关的WebGL功能:vertexAttribPointer()偏移参数

5.1.3. accessor.componentType 5.1.3。 consector.componentType 

The datatype of the accessor’s components. UNSIGNED_INT type MUST NOT be used for any accessor that is not referenced by mesh.primitive.indices.登录组件的数据类型。 unsigned_int类型不得用于mesh.primitive.indices未引用的任何访问者。

  • Type: integer类型:integer。 
  • Required:  Yes必需:是的
  • Allowed values: 允许的值:
    • 5120BYTE 5120字节 
    • 5121UNSIGNED_BYTE 5121 unsigned_byte 
    • 5122SHORT 5122短 
    • 5123UNSIGNED_SHORT 5123 unsigned_short 
    • 5125UNSIGNED_INT 5125 unsigned_int 
    • 5126FLOAT 5126浮点 
  • Related WebGL functions: typeparameter of vertexAttribPointer(). The corresponding typed arrays are Int8Array, Uint8Array, Int16Array, Uint16Array, Uint32Array, and Float32Array.相关的WebGL功能:type <b1>> </b1>的参数。相应的键入数组为Int8Array,Uint8Array,Int16Array,Uint16Array,Uint32Array </b6>和Float32Array。

5.1.4. accessor.normalized 5.1.4。登录器 

Specifies whether integer data values are normalized (true) to [0, 1] (for unsigned types) or to [-1, 1] (for signed types) when they are accessed. This property MUST NOT be set to true for accessors with FLOAT or UNSIGNED_INT component type.指定整数数据值是标准化(true)为[0,1](对于未签名类型)还是[-1,1](对于签名类型)。对于具有FLOAT或UNSIGNED_INT组件类型的配件,不得将此属性设置为true。

  • Type: boolean类型:boolean。 
  • Required: No, default: false必需:否,默认值:false。 
  • Related WebGL functions: normalizedparameter of vertexAttribPointer()相关的WebGL功能:normalized <b1>> </b1>的参数。

5.1.5. accessor.count 5.1.5。登录器 

The number of elements referenced by this accessor, not to be confused with the number of bytes or number of components.该登录器引用的元素数量,不要与字节数或组件数量混淆。

  • Type: integer类型:integer。 
  • Required:  Yes必需:是的
  • Minimum: >= 1最低:>= 1。 

5.1.6. accessor.type 5.1.6。 consector.type 

Specifies if the accessor’s elements are scalars, vectors, or matrices.指定登录器的元素是标量,向量或矩阵。

  • Type: string类型:string。 
  • Required:  Yes必需:是的
  • Allowed values: 允许的值:
    • "SCALAR"
    • "VEC2"
    • "VEC3"
    • "VEC4"
    • "MAT2"
    • "MAT3"
    • "MAT4"

5.1.7. accessor.max 5.1.7。 consector.max 

Maximum value of each component in this accessor. Array elements MUST be treated as having the same data type as accessor’s componentType. Both min and max arrays have the same length. The length is determined by the value of the type property; it can be 1, 2, 3, 4, 9, or 16.此登录器中每个组件的最大值。数组元素必须被视为具有与登录器componentType相同的数据类型。 min和max数组的长度相同。长度由type属性的值确定;可以是1、2、3、4、9或16。

normalized property has no effect on array values: they always correspond to the actual values stored in the buffer. When the accessor is sparse, this property MUST contain maximum values of accessor data with sparse substitution applied.normalized属性对数组值没有影响:它们始终与存储在缓冲区中的实际值相对应。当登录器稀疏时,此属性必须包含具有稀疏替代的访问器数据的最大值。

  • Type: number[1-16] 类型:number [1-16]。 
  • Required: No 必需:否

5.1.8. accessor.min 5.1.8。 conscontor.min 

Minimum value of each component in this accessor. Array elements MUST be treated as having the same data type as accessor’s componentType. Both min and max arrays have the same length. The length is determined by the value of the type property; it can be 1, 2, 3, 4, 9, or 16.此登录器中每个组件的最小值。数组元素必须被视为具有与登录器componentType相同的数据类型。 min和max数组的长度相同。长度由type属性的值确定;可以是1、2、3、4、9或16。

normalized property has no effect on array values: they always correspond to the actual values stored in the buffer. When the accessor is sparse, this property MUST contain minimum values of accessor data with sparse substitution applied.normalized属性对数组值没有影响:它们始终与存储在缓冲区中的实际值相对应。当登录器稀疏时,此属性必须包含具有稀疏替代的访问器数据的最小值。

  • Type: number[1-16] 类型:number [1-16]。 
  • Required: No 必需:否

5.1.9. accessor.sparse 5.1.9。 consector.sparse 

Sparse storage of elements that deviate from their initialization value.稀疏的元素偏离初始化值的存储。

  • Typesparse类型:accessor.sparse。 
  • Required: No 必需:否

5.1.10. accessor.name 5.1.10。登录器。名称 

The user-defined name of this object. This is not necessarily unique, e.g., an accessor and a buffer could have the same name, or two accessors could even have the same name.此对象的用户定义名称。这不一定是唯一的,例如,登录器和一个缓冲区可以具有相同的名称,或者两个访问者甚至可以具有相同的名称。

  • Type: string类型:string。 
  • Required: No 必需:否

5.1.11. accessor.extensions 5.1.11。 consector.extensions 

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

  • Typeextension类型:extension。 
  • Required: No 必需:否
  • Type of each property: Extension每个属性的类型:扩展

5.1.12. accessor.extras 5.1.12。 consector.extras 

Application-specific data. 特定于应用程序的数据。 

  • Typeextras类型:extras。 
  • Required: No 必需:否

 

5.2. Accessor Sparse 5.2。登录器稀疏 

Sparse storage of accessor values that deviate from their initialization value.稀疏的访问者值偏离其初始化值。

Table 3. Accessor Sparse Properties表3。Accessor Sparse属性

 

Type 类型 

Description 描述 

Required 必需的 

count 数数 

integer

Number of deviating accessor values stored in the sparse array.存储在稀疏数组中的偏离登录值的数量。

 Yes 是的 

indices 指数 

accessor.sparse.indices

An object pointing to a buffer view containing the indices of deviating accessor values. The number of indices is equal to count. Indices MUST strictly increase.一个指向缓冲视图的对象,该视图包含偏离登录器值的索引。索引数量等于count。指数必须严格增加。

 Yes 是的 

values 值 

accessor.sparse.values

An object pointing to a buffer view containing the deviating accessor values.指向包含偏差登录器值的缓冲区视图的对象。

 Yes 是的 

extensions 扩展 

extension

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

No 不 

extras 额外 

extras

Application-specific data. 特定于应用程序的数据。 

No 不 

Additional properties are allowed.允许其他属性。

5.2.1. accessor.sparse.count 5.2.1。 consector.sparse.count 

Number of deviating accessor values stored in the sparse array.存储在稀疏数组中的偏离登录值的数量。

  • Type: integer类型:integer。 
  • Required:  Yes必需:是的
  • Minimum: >= 1最低:>= 1。 

5.2.2. accessor.sparse.indices 5.2.2。 consector.sparse.indices 

An object pointing to a buffer view containing the indices of deviating accessor values. The number of indices is equal to count. Indices MUST strictly increase.一个指向缓冲视图的对象,该视图包含偏离登录器值的索引。索引数量等于count。指数必须严格增加。

  • Typesparse.indices类型:accessor.sparse.indices。 
  • Required:  Yes必需:是的

5.2.3. accessor.sparse.values 5.2.3。 consector.sparse.values 

An object pointing to a buffer view containing the deviating accessor values.指向包含偏差登录器值的缓冲区视图的对象。

  • Typesparse.values类型:accessor.sparse.values。 
  • Required:  Yes必需:是的

5.2.4. accessor.sparse.extensions5.2.4。 consector.sparse.extensions

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

  • Typeextension类型:extension。 
  • Required: No 必需:否
  • Type of each property: Extension每个属性的类型:扩展

5.2.5. accessor.sparse.extras 5.2.5。 consector.sparse.extras 

Application-specific data. 特定于应用程序的数据。 

  • Typeextras类型:extras。 
  • Required: No 必需:否

 

5.3. Accessor Sparse Indices 5.3。 Accessor Sparse Indices 

An object pointing to a buffer view containing the indices of deviating accessor values. The number of indices is equal to accessor.sparse.count. Indices MUST strictly increase.一个指向缓冲视图的对象,该视图包含偏离登录器值的索引。索引数量等于accessor.sparse.count。指数必须严格增加。

Table 4. Accessor Sparse Indices Properties表4。Accessor Sparse Indices属性

 

Type 类型 

Description 描述 

Required 必需的 

bufferView Bufferview 

integer

The index of the buffer view with sparse indices. The referenced buffer view MUST NOT have its target or byteStride properties defined. The buffer view and the optional byteOffset MUST be aligned to the componentType byte length.带有稀疏索引的缓冲区视图的索引。引用的缓冲区视图不得具有定义的target或byteStride属性。缓冲区视图和可选的byteOffset必须与componentType字节长度对齐。

 Yes 是的 

byteOffset 字节offset 

integer

The offset relative to the start of the buffer view in bytes.相对于字节中的缓冲区视图开始的偏移。

No, default:  不,默认值:0。 0

componentType 组成型 

integer

The indices data type. 指数数据类型。 

 Yes 是的 

extensions 扩展 

extension

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

No 不 

extras 额外 

extras

Application-specific data. 特定于应用程序的数据。 

No 不 

Additional properties are allowed.允许其他属性。

5.3.1. accessor.sparse.indices.bufferView5.3.1。 consector.sparse.indices.bufferview

The index of the buffer view with sparse indices. The referenced buffer view MUST NOT have its target or byteStride properties defined. The buffer view and the optional byteOffset MUST be aligned to the componentType byte length.带有稀疏索引的缓冲区视图的索引。引用的缓冲区视图不得具有定义的target或byteStride属性。缓冲区视图和可选的byteOffset必须与componentType字节长度对齐。

  • Type: integer类型:integer。 
  • Required:  Yes必需:是的
  • Minimum: >= 0最低:>= 0。 

5.3.2. accessor.sparse.indices.byteOffset5.3.2。 consector.sparse.indices.byteoffset

The offset relative to the start of the buffer view in bytes.相对于字节中的缓冲区视图开始的偏移。

  • Type: integer类型:integer。 
  • Required: No, default: 0必需:否,默认值:0。 
  • Minimum: >= 0最低:>= 0。 

5.3.3. accessor.sparse.indices.componentType5.3.3。 consector.sparse.indices.componentType

The indices data type. 指数数据类型。 

  • Type: integer类型:integer。 
  • Required:  Yes必需:是的
  • Allowed values: 允许的值:
    • 5121UNSIGNED_BYTE 5121 unsigned_byte 
    • 5123UNSIGNED_SHORT 5123 unsigned_short 
    • 5125UNSIGNED_INT 5125 unsigned_int 

5.3.4. accessor.sparse.indices.extensions5.3.4。 consector.sparse.indices.extensions

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

  • Typeextension类型:extension。 
  • Required: No 必需:否
  • Type of each property: Extension每个属性的类型:扩展

5.3.5. accessor.sparse.indices.extras5.3.5。 consector.sparse.indices.extras

Application-specific data. 特定于应用程序的数据。 

  • Typeextras类型:extras。 
  • Required: No 必需:否

 

5.4. Accessor Sparse Values 5.4。登录器稀疏值 

An object pointing to a buffer view containing the deviating accessor values. The number of elements is equal to accessor.sparse.count times number of components. The elements have the same component type as the base accessor. The elements are tightly packed. Data MUST be aligned following the same rules as the base accessor.指向包含偏差登录器值的缓冲区视图的对象。元素的数量等于accessor.sparse.count组件的数量。元素具有与基本登录器相同的组件类型。这些元素被紧密包装。数据必须按照与基本登录器相同的规则对齐。

Table 5. Accessor Sparse Values Properties表5。Accessor Sparse Values属性

 

Type 类型 

Description 描述 

Required 必需的 

bufferView Bufferview 

integer

The index of the bufferView with sparse values. The referenced buffer view MUST NOT have its target or byteStride properties defined.带有稀疏值的Bufferview的索引。引用的缓冲区视图不得具有定义的target或byteStride属性。

 Yes 是的 

byteOffset 字节offset 

integer

The offset relative to the start of the bufferView in bytes.相对于Bufferview在字节中的开始的偏移。

No, default:  不,默认值:0。 0

extensions 扩展 

extension

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

No 不 

extras 额外 

extras

Application-specific data. 特定于应用程序的数据。 

No 不 

Additional properties are allowed.允许其他属性。

5.4.1. accessor.sparse.values.bufferView5.4.1。 consector.sparse.values.bufferview

The index of the bufferView with sparse values. The referenced buffer view MUST NOT have its target or byteStride properties defined.带有稀疏值的Bufferview的索引。引用的缓冲区视图不得具有定义的target或byteStride属性。

  • Type: integer类型:integer。 
  • Required:  Yes必需:是的
  • Minimum: >= 0最低:>= 0。 

5.4.2. accessor.sparse.values.byteOffset5.4.2。 consector.sparse.values.byteoffset

The offset relative to the start of the bufferView in bytes.相对于Bufferview在字节中的开始的偏移。

  • Type: integer类型:integer。 
  • Required: No, default: 0必需:否,默认值:0。 
  • Minimum: >= 0最低:>= 0。 

5.4.3. accessor.sparse.values.extensions5.4.3。 consector.sparse.values.extensions

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

  • Typeextension类型:extension。 
  • Required: No 必需:否
  • Type of each property: Extension每个属性的类型:扩展

5.4.4. accessor.sparse.values.extras5.4.4。 consector.sparse.values.extras

Application-specific data. 特定于应用程序的数据。 

  • Typeextras类型:extras。 
  • Required: No 必需:否

 

5.5. Animation 5.5。动画片 

A keyframe animation. 关键帧动画。 

Table 6. Animation Properties表6。Animation属性

 

Type 类型 

Description 描述 

Required 必需的 

channels 频道 

animation.channel [1-*]

An array of animation channels. An animation channel combines an animation sampler with a target property being animated. Different channels of the same animation MUST NOT have the same targets.一系列动画频道。动画频道将动画采样器与动画的目标属性相结合。同一动画的不同频道不得具有相同的目标。

 Yes 是的 

samplers 采样器 

animation.sampler [1-*]

An array of animation samplers. An animation sampler combines timestamps with a sequence of output values and defines an interpolation algorithm.一系列动画采样器。动画采样器将时间戳与一系列输出值结合并定义了插值算法。

 Yes 是的 

name 姓名 

string

The user-defined name of this object.此对象的用户定义名称。

No 不 

extensions 扩展 

extension

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

No 不 

extras 额外 

extras

Application-specific data. 特定于应用程序的数据。 

No 不 

Additional properties are allowed.允许其他属性。

  • JSON schemaschema.jsonJSON模式:animation.schema.json。 

5.5.1. animation.channels 5.5.1。动画。通道 

An array of animation channels. An animation channel combines an animation sampler with a target property being animated. Different channels of the same animation MUST NOT have the same targets.一系列动画频道。动画频道将动画采样器与动画的目标属性相结合。同一动画的不同频道不得具有相同的目标。

  • Typechannel[1-*] 类型:animation.channel [1-*]。 
  • Required:  Yes必需:是的

5.5.2. animation.samplers 5.5.2。 animation.samplers 

An array of animation samplers. An animation sampler combines timestamps with a sequence of output values and defines an interpolation algorithm.一系列动画采样器。动画采样器将时间戳与一系列输出值结合并定义了插值算法。

  • Typesampler[1-*] 类型:animation.sampler [1-*]。 
  • Required:  Yes必需:是的

5.5.3. animation.name 5.5.3。 animation.name 

The user-defined name of this object. This is not necessarily unique, e.g., an accessor and a buffer could have the same name, or two accessors could even have the same name.此对象的用户定义名称。这不一定是唯一的,例如,登录器和一个缓冲区可以具有相同的名称,或者两个访问者甚至可以具有相同的名称。

  • Type: string类型:string。 
  • Required: No 必需:否

5.5.4. animation.extensions 5.5.4。 animation.extensions 

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

  • Typeextension类型:extension。 
  • Required: No 必需:否
  • Type of each property: Extension每个属性的类型:扩展

5.5.5. animation.extras 5.5.5。 animation.extras 

Application-specific data. 特定于应用程序的数据。 

  • Typeextras类型:extras。 
  • Required: No 必需:否

 

5.6. Animation Channel 5.6。动画频道 

An animation channel combines an animation sampler with a target property being animated.动画频道将动画采样器与动画的目标属性相结合。

Table 7. Animation Channel Properties表7。Animation Channel属性

 

Type 类型 

Description 描述 

Required 必需的 

sampler 采样器 

integer

The index of a sampler in this animation used to compute the value for the target.该动画中采样器的索引用于计算目标的值。

 Yes 是的 

target 目标 

animation.channel.target

The descriptor of the animated property.动画属性的描述符。

 Yes 是的 

extensions 扩展 

extension

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

No 不 

extras 额外 

extras

Application-specific data. 特定于应用程序的数据。 

No 不 

Additional properties are allowed.允许其他属性。

5.6.1. animation.channel.sampler5.6.1。 Animation.Channel.Sampler

The index of a sampler in this animation used to compute the value for the target, e.g., a node’s translation, rotation, or scale (TRS).该动画中采样器的索引用于计算目标的值,例如节点的翻译,旋转或比例(TRS)。

  • Type: integer类型:integer。 
  • Required:  Yes必需:是的
  • Minimum: >= 0最低:>= 0。 

5.6.2. animation.channel.target 5.6.2。 animation.channel.target 

The descriptor of the animated property.动画属性的描述符。

  • Typechannel.target类型:animation.channel.target。 
  • Required:  Yes必需:是的

5.6.3. animation.channel.extensions5.6.3。 animation.channel.extensions

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

  • Typeextension类型:extension。 
  • Required: No 必需:否
  • Type of each property: Extension每个属性的类型:扩展

5.6.4. animation.channel.extras 5.6.4。 Animation.Channel.Extras 

Application-specific data. 特定于应用程序的数据。 

  • Typeextras类型:extras。 
  • Required: No 必需:否

 

5.7. Animation Channel Target 5.7。动画频道目标 

The descriptor of the animated property.动画属性的描述符。

Table 8. Animation Channel Target Properties表8。Animation Channel Target属性

 

Type 类型 

Description 描述 

Required 必需的 

node 节点 

integer

The index of the node to animate. When undefined, the animated object MAY be defined by an extension.节点动画的索引。如果未定义,则可以通过扩展定义动画对象。

No 不 

path 小路 

string

The name of the node’s TRS property to animate, or the "weights" of the Morph Targets it instantiates. For the "translation" property, the values that are provided by the sampler are the translation along the X, Y, and Z axes. For the "rotation" property, the values are a quaternion in the order (x, y, z, w), where w is the scalar. For the "scale" property, the values are the scaling factors along the X, Y, and Z axes.节点的TRS属性的名称是动画的,或者的"weights"针对其实例化。对于<b1>> </b1>属性,采样器提供的值是沿x,y和z轴的翻译。对于"rotation"属性,这些值是按顺序(x,y,z,w)的四元组,其中w是标量。对于"scale"属性,值是沿x,y和z轴的缩放因子。

 Yes 是的 

extensions 扩展 

extension

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

No 不 

extras 额外 

extras

Application-specific data. 特定于应用程序的数据。 

No 不 

Additional properties are allowed.允许其他属性。

5.7.1. animation.channel.target.node5.7.1。 animation.channel.target.node

The index of the node to animate. When undefined, the animated object MAY be defined by an extension.节点动画的索引。如果未定义,则可以通过扩展定义动画对象。

  • Type: integer类型:integer。 
  • Required: No 必需:否
  • Minimum: >= 0最低:>= 0。 

5.7.2. animation.channel.target.path5.7.2。 animation.channel.target.path

The name of the node’s TRS property to animate, or the "weights" of the Morph Targets it instantiates. For the "translation" property, the values that are provided by the sampler are the translation along the X, Y, and Z axes. For the "rotation" property, the values are a quaternion in the order (x, y, z, w), where w is the scalar. For the "scale" property, the values are the scaling factors along the X, Y, and Z axes.节点的TRS属性的名称是动画的,或者的"weights"针对其实例化。对于<b1>> </b1>属性,采样器提供的值是沿x,y和z轴的翻译。对于"rotation"属性,这些值是按顺序(x,y,z,w)的四元组,其中w是标量。对于"scale"属性,值是沿x,y和z轴的缩放因子。

  • Type: string类型:string。 
  • Required:  Yes必需:是的
  • Allowed values: 允许的值:
    • "translation"
    • "rotation"
    • "scale"
    • "weights"

5.7.3. animation.channel.target.extensions5.7.3。 animation.channel.target.extensions

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

  • Typeextension类型:extension。 
  • Required: No 必需:否
  • Type of each property: Extension每个属性的类型:扩展

5.7.4. animation.channel.target.extras5.7.4。 animation.channel.target.extras

Application-specific data. 特定于应用程序的数据。 

  • Typeextras类型:extras。 
  • Required: No 必需:否

 

5.8. Animation Sampler 5.8。动画采样器 

An animation sampler combines timestamps with a sequence of output values and defines an interpolation algorithm.动画采样器将时间戳与一系列输出值结合并定义了插值算法。

Table 9. Animation Sampler Properties表9。Animation Sampler属性

 

Type 类型 

Description 描述 

Required 必需的 

input 输入 

integer

The index of an accessor containing keyframe timestamps.包含键框时间戳的访问器的索引。

 Yes 是的 

interpolation 插值 

string

Interpolation algorithm. 插值算法。 

No, default:  不,默认值:"LINEAR"。 "LINEAR"

output 输出 

integer

The index of an accessor, containing keyframe output values.登录器的索引,包含密钥帧输出值。

 Yes 是的 

extensions 扩展 

extension

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

No 不 

extras 额外 

extras

Application-specific data. 特定于应用程序的数据。 

No 不 

Additional properties are allowed.允许其他属性。

5.8.1. animation.sampler.input 5.8.1。 animation.sampler.input 

The index of an accessor containing keyframe timestamps. The accessor MUST be of scalar type with floating-point components. The values represent time in seconds with time[0] >= 0.0, and strictly increasing values, i.e., time[n + 1] > time[n].包含键框时间戳的访问器的索引。登录器必须具有带有浮点数组件的标量类型。该值以time[0] >= 0.0的秒数为单位,并严格增加值,即time[n + 1] > time[n]。

  • Type: integer类型:integer。 
  • Required:  Yes必需:是的
  • Minimum: >= 0最低:>= 0。 

5.8.2. animation.sampler.interpolation5.8.2。 Animation.sampler.interpolation

Interpolation algorithm. 插值算法。 

  • Type: string类型:string。 
  • Required: No, default: "LINEAR"必需:否,默认值:"LINEAR"。 
  • Allowed values: 允许的值:
    • "LINEAR"The animated values are linearly interpolated between keyframes. When targeting a rotation, spherical linear interpolation (slerp) SHOULD be used to interpolate quaternions. The number of output elements MUST equal the number of input elements."LINEAR"动画值在密钥帧之间线性插值。靶向旋转时,应使用球形线性插值(SLERP)插入四合一。输出元素的数量必须等于输入元素的数量。
    • "STEP"The animated values remain constant to the output of the first keyframe, until the next keyframe. The number of output elements MUST equal the number of input elements."STEP"动画值保持在第一个密钥帧的输出之前恒定,直到下一个密钥帧为止。输出元素的数量必须等于输入元素的数量。
    • "CUBICSPLINE"The animation’s interpolation is computed using a cubic spline with specified tangents. The number of output elements MUST equal three times the number of input elements. For each input element, the output stores three elements, an in-tangent, a spline vertex, and an out-tangent. There MUST be at least two keyframes when using this interpolation."CUBICSPLINE"使用带有指定切线的立方样条计算动画的插值。输出元素的数量必须等于输入元素数量的三倍。对于每个输入元素,输出存储三个元素,一个距离,一个条带顶点和一个距离。使用此插值时,必须至少有两个关键帧。

5.8.3. animation.sampler.output 5.8.3。 Animation.Sampler.Output 

The index of an accessor, containing keyframe output values.登录器的索引,包含密钥帧输出值。

  • Type: integer类型:integer。 
  • Required:  Yes必需:是的
  • Minimum: >= 0最低:>= 0。 

5.8.4. animation.sampler.extensions5.8.4。 animation.sampler.extensions

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

  • Typeextension类型:extension。 
  • Required: No 必需:否
  • Type of each property: Extension每个属性的类型:扩展

5.8.5. animation.sampler.extras 5.8.5。 animation.sampler.extras 

Application-specific data. 特定于应用程序的数据。 

  • Typeextras类型:extras。 
  • Required: No 必需:否

 

5.9. Asset 5.9。资产 

Metadata about the glTF asset.关于GLTF资产的元数据。

Table 10. Asset Properties表10。Asset属性

 

Type 类型 

Description 描述 

Required 必需的 

copyright 版权 

string

A copyright message suitable for display to credit the content creator.适合显示内容创建者的版权消息。

No 不 

generator 发电机 

string

Tool that generated this glTF model. Useful for debugging.生成此GLTF模型的工具。可用于调试。

No 不 

version 版本 

string

The glTF version in the form of <major>.<minor> that this asset targets.该资产针对的<major>.<minor>形式的GLTF版本。

 Yes 是的 

minVersion 分子 

string

The minimum glTF version in the form of <major>.<minor> that this asset targets. This property MUST NOT be greater than the asset version.该资产针对的<major>.<minor>形式的最小GLTF版本。此属性不得大于资产版本。

No 不 

extensions 扩展 

extension

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

No 不 

extras 额外 

extras

Application-specific data. 特定于应用程序的数据。 

No 不 

Additional properties are allowed.允许其他属性。

  • JSON schemaschema.jsonJSON模式:asset.schema.json。 

5.9.1. asset.copyright 5.9.1。资产 

A copyright message suitable for display to credit the content creator.适合显示内容创建者的版权消息。

  • Type: string类型:string。 
  • Required: No 必需:否

5.9.2. asset.generator 5.9.2。 Asset.Generator 

Tool that generated this glTF model. Useful for debugging.生成此GLTF模型的工具。可用于调试。

  • Type: string类型:string。 
  • Required: No 必需:否

5.9.3. asset.version 5.9.3。资产 

The glTF version in the form of <major>.<minor> that this asset targets.该资产针对的<major>.<minor>形式的GLTF版本。

  • Type: string类型:string。 
  • Required:  Yes必需:是的
  • Pattern: ^[0-9]+\.[0-9]+[09]+\.[09]+。 

5.9.4. asset.minVersion 5.9.4。资产 

The minimum glTF version in the form of <major>.<minor> that this asset targets. This property MUST NOT be greater than the asset version.该资产针对的<major>.<minor>形式的最小GLTF版本。此属性不得大于资产版本。

  • Type: string类型:string。 
  • Required: No 必需:否
  • Pattern: ^[0-9]+\.[0-9]+[09]+\.[09]+。 

5.9.5. asset.extensions 5.9.5。资产 

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

  • Typeextension类型:extension。 
  • Required: No 必需:否
  • Type of each property: Extension每个属性的类型:扩展

5.9.6. asset.extras 5.9.6。 Asset.Extras 

Application-specific data. 特定于应用程序的数据。 

  • Typeextras类型:extras。 
  • Required: No 必需:否

 

5.10. Buffer 5.10。缓冲 

A buffer points to binary geometry, animation, or skins.缓冲区指向二进制几何,动画或皮肤。

Table 11. Buffer Properties表11。Buffer属性

 

Type 类型 

Description 描述 

Required 必需的 

uri Uri 

string

The URI (or IRI) of the buffer.缓冲区的URI(或IRI)。

No 不 

byteLength 字节 

integer

The length of the buffer in bytes.在字节中的缓冲区长度。

 Yes 是的 

name 姓名 

string

The user-defined name of this object.此对象的用户定义名称。

No 不 

extensions 扩展 

extension

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

No 不 

extras 额外 

extras

Application-specific data. 特定于应用程序的数据。 

No 不 

Additional properties are allowed.允许其他属性。

  • JSON schemaschema.jsonJSON模式:buffer.schema.json。 

5.10.1. buffer.uri 5.10.1。 buffer.uri 

The URI (or IRI) of the buffer. Relative paths are relative to the current glTF asset. Instead of referencing an external file, this field MAY contain a data:-URI.缓冲区的URI(或IRI)。相对路径相对于当前的GLTF资产。该字段没有引用外部文件,而是包含data: -uri。

  • Type: string类型:string。 
  • Required: No 必需:否
  • Format: iri-reference 格式:iri-Reference 

5.10.2. buffer.byteLength 5.10.2。 buffer.bytelength 

The length of the buffer in bytes.在字节中的缓冲区长度。

  • Type: integer类型:integer。 
  • Required:  Yes必需:是的
  • Minimum: >= 1最低:>= 1。 

5.10.3. buffer.name 5.10.3。 buffer.name 

The user-defined name of this object. This is not necessarily unique, e.g., an accessor and a buffer could have the same name, or two accessors could even have the same name.此对象的用户定义名称。这不一定是唯一的,例如,登录器和一个缓冲区可以具有相同的名称,或者两个访问者甚至可以具有相同的名称。

  • Type: string类型:string。 
  • Required: No 必需:否

5.10.4. buffer.extensions 5.10.4。 buffer.extensions 

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

  • Typeextension类型:extension。 
  • Required: No 必需:否
  • Type of each property: Extension每个属性的类型:扩展

5.10.5. buffer.extras 5.10.5。 buffer.extras 

Application-specific data. 特定于应用程序的数据。 

  • Typeextras类型:extras。 
  • Required: No 必需:否

 

5.11. Buffer View 5.11。缓冲区视图 

A view into a buffer generally representing a subset of the buffer.一看缓冲区的视图通常代表缓冲区的子集。

Table 12. Buffer View Properties表12。Buffer View属性

 

Type 类型 

Description 描述 

Required 必需的 

buffer 缓冲 

integer

The index of the buffer.缓冲区的索引。

 Yes 是的 

byteOffset 字节offset 

integer

The offset into the buffer in bytes.字节中的偏移到缓冲区中。

No, default:  不,默认值:0。 0

byteLength 字节 

integer

The length of the bufferView in bytes.字节中的自助餐的长度。

 Yes 是的 

byteStride 字节 

integer

The stride, in bytes. 大步,字节。 

No 不 

target 目标 

integer

The hint representing the intended GPU buffer type to use with this buffer view.表示预期的GPU缓冲区类型的提示与此缓冲区视图一起使用。

No 不 

name 姓名 

string

The user-defined name of this object.此对象的用户定义名称。

No 不 

extensions 扩展 

extension

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

No 不 

extras 额外 

extras

Application-specific data. 特定于应用程序的数据。 

No 不 

Additional properties are allowed.允许其他属性。

  • JSON schemaschema.jsonJSON模式:bufferView.schema.json。 

5.11.1. bufferView.buffer 5.11.1。 bufferview.buffer 

The index of the buffer.缓冲区的索引。

  • Type: integer类型:integer。 
  • Required:  Yes必需:是的
  • Minimum: >= 0最低:>= 0。 

5.11.2. bufferView.byteOffset 5.11.2。 Bufferview.ByteOffset 

The offset into the buffer in bytes.字节中的偏移到缓冲区中。

  • Type: integer类型:integer。 
  • Required: No, default: 0必需:否,默认值:0。 
  • Minimum: >= 0最低:>= 0。 

5.11.3. bufferView.byteLength 5.11.3。 bufferview.bytelength 

The length of the bufferView in bytes.字节中的自助餐的长度。

  • Type: integer类型:integer。 
  • Required:  Yes必需:是的
  • Minimum: >= 1最低:>= 1。 

5.11.4. bufferView.byteStride 5.11.4。 bufferview.bytestride 

The stride, in bytes, between vertex attributes. When this is not defined, data is tightly packed. When two or more accessors use the same buffer view, this field MUST be defined.顶点属性之间的大步。如果未定义,则数据将紧密包装。当两个或多个配件使用相同的缓冲区视图时,必须定义此字段。

  • Type: integer类型:integer。 
  • Required: No 必需:否
  • Minimum: >= 4最低:>= 4。 
  • Maximum: <= 252最大:<= 252。 
  • Related WebGL functions: vertexAttribPointer()stride parameter相关的WebGL功能:vertexAttribPointer()步幅参数

5.11.5. bufferView.target 5.11.5。 bufferview.target 

The hint representing the intended GPU buffer type to use with this buffer view.表示预期的GPU缓冲区类型的提示与此缓冲区视图一起使用。

  • Type: integer类型:integer。 
  • Required: No 必需:否
  • Allowed values: 允许的值:
    • 34962ARRAY_BUFFER 34962 array_buffer 
    • 34963ELEMENT_ARRAY_BUFFER 34963 element_array_buffer 
  • Related WebGL functions: bindBuffer()相关的WebGL功能:bindBuffer()。 

5.11.6. bufferView.name 5.11.6。 bufferview.name 

The user-defined name of this object. This is not necessarily unique, e.g., an accessor and a buffer could have the same name, or two accessors could even have the same name.此对象的用户定义名称。这不一定是唯一的,例如,登录器和一个缓冲区可以具有相同的名称,或者两个访问者甚至可以具有相同的名称。

  • Type: string类型:string。 
  • Required: No 必需:否

5.11.7. bufferView.extensions 5.11.7。 bufferview.extensions 

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

  • Typeextension类型:extension。 
  • Required: No 必需:否
  • Type of each property: Extension每个属性的类型:扩展

5.11.8. bufferView.extras 5.11.8。 bufferview.extras 

Application-specific data. 特定于应用程序的数据。 

  • Typeextras类型:extras。 
  • Required: No 必需:否

 

5.12. Camera 5.12。相机 

A camera’s projection. A node MAY reference a camera to apply a transform to place the camera in the scene.相机的投影。节点可以引用相机应用转换以将相机放置在场景中。

Table 13. Camera Properties表13。Camera属性

 

Type 类型 

Description 描述 

Required 必需的 

orthographic 拼字法 

camera.orthographic

An orthographic camera containing properties to create an orthographic projection matrix. This property MUST NOT be defined when perspective is defined.一个拼字摄像机,其中包含可创建拼字图投影矩阵的属性。当定义perspective时,不得定义此属性。

No 不 

perspective

camera.perspective

A perspective camera containing properties to create a perspective projection matrix. This property MUST NOT be defined when orthographic is defined.

No

type 类型 

string

Specifies if the camera uses a perspective or orthographic projection.指定相机使用透视图或拼字图投影。

 Yes 是的 

name 姓名 

string

The user-defined name of this object.此对象的用户定义名称。

No 不 

extensions 扩展 

extension

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

No 不 

extras 额外 

extras

Application-specific data. 特定于应用程序的数据。 

No 不 

Additional properties are allowed.允许其他属性。

  • JSON schemaschema.jsonJSON模式:camera.schema.json。 

5.12.1. camera.orthographic 5.12.1。摄像头 

An orthographic camera containing properties to create an orthographic projection matrix. This property MUST NOT be defined when perspective is defined.一个拼字摄像机,其中包含可创建拼字图投影矩阵的属性。当定义perspective时,不得定义此属性。

  • Typeorthographic类型:camera.orthographic。 
  • Required: No 必需:否

5.12.2. camera.perspective 5.12.2。相机 

A perspective camera containing properties to create a perspective projection matrix. This property MUST NOT be defined when orthographic is defined.一个包含属性的透视摄像头,可以创建一个透视投影矩阵。当定义orthographic时,不得定义此属性。

  • Typeperspective类型:camera.perspective。 
  • Required: No 必需:否

5.12.3. camera.type 5.12.3。相机。类型 

Specifies if the camera uses a perspective or orthographic projection. Based on this, either the camera’s perspective or orthographic property MUST be defined.指定相机使用透视图或拼字图投影。基于此,必须定义相机的perspective或<b1>> </b1>。

  • Type: string类型:string。 
  • Required:  Yes必需:是的
  • Allowed values: 允许的值:
    • "perspective"
    • "orthographic"

5.12.4. camera.name 5.12.4。相机。名称 

The user-defined name of this object. This is not necessarily unique, e.g., an accessor and a buffer could have the same name, or two accessors could even have the same name.此对象的用户定义名称。这不一定是唯一的,例如,登录器和一个缓冲区可以具有相同的名称,或者两个访问者甚至可以具有相同的名称。

  • Type: string类型:string。 
  • Required: No 必需:否

5.12.5. camera.extensions 5.12.5。相机。扩展 

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

  • Typeextension类型:extension。 
  • Required: No 必需:否
  • Type of each property: Extension每个属性的类型:扩展

5.12.6. camera.extras 5.12.6。相机 

Application-specific data. 特定于应用程序的数据。 

  • Typeextras类型:extras。 
  • Required: No 必需:否

 

5.13. Camera Orthographic 5.13。相机拼字法 

An orthographic camera containing properties to create an orthographic projection matrix.

Table 14. Camera Orthographic Properties

 

Type

Description

Required

xmag

number

The floating-point horizontal magnification of the view. This value MUST NOT be equal to zero. This value SHOULD NOT be negative.

 Yes

ymag

number

The floating-point vertical magnification of the view. This value MUST NOT be equal to zero. This value SHOULD NOT be negative.

 Yes

zfar

number

The floating-point distance to the far clipping plane. This value MUST NOT be equal to zero. zfar MUST be greater than znear.浮点距离远距离剪**面。该值不得等于零。 zfar必须大于znear。

 Yes

znear Znear 

number

The floating-point distance to the near clipping plane.浮点距离靠*剪裁*面。

 Yes 是的 

extensions 扩展 

extension

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

No 不 

extras 额外 

extras

Application-specific data. 特定于应用程序的数据。 

No 不 

Additional properties are allowed.允许其他属性。

5.13.1. camera.orthographic.xmag5.13.1。摄像头。XMAG

The floating-point horizontal magnification of the view. This value MUST NOT be equal to zero. This value SHOULD NOT be negative.视图的浮点水*放大。该值不得等于零。该值不应该为负。

  • Type: number类型:number。 
  • Required:  Yes必需:是的

5.13.2. camera.orthographic.ymag5.13.2。摄像头

The floating-point vertical magnification of the view. This value MUST NOT be equal to zero. This value SHOULD NOT be negative.视图的浮点垂直放大。该值不得等于零。该值不应该为负。

  • Type: number类型:number。 
  • Required:  Yes必需:是的

5.13.3. camera.orthographic.zfar5.13.3。摄像头。ZFAR

The floating-point distance to the far clipping plane. This value MUST NOT be equal to zero. zfar MUST be greater than znear.浮点距离远距离剪**面。该值不得等于零。 zfar必须大于znear。

  • Type: number类型:number。 
  • Required:  Yes必需:是的
  • Minimum: > 0最低:> 0。 

5.13.4. camera.orthographic.znear5.13.4。摄像头。ZNEAR

The floating-point distance to the near clipping plane.浮点距离靠*剪裁*面。

  • Type: number类型:number。 
  • Required:  Yes必需:是的
  • Minimum: >= 0最低:>= 0。 

5.13.5. camera.orthographic.extensions5.13.5。摄像头。延伸

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

  • Typeextension类型:extension。 
  • Required: No 必需:否
  • Type of each property: Extension每个属性的类型:扩展

5.13.6. camera.orthographic.extras5.13.6。相机

Application-specific data. 特定于应用程序的数据。 

  • Typeextras类型:extras。 
  • Required: No 必需:否

 

5.14. Camera Perspective 5.14。相机的视角 

A perspective camera containing properties to create a perspective projection matrix.一个包含属性的透视摄像头,可以创建一个透视投影矩阵。

Table 15. Camera Perspective Properties表15。Camera Perspective属性

 

Type 类型 

Description 描述 

Required 必需的 

aspectRatio expactratio 

number

The floating-point aspect ratio of the field of view.视场的浮点纵横比。

No 不 

yfov yfov 

number

The floating-point vertical field of view in radians. This value SHOULD be less than π.弧度的浮点垂直视野。该值应小于π。

 Yes 是的 

zfar ZFAR 

number

The floating-point distance to the far clipping plane.浮点距离远距离剪**面。

No 不 

znear Znear 

number

The floating-point distance to the near clipping plane.浮点距离靠*剪裁*面。

 Yes 是的 

extensions 扩展 

extension

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

No 不 

extras 额外 

extras

Application-specific data. 特定于应用程序的数据。 

No 不 

Additional properties are allowed.允许其他属性。

5.14.1. camera.perspective.aspectRatio5.14.1。 camera.perspective

The floating-point aspect ratio of the field of view. When undefined, the aspect ratio of the rendering viewport MUST be used.视场的浮点纵横比。如果未定义,则必须使用渲染视口的长宽比。

  • Type: number类型:number。 
  • Required: No 必需:否
  • Minimum: > 0最低:> 0。 

5.14.2. camera.perspective.yfov 5.14.2。 camera.perspective.yfov 

The floating-point vertical field of view in radians. This value SHOULD be less than π.弧度的浮点垂直视野。该值应小于π。

  • Type: number类型:number。 
  • Required:  Yes必需:是的
  • Minimum: > 0最低:> 0。 

5.14.3. camera.perspective.zfar 5.14.3。相机 

The floating-point distance to the far clipping plane. When defined, zfar MUST be greater than znear. If zfar is undefined, client implementations SHOULD use infinite projection matrix.浮点距离远距离剪**面。定义时,zfar必须大于znear。如果zfar未定义,则客户实现应使用无限投影矩阵。

  • Type: number类型:number。 
  • Required: No 必需:否
  • Minimum: > 0最低:> 0。 

5.14.4. camera.perspective.znear5.14.4。相机

The floating-point distance to the near clipping plane.浮点距离靠*剪裁*面。

  • Type: number类型:number。 
  • Required:  Yes必需:是的
  • Minimum: > 0最低:> 0。 

5.14.5. camera.perspective.extensions5.14.5。 camera.perspective.extensions

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

  • Typeextension类型:extension。 
  • Required: No 必需:否
  • Type of each property: Extension每个属性的类型:扩展

5.14.6. camera.perspective.extras5.14.6。 camera.perspective.extras

Application-specific data. 特定于应用程序的数据。 

  • Typeextras类型:extras。 
  • Required: No 必需:否

 

5.15. Extension 5.15。扩大 

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

Additional properties are allowed.允许其他属性。

  • JSON schemaschema.jsonJSON模式:extension.schema.json。 

 

5.16. Extras 5.16。额外 

Application-specific data. 特定于应用程序的数据。 

Although extras MAY have any type, it is common for applications to store and access custom data as key/value pairs. Therefore, extras SHOULD be a JSON object rather than a primitive value for best portability.尽管extras可能具有任何类型,但应用程序将自定义数据作为键/值对访问并访问自定义数据是很常见的。因此,extras应该是JSON对象,而不是最佳便携性的原始值。

 

5.17. glTF 5.17。 GLTF 

The root object for a glTF asset.GLTF资产的根对象。

Table 16. glTF Properties表16。glTF属性

 

Type 类型 

Description 描述 

Required 必需的 

extensionsUsed 扩展 

string [1-*]

Names of glTF extensions used in this asset.该资产中使用的GLTF扩展名称。

No 不 

extensionsRequired ExtensionsRequired 

string [1-*]

Names of glTF extensions required to properly load this asset.正确加载此资产所需的GLTF扩展名称。

No 不 

accessors 登录 

accessor [1-*]

An array of accessors. 一系列登记。 

No 不 

animations 动画 

animation [1-*]

An array of keyframe animations.一系列密钥帧动画。

No 不 

asset 资产 

asset

Metadata about the glTF asset.关于GLTF资产的元数据。

 Yes 是的 

buffers 缓冲区 

buffer [1-*]

An array of buffers. 一系列缓冲区。 

No 不 

bufferViews Bufferviews 

bufferView [1-*]

An array of bufferViews. 一系列的养老花。 

No 不 

cameras 相机 

camera [1-*]

An array of cameras. 一系列相机。 

No 不 

images 图像 

image [1-*]

An array of images. 一系列图像。 

No 不 

materials 材料 

material [1-*]

An array of materials. 一系列材料。 

No 不 

meshes 网眼 

mesh [1-*]

An array of meshes. 一系列网格。 

No 不 

nodes 节点 

node [1-*]

An array of nodes. 一系列节点。 

No 不 

samplers 采样器 

sampler [1-*]

An array of samplers. 一系列采样器。 

No 不 

scene 场景 

integer

The index of the default scene.默认场景的索引。

No 不 

scenes 场景 

scene [1-*]

An array of scenes. 一系列场景。 

No 不 

skins 皮肤 

skin [1-*]

An array of skins. 一系列皮肤。 

No 不 

textures 纹理 

texture [1-*]

An array of textures. 一系列纹理。 

No 不 

extensions 扩展 

extension

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

No 不 

extras 额外 

extras

Application-specific data. 特定于应用程序的数据。 

No 不 

Additional properties are allowed.允许其他属性。

  • JSON schemaschema.jsonJSON模式:glTF.schema.json。 

5.17.1. glTF.extensionsUsed 5.17.1。 gltf.extensions 

Names of glTF extensions used in this asset.该资产中使用的GLTF扩展名称。

  • Type: string[1-*] 类型:string [1-*]。 
    • Each element in the array MUSTbe unique.数组中的每个元素都必须唯一。
  • Required: No 必需:否

5.17.2. glTF.extensionsRequired 5.17.2。 gltf.extensionsRequired 

Names of glTF extensions required to properly load this asset.正确加载此资产所需的GLTF扩展名称。

  • Type: string[1-*] 类型:string [1-*]。 
    • Each element in the array MUSTbe unique.数组中的每个元素都必须唯一。
  • Required: No 必需:否

5.17.3. glTF.accessors 5.17.3。 gltf.Accessors 

An array of accessors. An accessor is a typed view into a bufferView.一系列登记。登录器是录像带中的录像带。

  • Typeaccessor[1-*] 类型:accessor [1-*]。 
  • Required: No 必需:否

5.17.4. glTF.animations 5.17.4。 gltf.Animations 

An array of keyframe animations.一系列密钥帧动画。

  • Typeanimation[1-*] 类型:animation [1-*]。 
  • Required: No 必需:否

5.17.5. glTF.asset 5.17.5。 gltf.sets 

Metadata about the glTF asset.关于GLTF资产的元数据。

  • Typeasset类型:asset。 
  • Required:  Yes必需:是的

5.17.6. glTF.buffers 5.17.6。 Gltf.Buffers 

An array of buffers. A buffer points to binary geometry, animation, or skins.一系列缓冲区。缓冲区指向二进制几何,动画或皮肤。

  • Typebuffer[1-*] 类型:buffer [1-*]。 
  • Required: No 必需:否

5.17.7. glTF.bufferViews 5.17.7。 GLTF.Bufferviews 

An array of bufferViews. A bufferView is a view into a buffer generally representing a subset of the buffer.一系列的养老花。自助服务是一个通常代表缓冲区子集的缓冲区的视图。

  • TypebufferView[1-*] 类型:bufferView [1-*]。 
  • Required: No 必需:否

5.17.8. glTF.cameras 5.17.8。 Gltf.Cameras 

An array of cameras. A camera defines a projection matrix.一系列相机。相机定义了投影矩阵。

  • Typecamera[1-*] 类型:camera [1-*]。 
  • Required: No 必需:否

5.17.9. glTF.images 5.17.9。 gltf.images 

An array of images. An image defines data used to create a texture.一系列图像。图像定义了用于创建纹理的数据。

  • Typeimage[1-*] 类型:image [1-*]。 
  • Required: No 必需:否

5.17.10. glTF.materials 5.17.10。 Gltf.Materials 

An array of materials. A material defines the appearance of a primitive.一系列材料。材料定义了原始的外观。

  • Typematerial[1-*] 类型:material [1-*]。 
  • Required: No 必需:否

5.17.11. glTF.meshes 5.17.11。 gltf.meshes 

An array of meshes. A mesh is a set of primitives to be rendered.一系列网格。网格是要渲染的一组原语。

  • Typemesh[1-*] 类型:mesh [1-*]。 
  • Required: No 必需:否

5.17.12. glTF.nodes 5.17.12。 gltf.nodes 

An array of nodes. 一系列节点。 

  • Typenode[1-*] 类型:node [1-*]。 
  • Required: No 必需:否

5.17.13. glTF.samplers 5.17.13。 Gltf.Samplers 

An array of samplers. A sampler contains properties for texture filtering and wrapping modes.一系列采样器。采样器包含用于纹理过滤和包装模式的属性。

  • Typesampler[1-*] 类型:sampler [1-*]。 
  • Required: No 必需:否

5.17.14. glTF.scene 5.17.14。 gltf.scene 

The index of the default scene. This property MUST NOT be defined, when scenes is undefined.默认场景的索引。当scenes未定义时,不得定义此属性。

  • Type: integer类型:integer。 
  • Required: No 必需:否
  • Minimum: >= 0最低:>= 0。 

5.17.15. glTF.scenes 5.17.15。 gltf.scenes 

An array of scenes. 一系列场景。 

  • Typescene[1-*] 类型:scene [1-*]。 
  • Required: No 必需:否

5.17.16. glTF.skins 5.17.16。 gltf.skins 

An array of skins. A skin is defined by joints and matrices.一系列皮肤。皮肤由关节和矩阵定义。

  • Typeskin[1-*] 类型:skin [1-*]。 
  • Required: No 必需:否

5.17.17. glTF.textures 5.17.17。 gltf.textures 

An array of textures. 一系列纹理。 

  • Typetexture[1-*] 类型:texture [1-*]。 
  • Required: No 必需:否

5.17.18. glTF.extensions 5.17.18。 gltf.extensions 

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

  • Typeextension类型:extension。 
  • Required: No 必需:否
  • Type of each property: Extension每个属性的类型:扩展

5.17.19. glTF.extras 5.17.19。 gltf.extras 

Application-specific data. 特定于应用程序的数据。 

  • Typeextras类型:extras。 
  • Required: No 必需:否

 

5.18. Image 5.18。图像 

Image data used to create a texture. Image MAY be referenced by an URI (or IRI) or a buffer view index.用于创建纹理的图像数据。图像可以通过URI(或IRI)或缓冲视图索引引用。

Table 17. Image Properties表17。Image属性

 

Type 类型 

Description 描述 

Required 必需的 

uri Uri 

string

The URI (or IRI) of the image.图像的URI(或IRI)。

No 不 

mimeType 模仿 

string

The image’s media type. This field MUST be defined when bufferView is defined.图像的媒体类型。当定义bufferView时,必须定义此字段。

No 不 

bufferView Bufferview 

integer

The index of the bufferView that contains the image. This field MUST NOT be defined when uri is defined.包含图像的自助服务的索引。当定义uri时,不得定义此字段。

No 不 

name 姓名 

string

The user-defined name of this object.此对象的用户定义名称。

No 不 

extensions 扩展 

extension

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

No 不 

extras 额外 

extras

Application-specific data. 特定于应用程序的数据。 

No 不 

Additional properties are allowed.允许其他属性。

  • JSON schemaschema.jsonJSON模式:image.schema.json。 

5.18.1. image.uri 5.18.1。 image.uri 

The URI (or IRI) of the image. Relative paths are relative to the current glTF asset. Instead of referencing an external file, this field MAY contain a data:-URI. This field MUST NOT be defined when bufferView is defined.图像的URI(或IRI)。相对路径相对于当前的GLTF资产。该字段没有引用外部文件,而是包含data: -uri。当定义<b1>> </b1>时,不得定义此字段。

  • Type: string类型:string。 
  • Required: No 必需:否
  • Format: iri-reference 格式:iri-Reference 

5.18.2. image.mimeType 5.18.2。 Image.Mimetype 

The image’s media type. This field MUST be defined when bufferView is defined.图像的媒体类型。当定义bufferView时,必须定义此字段。

  • Type: string类型:string。 
  • Required: No 必需:否
  • Allowed values: 允许的值:
    • "image/jpeg"
    • "image/png"

5.18.3. image.bufferView 5.18.3。 Image.Bufferview 

The index of the bufferView that contains the image. This field MUST NOT be defined when uri is defined.包含图像的自助服务的索引。当定义uri时,不得定义此字段。

  • Type: integer类型:integer。 
  • Required: No 必需:否
  • Minimum: >= 0最低:>= 0。 

5.18.4. image.name 5.18.4。 image.name 

The user-defined name of this object. This is not necessarily unique, e.g., an accessor and a buffer could have the same name, or two accessors could even have the same name.此对象的用户定义名称。这不一定是唯一的,例如,登录器和一个缓冲区可以具有相同的名称,或者两个访问者甚至可以具有相同的名称。

  • Type: string类型:string。 
  • Required: No 必需:否

5.18.5. image.extensions 5.18.5。 image.extensions 

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

  • Typeextension类型:extension。 
  • Required: No 必需:否
  • Type of each property: Extension每个属性的类型:扩展

5.18.6. image.extras 5.18.6。 Image.Extras 

Application-specific data. 特定于应用程序的数据。 

  • Typeextras类型:extras。 
  • Required: No 必需:否

 

5.19. Material 5.19。材料 

The material appearance of a primitive.原始的物质外观。

Table 18. Material Properties表18。Material属性

 

Type 类型 

Description 描述 

Required 必需的 

name 姓名 

string

The user-defined name of this object.此对象的用户定义名称。

No 不 

extensions 扩展 

extension

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

No 不 

extras 额外 

extras

Application-specific data. 特定于应用程序的数据。 

No 不 

pbrMetallicRoughness pbrmetallicroughness 

material.pbrMetallicRoughness

A set of parameter values that are used to define the metallic-roughness material model from Physically Based Rendering (PBR) methodology. When undefined, all the default values of pbrMetallicRoughness MUST apply.一组用于从物理渲染(PBR)方法来定义金属 - 粗糙度材料模型的参数值。当未定义时,必须应用pbrMetallicRoughness的所有默认值。

No 不 

normalTexture 正常文字 

material.normalTextureInfo

The tangent space normal texture.切线空间正常纹理。

No

occlusionTexture 咬合文本 

material.occlusionTextureInfo

The occlusion texture. 阻塞纹理。 

No

emissiveTexture 发射版 

textureInfo

The emissive texture. 发射质地。 

No

emissiveFactor 发射反应器 

number [3]

The factors for the emissive color of the material.材料发射颜色的因素。

No, default: [0,0,0]

alphaMode 字母码 

string

The alpha rendering mode of the material.材料的α渲染模式。

No, default: "OPAQUE"

alphaCutoff Alphacutoff 

number

The alpha cutoff value of the material.材料的α截止值。

No, default: 0.5

doubleSided 加倍 

boolean

Specifies whether the material is double sided.指定材料是否是双面的。

No, default: false

Additional properties are allowed.允许其他属性。

  • JSON schemaschema.jsonJSON模式:material.schema.json。 

5.19.1. material.name 5.19.1。材料。名称 

The user-defined name of this object. This is not necessarily unique, e.g., an accessor and a buffer could have the same name, or two accessors could even have the same name.此对象的用户定义名称。这不一定是唯一的,例如,登录器和一个缓冲区可以具有相同的名称,或者两个访问者甚至可以具有相同的名称。

  • Type: string类型:string。 
  • Required: No 必需:否

5.19.2. material.extensions 5.19.2。材料 

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

  • Typeextension类型:extension。 
  • Required: No 必需:否
  • Type of each property: Extension每个属性的类型:扩展

5.19.3. material.extras 5.19.3。材料 

Application-specific data. 特定于应用程序的数据。 

  • Typeextras类型:extras。 
  • Required: No 必需:否

5.19.4. material.pbrMetallicRoughness5.19.4。材料

A set of parameter values that are used to define the metallic-roughness material model from Physically Based Rendering (PBR) methodology. When undefined, all the default values of pbrMetallicRoughness MUST apply.一组用于从物理渲染(PBR)方法来定义金属 - 粗糙度材料模型的参数值。当未定义时,必须应用pbrMetallicRoughness的所有默认值。

5.19.5. material.normalTexture 5.19.5。材料 

The tangent space normal texture. The texture encodes RGB components with linear transfer function. Each texel represents the XYZ components of a normal vector in tangent space. The normal vectors use the convention +X is right and +Y is up. +Z points toward the viewer. If a fourth component (A) is present, it MUST be ignored. When undefined, the material does not have a tangent space normal texture.切线空间正常纹理。纹理编码具有线性传输函数的RGB组件。每个Texel代表切线空间中正常载体的XYZ成分。普通向量使用juntertion +x是正确的, +y是向上的。 +z指向观众。如果存在第四个组件(a),则必须忽略它。当未定义时,材料没有切线空间正常纹理。

  • TypenormalTextureInfo类型:material.normalTextureInfo。 
  • Required: No 必需:否

5.19.6. material.occlusionTexture5.19.6。材料

The occlusion texture. The occlusion values are linearly sampled from the R channel. Higher values indicate areas that receive full indirect lighting and lower values indicate no indirect lighting. If other channels are present (GBA), they MUST be ignored for occlusion calculations. When undefined, the material does not have an occlusion texture.阻塞纹理。闭塞值是从R通道线性采样的。较高的值表示接收完整间接照明和较低值的区域表示没有间接照明。如果存在其他通道(GBA),则必须忽略它们以进行遮挡计算。当未定义时,材料没有遮挡质地。

5.19.7. material.emissiveTexture5.19.7。材料。发行

The emissive texture. It controls the color and intensity of the light being emitted by the material. This texture contains RGB components encoded with the sRGB transfer function. If a fourth component (A) is present, it MUST be ignored. When undefined, the texture MUST be sampled as having 1.0 in RGB components.发射质地。它控制着材料发出的光的颜色和强度。该纹理包含使用SRGB传输函数编码的RGB组件。如果存在第四个组件(a),则必须忽略它。如果未定义,则必须将纹理采样为RGB组件中的1.0。

  • TypetextureInfo类型:textureInfo。 
  • Required: No 必需:否

5.19.8. material.emissiveFactor 5.19.8。材料。发行者 

The factors for the emissive color of the material. This value defines linear multipliers for the sampled texels of the emissive texture.材料发射颜色的因素。该值定义了发射纹理的采样件的线性乘数。

  • Type: number[3] 类型:number [3]。 
    • Each element in the array MUSTbe greater than or equal to 0 and less than or equal to 1.阵列中的每个元素必须大于或等于0,并且小于或等于1。
  • Required: No, default: [0,0,0]必需:否,默认值:[0,0,0]。 

5.19.9. material.alphaMode 5.19.9。材料。alphamode 

The material’s alpha rendering mode enumeration specifying the interpretation of the alpha value of the base color.材料的α渲染模式枚举指定了基本颜色α值的解释。

  • Type: string类型:string。 
  • Required: No, default: "OPAQUE"必需:否,默认值:"OPAQUE"。 
  • Allowed values: 允许的值:
    • "OPAQUE"The alpha value is ignored, and the rendered output is fully opaque."OPAQUE"忽略α值,并且渲染输出完全不透明。
    • "MASK"The rendered output is either fully opaque or fully transparent depending on the alpha value and the specified alphaCutoff value; the exact appearance of the edges MAY be subject to implementation-specific techniques such as “Alpha-to-Coverage”."MASK"渲染输出是完全不透明的,要么完全透明,具体取决于alpha值,指定的alphaCutoff值;边缘的确切外观可能受到特定于实施技术的影响,例如“ alpha-to-coverage”。
    • "BLEND"The alpha value is used to composite the source and destination areas. The rendered output is combined with the background using the normal painting operation (i.e. the Porter and Duff over operator)."BLEND"α值用于复合源和目的地区域。使用普通的绘画操作(即操作员的搬运工和达夫)将渲染的输出与背景结合使用。

5.19.10. material.alphaCutoff 5.19.10。材料 

Specifies the cutoff threshold when in MASK alpha mode. If the alpha value is greater than or equal to this value then it is rendered as fully opaque, otherwise, it is rendered as fully transparent. A value greater than 1.0 will render the entire material as fully transparent. This value MUST be ignored for other alpha modes. When alphaMode is not defined, this value MUST NOT be defined.指定MASK alpha模式时的截止阈值。如果alpha值大于或等于此值,则将其呈现为完全不透明,否则,它将呈现为完全透明。大于1.0的值将使整个材料完全透明。对于其他alpha模式,必须忽略此值。当未定义alphaMode时,不得定义此值。

  • Type: number类型:number。 
  • Required: No, default: 5必需:否,默认值:0.5。 
  • Minimum: >= 0最低:>= 0。 

5.19.11. material.doubleSided 5.19.11。材料。两倍 

Specifies whether the material is double sided. When this value is false, back-face culling is enabled. When this value is true, back-face culling is disabled and double-sided lighting is enabled. The back-face MUST have its normals reversed before the lighting equation is evaluated.指定材料是否是双面的。当此值为错误时,启用了后面扣。当此值为真时,将禁用后面扣,并启用双面照明。在评估照明方程之前,后面必须使其正态逆转。

  • Type: boolean类型:boolean。 
  • Required: No, default: false必需:否,默认值:false。 

 

5.20. Material Normal Texture Info5.20。材料正常纹理信息

Reference to a texture. 引用纹理。 

Table 19. Material Normal Texture Info Properties表19。Material Normal Texture Info属性

 

Type 类型 

Description 描述 

Required 必需的 

index 指数 

integer

The index of the texture.纹理的索引。

 Yes 是的 

texCoord Texcoord 

integer

The set index of texture’s TEXCOORD attribute used for texture coordinate mapping.用于纹理坐标映射的Texture的TexCoord属性的集合索引。

No, default:  不,默认值:0。 0

scale 规模 

number

The scalar parameter applied to each normal vector of the normal texture.标量参数应用于正常纹理的每个正常向量。

No, default:  不,默认值:1。 1

extensions 扩展 

extension

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

No 不 

extras 额外 

extras

Application-specific data. 特定于应用程序的数据。 

No 不 

Additional properties are allowed.允许其他属性。

5.20.1. material.normalTextureInfo.index5.20.1。 Material.normalTextureInfo.Index

The index of the texture.纹理的索引。

  • Type: integer类型:integer。 
  • Required:  Yes必需:是的
  • Minimum: >= 0最低:>= 0。 

5.20.2. material.normalTextureInfo.texCoord5.20.2。材料

This integer value is used to construct a string in the format TEXCOORD_<set index> which is a reference to a key in mesh.primitives.attributes (e.g. a value of 0 corresponds to TEXCOORD_0). A mesh primitive MUST have the corresponding texture coordinate attributes for the material to be applicable to it.此整数值用于以格式TEXCOORD_<set index>构造字符串,该字符串是对<b1>> </b1>中的键的引用(例如,0的值对应于0对应于TEXCOORD_0)。网格原始性必须具有相应的纹理坐标属性,以使其适用于其。

  • Type: integer类型:integer。 
  • Required: No, default: 0必需:否,默认值:0。 
  • Minimum: >= 0最低:>= 0。 

5.20.3. material.normalTextureInfo.scale5.20.3。材料

The scalar parameter applied to each normal vector of the texture. This value scales the normal vector in X and Y directions using the formula: scaledNormal = normalize<sampled normal texture value> * 2.0 - 1.0) * vec3(<normal scale>, <normal scale>, 1.0.标量参数应用于纹理的每个正常向量。此值使用公式:scaledNormal = normalize<sampled normal texture value> * 2.0 - 1.0) * vec3(<normal scale>, <normal scale>, 1.0以x和y方向缩放正常矢量。

  • Type: number类型:number。 
  • Required: No, default: 1必需:否,默认值:1。 

5.20.4. material.normalTextureInfo.extensions5.20.4。材料

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

  • Typeextension类型:extension。 
  • Required: No 必需:否
  • Type of each property: Extension每个属性的类型:扩展

5.20.5. material.normalTextureInfo.extras5.20.5。物料

Application-specific data. 特定于应用程序的数据。 

  • Typeextras类型:extras。 
  • Required: No 必需:否

 

5.21. Material Occlusion Texture Info5.21。材料阻塞纹理信息

Reference to a texture. 引用纹理。 

Table 20. Material Occlusion Texture Info Properties表20。Material Occlusion Texture Info属性

 

Type 类型 

Description 描述 

Required 必需的 

index 指数 

integer

The index of the texture.纹理的索引。

 Yes 是的 

texCoord Texcoord 

integer

The set index of texture’s TEXCOORD attribute used for texture coordinate mapping.用于纹理坐标映射的Texture的TexCoord属性的集合索引。

No, default:  不,默认值:0。 0

strength 力量 

number

A scalar multiplier controlling the amount of occlusion applied.标量乘数控制施加的闭塞量。

No, default:  不,默认值:1。 1

extensions 扩展 

extension

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

No 不 

extras 额外 

extras

Application-specific data. 特定于应用程序的数据。 

No 不 

Additional properties are allowed.允许其他属性。

5.21.1. material.occlusionTextureInfo.index5.21.1。材料

The index of the texture.纹理的索引。

  • Type: integer类型:integer。 
  • Required:  Yes必需:是的
  • Minimum: >= 0最低:>= 0。 

5.21.2. material.occlusionTextureInfo.texCoord5.21.2。材料

This integer value is used to construct a string in the format TEXCOORD_<set index> which is a reference to a key in mesh.primitives.attributes (e.g. a value of 0 corresponds to TEXCOORD_0). A mesh primitive MUST have the corresponding texture coordinate attributes for the material to be applicable to it.此整数值用于以格式TEXCOORD_<set index>构造字符串,该字符串是对<b1>> </b1>中的键的引用(例如,0的值对应于0对应于TEXCOORD_0)。网格原始性必须具有相应的纹理坐标属性,以使其适用于其。

  • Type: integer类型:integer。 
  • Required: No, default: 0必需:否,默认值:0。 
  • Minimum: >= 0最低:>= 0。 

5.21.3. material.occlusionTextureInfo.strength5.21.3。材料。ClusionTextureInfo.strength

A scalar parameter controlling the amount of occlusion applied. A value of 0.0 means no occlusion. A value of 1.0 means full occlusion. This value affects the final occlusion value as: 1.0 + strength * (<sampled occlusion texture value> - 1.0).标量参数控制施加的遮挡量。 0.0的值无需遮挡。 <b1>> </b1>的值表示完全遮挡。此值会影响最终的闭塞值,如:1.0 + strength * (<sampled occlusion texture value> - 1.0)。

  • Type: number类型:number。 
  • Required: No, default: 1必需:否,默认值:1。 
  • Minimum: >= 0最低:>= 0。 
  • Maximum: <= 1最大:<= 1。 

5.21.4. material.occlusionTextureInfo.extensions5.21.4。材料。ClusionTextureInfo.extensions

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

  • Typeextension类型:extension。 
  • Required: No 必需:否
  • Type of each property: Extension每个属性的类型:扩展

5.21.5. material.occlusionTextureInfo.extras5.21.5。材料。ClusionTextureInfo.extras

Application-specific data. 特定于应用程序的数据。 

  • Typeextras类型:extras。 
  • Required: No 必需:否

 

5.22. Material PBR Metallic Roughness5.22。材料PBR金属粗糙度

A set of parameter values that are used to define the metallic-roughness material model from Physically-Based Rendering (PBR) methodology.一组用于从基于物理的渲染(PBR)方法来定义金属 - 粗糙度材料模型的参数值。

Table 21. Material PBR Metallic Roughness Properties表21。Material PBR Metallic Roughness属性

 

Type 类型 

Description 描述 

Required 必需的 

baseColorFactor 基核酸 

number [4]

The factors for the base color of the material.材料基颜色的因素。

No, default:  不,默认值:[1,1,1,1]。 [1,1,1,1]

baseColorTexture 基本延迟 

textureInfo

The base color texture. 基本颜色纹理。 

No 不 

metallicFactor 金属factor 

number

The factor for the metalness of the material.材料金属的因素。

No, default:  不,默认值:1。 1

roughnessFactor 粗糙的factor 

number

The factor for the roughness of the material.材料粗糙度的因素。

No, default:  不,默认值:1。 1

metallicRoughnessTexture 金属质量文本 

textureInfo

The metallic-roughness texture. 金属粗糙度纹理。 

No 不 

extensions 扩展 

extension

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

No 不 

extras 额外 

extras

Application-specific data. 特定于应用程序的数据。 

No 不 

Additional properties are allowed.允许其他属性。

5.22.1. material.pbrMetallicRoughness.baseColorFactor5.22.1。材料

The factors for the base color of the material. This value defines linear multipliers for the sampled texels of the base color texture.材料基颜色的因素。此值定义了基本色纹理的采样式纹理的线性乘数。

  • Type: number[4] 类型:number [4]。 
    • Each element in the array MUSTbe greater than or equal to 0 and less than or equal to 1.阵列中的每个元素必须大于或等于0,并且小于或等于1。
  • Required: No, default: [1,1,1,1]必需:否,默认值:[1,1,1,1]。 

5.22.2. material.pbrMetallicRoughness.baseColorTexture5.22.2。材料

The base color texture. The first three components (RGB) MUST be encoded with the sRGB transfer function. They specify the base color of the material. If the fourth component (A) is present, it represents the linear alpha coverage of the material. Otherwise, the alpha coverage is equal to 1.0. The material.alphaMode property specifies how alpha is interpreted. The stored texels MUST NOT be premultiplied. When undefined, the texture MUST be sampled as having 1.0 in all components.基本颜色纹理。前三个组件(RGB)必须使用SRGB传输函数编码。他们指定材料的基颜色。如果存在第四个组件(a),则表示材料的线性α覆盖范围。否则,α覆盖范围等于1.0。 material.alphaMode属性指定了如何解释alpha。存储的Texels一定不得进行。如果未定义,则必须将纹理采样为所有组件中的1.0。

  • TypetextureInfo类型:textureInfo。 
  • Required: No 必需:否

5.22.3. material.pbrMetallicRoughness.metallicFactor5.22.3。材料。pbrmetallicroughness.MetallicFactor

The factor for the metalness of the material. This value defines a linear multiplier for the sampled metalness values of the metallic-roughness texture.材料金属的因素。该值定义了金属纹理纹理的采样金属值的线性乘数。

  • Type: number类型:number。 
  • Required: No, default: 1必需:否,默认值:1。 
  • Minimum: >= 0最低:>= 0。 
  • Maximum: <= 1最大:<= 1。 

5.22.4. material.pbrMetallicRoughness.roughnessFactor5.22.4。材料

The factor for the roughness of the material. This value defines a linear multiplier for the sampled roughness values of the metallic-roughness texture.材料粗糙度的因素。该值定义了金属纹理纹理的采样粗糙度值的线性乘数。

  • Type: number类型:number。 
  • Required: No, default: 1必需:否,默认值:1。 
  • Minimum: >= 0最低:>= 0。 
  • Maximum: <= 1最大:<= 1。 

5.22.5. material.pbrMetallicRoughness.metallicRoughnessTexture5.22.5。材料。pbrmetallicroughness.metallicroughnesstexture

The metallic-roughness texture. The metalness values are sampled from the B channel. The roughness values are sampled from the G channel. These values MUST be encoded with a linear transfer function. If other channels are present (R or A), they MUST be ignored for metallic-roughness calculations. When undefined, the texture MUST be sampled as having 1.0 in G and B components.金属粗糙度纹理。金属值是从B通道采样的。粗糙度值是从G通道采样的。这些值必须用线性传输函数编码。如果存在其他通道(R或A),则必须忽略它们以计算金属循环。如果未定义,则必须将纹理采样为G和B组件中的1.0。

  • TypetextureInfo类型:textureInfo。 
  • Required: No 必需:否

5.22.6. material.pbrMetallicRoughness.extensions5.22.6。材料。pbrmetallicroughness.extensions

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

  • Typeextension类型:extension。 
  • Required: No 必需:否
  • Type of each property: Extension每个属性的类型:扩展

5.22.7. material.pbrMetallicRoughness.extras5.22.7。材料。pbrmetallicroughness.extras

Application-specific data. 特定于应用程序的数据。 

  • Typeextras类型:extras。 
  • Required: No 必需:否

 

5.23. Mesh 5.23。网 

A set of primitives to be rendered. Its global transform is defined by a node that references it.一组要渲染的原语。它的全局变换由引用它的节点定义。

Table 22. Mesh Properties表22。Mesh属性

 

Type 类型 

Description 描述 

Required 必需的 

primitives 原语 

mesh.primitive [1-*]

An array of primitives, each defining geometry to be rendered.一系列原始词,每个都定义要渲染的几何形状。

 Yes 是的 

weights 权重 

number [1-*]

Array of weights to be applied to the morph targets. The number of array elements MUST match the number of morph targets.要应用于变形靶标的重量阵列。数组元素的数量必须匹配变形靶标的数量。

No 不 

name 姓名 

string

The user-defined name of this object.此对象的用户定义名称。

No 不 

extensions 扩展 

extension

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

No 不 

extras 额外 

extras

Application-specific data. 特定于应用程序的数据。 

No 不 

Additional properties are allowed.允许其他属性。

  • JSON schemaschema.jsonJSON模式:mesh.schema.json。 

5.23.1. mesh.primitives 5.23.1。网格 

An array of primitives, each defining geometry to be rendered.一系列原始词,每个都定义要渲染的几何形状。

  • Typeprimitive[1-*] 类型:mesh.primitive [1-*]。 
  • Required:  Yes必需:是的

5.23.2. mesh.weights 5.23.2。网状 

Array of weights to be applied to the morph targets. The number of array elements MUST match the number of morph targets.要应用于变形靶标的重量阵列。数组元素的数量必须匹配变形靶标的数量。

  • Type: number[1-*] 类型:number [1-*]。 
  • Required: No 必需:否

5.23.3. mesh.name 5.23.3。网格。名称 

The user-defined name of this object. This is not necessarily unique, e.g., an accessor and a buffer could have the same name, or two accessors could even have the same name.此对象的用户定义名称。这不一定是唯一的,例如,登录器和一个缓冲区可以具有相同的名称,或者两个访问者甚至可以具有相同的名称。

  • Type: string类型:string。 
  • Required: No 必需:否

5.23.4. mesh.extensions 5.23.4。网格。延伸 

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

  • Typeextension类型:extension。 
  • Required: No 必需:否
  • Type of each property: Extension每个属性的类型:扩展

5.23.5. mesh.extras 5.23.5。网格 

Application-specific data. 特定于应用程序的数据。 

  • Typeextras类型:extras。 
  • Required: No 必需:否

 

5.24. Mesh Primitive 5.24。网格原始 

Geometry to be rendered with the given material.几何形状用给定的材料呈现。

Related WebGL functions: drawElements() and drawArrays()相关的WebGL功能:drawElements()和drawArrays()。

Table 23. Mesh Primitive Properties表23。Mesh Primitive属性

 

Type 类型 

Description 描述 

Required 必需的 

attributes 属性 

object

A plain JSON object, where each key corresponds to a mesh attribute semantic and each value is the index of the accessor containing attribute’s data.一个普通的JSON对象,其中每个密钥对应于网格属性语义,每个值是包含属性数据的访问器的索引。

 Yes 是的 

indices 指数 

integer

The index of the accessor that contains the vertex indices.包含顶点索引的登录器的索引。

No 不 

material 材料 

integer

The index of the material to apply to this primitive when rendering.渲染时,材料的索引适用于此原始。

No 不 

mode 模式 

integer

The topology type of primitives to render.呈现的拓扑类型。

No, default:  不,默认值:4。 4

targets 目标 

object [1-*]

An array of morph targets.一系列变体靶标。

No 不 

extensions 扩展 

extension

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

No 不 

extras 额外 

extras

Application-specific data. 特定于应用程序的数据。 

No 不 

Additional properties are allowed.允许其他属性。

5.24.1. mesh.primitive.attributes5.24.1。网格

A plain JSON object, where each key corresponds to a mesh attribute semantic and each value is the index of the accessor containing attribute’s data.一个普通的JSON对象,其中每个密钥对应于网格属性语义,每个值是包含属性数据的访问器的索引。

  • Type: object类型:object。 
  • Required:  Yes必需:是的
  • Type of each property: integer每个属性的类型:integer。

5.24.2. mesh.primitive.indices 5.24.2。 mesh.primitive.Indices 

The index of the accessor that contains the vertex indices. When this is undefined, the primitive defines non-indexed geometry. When defined, the accessor MUST have SCALAR type and an unsigned integer component type.包含顶点索引的登录器的索引。当这不确定时,原始定义了非索引几何形状。定义时,登录器必须具有SCALAR类型和无符号整数组件类型。

  • Type: integer类型:integer。 
  • Required: No 必需:否
  • Minimum: >= 0最低:>= 0。 
  • Related WebGL functions: drawElements()when defined and drawArrays()相关的WebGL功能:drawElements()定义时,drawArrays()否则。

5.24.3. mesh.primitive.material 5.24.3。网格。材料 

The index of the material to apply to this primitive when rendering.渲染时,材料的索引适用于此原始。

  • Type: integer类型:integer。 
  • Required: No 必需:否
  • Minimum: >= 0最低:>= 0。 

5.24.4. mesh.primitive.mode 5.24.4。 mesh.primitive.mode 

The topology type of primitives to render.呈现的拓扑类型。

  • Type: integer类型:integer。 
  • Required: No, default: 4必需:否,默认值:4。 
  • Allowed values: 允许的值:
    • 0POINTS 0点 
    • 1LINES 1线 
    • 2LINE_LOOP 2 line_loop 
    • 3LINE_STRIP 3 line_strip 
    • 4TRIANGLES 4三角形 
    • 5TRIANGLE_STRIP 5 triangle_strip 
    • 6TRIANGLE_FAN 6 triangle_fan 

5.24.5. mesh.primitive.targets 5.24.5。 mesh.primitive.targets 

An array of morph targets.一系列变体靶标。

  • Type: object[1-*] 类型:object [1-*]。 
  • Required: No 必需:否

5.24.6. mesh.primitive.extensions5.24.6。 mesh.primitive.extensions

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

  • Typeextension类型:extension。 
  • Required: No 必需:否
  • Type of each property: Extension每个属性的类型:扩展

5.24.7. mesh.primitive.extras 5.24.7。 mesh.primitive.extras 

Application-specific data. 特定于应用程序的数据。 

  • Typeextras类型:extras。 
  • Required: No 必需:否

 

5.25. Node 5.25。节点 

A node in the node hierarchy. When the node contains skin, all mesh.primitives MUST contain JOINTS_0 and WEIGHTS_0 attributes. A node MAY have either a matrix or any combination of translation/rotation/scale (TRS) properties. TRS properties are converted to matrices and postmultiplied in the T * R * S order to compose the transformation matrix; first the scale is applied to the vertices, then the rotation, and then the translation. If none are provided, the transform is the identity. When a node is targeted for animation (referenced by an animation.channel.target), matrix MUST NOT be present.节点层次结构中的节点。当节点包含skin时,所有mesh.primitives必须包含JOINTS_0和WEIGHTS_0属性。节点可以具有matrix或translation/rotation/scale </b7>(trs)属性的任何组合。 TRS属性转换为矩阵,并在T * R * S下进行后构成构成转换矩阵的顺序;首先,将刻度应用于顶点,然后是旋转,然后将其应用于翻译。如果没有提供,则转换是身份。当一个节点是针对动画的(由动画引用。channel.target)时,matrix不得存在。

Table 24. Node Properties表24。Node属性

 

Type 类型 

Description 描述 

Required 必需的 

camera 相机 

integer

The index of the camera referenced by this node.该节点引用的摄像机的索引。

No 不 

children 孩子们 

integer [1-*]

The indices of this node’s children.该节点的孩子的索引。

No 不 

skin 皮肤 

integer

The index of the skin referenced by this node.该节点引用的皮肤索引。

No 不 

matrix 矩阵 

number [16]

A floating-point 4x4 transformation matrix stored in column-major order.浮点4x4转换矩阵存储在列级订单中。

No, default:  不,默认值:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]。 [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]

mesh 网 

integer

The index of the mesh in this node.该节点中网格的索引。

No 不 

rotation 旋转 

number [4]

The node’s unit quaternion rotation in the order (x, y, z, w), where w is the scalar.节点的单位四元基因旋转(x,y,z,w),其中w是标量。

No, default:  不,默认值:[0,0,0,1]。 [0,0,0,1]

scale 规模 

number [3]

The node’s non-uniform scale, given as the scaling factors along the x, y, and z axes.节点的不均匀尺度,作为沿X,Y和Z轴的缩放因子给出。

No, default:  不,默认值:[1,1,1]。 [1,1,1]

translation 翻译 

number [3]

The node’s translation along the x, y, and z axes.节点沿X,Y和Z轴的翻译。

No, default:  不,默认值:[0,0,0]。 [0,0,0]

weights 权重 

number [1-*]

The weights of the instantiated morph target. The number of array elements MUST match the number of morph targets of the referenced mesh. When defined, mesh MUST also be defined.实例化的变体靶标的权重。数组元素的数量必须匹配引用网格的变形靶标数。定义时,还必须定义mesh。

No 不 

name 姓名 

string

The user-defined name of this object.此对象的用户定义名称。

No 不 

extensions 扩展 

extension

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

No 不 

extras 额外 

extras

Application-specific data. 特定于应用程序的数据。 

No 不 

Additional properties are allowed.允许其他属性。

  • JSON schemaschema.jsonJSON模式:node.schema.json。 

5.25.1. node.camera 5.25.1。 Node.Camera 

The index of the camera referenced by this node.该节点引用的摄像机的索引。

  • Type: integer类型:integer。 
  • Required: No 必需:否
  • Minimum: >= 0最低:>= 0。 

5.25.2. node.children 5.25.2。节点。儿童 

The indices of this node’s children.该节点的孩子的索引。

  • Type: integer[1-*] 类型:integer [1-*]。 
    • Each element in the array MUSTbe unique.数组中的每个元素都必须唯一。
    • Each element in the array MUSTbe greater than or equal to 0.数组中的每个元素必须大于或等于0。
  • Required: No 必需:否

5.25.3. node.skin 5.25.3。 node.skin 

The index of the skin referenced by this node. When a skin is referenced by a node within a scene, all joints used by the skin MUST belong to the same scene. When defined, mesh MUST also be defined.该节点引用的皮肤索引。当一个场景中的节点引用皮肤时,皮肤使用的所有关节都必须属于同一场景。定义时,还必须定义mesh。

  • Type: integer类型:integer。 
  • Required: No 必需:否
  • Minimum: >= 0最低:>= 0。 

5.25.4. node.matrix 5.25.4。 node.matrix 

A floating-point 4x4 transformation matrix stored in column-major order.浮点4x4转换矩阵存储在列级订单中。

  • Type: number[16] 类型:number [16]。 
  • Required: No, default: [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]必需:否,默认值:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]。 
  • Related WebGL functions: uniformMatrix4fv()with the transpose parameter equal to false相关的WebGL函数:uniformMatrix4fv()带有转置参数等于false

5.25.5. node.mesh 5.25.5。 node.mesh 

The index of the mesh in this node.该节点中网格的索引。

  • Type: integer类型:integer。 
  • Required: No 必需:否
  • Minimum: >= 0最低:>= 0。 

5.25.6. node.rotation 5.25.6。 Node.Rotation 

The node’s unit quaternion rotation in the order (x, y, z, w), where w is the scalar.节点的单位四元基因旋转(x,y,z,w),其中w是标量。

  • Type: number[4] 类型:number [4]。 
    • Each element in the array MUSTbe greater than or equal to -1 and less than or equal to 1.阵列中的每个元素必须大于或等于-1,并且小于或等于1。
  • Required: No, default: [0,0,0,1]必需:否,默认值:[0,0,0,1]。 

5.25.7. node.scale 5.25.7。 node.scale 

The node’s non-uniform scale, given as the scaling factors along the x, y, and z axes.节点的不均匀尺度,作为沿X,Y和Z轴的缩放因子给出。

  • Type: number[3] 类型:number [3]。 
  • Required: No, default: [1,1,1]必需:否,默认值:[1,1,1]。 

5.25.8. node.translation 5.25.8。 node.translation 

The node’s translation along the x, y, and z axes.节点沿X,Y和Z轴的翻译。

  • Type: number[3] 类型:number [3]。 
  • Required: No, default: [0,0,0]必需:否,默认值:[0,0,0]。 

5.25.9. node.weights 5.25.9。 node.xewights 

The weights of the instantiated morph target. The number of array elements MUST match the number of morph targets of the referenced mesh. When defined, mesh MUST also be defined.实例化的变体靶标的权重。数组元素的数量必须匹配引用网格的变形靶标数。定义时,还必须定义mesh。

  • Type: number[1-*] 类型:number [1-*]。 
  • Required: No 必需:否

5.25.10. node.name 5.25.10。 node.name 

The user-defined name of this object. This is not necessarily unique, e.g., an accessor and a buffer could have the same name, or two accessors could even have the same name.此对象的用户定义名称。这不一定是唯一的,例如,登录器和一个缓冲区可以具有相同的名称,或者两个访问者甚至可以具有相同的名称。

  • Type: string类型:string。 
  • Required: No 必需:否

5.25.11. node.extensions 5.25.11。 node.extensions 

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

  • Typeextension类型:extension。 
  • Required: No 必需:否
  • Type of each property: Extension每个属性的类型:扩展

5.25.12. node.extras 5.25.12。 node.extras 

Application-specific data. 特定于应用程序的数据。 

  • Typeextras类型:extras。 
  • Required: No 必需:否

 

5.26. Sampler 5.26。采样器 

Texture sampler properties for filtering and wrapping modes.用于过滤和包装模式的纹理采样器属性。

Table 25. Sampler Properties表25。Sampler属性

 

Type 类型 

Description 描述 

Required 必需的 

magFilter Magfilter 

integer

Magnification filter. 放大过滤器。 

No 不 

minFilter Minfilter 

integer

Minification filter. 缩小过滤器。 

No 不 

wrapS 包裹 

integer

S (U) wrapping mode. S(U)包装模式。 

No, default:  不,默认值:10497。 10497

wrapT 缠绕 

integer

T (V) wrapping mode. t(v)包装模式。 

No, default:  不,默认值:10497。 10497

name 姓名 

string

The user-defined name of this object.此对象的用户定义名称。

No 不 

extensions 扩展 

extension

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

No 不 

extras 额外 

extras

Application-specific data. 特定于应用程序的数据。 

No 不 

Additional properties are allowed.允许其他属性。

  • JSON schemaschema.jsonJSON模式:sampler.schema.json。 

5.26.1. sampler.magFilter 5.26.1。 Sampler.magfilter 

Magnification filter. 放大过滤器。 

  • Type: integer类型:integer。 
  • Required: No 必需:否
  • Allowed values: 允许的值:
    • 9728NEAREST 9728最* 
    • 9729LINEAR 9729线性 
  • Related WebGL functions: samplerParameteri()with pname equal to TEXTURE_MAG_FILTER相关的WebGL函数:samplerParameteri()与pname等于texture_mag_filter

5.26.2. sampler.minFilter 5.26.2。 Sampler.minfilter 

Minification filter. 缩小过滤器。 

  • Type: integer类型:integer。 
  • Required: No 必需:否
  • Allowed values: 允许的值:
    • 9728NEAREST 9728最* 
    • 9729LINEAR 9729线性 
    • 9984NEAREST_MIPMAP_NEAREST 9984最*的_mipmap_nearest 
    • 9985LINEAR_MIPMAP_NEAREST 9985 linear_mipmap_nearest 
    • 9986NEAREST_MIPMAP_LINEAR 9986最*的_mipmap_linear 
    • 9987LINEAR_MIPMAP_LINEAR 9987 linear_mipmap_linear 
  • Related WebGL functions: samplerParameteri()with pname equal to TEXTURE_MIN_FILTER相关的WebGL函数:samplerParameteri()与pname等于texture_min_filter

5.26.3. sampler.wrapS 5.26.3。 Sampler.Wraps 

S (U) wrapping mode. All valid values correspond to WebGL enums.S(U)包装模式。所有有效值对应于WebGL枚举。

  • Type: integer类型:integer。 
  • Required: No, default: 10497必需:否,默认值:10497。 
  • Allowed values: 允许的值:
    • 33071CLAMP_TO_EDGE 33071 clamp_to_edge 
    • 33648MIRRORED_REPEAT 33648镜像 
    • 10497REPEAT 10497重复 
  • Related WebGL functions: samplerParameteri()with pname equal to TEXTURE_WRAP_S相关的WebGL函数:samplerParameteri() pname等于texture_wrap_s

5.26.4. sampler.wrapT 5.26.4。 Sampler.Wrapt 

T (V) wrapping mode. t(v)包装模式。 

  • Type: integer类型:integer。 
  • Required: No, default: 10497必需:否,默认值:10497。 
  • Allowed values: 允许的值:
    • 33071CLAMP_TO_EDGE 33071 clamp_to_edge 
    • 33648MIRRORED_REPEAT 33648镜像 
    • 10497REPEAT 10497重复 
  • Related WebGL functions: samplerParameteri()with pname equal to TEXTURE_WRAP_T相关的WebGL函数:samplerParameteri() pname等于texture_wrap_t

5.26.5. sampler.name 5.26.5。 sampler.name 

The user-defined name of this object. This is not necessarily unique, e.g., an accessor and a buffer could have the same name, or two accessors could even have the same name.此对象的用户定义名称。这不一定是唯一的,例如,登录器和一个缓冲区可以具有相同的名称,或者两个访问者甚至可以具有相同的名称。

  • Type: string类型:string。 
  • Required: No 必需:否

5.26.6. sampler.extensions 5.26.6。 Sampler.extensions 

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

  • Typeextension类型:extension。 
  • Required: No 必需:否
  • Type of each property: Extension每个属性的类型:扩展

5.26.7. sampler.extras 5.26.7。 Sampler.Extras 

Application-specific data. 特定于应用程序的数据。 

  • Typeextras类型:extras。 
  • Required: No 必需:否

 

5.27. Scene 5.27。场景 

The root nodes of a scene.场景的根节点。

Table 26. Scene Properties表26。Scene属性

 

Type 类型 

Description 描述 

Required 必需的 

nodes 节点 

integer [1-*]

The indices of each root node.每个根节点的索引。

No 不 

name 姓名 

string

The user-defined name of this object.此对象的用户定义名称。

No 不 

extensions 扩展 

extension

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

No 不 

extras 额外 

extras

Application-specific data. 特定于应用程序的数据。 

No 不 

Additional properties are allowed.允许其他属性。

  • JSON schemaschema.jsonJSON模式:scene.schema.json。 

5.27.1. scene.nodes 5.27.1。场景。节点 

The indices of each root node.每个根节点的索引。

  • Type: integer[1-*] 类型:integer [1-*]。 
    • Each element in the array MUSTbe unique.数组中的每个元素都必须唯一。
    • Each element in the array MUSTbe greater than or equal to 0.数组中的每个元素必须大于或等于0。
  • Required: No 必需:否

5.27.2. scene.name 5.27.2。 scene.name 

The user-defined name of this object. This is not necessarily unique, e.g., an accessor and a buffer could have the same name, or two accessors could even have the same name.此对象的用户定义名称。这不一定是唯一的,例如,登录器和一个缓冲区可以具有相同的名称,或者两个访问者甚至可以具有相同的名称。

  • Type: string类型:string。 
  • Required: No 必需:否

5.27.3. scene.extensions 5.27.3。 scene.extensions 

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

  • Typeextension类型:extension。 
  • Required: No 必需:否
  • Type of each property: Extension每个属性的类型:扩展

5.27.4. scene.extras 5.27.4。 scene.extras 

Application-specific data. 特定于应用程序的数据。 

  • Typeextras类型:extras。 
  • Required: No 必需:否

 

5.28. Skin 5.28。皮肤 

Joints and matrices defining a skin.关节和矩阵定义皮肤。

Table 27. Skin Properties表27。Skin属性

 

Type 类型 

Description 描述 

Required 必需的 

inverseBindMatrices 逆向膜片 

integer

The index of the accessor containing the floating-point 4x4 inverse-bind matrices.包含浮点4x4逆矩阵的登录器的索引。

No 不 

skeleton 骨骼 

integer

The index of the node used as a skeleton root.节点的索引用作骨骼根。

No 不 

joints 关节 

integer [1-*]

Indices of skeleton nodes, used as joints in this skin.骨骼节点的指标,用作该皮肤的关节。

 Yes 是的 

name 姓名 

string

The user-defined name of this object.此对象的用户定义名称。

No 不 

extensions 扩展 

extension

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

No 不 

extras 额外 

extras

Application-specific data. 特定于应用程序的数据。 

No 不 

Additional properties are allowed.允许其他属性。

  • JSON schemaschema.jsonJSON模式:skin.schema.json。 

5.28.1. skin.inverseBindMatrices5.28.1。皮肤

The index of the accessor containing the floating-point 4x4 inverse-bind matrices. Its accessor.count property MUST be greater than or equal to the number of elements of the joints array. When undefined, each matrix is a 4x4 identity matrix.包含浮点4x4逆矩阵的登录器的索引。其accessor.count属性必须大于或等于<b1>> </b1>数组的元素数量。当未定义时,每个矩阵是一个4x4身份矩阵。

  • Type: integer类型:integer。 
  • Required: No 必需:否
  • Minimum: >= 0最低:>= 0。 

5.28.2. skin.skeleton 5.28.2。皮肤 

The index of the node used as a skeleton root. The node MUST be the closest common root of the joints hierarchy or a direct or indirect parent node of the closest common root.节点的索引用作骨骼根。该节点必须是关节层次结构的最接*的共同根或最接*共同根的直接或间接的父节点。

  • Type: integer类型:integer。 
  • Required: No 必需:否
  • Minimum: >= 0最低:>= 0。 

5.28.3. skin.joints 5.28.3。皮肤 

Indices of skeleton nodes, used as joints in this skin.骨骼节点的指标,用作该皮肤的关节。

  • Type: integer[1-*] 类型:integer [1-*]。 
    • Each element in the array MUSTbe unique.数组中的每个元素都必须唯一。
    • Each element in the array MUSTbe greater than or equal to 0.数组中的每个元素必须大于或等于0。
  • Required:  Yes必需:是的

5.28.4. skin.name 5.28.4。皮肤。名称 

The user-defined name of this object. This is not necessarily unique, e.g., an accessor and a buffer could have the same name, or two accessors could even have the same name.此对象的用户定义名称。这不一定是唯一的,例如,登录器和一个缓冲区可以具有相同的名称,或者两个访问者甚至可以具有相同的名称。

  • Type: string类型:string。 
  • Required: No 必需:否

5.28.5. skin.extensions 5.28.5。皮肤。延伸 

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

  • Typeextension类型:extension。 
  • Required: No 必需:否
  • Type of each property: Extension每个属性的类型:扩展

5.28.6. skin.extras 5.28.6。 skin.extras 

Application-specific data. 特定于应用程序的数据。 

  • Typeextras类型:extras。 
  • Required: No 必需:否

 

5.29. Texture 5.29。质地 

A texture and its sampler.纹理及其采样器。

Related WebGL functions: createTexture(), deleteTexture(), bindTexture(), texImage2D(), and texParameterf()相关的WebGL功能:createTexture(),deleteTexture(),bindTexture(),texImage2D()和texParameterf()。

Table 28. Texture Properties表28。Texture属性

 

Type 类型 

Description 描述 

Required 必需的 

sampler 采样器 

integer

The index of the sampler used by this texture. When undefined, a sampler with repeat wrapping and auto filtering SHOULD be used.该纹理使用的采样器的索引。当不确定时,应使用具有重复包装和自动过滤的采样器。

No 不 

source 来源 

integer

The index of the image used by this texture. When undefined, an extension or other mechanism SHOULD supply an alternate texture source, otherwise behavior is undefined.此纹理使用的图像的索引。如果不确定,扩展或其他机制应提供替代纹理源,否则行为是不确定的。

No 不 

name 姓名 

string

The user-defined name of this object.此对象的用户定义名称。

No 不 

extensions 扩展 

extension

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

No 不 

extras 额外 

extras

Application-specific data. 特定于应用程序的数据。 

No 不 

Additional properties are allowed.允许其他属性。

  • JSON schemaschema.jsonJSON模式:texture.schema.json。 

5.29.1. texture.sampler 5.29.1。纹理 

The index of the sampler used by this texture. When undefined, a sampler with repeat wrapping and auto filtering SHOULD be used.该纹理使用的采样器的索引。当不确定时,应使用具有重复包装和自动过滤的采样器。

  • Type: integer类型:integer。 
  • Required: No 必需:否
  • Minimum: >= 0最低:>= 0。 

5.29.2. texture.source 5.29.2。纹理 

The index of the image used by this texture. When undefined, an extension or other mechanism SHOULD supply an alternate texture source, otherwise behavior is undefined.此纹理使用的图像的索引。如果不确定,扩展或其他机制应提供替代纹理源,否则行为是不确定的。

  • Type: integer类型:integer。 
  • Required: No 必需:否
  • Minimum: >= 0最低:>= 0。 

5.29.3. texture.name 5.29.3。 texture.name 

The user-defined name of this object. This is not necessarily unique, e.g., an accessor and a buffer could have the same name, or two accessors could even have the same name.此对象的用户定义名称。这不一定是唯一的,例如,登录器和一个缓冲区可以具有相同的名称,或者两个访问者甚至可以具有相同的名称。

  • Type: string类型:string。 
  • Required: No 必需:否

5.29.4. texture.extensions 5.29.4。纹理。扩展 

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

  • Typeextension类型:extension。 
  • Required: No 必需:否
  • Type of each property: Extension每个属性的类型:扩展

5.29.5. texture.extras 5.29.5。 texture.extras 

Application-specific data. 特定于应用程序的数据。 

  • Typeextras类型:extras。 
  • Required: No 必需:否

 

5.30. Texture Info 5.30。纹理信息 

Reference to a texture. 引用纹理。 

Table 29. Texture Info Properties表29。Texture Info属性

 

Type 类型 

Description 描述 

Required 必需的 

index 指数 

integer

The index of the texture.纹理的索引。

 Yes 是的 

texCoord Texcoord 

integer

The set index of texture’s TEXCOORD attribute used for texture coordinate mapping.用于纹理坐标映射的Texture的TexCoord属性的集合索引。

No, default:  不,默认值:0。 0

extensions 扩展 

extension

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

No 不 

extras 额外 

extras

Application-specific data. 特定于应用程序的数据。 

No 不 

Additional properties are allowed.允许其他属性。

  • JSON schemaschema.jsonJSON模式:textureInfo.schema.json。 

5.30.1. textureInfo.index 5.30.1。 TextureInfo.Index 

The index of the texture.纹理的索引。

  • Type: integer类型:integer。 
  • Required:  Yes必需:是的
  • Minimum: >= 0最低:>= 0。 

5.30.2. textureInfo.texCoord 5.30.2。 TextureInfo.TexCoord 

This integer value is used to construct a string in the format TEXCOORD_<set index> which is a reference to a key in mesh.primitives.attributes (e.g. a value of 0 corresponds to TEXCOORD_0). A mesh primitive MUST have the corresponding texture coordinate attributes for the material to be applicable to it.此整数值用于以格式TEXCOORD_<set index>构造字符串,该字符串是对<b1>> </b1>中的键的引用(例如,0的值对应于0对应于TEXCOORD_0)。网格原始性必须具有相应的纹理坐标属性,以使其适用于其。

  • Type: integer类型:integer。 
  • Required: No, default: 0必需:否,默认值:0。 
  • Minimum: >= 0最低:>= 0。 

5.30.3. textureInfo.extensions 5.30.3。 textureInfo.extensions 

JSON object with extension-specific objects.带有特定于扩展对象的JSON对象。

  • Typeextension类型:extension。 
  • Required: No 必需:否
  • Type of each property: Extension每个属性的类型:扩展

5.30.4. textureInfo.extras 5.30.4。 TextureInfo.Extras 

Application-specific data. 特定于应用程序的数据。 

  • Typeextras类型:extras。 
  • Required: No 必需:否
  1. Acknowledgments (Informative)6。致谢(信息性)

6.1. Editors 6.1。编辑 

  • Saurabh Bhatia, Microsoft Microsoft Saurabh Bhatia 
  • Patrick Cozzi, Cesium 帕特里克科兹(Patrick Cozzi)
  • Alexey Knyazev, Individual ContributorAlexey Knyazev,个人贡献者
  • Tony Parisi, Unity 托尼帕里西(Tony Parisi),团结

6.2. Khronos 3D Formats Working Group and Alumni6.2。 Khronos 3D格式工作组和校友

  • Remi Arnaud, Vario Remi Arnaud,Vario 
  • Mike Bond, Adobe Mike Bond,Adobe 
  • Leonard Daly, Individual Contributor伦纳德戴利(Leonard Daly),个人贡献者
  • Emiliano Gambaretto, Adobe Emiliano Gambaretto,Adobe 
  • Tobias Häußler, Dassault SystèmesTobiasHäußler,DassaultSystèmes
  • Gary Hsu, Microsoft Microsoft的Gary Hsu 
  • Marco Hutter, Individual ContributorMarco Hutter,个人贡献者
  • Uli Klumpp, Individual ContributorUli Klumpp,个人贡献者
  • Max Limper, Fraunhofer IGD Max Limper,Fraunhofer IGD 
  • Ed Mackey, Analytical Graphics, Inc.Ed Mackey,Analytical Graphics,Inc。
  • Don McCurdy, Google Don McCurdy,Google 
  • Scott Nagy, Microsoft 斯科特纳吉(Scott Nagy),微软
  • Norbert Nopper, UX3D Norbert Nopper,UX3D 
  • Fabrice Robinet, Individual Contributor (Previous Editor and Incubator)Fabrice Robinet,个人贡献者(以前的编辑和孵化器)
  • Bastian Sdorra, Dassault SystèmesBastian Sdorra,DassaultSystèmes
  • Neil Trevett, NVIDIA 尼尔特雷维特(Neil Trevett),恩维迪亚(Nvidia)
  • Jan Paul Van Waveren, OculusJan Paul Van Waveren,Oculus
  • Amanda Watson, Oculus 阿曼达沃森(Amanda Watson),Oculus 

6.3. Special Thanks 6.3。特别感谢 

  • Sarah Chow, Cesium 萨拉乔(Sarah Chow),剖腹产
  • Tom Fili, Cesium 汤姆菲利(Cesium)
  • Darryl Gough 达里尔高夫
  • Eric Haines, Autodesk Eric Haines,Autodesk 
  • Yu Chen Hou, Individual ContributorYu Chen Hou,个人贡献者
  • Scott Hunter, Analytical Graphics, Inc.Scott Hunter,Analytical Graphics,Inc。
  • Brandon Jones, Google 布兰登琼斯(Brandon Jones),Google 
  • Arseny Kapoulkine, Individual ContributorArseny Kapoulkine,个人贡献者
  • Jon Leech, Individual Contributor乔恩利奇(Jon Leech),个人贡献者
  • Sean Lilley, Cesium 肖恩利利(Sean Lilley),仪式
  • Juan Linietsky, Godot Engine Juan Linietsky,Godot引擎
  • Matthew McMullan, Individual ContributorMatthew McMullan,个人贡献者
  • Mohamad Moneimne, University of Pennsylvania宾夕法尼亚大学Mohamad Moneimne
  • Kai Ninomiya, formerly Cesium Kai Ninomiya,以前是剖腹产
  • Cedric Pinson, Sketchfab 塞德里克*森(Cedric Pinson),Sketchfab 
  • Jeff Russell, Marmoset Jeff Russell,Marmoset 
  • Miguel Sousa, Fraunhofer IGD Miguel Sousa,Fraunhofer IGD 
  • Timo Sturm, Fraunhofer IGD Timo Sturm,Fraunhofer IGD 
  • Rob Taglang, Cesium 罗布塔格兰(Rob Taglang),剖腹产
  • Maik Thöner, Fraunhofer IGD MaikThöner,Fraunhofer IGD 
  • Steven Vergenz, AltspaceVR Steven Vergenz,AltSpacevr 
  • Corentin Wallez, Google Corentin Wallez,Google 
  • Alex Wood, Analytical Graphics, IncAlex Wood,Analytical Graphics,Inc

Appendix A: JSON Schema Reference (Informative)附录A:JSON模式参考(信息性)

A.1. JSON Schema for AccessorA.1。 JSON模式登录机

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "accessor.schema.json",

    "title": "Accessor",

    "type": "object",

    "description": "A typed view into a buffer view that contains raw binary data.",

    "allOf": [ { "$ref": "glTFChildOfRootProperty.schema.json" } ],

    "properties": {

        "bufferView": {

            "allOf": [ { "$ref": "glTFid.schema.json" } ],

            "description": "The index of the bufferView.",

            "gltf_detailedDescription": "The index of the buffer view. When undefined, the accessor **MUST** be initialized with zeros; `sparse` property or extensions **MAY** override zeros with actual values."

        },

        "byteOffset": {

            "type": "integer",

            "description": "The offset relative to the start of the buffer view in bytes.",

            "minimum": 0,

            "default": 0,

            "gltf_detailedDescription": "The offset relative to the start of the buffer view in bytes.  This **MUST** be a multiple of the size of the component datatype. This property **MUST NOT** be defined when `bufferView` is undefined.",

            "gltf_webgl": "`vertexAttribPointer()` offset parameter"

        },

        "componentType": {

            "description": "The datatype of the accessor's components.",

            "gltf_detailedDescription": "The datatype of the accessor's components.  UNSIGNED_INT type **MUST NOT** be used for any accessor that is not referenced by `mesh.primitive.indices`.",

            "gltf_webgl": "`type` parameter of `vertexAttribPointer()`.  The corresponding typed arrays are `Int8Array`, `Uint8Array`, `Int16Array`, `Uint16Array`, `Uint32Array`, and `Float32Array`.",

            "anyOf": [

                {

                    "const": 5120,

                    "description": "BYTE",

                    "type": "integer"

                },

                {

                    "const": 5121,

                    "description": "UNSIGNED_BYTE",

                    "type": "integer"

                },

                {

                    "const": 5122,

                    "description": "SHORT",

                    "type": "integer"

                },

                {

                    "const": 5123,

                    "description": "UNSIGNED_SHORT",

                    "type": "integer"

                },

                {

                    "const": 5125,

                    "description": "UNSIGNED_INT",

                    "type": "integer"

                },

                {

                    "const": 5126,

                    "description": "FLOAT",

                    "type": "integer"

                },

                {

                    "type": "integer"

                }

            ]

        },

        "normalized": {

            "type": "boolean",

            "description": "Specifies whether integer data values are normalized before usage.",

            "default": false,

            "gltf_detailedDescription": "Specifies whether integer data values are normalized (`true`) to [0, 1] (for unsigned types) or to [-1, 1] (for signed types) when they are accessed. This property **MUST NOT** be set to `true` for accessors with `FLOAT` or `UNSIGNED_INT` component type.",

            "gltf_webgl": "`normalized` parameter of `vertexAttribPointer()` "

        },

        "count": {

            "type": "integer",

            "description": "The number of elements referenced by this accessor.",

            "minimum": 1,

            "gltf_detailedDescription": "The number of elements referenced by this accessor, not to be confused with the number of bytes or number of components."

        },

        "type": {

            "description": "Specifies if the accessor's elements are scalars, vectors, or matrices.",

            "anyOf": [

                {

                    "const": "SCALAR"

                },

                {

                    "const": "VEC2"

                },

                {

                    "const": "VEC3"

                },

                {

                    "const": "VEC4"

                },

                {

                    "const": "MAT2"

                },

                {

                    "const": "MAT3"

                },

                {

                    "const": "MAT4"

                },

                {

                    "type": "string"

                }

            ]

        },

        "max": {

            "type": "array",

            "description": "Maximum value of each component in this accessor.",

            "items": {

                "type": "number"

            },

            "minItems": 1,

            "maxItems": 16,

            "gltf_detailedDescription": "Maximum value of each component in this accessor.  Array elements **MUST** be treated as having the same data type as accessor's `componentType`. Both `min` and `max` arrays have the same length.  The length is determined by the value of the `type` property; it can be 1, 2, 3, 4, 9, or 16.\n\n`normalized` property has no effect on array values: they always correspond to the actual values stored in the buffer. When the accessor is sparse, this property **MUST** contain maximum values of accessor data with sparse substitution applied."

        },

        "min": {

            "type": "array",

            "description": "Minimum value of each component in this accessor.",

            "items": {

                "type": "number"

            },

            "minItems": 1,

            "maxItems": 16,

            "gltf_detailedDescription": "Minimum value of each component in this accessor.  Array elements **MUST** be treated as having the same data type as accessor's `componentType`. Both `min` and `max` arrays have the same length.  The length is determined by the value of the `type` property; it can be 1, 2, 3, 4, 9, or 16.\n\n`normalized` property has no effect on array values: they always correspond to the actual values stored in the buffer. When the accessor is sparse, this property **MUST** contain minimum values of accessor data with sparse substitution applied."

        },

        "sparse": {

            "allOf": [ { "$ref": "accessor.sparse.schema.json" } ],

            "description": "Sparse storage of elements that deviate from their initialization value."

        },

        "name": { },

        "extensions": { },

        "extras": { }

    },

    "dependencies": {

        "byteOffset": [ "bufferView" ]

    },

    "required": [ "componentType", "count", "type" ]

}

A.2. JSON Schema for Accessor SparseA.2。 JSON模式用于登录稀疏

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "accessor.sparse.schema.json",

    "title": "Accessor Sparse",

    "type": "object",

    "description": "Sparse storage of accessor values that deviate from their initialization value.",

    "allOf": [ { "$ref": "glTFProperty.schema.json" } ],

    "properties": {

        "count": {

            "type": "integer",

            "description": "Number of deviating accessor values stored in the sparse array.",

            "minimum": 1

        },

        "indices": {

            "allOf": [ { "$ref": "accessor.sparse.indices.schema.json" } ],

            "description": "An object pointing to a buffer view containing the indices of deviating accessor values. The number of indices is equal to `count`. Indices **MUST** strictly increase."

        },

        "values": {

            "allOf": [ { "$ref": "accessor.sparse.values.schema.json" } ],

            "description": "An object pointing to a buffer view containing the deviating accessor values."

        },

        "extensions": { },

        "extras": { }

    },

    "required": [ "count", "indices", "values" ]

}

A.3. JSON Schema for Accessor Sparse IndicesA.3。 JSON模式访问稀疏指数

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "accessor.sparse.indices.schema.json",

    "title": "Accessor Sparse Indices",

    "type": "object",

    "description": "An object pointing to a buffer view containing the indices of deviating accessor values. The number of indices is equal to `accessor.sparse.count`. Indices **MUST** strictly increase.",

    "allOf": [ { "$ref": "glTFProperty.schema.json" } ],

    "properties": {

        "bufferView": {

            "allOf": [ { "$ref": "glTFid.schema.json" } ],

            "description": "The index of the buffer view with sparse indices. The referenced buffer view **MUST NOT** have its `target` or `byteStride` properties defined. The buffer view and the optional `byteOffset` **MUST** be aligned to the `componentType` byte length."

        },

        "byteOffset": {

            "type": "integer",

            "description": "The offset relative to the start of the buffer view in bytes.",

            "minimum": 0,

            "default": 0

        },

        "componentType": {

            "description": "The indices data type.",

            "anyOf": [

                {

                    "const": 5121,

                    "description": "UNSIGNED_BYTE",

                    "type": "integer"

                },

                {

                    "const": 5123,

                    "description": "UNSIGNED_SHORT",

                    "type": "integer"

                },

                {

                    "const": 5125,

                    "description": "UNSIGNED_INT",

                    "type": "integer"

                },

                {

                    "type": "integer"

                }

            ]

        },

        "extensions": { },

        "extras": { }

    },

    "required": [ "bufferView", "componentType" ]

}

A.4. JSON Schema for Accessor Sparse ValuesA.4。 JSON模式用于登录稀疏值

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "accessor.sparse.values.schema.json",

    "title": "Accessor Sparse Values",

    "type": "object",

    "description": "An object pointing to a buffer view containing the deviating accessor values. The number of elements is equal to `accessor.sparse.count` times number of components. The elements have the same component type as the base accessor. The elements are tightly packed. Data **MUST** be aligned following the same rules as the base accessor.",

    "allOf": [ { "$ref": "glTFProperty.schema.json" } ],

    "properties": {

        "bufferView": {

            "allOf": [ { "$ref": "glTFid.schema.json" } ],

            "description": "The index of the bufferView with sparse values. The referenced buffer view **MUST NOT** have its `target` or `byteStride` properties defined."

        },

        "byteOffset": {

            "type": "integer",

            "description": "The offset relative to the start of the bufferView in bytes.",

            "minimum": 0,

            "default": 0

        },

        "extensions": { },

        "extras": { }

    },

    "required": [ "bufferView" ]

}

A.5. JSON Schema for AnimationA.5。 JSON动画模式

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "animation.schema.json",

    "title": "Animation",

    "type": "object",

    "description": "A keyframe animation.",

    "allOf": [ { "$ref": "glTFChildOfRootProperty.schema.json" } ],

    "properties": {

        "channels": {

            "type": "array",

            "description": "An array of animation channels. An animation channel combines an animation sampler with a target property being animated. Different channels of the same animation **MUST NOT** have the same targets.",

            "items": {

                "$ref": "animation.channel.schema.json"

            },

            "minItems": 1

        },

        "samplers": {

            "type": "array",

            "description": "An array of animation samplers. An animation sampler combines timestamps with a sequence of output values and defines an interpolation algorithm.",

            "items": {

                "$ref": "animation.sampler.schema.json"

            },

            "minItems": 1

        },

        "name": { },

        "extensions": { },

        "extras": { }

    },

    "required": [ "channels", "samplers" ]

}

A.6. JSON Schema for Animation ChannelA.6。动画频道的JSON模式

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "animation.channel.schema.json",

    "title": "Animation Channel",

    "type": "object",

    "description": "An animation channel combines an animation sampler with a target property being animated.",

    "allOf": [ { "$ref": "glTFProperty.schema.json" } ],

    "properties": {

        "sampler": {

            "allOf": [ { "$ref": "glTFid.schema.json" } ],

            "description": "The index of a sampler in this animation used to compute the value for the target.",

            "gltf_detailedDescription": "The index of a sampler in this animation used to compute the value for the target, e.g., a node's translation, rotation, or scale (TRS)."

        },

        "target": {

            "allOf": [ { "$ref": "animation.channel.target.schema.json" } ],

            "description": "The descriptor of the animated property."

        },

        "extensions": { },

        "extras": { }

    },

    "required": [ "sampler", "target" ]

}

A.7. JSON Schema for Animation Channel TargetA.7。动画频道目标的JSON模式

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "animation.channel.target.schema.json",

    "title": "Animation Channel Target",

    "type": "object",

    "description": "The descriptor of the animated property.",

    "allOf": [ { "$ref": "glTFProperty.schema.json" } ],

    "properties": {

        "node": {

            "allOf": [ { "$ref": "glTFid.schema.json" } ],

            "description": "The index of the node to animate. When undefined, the animated object **MAY** be defined by an extension."

        },

        "path": {

            "description": "The name of the node's TRS property to animate, or the `\"weights\"` of the Morph Targets it instantiates. For the `\"translation\"` property, the values that are provided by the sampler are the translation along the X, Y, and Z axes. For the `\"rotation\"` property, the values are a quaternion in the order (x, y, z, w), where w is the scalar. For the `\"scale\"` property, the values are the scaling factors along the X, Y, and Z axes.",

            "anyOf": [

                {

                    "const": "translation"

                },

                {

                    "const": "rotation"

                },

                {

                    "const": "scale"

                },

                {

                    "const": "weights"

                },

                {

                    "type": "string"

                }

            ]

        },

        "extensions": { },

        "extras": { }

    },

    "required": [ "path" ]

}

A.8. JSON Schema for Animation SamplerA.8。 JSON动画采样器模式

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "animation.sampler.schema.json",

    "title": "Animation Sampler",

    "type": "object",

    "description": "An animation sampler combines timestamps with a sequence of output values and defines an interpolation algorithm.",

    "allOf": [ { "$ref": "glTFProperty.schema.json" } ],

    "properties": {

        "input": {

            "allOf": [ { "$ref": "glTFid.schema.json" } ],

            "description": "The index of an accessor containing keyframe timestamps.",

            "gltf_detailedDescription": "The index of an accessor containing keyframe timestamps. The accessor **MUST** be of scalar type with floating-point components. The values represent time in seconds with `time[0] >= 0.0`, and strictly increasing values, i.e., `time[n + 1] > time[n]`."

        },

        "interpolation": {

            "description": "Interpolation algorithm.",

            "default": "LINEAR",

            "gltf_detailedDescription": "Interpolation algorithm.",

            "anyOf": [

                {

                    "const": "LINEAR",

                    "description": "The animated values are linearly interpolated between keyframes. When targeting a rotation, spherical linear interpolation (slerp) **SHOULD** be used to interpolate quaternions. The number of output elements **MUST** equal the number of input elements."

                },

                {

                    "const": "STEP",

                    "description": "The animated values remain constant to the output of the first keyframe, until the next keyframe. The number of output elements **MUST** equal the number of input elements."

                },

                {

                    "const": "CUBICSPLINE",

                    "description": "The animation's interpolation is computed using a cubic spline with specified tangents. The number of output elements **MUST** equal three times the number of input elements. For each input element, the output stores three elements, an in-tangent, a spline vertex, and an out-tangent. There **MUST** be at least two keyframes when using this interpolation."

                },

                {

                    "type": "string"

                }

            ]

        },

        "output": {

            "allOf": [ { "$ref": "glTFid.schema.json" } ],

            "description": "The index of an accessor, containing keyframe output values."

        },

        "extensions": { },

        "extras": { }

    },

    "required": [ "input", "output" ]

}

A.9. JSON Schema for AssetA.9。 JSON资产模式

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "asset.schema.json",

    "title": "Asset",

    "type": "object",

    "description": "Metadata about the glTF asset.",

    "allOf": [ { "$ref": "glTFProperty.schema.json" } ],

    "properties": {

        "copyright": {

            "type": "string",

            "description": "A copyright message suitable for display to credit the content creator."

        },

        "generator": {

            "type": "string",

            "description": "Tool that generated this glTF model.  Useful for debugging."

        },

        "version": {

            "type": "string",

            "description": "The glTF version in the form of `<major>.<minor>` that this asset targets.",

            "pattern": "^[0-9]+\.[0-9]+$"

        },

        "minVersion": {

            "type": "string",

            "description": "The minimum glTF version in the form of `<major>.<minor>` that this asset targets. This property **MUST NOT** be greater than the asset version.",

            "pattern": "^[0-9]+\.[0-9]+$"

        },

        "extensions": { },

        "extras": { }

    },

    "required": [ "version" ]

}

A.10. JSON Schema for BufferA.10。 JSON模式用于缓冲区

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "buffer.schema.json",

    "title": "Buffer",

    "type": "object",

    "description": "A buffer points to binary geometry, animation, or skins.",

    "allOf": [ { "$ref": "glTFChildOfRootProperty.schema.json" } ],

    "properties": {

        "uri": {

            "type": "string",

            "description": "The URI (or IRI) of the buffer.",

            "format": "iri-reference",

            "gltf_detailedDescription": "The URI (or IRI) of the buffer.  Relative paths are relative to the current glTF asset.  Instead of referencing an external file, this field **MAY** contain a `data:`-URI.",

            "gltf_uriType": "application"

        },

        "byteLength": {

            "type": "integer",

            "description": "The length of the buffer in bytes.",

            "minimum": 1

        },

        "name": { },

        "extensions": { },

        "extras": { }

    },

    "required": [ "byteLength" ]

}

A.11. JSON Schema for Buffer ViewA.11。 JSON模式用于缓冲视图

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "bufferView.schema.json",

    "title": "Buffer View",

    "type": "object",

    "description": "A view into a buffer generally representing a subset of the buffer.",

    "allOf": [ { "$ref": "glTFChildOfRootProperty.schema.json" } ],

    "properties": {

        "buffer": {

            "allOf": [ { "$ref": "glTFid.schema.json" } ],

            "description": "The index of the buffer."

        },

        "byteOffset": {

            "type": "integer",

            "description": "The offset into the buffer in bytes.",

            "minimum": 0,

            "default": 0

        },

        "byteLength": {

            "type": "integer",

            "description": "The length of the bufferView in bytes.",

            "minimum": 1

        },

        "byteStride": {

            "type": "integer",

            "description": "The stride, in bytes.",

            "minimum": 4,

            "maximum": 252,

            "multipleOf": 4,

            "gltf_detailedDescription": "The stride, in bytes, between vertex attributes.  When this is not defined, data is tightly packed. When two or more accessors use the same buffer view, this field **MUST** be defined.",

            "gltf_webgl": "`vertexAttribPointer()` stride parameter"

        },

        "target": {

            "description": "The hint representing the intended GPU buffer type to use with this buffer view.",

            "gltf_webgl": "`bindBuffer()`",

            "anyOf": [

                {

                    "const": 34962,

                    "description": "ARRAY_BUFFER",

                    "type": "integer"

                },

                {

                    "const": 34963,

                    "description": "ELEMENT_ARRAY_BUFFER",

                    "type": "integer"

                },

                {

                    "type": "integer"

                }

            ]

        },

        "name": { },

        "extensions": { },

        "extras": { }

    },

    "required": [ "buffer", "byteLength" ]

}

A.12. JSON Schema for CameraA.12。 JSON模式相机

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "camera.schema.json",

    "title": "Camera",

    "type": "object",

    "description": "A camera's projection.  A node **MAY** reference a camera to apply a transform to place the camera in the scene.",

    "allOf": [ { "$ref": "glTFChildOfRootProperty.schema.json" } ],

    "properties": {

        "orthographic": {

            "allOf": [ { "$ref": "camera.orthographic.schema.json" } ],

            "description": "An orthographic camera containing properties to create an orthographic projection matrix. This property **MUST NOT** be defined when `perspective` is defined."

        },

        "perspective": {

            "allOf": [ { "$ref": "camera.perspective.schema.json" } ],

            "description": "A perspective camera containing properties to create a perspective projection matrix. This property **MUST NOT** be defined when `orthographic` is defined."

        },

        "type": {

            "description": "Specifies if the camera uses a perspective or orthographic projection.",

            "gltf_detailedDescription": "Specifies if the camera uses a perspective or orthographic projection.  Based on this, either the camera's `perspective` or `orthographic` property **MUST** be defined.",

            "anyOf": [

                {

                    "const": "perspective"

                },

                {

                    "const": "orthographic"

                },

                {

                    "type": "string"

                }

            ]

        },

        "name": { },

        "extensions": { },

        "extras": { }

    },

    "required": [ "type" ],

    "not": {

        "required": [ "perspective", "orthographic" ]

    }

}

A.13. JSON Schema for Camera OrthographicA.13。摄像机拼字法的JSON模式

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "camera.orthographic.schema.json",

    "title": "Camera Orthographic",

    "type": "object",

    "description": "An orthographic camera containing properties to create an orthographic projection matrix.",

    "allOf": [ { "$ref": "glTFProperty.schema.json" } ],

    "properties": {

        "xmag": {

            "type": "number",

            "description": "The floating-point horizontal magnification of the view. This value **MUST NOT** be equal to zero. This value **SHOULD NOT** be negative."

        },

        "ymag": {

            "type": "number",

            "description": "The floating-point vertical magnification of the view. This value **MUST NOT** be equal to zero. This value **SHOULD NOT** be negative."

        },

        "zfar": {

            "type": "number",

            "description": "The floating-point distance to the far clipping plane. This value **MUST NOT** be equal to zero. `zfar` **MUST** be greater than `znear`.",

            "exclusiveMinimum": 0.0

        },

        "znear": {

            "type": "number",

            "description": "The floating-point distance to the near clipping plane.",

            "minimum": 0.0

        },

        "extensions": { },

        "extras": { }

    },

    "required": [ "xmag", "ymag", "zfar", "znear" ]

}

A.14. JSON Schema for Camera PerspectiveA.14。 JSON模式用于摄像机视角

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "camera.perspective.schema.json",

    "title": "Camera Perspective",

    "type": "object",

    "description": "A perspective camera containing properties to create a perspective projection matrix.",

    "allOf": [ { "$ref": "glTFProperty.schema.json" } ],

    "properties": {

        "aspectRatio": {

            "type": "number",

            "description": "The floating-point aspect ratio of the field of view.",

            "exclusiveMinimum": 0.0,

            "gltf_detailedDescription": "The floating-point aspect ratio of the field of view. When undefined, the aspect ratio of the rendering viewport **MUST** be used."

        },

        "yfov": {

            "type": "number",

            "description": "The floating-point vertical field of view in radians. This value **SHOULD** be less than π.",

            "exclusiveMinimum": 0.0

        },

        "zfar": {

            "type": "number",

            "description": "The floating-point distance to the far clipping plane.",

            "exclusiveMinimum": 0.0,

            "gltf_detailedDescription": "The floating-point distance to the far clipping plane. When defined, `zfar` **MUST** be greater than `znear`. If `zfar` is undefined, client implementations **SHOULD** use infinite projection matrix."

        },

        "znear": {

            "type": "number",

            "description": "The floating-point distance to the near clipping plane.",

            "exclusiveMinimum": 0.0,

            "gltf_detailedDescription": "The floating-point distance to the near clipping plane."

        },

        "extensions": { },

        "extras": { }

    },

    "required": [ "yfov", "znear" ]

}

A.15. JSON Schema for ExtensionA.15。 JSON模式扩展

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "extension.schema.json",

    "title": "Extension",

    "type": "object",

    "description": "JSON object with extension-specific objects.",

    "properties": {

    },

    "additionalProperties": {

        "type": "object"

    }

}

A.16. JSON Schema for ExtrasA.16。 JSON模式用于额外

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "extras.schema.json",

    "title": "Extras",

    "description": "Application-specific data.",

    "gltf_sectionDescription": "Although `extras` **MAY** have any type, it is common for applications to store and access custom data as key/value pairs. Therefore, `extras` **SHOULD** be a JSON object rather than a primitive value for best portability."

}

A.17. JSON Schema for glTFA.17。 GLTF的JSON模式

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "glTF.schema.json",

    "title": "glTF",

    "type": "object",

    "description": "The root object for a glTF asset.",

    "allOf": [ { "$ref": "glTFProperty.schema.json" } ],

    "properties": {

        "extensionsUsed": {

            "type": "array",

            "description": "Names of glTF extensions used in this asset.",

            "items": {

                "type": "string"

            },

            "uniqueItems": true,

            "minItems": 1

        },

        "extensionsRequired": {

            "type": "array",

            "description": "Names of glTF extensions required to properly load this asset.",

            "items": {

                "type": "string"

            },

            "uniqueItems": true,

            "minItems": 1

        },

        "accessors": {

            "type": "array",

            "description": "An array of accessors.",

            "items": {

                "$ref": "accessor.schema.json"

            },

            "minItems": 1,

            "gltf_detailedDescription": "An array of accessors.  An accessor is a typed view into a bufferView."

        },

        "animations": {

            "type": "array",

            "description": "An array of keyframe animations.",

            "items": {

                "$ref": "animation.schema.json"

            },

            "minItems": 1

        },

        "asset": {

            "allOf": [ { "$ref": "asset.schema.json" } ],

            "description": "Metadata about the glTF asset."

        },

        "buffers": {

            "type": "array",

            "description": "An array of buffers.",

            "items": {

                "$ref": "buffer.schema.json"

            },

            "minItems": 1,

            "gltf_detailedDescription": "An array of buffers.  A buffer points to binary geometry, animation, or skins."

        },

        "bufferViews": {

            "type": "array",

            "description": "An array of bufferViews.",

            "items": {

                "$ref": "bufferView.schema.json"

            },

            "minItems": 1,

            "gltf_detailedDescription": "An array of bufferViews.  A bufferView is a view into a buffer generally representing a subset of the buffer."

        },

        "cameras": {

            "type": "array",

            "description": "An array of cameras.",

            "items": {

                "$ref": "camera.schema.json"

            },

            "minItems": 1,

            "gltf_detailedDescription": "An array of cameras.  A camera defines a projection matrix."

        },

        "images": {

            "type": "array",

            "description": "An array of images.",

            "items": {

                "$ref": "image.schema.json"

            },

            "minItems": 1,

            "gltf_detailedDescription": "An array of images.  An image defines data used to create a texture."

        },

        "materials": {

            "type": "array",

            "description": "An array of materials.",

            "items": {

                "$ref": "material.schema.json"

            },

            "minItems": 1,

            "gltf_detailedDescription": "An array of materials.  A material defines the appearance of a primitive."

        },

        "meshes": {

            "type": "array",

            "description": "An array of meshes.",

            "items": {

                "$ref": "mesh.schema.json"

            },

            "minItems": 1,

            "gltf_detailedDescription": "An array of meshes.  A mesh is a set of primitives to be rendered."

        },

        "nodes": {

            "type": "array",

            "description": "An array of nodes.",

            "items": {

                "$ref": "node.schema.json"

            },

            "minItems": 1

        },

        "samplers": {

            "type": "array",

            "description": "An array of samplers.",

            "items": {

                "$ref": "sampler.schema.json"

            },

            "minItems": 1,

            "gltf_detailedDescription": "An array of samplers.  A sampler contains properties for texture filtering and wrapping modes."

        },

        "scene": {

            "allOf": [ { "$ref": "glTFid.schema.json" } ],

            "description": "The index of the default scene.",

            "gltf_detailedDescription": "The index of the default scene.  This property **MUST NOT** be defined, when `scenes` is undefined."

        },

        "scenes": {

            "type": "array",

            "description": "An array of scenes.",

            "items": {

                "$ref": "scene.schema.json"

            },

            "minItems": 1

        },

        "skins": {

            "type": "array",

            "description": "An array of skins.",

            "items": {

                "$ref": "skin.schema.json"

            },

            "minItems": 1,

            "gltf_detailedDescription": "An array of skins.  A skin is defined by joints and matrices."

        },

        "textures": {

            "type": "array",

            "description": "An array of textures.",

            "items": {

                "$ref": "texture.schema.json"

            },

            "minItems": 1

        },

        "extensions": { },

        "extras": { }

    },

    "dependencies": {

        "scene": [ "scenes" ]

    },

    "required": [ "asset" ]

}

A.18. JSON Schema for glTF Child of Root PropertyA.18。 GLTF root属性儿童的JSON模式

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "glTFChildOfRootProperty.schema.json",

    "title": "glTF Child of Root Property",

    "type": "object",

    "allOf": [ { "$ref": "glTFProperty.schema.json" } ],

    "properties": {

        "name": {

            "type": "string",

            "description": "The user-defined name of this object.",

            "gltf_detailedDescription": "The user-defined name of this object.  This is not necessarily unique, e.g., an accessor and a buffer could have the same name, or two accessors could even have the same name."

        }

    }

}

A.19. JSON Schema for glTF IdA.19。 GLTF ID的JSON模式

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "glTFid.schema.json",

    "title": "glTF Id",

    "type": "integer",

    "minimum": 0

}

A.20. JSON Schema for glTF PropertyA.20。 GLTF属性的JSON模式

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "glTFProperty.schema.json",

    "title": "glTF Property",

    "type": "object",

    "properties": {

        "extensions": {

            "$ref": "extension.schema.json"

        },

        "extras": {

            "$ref": "extras.schema.json"

        }

    }

}

A.21. JSON Schema for ImageA.21。 JSON图像模式

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "image.schema.json",

    "title": "Image",

    "type": "object",

    "description": "Image data used to create a texture. Image **MAY** be referenced by an URI (or IRI) or a buffer view index.",

    "allOf": [ { "$ref": "glTFChildOfRootProperty.schema.json" } ],

    "properties": {

        "uri": {

            "type": "string",

            "description": "The URI (or IRI) of the image.",

            "format": "iri-reference",

            "gltf_detailedDescription": "The URI (or IRI) of the image.  Relative paths are relative to the current glTF asset.  Instead of referencing an external file, this field **MAY** contain a `data:`-URI. This field **MUST NOT** be defined when `bufferView` is defined.",

            "gltf_uriType": "image"

        },

        "mimeType": {

            "anyOf": [

                {

                    "const": "image/jpeg"

                },

                {

                    "const": "image/png"

                },

                {

                    "type": "string"

                }

            ],

            "description": "The image's media type. This field **MUST** be defined when `bufferView` is defined."

        },

        "bufferView": {

            "allOf": [ { "$ref": "glTFid.schema.json" } ],

            "description": "The index of the bufferView that contains the image. This field **MUST NOT** be defined when `uri` is defined."

        },

        "name": { },

        "extensions": { },

        "extras": { }

    },

    "dependencies": {

        "bufferView": [ "mimeType" ]

    },

    "oneOf": [

        { "required": [ "uri" ] },

        { "required": [ "bufferView" ] }

    ]

}

A.22. JSON Schema for MaterialA.22。 JSON材料模式

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "material.schema.json",

    "title": "Material",

    "type": "object",

    "description": "The material appearance of a primitive.",

    "allOf": [ { "$ref": "glTFChildOfRootProperty.schema.json" } ],

    "properties": {

        "name": { },

        "extensions": { },

        "extras": { },

        "pbrMetallicRoughness": {

            "allOf": [ { "$ref": "material.pbrMetallicRoughness.schema.json" } ],

            "description": "A set of parameter values that are used to define the metallic-roughness material model from Physically Based Rendering (PBR) methodology. When undefined, all the default values of `pbrMetallicRoughness` **MUST** apply."

        },

        "normalTexture": {

            "allOf": [ { "$ref": "material.normalTextureInfo.schema.json" } ],

            "description": "The tangent space normal texture.",

            "gltf_detailedDescription": "The tangent space normal texture. The texture encodes RGB components with linear transfer function. Each texel represents the XYZ components of a normal vector in tangent space. The normal vectors use the convention +X is right and +Y is up. +Z points toward the viewer. If a fourth component (A) is present, it **MUST** be ignored. When undefined, the material does not have a tangent space normal texture."

        },

        "occlusionTexture": {

            "allOf": [ { "$ref": "material.occlusionTextureInfo.schema.json" } ],

            "description": "The occlusion texture.",

            "gltf_detailedDescription": "The occlusion texture. The occlusion values are linearly sampled from the R channel. Higher values indicate areas that receive full indirect lighting and lower values indicate no indirect lighting. If other channels are present (GBA), they **MUST** be ignored for occlusion calculations. When undefined, the material does not have an occlusion texture."

        },

        "emissiveTexture": {

            "allOf": [ { "$ref": "textureInfo.schema.json" } ],

            "description": "The emissive texture.",

            "gltf_detailedDescription": "The emissive texture. It controls the color and intensity of the light being emitted by the material. This texture contains RGB components encoded with the sRGB transfer function. If a fourth component (A) is present, it **MUST** be ignored. When undefined, the texture **MUST** be sampled as having `1.0` in RGB components."

        },

        "emissiveFactor": {

            "type": "array",

            "items": {

                "type": "number",

                "minimum": 0.0,

                "maximum": 1.0

            },

            "minItems": 3,

            "maxItems": 3,

            "default": [ 0.0, 0.0, 0.0 ],

            "description": "The factors for the emissive color of the material.",

            "gltf_detailedDescription": "The factors for the emissive color of the material. This value defines linear multipliers for the sampled texels of the emissive texture."

        },

        "alphaMode": {

            "default": "OPAQUE",

            "description": "The alpha rendering mode of the material.",

            "gltf_detailedDescription": "The material's alpha rendering mode enumeration specifying the interpretation of the alpha value of the base color.",

            "anyOf": [

                {

                    "const": "OPAQUE",

                    "description": "The alpha value is ignored, and the rendered output is fully opaque."

                },

                {

                    "const": "MASK",

                    "description": "The rendered output is either fully opaque or fully transparent depending on the alpha value and the specified `alphaCutoff` value; the exact appearance of the edges **MAY** be subject to implementation-specific techniques such as \"`Alpha-to-Coverage`\"."

                },

                {

                    "const": "BLEND",

                    "description": "The alpha value is used to composite the source and destination areas. The rendered output is combined with the background using the normal painting operation (i.e. the Porter and Duff over operator)."

                },

                {

                    "type": "string"

                }

            ]

        },

        "alphaCutoff": {

            "type": "number",

            "minimum": 0.0,

            "default": 0.5,

            "description": "The alpha cutoff value of the material.",

            "gltf_detailedDescription": "Specifies the cutoff threshold when in `MASK` alpha mode. If the alpha value is greater than or equal to this value then it is rendered as fully opaque, otherwise, it is rendered as fully transparent. A value greater than `1.0` will render the entire material as fully transparent. This value **MUST** be ignored for other alpha modes. When `alphaMode` is not defined, this value **MUST NOT** be defined."

        },

        "doubleSided": {

            "type": "boolean",

            "default": false,

            "description": "Specifies whether the material is double sided.",

            "gltf_detailedDescription": "Specifies whether the material is double sided. When this value is false, back-face culling is enabled. When this value is true, back-face culling is disabled and double-sided lighting is enabled. The back-face **MUST** have its normals reversed before the lighting equation is evaluated."

        }

    },

     "dependencies" : {

        "alphaCutoff" : ["alphaMode"]

    }

}

A.23. JSON Schema for Material Normal Texture InfoA.23。 JSON材料模式正常纹理信息

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "material.normalTextureInfo.schema.json",

    "title": "Material Normal Texture Info",

    "type": "object",

    "allOf": [ { "$ref": "textureInfo.schema.json" } ],

    "properties": {

        "index": { },

        "texCoord": { },

        "scale": {

            "type": "number",

            "description": "The scalar parameter applied to each normal vector of the normal texture.",

            "default": 1.0,

            "gltf_detailedDescription": "The scalar parameter applied to each normal vector of the texture. This value scales the normal vector in X and Y directions using the formula: `scaledNormal =  normalize((<sampled normal texture value> * 2.0 - 1.0) * vec3(<normal scale>, <normal scale>, 1.0))`."

        },

        "extensions": { },

        "extras": { }

    }

}

A.24. JSON Schema for Material Occlusion Texture InfoA.24。材料遮挡纹理信息的JSON模式

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "material.occlusionTextureInfo.schema.json",

    "title": "Material Occlusion Texture Info",

    "type": "object",

    "allOf": [ { "$ref": "textureInfo.schema.json" } ],

    "properties": {

        "index": { },

        "texCoord": { },

        "strength": {

            "type": "number",

            "description": "A scalar multiplier controlling the amount of occlusion applied.",

            "default": 1.0,

            "minimum": 0.0,

            "maximum": 1.0,

            "gltf_detailedDescription": "A scalar parameter controlling the amount of occlusion applied. A value of `0.0` means no occlusion. A value of `1.0` means full occlusion. This value affects the final occlusion value as: `1.0 + strength * (<sampled occlusion texture value> - 1.0)`."

        },

        "extensions": { },

        "extras": { }

    }

}

A.25. JSON Schema for Material PBR Metallic RoughnessA.25。材料PBR金属粗糙度的JSON模式

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "material.pbrMetallicRoughness.schema.json",

    "title": "Material PBR Metallic Roughness",

    "type": "object",

    "description": "A set of parameter values that are used to define the metallic-roughness material model from Physically-Based Rendering (PBR) methodology.",

    "allOf": [ { "$ref": "glTFProperty.schema.json" } ],

    "properties": {

        "baseColorFactor": {

            "type": "array",

            "items": {

                "type": "number",

                "minimum": 0.0,

                "maximum": 1.0

            },

            "description": "The factors for the base color of the material.",

            "default": [ 1.0, 1.0, 1.0, 1.0 ],

            "minItems": 4,

            "maxItems": 4,

            "gltf_detailedDescription": "The factors for the base color of the material. This value defines linear multipliers for the sampled texels of the base color texture."

        },

        "baseColorTexture": {

            "allOf": [ { "$ref": "textureInfo.schema.json" } ],

            "description": "The base color texture.",

            "gltf_detailedDescription": "The base color texture. The first three components (RGB) **MUST** be encoded with the sRGB transfer function. They specify the base color of the material. If the fourth component (A) is present, it represents the linear alpha coverage of the material. Otherwise, the alpha coverage is equal to `1.0`. The `material.alphaMode` property specifies how alpha is interpreted. The stored texels **MUST NOT** be premultiplied. When undefined, the texture **MUST** be sampled as having `1.0` in all components."

        },

        "metallicFactor": {

            "type": "number",

            "description": "The factor for the metalness of the material.",

            "default": 1.0,

            "minimum": 0.0,

            "maximum": 1.0,

            "gltf_detailedDescription": "The factor for the metalness of the material. This value defines a linear multiplier for the sampled metalness values of the metallic-roughness texture."

        },

        "roughnessFactor": {

            "type": "number",

            "description": "The factor for the roughness of the material.",

            "default": 1.0,

            "minimum": 0.0,

            "maximum": 1.0,

            "gltf_detailedDescription": "The factor for the roughness of the material. This value defines a linear multiplier for the sampled roughness values of the metallic-roughness texture."

        },

        "metallicRoughnessTexture": {

            "allOf": [ { "$ref": "textureInfo.schema.json" } ],

            "description": "The metallic-roughness texture.",

            "gltf_detailedDescription": "The metallic-roughness texture. The metalness values are sampled from the B channel. The roughness values are sampled from the G channel. These values **MUST** be encoded with a linear transfer function. If other channels are present (R or A), they **MUST** be ignored for metallic-roughness calculations. When undefined, the texture **MUST** be sampled as having `1.0` in G and B components."

        },

        "extensions": { },

        "extras": { }

    }

}

A.26. JSON Schema for MeshA.26。 JSON模式用于网格

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "mesh.schema.json",

    "title": "Mesh",

    "type": "object",

    "description": "A set of primitives to be rendered.  Its global transform is defined by a node that references it.",

    "allOf": [ { "$ref": "glTFChildOfRootProperty.schema.json" } ],

    "properties": {

        "primitives": {

            "type": "array",

            "description": "An array of primitives, each defining geometry to be rendered.",

            "items": {

                "$ref": "mesh.primitive.schema.json"

            },

            "minItems": 1

        },

        "weights": {

            "type": "array",

            "description": "Array of weights to be applied to the morph targets. The number of array elements **MUST** match the number of morph targets.",

            "items": {

                "type": "number"

            },

            "minItems": 1

        },

        "name": { },

        "extensions": { },

        "extras": { }

    },

    "required": [ "primitives" ]

}

A.27. JSON Schema for Mesh PrimitiveA.27。网状原始模式

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "mesh.primitive.schema.json",

    "title": "Mesh Primitive",

    "type": "object",

    "description": "Geometry to be rendered with the given material.",

    "allOf": [ { "$ref": "glTFProperty.schema.json" } ],

    "properties": {

        "attributes": {

            "type": "object",

            "description": "A plain JSON object, where each key corresponds to a mesh attribute semantic and each value is the index of the accessor containing attribute's data.",

            "minProperties": 1,

            "additionalProperties": {

                "$ref": "glTFid.schema.json"

            }

        },

        "indices": {

            "allOf": [ { "$ref": "glTFid.schema.json" } ],

            "description": "The index of the accessor that contains the vertex indices.",

            "gltf_detailedDescription": "The index of the accessor that contains the vertex indices.  When this is undefined, the primitive defines non-indexed geometry.  When defined, the accessor **MUST** have `SCALAR` type and an unsigned integer component type.",

            "gltf_webgl": "`drawElements()` when defined and `drawArrays()` otherwise."

        },

        "material": {

            "allOf": [ { "$ref": "glTFid.schema.json" } ],

            "description": "The index of the material to apply to this primitive when rendering."

        },

        "mode": {

            "description": "The topology type of primitives to render.",

            "default": 4,

            "anyOf": [

                {

                    "const": 0,

                    "description": "POINTS",

                    "type": "integer"

                },

                {

                    "const": 1,

                    "description": "LINES",

                    "type": "integer"

                },

                {

                    "const": 2,

                    "description": "LINE_LOOP",

                    "type": "integer"

                },

                {

                    "const": 3,

                    "description": "LINE_STRIP",

                    "type": "integer"

                },

                {

                    "const": 4,

                    "description": "TRIANGLES",

                    "type": "integer"

                },

                {

                    "const": 5,

                    "description": "TRIANGLE_STRIP",

                    "type": "integer"

                },

                {

                    "const": 6,

                    "description": "TRIANGLE_FAN",

                    "type": "integer"

                },

                {

                    "type": "integer"

                }

            ]

        },

        "targets": {

            "type": "array",

            "description": "An array of morph targets.",

            "items": {

                "type": "object",

                "minProperties": 1,

                "additionalProperties": {

                    "$ref": "glTFid.schema.json"

                },

                "description": "A plain JSON object specifying attributes displacements in a morph target, where each key corresponds to one of the three supported attribute semantic (`POSITION`, `NORMAL`, or `TANGENT`) and each value is the index of the accessor containing the attribute displacements' data."

            },

            "minItems": 1

        },

        "extensions": { },

        "extras": { }

    },

    "gltf_webgl": "`drawElements()` and `drawArrays()`",

    "required": [ "attributes" ]

}

A.28. JSON Schema for NodeA.28。节点的JSON模式

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "node.schema.json",

    "title": "Node",

    "type": "object",

    "description": "A node in the node hierarchy.  When the node contains `skin`, all `mesh.primitives` **MUST** contain `JOINTS_0` and `WEIGHTS_0` attributes.  A node **MAY** have either a `matrix` or any combination of `translation`/`rotation`/`scale` (TRS) properties. TRS properties are converted to matrices and postmultiplied in the `T * R * S` order to compose the transformation matrix; first the scale is applied to the vertices, then the rotation, and then the translation. If none are provided, the transform is the identity. When a node is targeted for animation (referenced by an animation.channel.target), `matrix` **MUST NOT** be present.",

    "allOf": [ { "$ref": "glTFChildOfRootProperty.schema.json" } ],

    "properties": {

        "camera": {

            "allOf": [ { "$ref": "glTFid.schema.json" } ],

            "description": "The index of the camera referenced by this node."

        },

        "children": {

            "type": "array",

            "description": "The indices of this node's children.",

            "items": {

                "$ref": "glTFid.schema.json"

            },

            "uniqueItems": true,

            "minItems": 1

        },

        "skin": {

            "allOf": [ { "$ref": "glTFid.schema.json" } ],

            "description": "The index of the skin referenced by this node.",

            "gltf_detailedDescription": "The index of the skin referenced by this node. When a skin is referenced by a node within a scene, all joints used by the skin **MUST** belong to the same scene. When defined, `mesh` **MUST** also be defined."

        },

        "matrix": {

            "type": "array",

            "description": "A floating-point 4x4 transformation matrix stored in column-major order.",

            "items": {

                "type": "number"

            },

            "minItems": 16,

            "maxItems": 16,

            "default": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ],

            "gltf_webgl": "`uniformMatrix4fv()` with the transpose parameter equal to false"

        },

        "mesh": {

            "allOf": [ { "$ref": "glTFid.schema.json" } ],

            "description": "The index of the mesh in this node."

        },

        "rotation": {

            "type": "array",

            "description": "The node's unit quaternion rotation in the order (x, y, z, w), where w is the scalar.",

            "items": {

                "type": "number",

                "minimum": -1.0,

                "maximum": 1.0

            },

            "minItems": 4,

            "maxItems": 4,

            "default": [ 0.0, 0.0, 0.0, 1.0 ]

        },

        "scale": {

            "type": "array",

            "description": "The node's non-uniform scale, given as the scaling factors along the x, y, and z axes.",

            "items": {

                "type": "number"

            },

            "minItems": 3,

            "maxItems": 3,

            "default": [ 1.0, 1.0, 1.0 ]

        },

        "translation": {

            "type": "array",

            "description": "The node's translation along the x, y, and z axes.",

            "items": {

                "type": "number"

            },

            "minItems": 3,

            "maxItems": 3,

            "default": [ 0.0, 0.0, 0.0 ]

        },

        "weights": {

            "type": "array",

            "description": "The weights of the instantiated morph target. The number of array elements **MUST** match the number of morph targets of the referenced mesh. When defined, `mesh` **MUST** also be defined.",

            "minItems": 1,

            "items": {

                "type": "number"

            }

        },

        "name": { },

        "extensions": { },

        "extras": { }

    },

    "dependencies": {

        "weights": [ "mesh" ],

        "skin": [ "mesh" ]

    },

    "not": {

        "anyOf": [

            { "required": [ "matrix", "translation" ] },

            { "required": [ "matrix", "rotation" ] },

            { "required": [ "matrix", "scale" ] }

        ]

    }

}

A.29. JSON Schema for SamplerA.29。 JSON模式用于采样器

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "sampler.schema.json",

    "title": "Sampler",

    "type": "object",

    "description": "Texture sampler properties for filtering and wrapping modes.",

    "allOf": [ { "$ref": "glTFChildOfRootProperty.schema.json" } ],

    "properties": {

        "magFilter": {

            "description": "Magnification filter.",

            "gltf_webgl": "`samplerParameteri()` with pname equal to TEXTURE_MAG_FILTER",

            "anyOf": [

                {

                    "const": 9728,

                    "description": "NEAREST",

                    "type": "integer"

                },

                {

                    "const": 9729,

                    "description": "LINEAR",

                    "type": "integer"

                },

                {

                    "type": "integer"

                }

            ]

        },

        "minFilter": {

            "description": "Minification filter.",

            "gltf_webgl": "`samplerParameteri()` with pname equal to TEXTURE_MIN_FILTER",

            "anyOf": [

                {

                    "const": 9728,

                    "description": "NEAREST",

                    "type": "integer"

                },

                {

                    "const": 9729,

                    "description": "LINEAR",

                    "type": "integer"

                },

                {

                    "const": 9984,

                    "description": "NEAREST_MIPMAP_NEAREST",

                    "type": "integer"

                },

                {

                    "const": 9985,

                    "description": "LINEAR_MIPMAP_NEAREST",

                    "type": "integer"

                },

                {

                    "const": 9986,

                    "description": "NEAREST_MIPMAP_LINEAR",

                    "type": "integer"

                },

                {

                    "const": 9987,

                    "description": "LINEAR_MIPMAP_LINEAR",

                    "type": "integer"

                },

                {

                    "type": "integer"

                }

            ]

        },

        "wrapS": {

            "description": "S (U) wrapping mode.",

            "default": 10497,

            "gltf_detailedDescription": "S (U) wrapping mode.  All valid values correspond to WebGL enums.",

            "gltf_webgl": "`samplerParameteri()` with pname equal to TEXTURE_WRAP_S",

            "anyOf": [

                {

                    "const": 33071,

                    "description": "CLAMP_TO_EDGE",

                    "type": "integer"

                },

                {

                    "const": 33648,

                    "description": "MIRRORED_REPEAT",

                    "type": "integer"

                },

                {

                    "const": 10497,

                    "description": "REPEAT",

                    "type": "integer"

                },

                {

                    "type": "integer"

                }

            ]

        },

        "wrapT": {

            "description": "T (V) wrapping mode.",

            "default": 10497,

            "gltf_webgl": "`samplerParameteri()` with pname equal to TEXTURE_WRAP_T",

            "anyOf": [

                {

                    "const": 33071,

                    "description": "CLAMP_TO_EDGE",

                    "type": "integer"

                },

                {

                    "const": 33648,

                    "description": "MIRRORED_REPEAT",

                    "type": "integer"

                },

                {

                    "const": 10497,

                    "description": "REPEAT",

                    "type": "integer"

                },

                {

                    "type": "integer"

                }

            ]

        },

        "name": { },

        "extensions": { },

        "extras": { }

    }

}

A.30. JSON Schema for SceneA.30。 JSON模式场景

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "scene.schema.json",

    "title": "Scene",

    "type": "object",

    "description": "The root nodes of a scene.",

    "allOf": [ { "$ref": "glTFChildOfRootProperty.schema.json" } ],

    "properties": {

        "nodes": {

            "type": "array",

            "description": "The indices of each root node.",

            "items": {

                "$ref": "glTFid.schema.json"

            },

            "uniqueItems": true,

            "minItems": 1

        },

        "name": { },

        "extensions": { },

        "extras": { }

    }

}

A.31. JSON Schema for SkinA.31。 JSON SHEMA的皮肤模式

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "skin.schema.json",

    "title": "Skin",

    "type": "object",

    "description": "Joints and matrices defining a skin.",

    "allOf": [ { "$ref": "glTFChildOfRootProperty.schema.json" } ],

    "properties": {

        "inverseBindMatrices": {

            "allOf": [ { "$ref": "glTFid.schema.json" } ],

            "description": "The index of the accessor containing the floating-point 4x4 inverse-bind matrices.",

            "gltf_detailedDescription": "The index of the accessor containing the floating-point 4x4 inverse-bind matrices. Its `accessor.count` property **MUST** be greater than or equal to the number of elements of the `joints` array. When undefined, each matrix is a 4x4 identity matrix."

        },

        "skeleton": {

            "allOf": [ { "$ref": "glTFid.schema.json" } ],

            "description": "The index of the node used as a skeleton root.",

            "gltf_detailedDescription": "The index of the node used as a skeleton root. The node **MUST** be the closest common root of the joints hierarchy or a direct or indirect parent node of the closest common root."

        },

        "joints": {

            "type": "array",

            "description": "Indices of skeleton nodes, used as joints in this skin.",

            "items": {

                "$ref": "glTFid.schema.json"

            },

            "uniqueItems": true,

            "minItems": 1,

            "gltf_detailedDescription": "Indices of skeleton nodes, used as joints in this skin."

        },

        "name": { },

        "extensions": { },

        "extras": { }

    },

    "required": [ "joints" ]

}

A.32. JSON Schema for TextureA.32。 JSON纹理模式

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "texture.schema.json",

    "title": "Texture",

    "type": "object",

    "description": "A texture and its sampler.",

    "allOf": [ { "$ref": "glTFChildOfRootProperty.schema.json" } ],

    "properties": {

        "sampler": {

            "allOf": [ { "$ref": "glTFid.schema.json" } ],

            "description": "The index of the sampler used by this texture. When undefined, a sampler with repeat wrapping and auto filtering **SHOULD** be used."

        },

        "source": {

            "allOf": [ { "$ref": "glTFid.schema.json" } ],

            "description": "The index of the image used by this texture. When undefined, an extension or other mechanism **SHOULD** supply an alternate texture source, otherwise behavior is undefined."

        },

        "name": { },

        "extensions": { },

        "extras": { }

    },

    "gltf_webgl": "`createTexture()`, `deleteTexture()`, `bindTexture()`, `texImage2D()`, and `texParameterf()`"

}

A.33. JSON Schema for Texture InfoA.33。 JSON模式用于纹理信息

{

    "$schema": "https://json-schema.org/draft/2020-12/schema",

    "$id": "textureInfo.schema.json",

    "title": "Texture Info",

    "type": "object",

    "description": "Reference to a texture.",

    "allOf": [ { "$ref": "glTFProperty.schema.json" } ],

    "properties": {

        "index": {

            "allOf": [ { "$ref": "glTFid.schema.json" } ],

            "description": "The index of the texture."

        },

        "texCoord": {

            "type": "integer",

            "description": "The set index of texture's TEXCOORD attribute used for texture coordinate mapping.",

            "default": 0,

            "minimum": 0,

            "gltf_detailedDescription": "This integer value is used to construct a string in the format `TEXCOORD_<set index>` which is a reference to a key in `mesh.primitives.attributes` (e.g. a value of `0` corresponds to `TEXCOORD_0`). A mesh primitive **MUST** have the corresponding texture coordinate attributes for the material to be applicable to it."

        },

        "extensions": { },

        "extras": { }

    },

    "required": [ "index" ]

}

Appendix B: BRDF Implementation 附录B:BRDF实施 

B.1. General B.1。一般的 

This chapter presents the bidirectional reflectance distribution function (BRDF) of the glTF 2.0 metallic-roughness material. The BRDF describes the reflective properties of the surface of a physically based material. For a pair of directions, the BRDF returns how much light from the incoming direction is reflected from the surface in the outgoing direction.本章介绍了GLTF 2.0金属 - 粗糙度材料的双向反射分布函数(BRDF)。 BRDF描述了基于物理材料表面的反射特性。对于一对方向,BRDF返回从传入方向反映出从向外方向反映出多少光。

 

Note 笔记 

See Pharr et al. (2016), Chapter 5.6 “Surface Reflection”, for an introduction to radiometry and the BRDF.参见Pharr等。 (2016年),第5.6章“表面反射”,用于辐射介绍和BRDF介绍。

The BRDF of the metallic-roughness material is a linear interpolation of a metallic BRDF and a dielectric BRDF. The BRDFs share the parameters for roughness and base color. The blending factor metallic describes the metalness of the material.金属 - 粗糙度材料的BRDF是金属BRDF和介电BRDF的线性插值。 BRDF共享粗糙度和基本颜色的参数。混合因子metallic描述了材料的金属。

material = mix(dielectric_brdf, metal_brdf, metallic)

         = (1.0 - metallic) * dielectric_brdf + metallic * metal_brdf

 

Note 笔记 

Such a material model based on a linear interpolation of metallic and dielectric components was introduced by Burley (2012) and adapted by many renderers, resulting in a wide range of applications supporting it.Burley(2012)引入了基于金属和介电组件的线性插值的这种材料模型,并由许多渲染器进行了调整,从而产生了支持它的广泛应用。

Usually, a material is either metallic or dielectric. A texture provided for metallic with either 1.0 or 0.0 separates metallic from dielectric regions on the mesh. There are situations in which there is no clear separation. It may happen that due to anti-aliasing or mip-mapping there is a portion of metal and a portion of dielectric within a texel. Furthermore, a material composed of several semi-transparent layers may be represented as a blend between several single-layered materials (layering via parameter blending).通常,材料是金属或介电。提供metallic的纹理,<b1>> </b1>或0.0将金属与网格的介电区分开。在某些情况下,没有明确的分离。可能会由于抗降异压或MIP映射而有一部分金属和一部分在Texel内部。此外,由几个半透明层组成的材料可以表示为几种单层材料之间的混合(通过参数混合而分层)。

The logical structure of the material is presented below, using an abstract notation that describes the material as a directed acyclic graph (DAG). The vertices correspond to the basic building blocks of the material model: BRDFs, mixing operators, input parameters, and constants. This is followed by an informative sample implementation as a set of equations and source code for the BRDFs and mixing operators.材料的逻辑结构如下所示,使用抽象符号将材料描述为有向的无环图(DAG)。顶点对应于材料模型的基本构建块:BRDF,混合操作员,输入参数和常数。接下来是一套有益的示例实现,作为BRDFS和混合操作员的一组方程和源代码。

B.2. Material Structure B.2。材料结构 

B.2.1. Metals B.2.1。金属 

Metallic surfaces reflect most illumination, only a small portion of the light is absorbed by the material.金属表面反映最照明,只有一小部分被材料吸收。

 

Note 笔记 

See Pharr et al. (2016), Chapter 8.2 “Specular Reflection and Transmission”.参见Pharr等。 (2016年),第8.2章“镜面反射和传播”。

This effect is described by the Fresnel term conductor_fresnel with the wavelength-dependent refractive index and extinction coefficient. To make parameterization simple, the metallic-roughness material combines the two quantities into a single, user-defined color value baseColor that defines the reflection color at normal incidence, also referred to as f0. The reflection color at grazing incidence is called f90. It is set to 1.0 because the grazing angle reflectance for any material approaches pure white in the limit. The conductor Fresnel term modulates the contribution of a specular BRDF parameterized by the roughness parameter.菲涅尔术语conductor_fresnel描述了这种效果,其依赖性依赖性折射率和消光系数。为了使参数化简单,金属 - 粗糙度材料将两个数量组合到一个用户定义的颜色值baseColor中,该颜色值baseColor在正常入射率下定义了反射颜色,也称为f0。放牧发生率的反射颜色称为f90。它之所以设置为1.0,因为任何物质方法的放牧角反射率在极限中纯白色。导体菲涅尔术语调节由roughness参数参数化的镜面BRDF的贡献。

metal_brdf =

  conductor_fresnel(

    f0 = baseColor,

    bsdf = specular_brdf(

      α = roughness ^ 2))

B.2.2. Dielectrics B.2.2。电介质 

Unlike metals, dielectric materials transmit most of the incident illumination into the interior of the object and the Fresnel term is parameterized only by the refractive index.与金属不同,介电材料将大部分入射照明传输到物体的内部,而菲涅耳项仅通过折射率进行参数化。

 

Note 笔记 

See Pharr et al. (2016), Chapter 8.2 “Specular Reflection and Transmission”.参见Pharr等。 (2016年),第8.2章“镜面反射和传播”。

This makes dielectrics like glass, oil, water or air transparent. Other dielectrics, like most plastic materials, are filled with particles that absorb or scatter most or all of the transmitted light, reducing the transparency and giving the surface its colorful appearance.这使得电介质等玻璃,油,水或空气透明。与大多数塑料材料一样,其他介电量充满了吸收或散布大多数或所有传输光的颗粒,从而降低了透明度并使表面具有丰富多彩的外观。

As a result, dielectric materials are modeled as a Fresnel-weighted combination of a specular BRDF, simulating the reflection at the surface, and a diffuse BRDF, simulating the transmitted portion of the light that is absorbed and scattered inside the object. The reflection roughness is given by the squared roughness of the material. The color of the diffuse BRDF comes from the baseColor. The amount of reflection compared to transmission is directional-dependent and as such determined by the Fresnel term. Its index of refraction is set to a fixed value of 1.5, a good compromise for most opaque, dielectric materials.结果,将介电材料建模为镜面BRDF的菲涅尔加权组合,模拟表面的反射和扩散的BRDF,模拟了被吸收并散布在物体内的光的传输部分。反射粗糙度由材料的*方roughness给出。弥漫性BRDF的颜色来自baseColor。与透射相比的反射量是定向依赖性的,因此由菲涅尔学期确定。它的折射率设置为固定值1.5,这是大多数不透明的介电材料的良好折衷。

dielectric_brdf =

  fresnel_mix(

    ior = 1.5,

    base = diffuse_brdf(

      color = baseColor),

    layer = specular_brdf(

      α = roughness ^ 2))

B.2.3. Microfacet Surfaces B.2.3。微纤维表面 

The metal BRDF and the dielectric BRDF are based on a microfacet model.金属BRDF和介电BRDF基于微胶囊模型。

 

Note 笔记 

The theory behind microfacet models was developed in early works by Torrance and Sparrow (1967)Cook and Torrance (1982) and others.Microfacet模型背后的理论是在Torrance和Sparrow(1967),Cook and Torrance(1982)等的早期作品中开发的。

A microfacet model describes the orientation of tiny facets (microfacets) on the surface as a statistical distribution. The distribution determines the orientation of the facets as a random perturbation around the normal direction of the surface. The perturbation strength depends on the roughness parameter and varies between 0.0 (smooth surface) and 1.0 (rough surface). A number of distribution functions have been proposed in the last decades.微杆面模型描述了表面上微小方面(微杆)作为统计分布的方向。该分布确定方面的方向是围绕表面正常方向的随机扰动。扰动强度取决于roughness参数,并且在<b1>> </b1>(光滑的表面)和1.0(粗糙的表面)之间变化。在过去的几十年中,已经提出了许多分布功能。

The Trowbridge-Reitz / GGX microfacet distribution describes the microsurface as being composed of perfectly specular, infinitesimal oblate ellipsoids, whose half-height in the normal direction is α times the radius in the tangent plane. α = 1 gives spheres, which results in uniform reflection in all directions. This reflection behavior corresponds to a rough surface. α = 0 gives a perfectly specular surface.trowbridge-reitz / ggx微胶囊分布描述的是由完全镜面的,无穷小的块状块状椭圆形组成,其在正常方向上的半高度是切线*面中半径的α倍。 α= 1给出球体,这会导致各个方向均匀的反射。这种反射行为对应于粗糙的表面。 α= 0给出了完美的镜面表面。

 

Note 笔记 

The Trowbridge-Reitz distribution was first described by Trowbridge and Reitz (1975). Later Walter et al. (2007) independently developed the same distribution and called it “GGX”. They show that it is a better fit for measured data than the Beckmann distribution used by Cook and Torrance (1982) due to its stronger tails.Trowbridge-Reitz分布最初由Trowbridge and Reitz(1975)描述。后来Walter等。 (2007年)独立开发了相同的分布,并将其称为“ GGX”。他们表明,由于其更强的尾巴,这比Cook and Torrance(1982)使用的Beckmann分布更适合测量数据。

The mapping α = roughness2 results in more perceptually linear changes in the roughness.映射α= roughness 2导致粗糙度上有更多的线性变化。

 

Note 笔记 

This mapping was suggested by Burley (2012).该映射由Burley(2012)提出。

The distribution only describes the proportion of each normal on the microsurface. It does not describe how the normals are organized. For this we need a microsurface profile.该分布仅描述微表面上每个正常的比例。它没有描述如何组织正常的组织。为此,我们需要一个微观配置文件。

 

Note 笔记 

The difference between distribution and profile is detailed by Heitz (2014), where he in addition provides an extensive study of common microfacet profiles. Based on this work, we suggest using the Smith microsurface profile (originally developed by Smith (1967)) and its corresponding masking-shadowing function. Heitz describes the Smith profile as the most accurate model for reflection from random height fields. It assumes that height and normal between neighboring points are not correlated, implying a random set of microfacets instead of a continuous surface.Heitz(2014)详细介绍了分布和轮廓之间的差异,此外,他还提供了对常见微胶质概况的广泛研究。基于这项工作,我们建议使用Smith MicroSurface配置文件(最初由Smith(1967)开发)及其相应的掩蔽遮盖功能。 Heitz将史密斯的轮廓描述为从随机高度场反射的最准确模型。它假设相邻点之间的高度和正常与不相关,这意味着一组随机的微杆片而不是连续的表面。

Microfacet models often do not consider multiple scattering. The shadowing term suppresses light that intersects the microsurface a second time. Heitz et al. (2016) extended the Smith-based microfacet models to include a multiple scattering component, which significantly improves accuracy of predictions of the model. We suggest to incorporate multiple scattering whenever possible, either by making use of the unbiased stochastic evaluation introduced by Heitz, or one of the approximations presented later, for example by Kulla and Conty (2017) or Turquin (2019).微纤维模型通常不考虑多个散射。阴影术语抑制第二次相交的光。 Heitz等。 (2016年)将基于史密斯的微胶片模型扩展到包括多个散射组件,从而显着提高了模型的预测准确性。我们建议在可能的情况下使用多个散射,以利用Heitz引入的无偏随机评估,或者使用后来提出的*似值之一,例如Kulla and Conty(2017)或Turquin(2019)。

B.2.4. Complete Model B.2.4。完整的型号 

The BRDFs and mixing operators used in the metallic-roughness material are summarized in the following figure.在下图中总结了用于金属 - 粗糙度材料中的BRDF和混合操作员。

Figure 9. BRDFs and Mixing Operators图9。BRDF和混合操作员

The glTF Specification is designed to allow applications to choose different lighting implementations based on their requirements. Some implementations MAY focus on an accurate simulation of light transport while others MAY choose to deliver real-time performance. Therefore, any implementation that adheres to the rules for mixing BRDFs is conformant to the glTF Specification.GLTF规范旨在允许应用程序根据其要求选择不同的照明实现。某些实施可能会集中于对轻型运输的准确模拟,而另一些实施可能会选择实时性能。因此,任何遵守混合BRDF规则的实现都符合GLTF规范。

In a physically accurate light simulation, the BRDFs MUST follow some basic principles: the BRDF MUST be positive, reciprocal, and energy conserving. This ensures that the visual output of the simulation is independent of the underlying rendering algorithm, if it is unbiased.在物理上准确的光模拟中,BRDF必须遵循一些基本原则:BRDF必须是正,倒数和能量保存。这样可以确保模拟的视觉输出与基础渲染算法无关,如果它是公正的。

The unbiased light simulation with physically realistic BRDFs will be the ground-truth for approximations in real-time renderers that are often biased, but still give visually pleasing results.具有物理逼真的BRDF的无偏光模拟将是实时渲染器中通常有偏见但仍然可以给人视觉令人愉悦的结果的基础真实。

B.3. Sample Implementation (Informative)B.3。样本实施(信息性)

B.3.1. Overview B.3.1。概述 

Often, renderers use approximations to solve the rendering equation, like the split-sum approximation for image based lighting, or simplify the math to save instructions and reduce register pressure. However, there are many ways to achieve good approximations, depending on the platform.通常,渲染器使用*似值来求解渲染方程,例如用于基于图像的照明的拆分和*似,或简化数学以节省指令并减少寄存器压力。但是,根据*台,有很多方法可以实现良好的*似值。

A sample implementation is available at https://github.com/KhronosGroup/glTF-Sample-Viewer/ and provides an example of a WebGL 2.0 implementation of a standard BRDF based on the glTF material parameters. To achieve high performance in real-time applications, this implementation uses several approximations and uses non-physical simplifications that break energy-conservation and reciprocity.可以在https://github.com/khronosgroup/gltf-sample--viewer/上获得示例实现,并提供了基于GLTF材料参数的标准BRDF实现WebGL 2.0的示例。为了在实时应用中实现高性能,此实现使用了几个*似值,并使用了破坏能量保存和互惠的非物理简化。

We use the following notation:我们使用以下符号:

  • Vis the normalized vector from the shading location to the eyeV是从阴影位置到眼睛的归一化矢量
  • Lis the normalized vector from the shading location to the lightl是从阴影位置到光线的归一化矢量
  • Nis the surface normal in the same space as the above valuesn是与上述值同一空间中的表面正常
  • His the half vector, where H = normalize(L + V)H是半矢量,其中H =归一化(L + V)

B.3.2. Specular BRDF B.3.2。镜头BRDF 

The specular reflection specular_brdf(α) is a microfacet BRDF镜面反射specular_brdf(α)是微纤维BRDF

MicrofacetBRDF Microfacetbrdf = = GD g d 4|N⋅L||N⋅V|4 | n·l | | n·v |MicrofacetBRDF=GD4|N⋅L||N⋅V|

with the Trowbridge-Reitz/GGX microfacet distribution与Trowbridge-Reitz/GGX微纤维分布

D d = = α2χ+(N⋅H) (n·h) π((N⋅H)2(α2−1)+1)2π(n夕( - 1) + 1D=α2χ+(N⋅H)π((N⋅H)2(α2−1)+1)2

and the separable form of the Smith joint masking-shadowing function以及史密斯关节掩蔽式函数的可分离形式

G=2|N⋅L|χ+(H⋅L)2 | n·l | (H·L)| | N n ⋅ 走为 L l | | + + α2+(1−α2)(N⋅L)2+(1-)(n·l−−−−−−−−−−−−−−−−−√2|N⋅V|χ+(H⋅V)2 | n·v | (H·V)| | N n ⋅ 走为 V v | | + + α2+(1−α2)(N⋅V)2+(1-)(n·v−−−−−−−−−−−−−−−−−√G=2|N⋅L|χ+(H⋅L)|N⋅L|+α2+(1−α2)(N⋅L)22|N⋅V|χ+(H⋅V)|N⋅V|+α2+(1−α2)(N⋅V)2

where χ+(x) denotes the Heaviside function: 1 if x > 0 and 0 if x ⇐ 0. See Heitz (2014) for a derivation of the formulas.其中χ+(x)表示重物函数:1如果x> 0,如果x⇐0。

Introducing the visibility function引入可见性功能

V v = = G4|N⋅L||N⋅V|4 | n·l | | n·v |V=G4|N⋅L||N⋅V|

simplifies the original microfacet BRDF to将原始微纤维BRDF简化为

MicrofacetBRDF=VD MicrofacetBrdf = V D MicrofacetBRDF=VD

with 和 

V v = = χ+(H⋅L) (H·L) | | N n ⋅ 走为 L l | | + + α2+(1−α2)(N⋅L)2+(1-)(n·l−−−−−−−−−−−−−−−−−√χ+(H⋅V) (H·V) | | N n ⋅ 走为 V v | | + + α2+(1−α2)(N⋅V)2+(1-)(n·v−−−−−−−−−−−−−−−−−√V=χ+(H⋅L)|N⋅L|+α2+(1−α2)(N⋅L)2χ+(H⋅V)|N⋅V|+α2+(1−α2)(N⋅V)2

Thus, we have the function因此,我们有功能

function specular_brdf(α) {

  return V * D

}

B.3.3. Diffuse BRDF B.3.3。弥漫性BRDF 

The diffuse reflection diffuse_brdf(color) is a Lambertian BRDF弥漫性反射diffuse_brdf(color)是兰伯特brdf

LambertianBRDF=1π Lambertianbrdf = LambertianBRDF=1π

multiplied with the color.乘以color。

function diffuse_brdf(color) {

  return (1/pi) * color

}

B.3.4. Fresnel B.3.4。菲涅尔 

An inexpensive approximation for the Fresnel term that can be used for conductors and dielectrics was developed by Schlick (1994):Schlick(1994)开发了可用于导体和电介质的菲涅耳术语的廉价*似:

F=f0+(1−f0)(1−|V⋅H|)5f = +(1-)(1- | v·h |F=f0+(1−f0)(1−|V⋅H|)5

The conductor Fresnel conductor_fresnel(f0, bsdf) applies a view-dependent tint to a BSDF:导体菲涅尔conductor_fresnel(f0, bsdf)将视图依赖性色调应用于BSDF:

function conductor_fresnel(f0, bsdf) {

  return bsdf * (f0 + (1 - f0) * (1 - abs(VdotH))^5)

}

For the dielectric BRDF a diffuse component base and a specular component layer are combined via fresnel_mix(ior, base, layer). The f0 color is now derived from the index of refraction ior.对于介电BRDF,通过fresnel_mix(ior, base, layer)组合了漫差组件base base layer。 f0颜色现在是从折射索引ior得出的。

function fresnel_mix(ior, base, layer) {

  f0 = ((1-ior)/(1+ior))^2

  fr = f0 + (1 - f0)*(1 - abs(VdotH))^5

  return mix(base, layer, fr)

}

B.3.5. Metal BRDF and Dielectric BRDFB.3.5。金属BRDF和电介质BRDF

Now that we have an implementation for all the functions used in the glTF metallic-roughness material model, we are able to connect the functions according to the graph shown in section “Complete Model”. By substituting the mixing functions (fresnel_mix, conductor_fresnel) for the implementation, we arrive at the following BRDFs for the metal and the dielectric component:既然我们已经针对GLTF金属 - 粗糙度材料模型中使用的所有功能进行了实现,那么我们能够根据“完整模型”部分所示的图表连接功能。通过替换混合功能(fresnel_mix,conductor_fresnel),我们可以为金属和介电组件提供以下BRDF:

metal_brdf = specular_brdf(roughness^2) * (baseColor.rgb + (1 - baseColor.rgb) * (1 - abs(VdotH))^5)

dielectric_brdf = mix(diffuse_brdf(baseColor.rgb), specular_brdf(roughness^2), 0.04 + (1 - 0.04) * (1 - abs(VdotH))^5)

Note that the dielectric index of refraction ior = 1.5 is now f0 = 0.04.请注意,折射的介电索引ior = 1.5现在是f0 = 0.04。

Metal and dielectric are mixed according to the metalness:金属和介电由金属混合:

material = mix(dielectric_brdf, metal_brdf, metallic)

Taking advantage of the fact that roughness is shared between metal and dielectric and that the Schlick Fresnel is used, we can simplify the mix and arrive at the final BRDF for the material:利用roughness在金属和电介质之间共享roughness的事实,并且使用了schlick Fresnel,我们可以简化混合物并到达最终BRDF的材料:

const black = 0

 

c_diff = lerp(baseColor.rgb, black, metallic)

f0 = lerp(0.04, baseColor.rgb, metallic)

α = roughness^2

 

F = f0 + (1 - f0) * (1 - abs(VdotH))^5

 

f_diffuse = (1 - F) * (1 / π) * c_diff

f_specular = F * D(α) * G(α) / (4 * abs(VdotN) * abs(LdotN))

 

material = f_diffuse + f_specular

B.3.6. Discussion B.3.6。讨论 

B.3.6.1. Masking-Shadowing Term and Multiple ScatteringB.3.6.1。掩盖痕迹和多个散射

The model for specular reflection can be improved in several ways. Heitz (2014) notes that a more accurate form of the masking-shadowing function takes the correlation between masking and shadowing due to the height of the microsurface into account. This correlation is accounted for in the height-correlated masking and shadowing function. Another improvement in accuracy can be achieved by modeling multiple scattering, see Section Microfacet Surfaces.可以通过多种方式改善镜面反射模型。 Heitz(2014)指出,由于微观面的高度,掩盖遮盖功能的一种更准确的形式将掩盖和阴影之间的相关性。该相关性在高度相关的遮罩和阴影函数中解释。通过对多个散射进行建模可以实现准确性的另一种提高,请参见小部分表面。

B.3.6.2. Schlick’s Fresnel ApproximationB.3.6.2。施利克的菲涅尔*似

Although Schlick’s Fresnel is a good approximation for a wide range of metallic and dielectric materials, there are a couple of reasons to use a more sophisticated solution for the Fresnel term.尽管对于多种金属和介电材料而言,Schlick的菲涅尔机构是一个很好的*似值,但有几个理由将更复杂的解决方案用于菲涅尔术语。

Metals often exhibit a “dip” in reflectance near grazing angles, which is not present in the Schlick Fresnel. Lazányi and Szirmay-Kalos (2005) extend the Schlick Fresnel with an error term to account for it. Hoffman (2019) improves the parameterization of this term by introducing an artist-friendly f82 color, the color at an angle of about 82°. An additional color parameter for metals was also introduced by Gulbrandsen (2014). Gulbrandson calls it “edge tint” and uses it in the full Fresnel equations instead of Schlick’s approximation. Even though the full Fresnel equations should give a more accurate result, Hoffman shows that it is worse than Schlick’s approximation in the context of RGB renderers. As we target RGB renderers and do not provide an additional color parameter for metals in glTF, we suggest using the original Schlick Fresnel for metals.金属通常在靠*放牧角的反射率中表现出“浸入”,而施莱克菲涅尔(Schlick Fresnel)不存在。 Lazányi和Szirmay-Kalos(2005)以错误的术语扩展了Schlick Fresnel。 Hoffman(2019)通过引入对艺术家友好的f82颜色,以约82°的角度提高该术语的参数化。 Gulbrandsen(2014)还引入了金属的附加颜色参数。 Gulbrandson称其为“边缘色”,并在完整的菲涅尔方程中使用它,而不是Schlick的*似值。即使完整的菲涅尔方程式应该给出更准确的结果,霍夫曼表明,在RGB渲染器的背景下,它比Schlick的*似值还差。由于我们针对RGB渲染器,并且不为GLTF中的金属提供其他颜色参数,因此我们建议将原始的Schlick Fresnel用于金属。

The index of refraction of most dielectrics is 1.5. For that reason, the dielectric Fresnel term uses a fixed f0 = 0.04. The Schlick Fresnel approximates the full Fresnel equations well for an index of refraction in the range [1.2, 2.2]. The main reason for a material to fall outside this range is transparency and nested objects. If a transparent object overlaps another transparent object and both have the same (or similar) index of refraction, the resulting ratio at the boundary is 1 (or close to 1). According to the full Fresnel equations, there is no (or almost no) reflection in this case. The reflection intensity computed from the Schlick Fresnel approximation will be too high. Implementations that care about accuracy in case of nested dielectrics are encouraged to use the full Fresnel equations for dielectrics. For metals Schlick’s approximation is still a good choice.大多数电介质的折射指数为1.5。因此,介电菲涅尔术语使用固定的f0 = 0.04。 Schlick Fresnel*似于完整的Fresnel方程,对于折射率的索引范围[1.2,2.2]。材料落在此范围之外的主要原因是透明性和嵌套对象。如果一个透明的对象与另一个透明对象重叠,并且两个对象都具有相同的(或相似)折射索引,则边界处的结果比为1(或接*1)。根据完整的菲涅尔方程,在这种情况下没有(几乎没有)反射。从Schlick Fresnel*似值计算的反射强度太高。鼓励在嵌套介电的情况下关心准确性的实现,以将完整的菲涅尔方程用于电介质。对于金属而言,施利克的*似仍然是一个不错的选择。

B.3.6.3. Coupling Diffuse and Specular ReflectionB.3.6.3。耦合扩散和镜面反射

While the coupling of diffuse and specular components in fresnel_mix as proposed in this section is simple and cheap to compute, it is not very accurate and breaks a fundamental property that a physically based BRDF must fulfill — energy conservation. Energy conservation means that a BRDF must not reflect more light than it receives. Several fixes have been proposed, each with its own trade-offs regarding performance and quality.虽然本节中提出的fresnel_mix中弥漫性和镜面成分的耦合简单又便宜,但它不是很准确,并且破坏了基于物理的BRDF必须实现的基本属性 - 能量保护。节能意味着BRDF不得反射比收到的光。已经提出了几种修复程序,每个修复程序都在性能和质量方面具有自己的权衡。

Burley (2012) notes that a common solution found in many models calculates the diffuse Fresnel factor by evaluating the Fresnel term twice with view and light direction instead of the half vector: (1-F(NdotL)) * (1-F(NdotV)). While this is energy-conserving, he notes that this weighting results in significant darkening at grazing angles, an effect they couldn’t observe in their measurements. They propose some changes to the diffuse BRDF to make it better predict the measurements, but even the fixed version is still not energy conserving mathematically.Burley(2012)指出,在许多模型中发现的一种常见解决方案通过用视图和光方向而不是半矢量评估菲涅尔术语来计算弥漫性菲涅尔因子:(1-F(NdotL)) * (1-F(NdotV))。尽管这是持节的能源,但他指出,这种加权会导致放牧角度显着变暗,这一效果无法在测量中观察到。他们提出了对弥漫性BRDF的一些更改,以使其更好地预测测量值,但即使固定版本也无法在数学上节省能源。

More recently, Jakob et al. (2014) developed a generic framework for computing BSDFs of layered materials, including multiple scattering within layers. Amongst much more complicated scenarios it also solves the special case of coupling diffuse and specular components, but it is too heavy for textured materials, even in offline rendering.最*,Jakob等人。 (2014年)开发了一个通用框架,用于计算分层材料的BSDF,包括层中的多个散射。在更复杂的场景中,它还解决了耦合弥散和镜面组件的特殊情况,但是即使在离线渲染中,它对于纹理材料来说太重了。

Kulla and Conty (2017) found a solution tailored to the special case of coupling diffuse and specular components, which is easy to compute. It requires the directional albedo of the Fresnel-weighted specular BRDF to be precomputed and tabulated, but they found that the function is smooth, and a low-resolution 3D texture (16³ pixels) is sufficient. Their coupled diffuse-specular model is not only energy-conserving, but also energy-preserving, meaning that if neither the specular nor the diffuse component absorb any energy, all energy is reflected.Kulla and Conty(2017)发现了一种针对耦合扩散和镜面组件的特殊情况量身定制的解决方案,该解决方案易于计算。它要求将菲涅耳加权的镜面BRDF的定向反照率进行预计算和列表,但他们发现该函数是光滑的,并且低分辨率的3D纹理(16³像素)就足够了。他们的耦合分散特异性模型不仅是能量的,而且是能量前的,这意味着,如果镜头和弥漫性分量都没有吸收任何能量,则所有能量都会反映出来。

B.4. References B.4。参考 

Appendix C: Animation Sampler Interpolation Modes附录C:动画采样器插值模式

C.1. Overview C.1。概述 

Animation sampler interpolation modes define how to compute values of animated properties for the timestamps located between the keyframes. When the current (requested) timestamp exists in the animation data, its associated property value MUST be used as-is, without interpolation.动画采样器插值模式定义了如何计算位于密钥帧之间的时间戳的动画属性值。当动画数据中存在当前(请求的)时间戳时,必须使用其关联的属性值,而无需插值。

For the following sections, let对于以下各节,让

  • nnbe the total number of keyframes,是关键帧的总数,n>0 n> 0 n>0; ; 
  • tktkbe the timestamp of the成为时间戳kk-th keyframe,   - 键帧, k∈[1,n]k∈[1,n]k∈[1,n]; ; 
  • vkvkbe the animated property value of the kk-th keyframe;成为-th键帧的动画属性值;
  • tctcbe the current (requested) timestamp,成为当前(请求的)时间戳,tk< < tc< < tk+1 K + 1 tk<tc<tk+1; ; 
  • td= = tk+1K + 1 −  -  tktd=tk+1-tk be the duration of the interpolation segment;成为插值段的持续时间;
  • t=tc−tktdt = t=tc-tktd be the segment-normalized interpolation factor.是分段归一化的插值因子。

The scalar-vector multiplications are per vector component.标量矢量乘以每个向量分量。

C.2. Step Interpolation C.2。步骤插值 

This mode is used when the animation sampler interpolation mode is set to STEP.当动画采样器插值模式设置为STEP时,使用此模式。

The interpolated sampler value vtvt at the current (requested) timestamp tctc is computed as follows.在电流(请求)时间戳处的插值采样器值如下计算。

vt=vkvt=vk

C.3. Linear Interpolation C.3。线性插值 

This mode is used when the animation sampler interpolation mode is set to LINEAR and the animated property is not rotation.当动画采样器插值模式设置为LINEAR时,使用此模式,而动画属性不是rotation。

The interpolated sampler value vtvt at the current (requested) timestamp tctc is computed as follows.在电流(请求)时间戳处的插值采样器值如下计算。

vt= = ( (( 1 1 −  -  t t ) ) ∗ * vk+ + t t ∗ * vk+1 K + 1 vt=(1−t)∗vk+t∗vk+1

C.4. Spherical Linear InterpolationC.4。球形线性插值

This mode is used when the animation sampler interpolation mode is set to LINEAR and the animated property is rotation, i.e., values of the animated property are unit quaternions.当动画采样器插值模式设置为LINEAR时,使用此模式,动画属性为rotation,即动画属性的值是单位四基元。

Let 让 

  • a 一个= = arccos Arccos ( (( | | vk⋅ 走为 vk+1 K + 1 | | ) ) a=arccos(|vk⋅vk+1|) be the arccosine of the absolute value of the dot product of two consecutive quaternions;成为两个连续四季度点产物的绝对值的arccosine;
  • s s = = vk⋅vk+1K + 1 | | vk⋅ 走为 vk+1 K + 1 | | s=vk⋅vk+1|vk⋅vk+1| be the sign of the dot product of two consecutive quaternions.成为两个连续四季度的点产物的迹象。

The interpolated sampler value vtvt at the timestamp tctc is computed as follows.时间戳处的插值采样器值如下计算。

vt= = sin(a(1−t))s i n(a(1 -t))sin(a)s i n(a)∗ * vk+ + s s ∗ * sin(at)s i n(a t)sin(a)s i n(a)∗ * vk+1 K + 1 vt=sin(a(1−t))sin(a)∗vk+s∗sin(at)sin(a)∗vk+1

 

Implementation Note 实施注释 

Using the dot product’s absolute value for computing使用DOT产品的绝对值进行计算aa and multiplying  并乘以 vk+1 K + 1 vk+1 by the dot product’s sign ensure that the spherical interpolation follows the short path along the great circle defined by the two quaternions.通过点产品的符号确保球形插值沿两个四季度定义的大圆圈沿着短路。

Implementations MAY approximate these equations to reach application-specific accuracy and/or performance targets.实现可能会*似这些方程,以达到特定于应用程序的精度和/或性能目标。

 

Implementation Note 实施注释 

When aa is close to zero, spherical linear interpolation turns into regular linear interpolation.当接*零时,球形线性插值会变成常规线性插值。

C.5. Cubic Spline Interpolation C.5。立方样条插值 

This mode is used when the animation sampler interpolation mode is set to CUBICSPLINE.当动画采样器插值模式设置为CUBICSPLINE时,使用此模式。

An animation sampler that uses cubic spline interpolation MUST have at least 2 keyframes.使用立方样条插值的动画采样器必须至少具有2个关键帧。

For each timestamp stored in the animation sampler, there are three associated keyframe values: in-tangent, property value, and out-tangent.对于存储在动画采样器中的每个时间戳,都有三个关联的密钥帧值:内加,属性值和距离分类。

Let 让 

  • akak, vkvk, and bkbkbe the in-tangent, the property value, and the out-tangent of the kk-th frame respectively.,并分别成为构架的内在属性值和the框架的外观。

The interpolated sampler value vtvt at the timestamp tctc is computed as follows.时间戳处的插值采样器值如下计算。

vt= = ( (( 2 2 t3−  -  3 3 t2+ + 1 1 ) ) ∗ * vk+ + td( (( t3−  -  2 2 t2+ + t t ) ) ∗ * bk+ + ( (( −  -  2 2 t3+ + 3 3 t2) ) ∗ * vk+1 K + 1 + + td( (( t3−  -  t2) ) ∗ * ak+1vt=(2t3−3t2+1)∗vk+td(t3−2t2+t)∗bk+(−2t3+3t2)∗vk+1+td(t3−t2)∗ak+1

When the animation sampler targets a node’s rotation property, the interpolated quaternion MUST be normalized before applying the result to the node’s rotation.当动画采样器以节点的旋转属性为目标时,必须在将结果应用于节点的旋转之前将插值四分值归一化。

When writing out rotation values, exporters SHOULD take care to not write out values that can result in an invalid quaternion with all zero values being produced by the interpolation.当写出旋转值时,出口商应注意不要写出可能导致无效的四元素的值,而插值产生的所有零值。

 

Implementation Note 实施注释 

This can be achieved by ensuring that这可以通过确保vk≠ ≠ −  -  vk+1 K + 1 vk≠-vk+1 for all keyframes. 对于所有密钥帧。 

The first in-tangent a1a1 and last out-tangent bnbn SHOULD be zeros as they are not used in the spline calculations.第一个内或最后一个距离的零应该是零,因为它们未在样条计算中使用。

Version 2.0.1版本2.0.1
Last updated 2021-10-11 23:01:54 UTC最后更新了2021-10-11 23:01:54 UTC

 

posted @   BIT祝威  阅读(17)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· ThreeJs-16智慧城市项目(重磅以及未来发展ai)
· .NET 原生驾驭 AI 新基建实战系列(一):向量数据库的应用与畅想
· Ai满嘴顺口溜,想考研?浪费我几个小时
· Browser-use 详细介绍&使用文档
· 软件产品开发中常见的10个问题及处理方法
canvas start.

canvas end.



点击右上角即可分享
微信分享提示