SlideShare a Scribd company logo
1 of 8
Download to read offline
Page 1glTF 2.0 Quick Reference Guide
Rev. 0717www.khronos.org/gltf
glTF was designed and speciļ¬ed by the Khronos
Group, for the eļ¬ƒcient transfer of 3D content
over networks.
glTF and the glTF logo
are trademarks of the
Khronos Group Inc.
Further resources
The Khronos glTF landing page:
https://www.khronos.org/gltf
The Khronos glTF GitHub repository:
https://github.com/KhronosGroup/glTF
glTF - what the ?
An overview of the basics of
the GL Transmission Format
The core of glTF is a JSON ļ¬le that describes the
structure and composition of a scene containing
3D models. The top-level elements of this ļ¬le are:
These elements are contained in arrays. References
between the objects are established by using their
indices to look up the objects in the arrays.
Ā©2016-2017 Marco Hutter
www.marco-hutter.de
Feedback:
gltf@marco-hutter.de
Version 2.0
glTF version 2.0
For glTF
2.0!
This overview is
non-normative!
It is also possible to store the whole asset in a single
binary glTF ļ¬le. In this case, the JSON data is stored
as a string, followed by the binary data of buļ¬€ers
or images.
scenes, nodes
Basic structure of the scene
meshes
Geometry of 3D objects
materials
Deļ¬nitions of how objects should be rendered
skins
Information for vertex skinning
animations
Changes of properties over time
cameras
View conļ¬gurations for the scene
textures, images, samplers
Surface appearance of objects
buļ¬€ers, buļ¬€erViews, accessors
Data references and data layout descriptions
buļ¬€erView
buļ¬€er
accessor
mesh
node
scene
skincamera
animationmaterial
texture
sampler image
Concepts
Binary data references
The images and buļ¬€ers of a glTF asset may refer to
external ļ¬les that contain the data that are required
for rendering the 3D content:
The data is referred to via URIs, but can also be
included directly in the JSON using data URIs. The
data URI deļ¬nes the MIME type, and contains the
data as a base64 encoded string:
"buffers": [
{
"uri": "buffer01.bin"
"byteLength": 102040,
}
],
"images": [
{
"uri": "image01.png"
}
],
"data:application/gltf-buffer;base64,AAABAAIAAgA..."
"data:image/png;base64,iVBORw0K..."
Buļ¬€er data:
Image data (PNG):
The buļ¬€ers refer to binary
ļ¬les (.BIN) that contain
geometry- or animation
data.
The images refer to image
ļ¬les (PNG, JPG...) that
contain texture data for
the models.
The conceptual relationships between the top-level
elements of a glTF asset are shown here:
Page 2 glTF 2.0 Quick Reference Guide
Rev. 0717 www.khronos.org/gltf
meshes
"meshes": [
{
"primitives": [
{
"mode": 4,
"indices": 0,
"attributes": {
"POSITION": 1,
"NORMAL": 2
},
"material": 2
}
]
}
],
The meshes may contain multiple mesh primitives.
These refer to the geometry data that is required
for rendering the mesh.
Each mesh primitive has a
rendering mode, which is
a constant indicating whether
it should be rendered as
POINTS, LINES, or TRIANGLES.
The primitive also refers to
indices and the attributes
of the vertices, using the
indices of the accessors for
this data. The material that
should be used for rendering
is also given, by the index of
the material.
{
"primitives": [
{
...
"targets": [
{
"POSITION": 11,
"NORMAL": 13
},
{
"POSITION": 21,
"NORMAL": 23
}
]
}
],
"weights": [0, 0.5]
}
A mesh may deļ¬ne multiple morph targets. Such
a morph target describes a deformation of the
original mesh.
To deļ¬ne a mesh with morph
targets, each mesh primitive
can contain an array of
targets. These are dictionaries
that map names of attributes
to the indices of accessors that
contain the displacements of
the geometry for the target.
The mesh may also contain an
array of weights that deļ¬ne
the contribution of each morph
target to the ļ¬nal, rendered
state of the mesh.
Combining multiple morph targets with diļ¬€erent
weights allows, for example, modeling diļ¬€erent
facial expressions of a character: The weights can
be modiļ¬ed with an animation, to interpolate
between diļ¬€erent states of the geometry.
Position:
Normal:
(1.2, -2.6, 4.3)
(0.0, 1.0, 0.0)
(2,7, -1.8, 6.2)
(0.71, 0.71, 0.0)
(... )
(... )
2.7 -1.8 6.2 ...
0.71 0.71 0.0 ...
POSITION 1.2 -2.6 4.3
0.0 1.0 0.0NORMAL
Each attribute is deļ¬ned by mapping the attribute
name to the index of the accessor that contains the
attribute data. This data will be used as the vertex
attributes when rendering the mesh. The attributes
may, for example, deļ¬ne the POSITION and the
NORMAL of the vertices:
A node may contain a local
transform. This can be given as
a column-major matrix array,
or with separate translation,
rotation and scale properties,
where the rotation is given as a
quaternion. The local transform
matrix is then computed as
M = T * R * S
where T, R and S are the matrices
that are created from the
translation, rotation and scale.
The global transform of a node
is given by the product of all local
transforms on the path from the
root to the respective node.
scene 0
node 0 node 1 node 2
node 3 node 4
"nodes": [
{
"matrix": [
1,0,0,0,
0,1,0,0,
0,0,1,0,
5,6,7,1
],
...
},
{
"translation":
[ 0,0,0 ],
"rotation":
[ 0,0,0,1 ],
"scale":
[ 1,1,1 ]
...
},
]
Each of the nodes can
contain an array of indices
of its children. This allows
modeling a simple scene
hierarchy:
scenes, nodes
"scene": 0,
"scenes": [
{
"nodes": [ 0, 1, 2 ]
}
],
"nodes": [
{
"children": [ 3, 4 ],
...
},
{ ... },
{ ... },
{ ... },
{ ... },
...
],
Each node may refer to a mesh or
a camera, using indices that point
into the meshes and cameras arrays.
These elements are then attached
to these nodes. During rendering,
instances of these elements are
created and transformed with the
global transform of the node.
The glTF JSON may contain scenes (with an optional
default scene). Each scene can contain an array of
indices of nodes.
"nodes": [
{
"mesh": 4,
...
},
{
"camera": 2,
...
},
]
Nodes are also used in vertex skinning: A node
hierarchy can deļ¬ne the skeleton of an animated
character. The node then refers to a mesh and to
a skin. The skin contains further information about
how the mesh is deformed based on the current
skeleton pose.
The translation, rotation and scale properties of a
node may also be the target of an animation: The
animation then describes how one property
changes over time. The attached objects will move
accordingly, allowing to model moving objects or
camera ļ¬‚ights.
Page 3glTF 2.0 Quick Reference Guide
Rev. 0717www.khronos.org/gltf
buļ¬€ers, buļ¬€erViews, accessors
"buffers": [
{
"byteLength": 35,
"uri": "buffer01.bin"
}
],
Each of the buļ¬€ers refers
to a binary data ļ¬le, using
a URI. It is the source of
one block of raw data with
the given byteLength.
"bufferViews": [
{
"buffer": 0,
"byteOffset": 4,
"byteLength": 28,
"target": 34963
}
],
Each of the buļ¬€erViews
refers to one buļ¬€er. It
has a byteOļ¬€set and a
byteLength, deļ¬ning the
part of the buļ¬€er that
belongs to the buļ¬€erView,
and an optional OpenGL
buļ¬€er target.
"accessors": [
{
"bufferView": 0,
"byteOffset": 4,
"type": "VEC2",
"componentType": 5126,
"count": 2,
"byteStride": 12,
"min" : [0.1, 0.2]
"max" : [0.9, 0.8]
}
]
The accessors deļ¬ne how
the data of a buļ¬€erView is
interpreted. They may
deļ¬ne an additional
byeOļ¬€set referring to the
start of the buļ¬€erView,
and contain information
about the type and layout
of the buļ¬€erView data:
buļ¬€er
byteLength = 35
buļ¬€erView
byteOļ¬€set = 4
byteLength = 28
0 4 8 1612 20 24 28 32
accessor
byteOļ¬€set = 4
The buļ¬€er data is read from a ļ¬le:
The buļ¬€erView deļ¬nes a segment of the buļ¬€er data:
The accessor deļ¬nes an additional oļ¬€set:
The accessor deļ¬nes a stride between the elements:
The accessor deļ¬nes that the elements are 2D ļ¬‚oat vectors:
This data may, for example,
be used by a mesh primitive,
to access 2D texture
coordinates: The data of the
buļ¬€erView may be bound
as an OpenGL buļ¬€er, using
glBindBuffer. Then, the
properties of the accessor
may be used to deļ¬ne this
buļ¬€er as vertex attribute
data, by passing them to
glVertexAttribPointer
when the buļ¬€erView buļ¬€er
is bound.
byteStride = 12
type = "VEC2"
componentType = GL_FLOAT
x0 y0 x1 y1
4 8 1612 20 24 28 32
8 1612 20 24 28 32
8 1612 20 24 28
The buļ¬€ers contain the data that is used for the
geometry of 3D models, animations, and skinning.
The buļ¬€erViews add structural information to this
data. The accessors deļ¬ne the exact type and
layout of the data.
The data may, for example, be deļ¬ned as 2D vectors
of ļ¬‚oating point values when the type is "VEC2"
and the componentType is GL_FLOAT (5126). The
byteStride says how many bytes are between the
start of one element and the start of the next,
which allows for accessors to deļ¬ne interleaved
data. The range of all values is stored in the min
and max property.
Sparse accessors
"accessors": [
{
"type": "SCALAR",
"componentType": 5126,
"count": 10,
"sparse": {
"count": 4,
"values": {
"bufferView": 2,
},
"indices": {
"bufferView": 1,
"componentType": 5123
}
}
}
]
When only few elements of an accessor diļ¬€er from
a default value (which is often the case for morph
targets), then the data can be given in a very
compact form using a sparse data description:
The sparse data block
contains the count of
sparse data elements.
The accessor deļ¬nes the
type of the data (here,
scalar ļ¬‚oat values), and
the total element count.
The values refer to the
buļ¬€erView that contains
the sparse data values.
The target indices for
the sparse data values
are deļ¬ned with a
reference to a
buļ¬€erView and the
componentType.
0.0 0.0 0.0 0.0 0.0 0.0
1 4 5 7
4.3 9.1 5.2 2.7
0 1 2 3 4 5 6 7 8 9
4.3 9.1 5.2 2.7
values
indices
sparse (count=4)
Final accessor data with 10 ļ¬‚oat values
The values are written into the ļ¬nal accessor data,
at the positions that are given by the indices:
Page 4 glTF 2.0 Quick Reference Guide
Rev. 0717 www.khronos.org/gltf
materials
1.0
0.75
0.5
0.25
0.0
0.0 0.25 0.5 0.75 1.0
Metal
Roughness
Each mesh primitive may refer to one of the materials that are
contained in a glTF asset. The materials describe how an object
should be rendered, based on physical material properties. This
allows to apply Physically Based Rendering (PBR) techniques,
to make sure that the appearance of the rendered object is
consistent among all renderers.
The default material model is the Metallic-Roughness-Model.
Values between 0.0 and 1.0 are used to describe how much the
material characteristics resemble that of a metal, and how rough
the surface of the object is. These properties may either be
given as individual values that apply to the whole object, or be
read from textures.
In addition to the properties that are deļ¬ned via the Metallic-Roughness-
Model, the material may contain other properties that aļ¬€ect the object
appearance:
"materials": [
...
{
"name": "brushed gold",
"pbrMetallicRoughness": {
"baseColorFactor":
[1,1,1,1],
"baseColorTexture": {
"index" : 1,
"texCoord" : 1
},
"metallicFactor": 1.0,
"roughnessFactor": 1.0
}
}
],
The texture references in a material always
contain the index of the texture. They may
also contain the texCoord set index. This
is the number that determines the
TEXCOORD_<n> attribute of the rendered
mesh primitive that contains the texture
coordinates for this texture, with 0 being
the default.
"meshes": [
{
"primitives": [
{
"material": 2,
"attributes": {
"NORMAL": 3,
"POSITION": 1,
"TEXCOORD_0": 2,
"TEXCOORD_1": 5
},
}
]
}
],
"textures": [
...
{
"source": 4,
"sampler": 2
}
],
Material properties in textures
The normalTexture refers to a texture that contains tangent-space
normal information, and a scale factor that will be applied to these
normals.
The occlusionTexture refers to a texture that deļ¬nes areas of the
surface that are occluded from light, and thus rendered darker. This
information is contained in the "red" channel of the texture. The
occlusion strength is a scaling factor to be applied to these values.
The emissiveTexture refers to a texture that may be used to
illuminate parts of the object surface: It deļ¬nes the color of the
light that is emitted from the surface. The emissiveFactor contains
scaling factors for the red, green and blue components of this texture.
"materials": [
{
"pbrMetallicRoughness": {
"baseColorTexture": {
"index": 1,
"texCoord": 1
},
"baseColorFactor":
[ 1.0, 0.75, 0.35, 1.0 ],
"metallicRoughnessTexture": {
"index": 5,
"texCoord": 1
},
"metallicFactor": 1.0,
"roughnessFactor": 0.0,
}
"normalTexture": {
"scale": 0.8,
"index": 2,
"texCoord": 1
},
"occlusionTexture": {
"strength": 0.9,
"index": 4,
"texCoord": 1
},
"emissiveTexture": {
"index": 3,
"texCoord": 1
},
"emissiveFactor":
[0.4, 0.8, 0.6]
}
],
The baseColorTexture is the main texture that will be applied to the
object. The baseColorFactor contains scaling factors for the red, green,
blue and alpha component of the color. If no texture is used, these
values will deļ¬ne the color of the whole object.
The metallicRoughnessTexture contains the metalness value in
the "blue" color channel, and the roughness value in the "green" color
channel. The metallicFactor and roughnessFactor are multiplied
with these values. If no texture is given, then these factors deļ¬ne
the reļ¬‚ection characteristics for the whole object.
The properties that deļ¬ne a material in the Metallic-Roughness-Model
are summarized in the pbrMetallicRoughness object:
Page 5glTF 2.0 Quick Reference Guide
Rev. 0717www.khronos.org/gltf
cameras
"cameras": [
{
"type": "perspective",
"perspective": {
"aspectRatio": 1.5,
"yfov": 0.65,
"zfar": 100,
"znear": 0.01
}
},
{
"type": "orthographic",
"orthographic": {
"xmag": 1.0,
"ymag": 1.0,
"zfar": 100,
"znear": 0.01
}
}
]
Each of the nodes may refer to one of the cameras
that are deļ¬ned in the glTF asset.
There are two types of
cameras: perspective
and orthographic
ones, and they deļ¬ne
the projection matrix.
The value for the far
clipping plane distance
of a perspective camera,
zfar, is optional. When
it is omitted, the camera
uses a special projection
matrix for inļ¬nite
projections.
textures, images, samplers
The texture consists of a
reference to the source of
the texture, which is one of
the images of the asset, and
a reference to a sampler.
"textures": [
{
"source": 4,
"sampler": 2
}
...
],
"images": [
...
{
"uri": "file01.png"
}
{
"bufferView": 3,
"mimeType" :
"image/jpeg"
}
],
The images deļ¬ne the image
data used for the texture.
This data can be given via
a URI that is the location of
an image ļ¬le, or by a
reference to a buļ¬€erView
and a MIME type that
deļ¬nes the type of the image
data that is stored in the
buļ¬€er view.
"samplers": [
...
{
"magFilter": 9729,
"minFilter": 9987,
"wrapS": 10497,
"wrapT": 10497
}
},
The samplers describe the
wrapping and scaling of
textures. (The constant
values correspond to
OpenGL constants that
can directly be passed to
glTexParameter).
The textures contain information about textures
that may be applied to rendered objects: Textures
are referred to by materials to deļ¬ne the basic
color of the objects, as well as physical properties
that aļ¬€ect the object appearance.
skins
A glTF asset may contain the information that is
necessary to perform vertex skinning. With vertex
skinning, it is possible to let the vertices of a mesh
be inļ¬‚uenced by the bones of a skeleton, based on
its current pose.
"nodes": [
{
"name" :
"Skinned mesh node",
"mesh": 0
"skin": 0,
},
...
{
"name": "Torso",
"children":
[ 2, 3, 4, 5, 6 ]
"rotation": [...],
"scale": [ ...],
"translation": [...]
},
...
{
"name": "LegL",
"children": [ 7 ],
...
},
...
{
"name": "FootL",
...
},
...
],
"skins": [
{
"inverseBindMatrices": 12,
"joints": [ 1, 2, 3 ... ]
}
],
"meshes": [
{
"primitives": [
{
"attributes": {
"POSITION": 0,
"JOINTS_0": 1,
"WEIGHTS_0": 2
...
},
]
}
],
Head
LegR LegL
ArmR ArmL
FootR FootL
Torso
The mesh primitives of a
skinned mesh contain the
POSITION attribute that
refers to the accessor for the
vertex positions, and two
special attributes that are
required for skinning:
A JOINTS_0 and a WEIGHTS_0
attribute, each referring to
an accessor.
The JOINTS_0 attribute data
contains the indices of the
joints that should aļ¬€ect the
vertex.
The WEIGHTS_0 attribute data
deļ¬nes the weights indicating
how strongly the joint should
inļ¬‚uence the vertex.
The skins contain an array
of joints, which are the
indices of nodes that deļ¬ne
the skeleton hierarchy, and
the inverseBindMatrices,
which is a a reference to an
accessor that contains one
matrix for each joint.
A node that refers to a mesh
may also refer to a skin.
The skeleton hierarchy is
modeled with nodes, just
like the scene structure:
Each joint node may have a
local transform and an array
of children, and the "bones"
of the skeleton are given
implicitly, as the connections
between the joints.
From this information, the
skinning matrix can be
computed.
This is explained in detail in
"Computing the skinning
matrix".
When one of the nodes refers to a camera, then
an instance of this camera is created. The camera
matrix of this instance is given by the global
transform matrix of the node.
Page 6 glTF 2.0 Quick Reference Guide
Rev. 0717 www.khronos.org/gltf
Wiki page about skinning in COLLADA: https://www.khronos.org/collada/wiki/Skinning
Section 4-7 in the COLLADA speciļ¬cation: https://www.khronos.org/ļ¬les/collada_spec_1_5.pdf
Computing the skinning matrix
The skinning matrix describes how the vertices of a mesh are transformed based on the current pose of a
skeleton. The skinning matrix is a weighted combination of joint matrices.
For each node whose index appears in the joints of
the skin, a global transform matrix can be computed.
It transforms the mesh from the local space of the
joint, based on the current global transform of the
joint, and is called globalJointTransform.
jointMatrix[j] =
inverse(globalTransform) *
globalJointTransform[j] *
inverseBindMatrix[j];
From these matrices, a jointMatrix may be
computed for each joint:
Any global transform of the node that contains
the mesh and the skin is cancelled out by
pre-multiplying the joint matrix with the inverse
of this transform.
The skin refers to the inverseBindMatrices. This
is an accessor which contains one inverse bind
matrix for each joint. Each of these matrices
transforms the mesh into the local space of the
joint.
inverseBindMatrix[1]
joint2
joint1
joint0
globalJointTransform[1]
joint2
joint1
joint0
Computing the joint matrices
For implementations based on OpenGL or WebGL,
the jointMatrix array will be passed to the
vertex shader as a uniform.
The primitives of a skinned mesh contain the POSITION,
JOINT and WEIGHT attributes, referring to accessors.
These accessors contain one element for each vertex:
Combining the joint matrices to create the skinning matrix
px py pz j0 j1 j2 j3 w0 w1 w2 w3
POSITION JOINTS_0 WEIGHTS_0
vertex 0:
px py pz j0 j1 j2 j3 w0 w1 w2 w3vertex n:
...
...
...
...
Vertex Shader
uniform mat4 u_jointMatrix[12];
attribute vec3 a_position;
attribute vec4 a_joint;
attribute vec4 a_weight;
...
void main(void) {
...
mat4 skinMatrix =
a_weight.x * u_jointMatrix[int(a_joint.x)] +
a_weight.y * u_jointMatrix[int(a_joint.y)] +
a_weight.z * u_jointMatrix[int(a_joint.z)] +
a_weight.w * u_jointMatrix[int(a_joint.w)];
gl_Position =
modelViewProjection * skinMatrix * position;
}
a_weight.x
a_joint.x a_joint.y
joint1
joint2
joint0
a_weight.y
skinMatrix = 1.0 * jointMatrix[1] + 0.0 * jointMatrix[0] +...
skinMatrix = 0.75 * jointMatrix[1] + 0.25 * jointMatrix[0] +...
skinMatrix = 0.5 * jointMatrix[1] + 0.5 * jointMatrix[0] +...
skinMatrix = 0.25 * jointMatrix[1] + 0.75 * jointMatrix[0] +...
skinMatrix = 0.0 * jointMatrix[1] + 1.0 * jointMatrix[0] +...
The data of these accessors is passed as attributes to
the vertex shader, together with the jointMatrix array.
The skinMatrix
transforms the
vertices based on
the skeleton pose,
before they are
transformed with
the model-view-
perspective matrix.
In the vertex shader, the skinMatrix is computed. It is
a linear combination of the joint matrices whose indices
are contained in the JOINTS_0 attribute, weighted with
the WEIGHTS_0 values:
(The vertex skinning in COLLADA
is similar to that in glTF)
Page 7glTF 2.0 Quick Reference Guide
Rev. 0717www.khronos.org/gltf
animations
"animations": [
{
"channels": [
{
"target": {
"node": 1,
"path": "translation"
},
"sampler": 0
}
],
"samplers": [
{
"input": 4,
"interpolation": "LINEAR",
"output": 5
}
]
}
]
A glTF asset can contain animations. An animation can be applied to the properties of a node that deļ¬ne
the local transform of the node, or to the weights for the morph targets.
The sampler looks up the key frames for
the current time, in the input data.
0 1 2 3 4 5 6
Global time:
Each channel deļ¬nes the target of the animation. This target usually
refers to a node, using the index of this node, and to a path, which
is the name of the animated property. The path may be "translation",
"rotation" or "scale", aļ¬€ecting the local transform of the node, or
"weights", in order to animate the weights of the morph targets of
the meshes that are referred to by the node. The channel also refers
to a sampler, which summarizes the actual animation data.
The data of the input accessor
of the animation sampler,
containing the key frame times
During the animation, a "global" animation time (in seconds) is advanced.
Each animation consists of two elements: An array of channels and an
array of samplers.
A sampler refers to the input and output data, using the indices of
accessors that provide the data. The input refers to an accessor with
scalar ļ¬‚oating-point values, which are the times of the key frames of
the animation. The output refers to an accessor that contains the
values for the animated property at the respective key frames. The
sampler also deļ¬nes an interpolation mode for the animation, which
may be "LINEAR", "STEP", "CATMULLROMSPLINE", or "CUBICSPLINE".
The data of the output accessor
of the animation sampler,
containing the key frame values
for the animated property
10.0
5.0
-5.0
14.0
3.0
-2.0
18.0
1.0
1.0
24.0
-1.0
4.0
31.0
-3.0
7.0
0.0 0.8 1.6 2.4 3.2
Current time: 1.2
16.0
2.0
-0.5
The corresponding values of the output
data are read, and interpolated based on
the interpolation mode of the sampler.
The interpolated value is forwarded
to the animation channel target.
Animation samplers
Displacement for
"POSITION" from
morph target 1:
Original mesh
primitive attribute
"POSITION"
weights=
[0.5,0.0]
Displacement for
"POSITION" from
morph target 0:
weights=
[0.0,0.5]
Rendering
Animation channel targets
The interpolated value that is provided by an
animation sampler may be applied to diļ¬€erent
animation channel targets.
translation=[2, 0, 0] translation=[3, 2, 0]
Animating the translation of a node:
rotation=
[0.0, 0.0, 0.0, 1.0]
rotation=
[0.0, 0.0, 0.38, 0.92]
Animating the rotation of a skeleton node of a skin:
Animating the weights for the morph targets that
are deļ¬ned for the primitives of a mesh that is
attached to a node:
Page 8 glTF 2.0 Quick Reference Guide
Rev. 0717 www.khronos.org/gltf
chunkLength
uint32
12-byte header
chunkType
uint32
chunkData
uchar[]
length
uint32
version
uint32
magic
uint32
chunkLength
uint32
chunkType
uint32
chunkData
uchar[]
chunk 0 (JSON) chunk 1 (Binary Buļ¬€er)
...
The length is the total length of the ļ¬le, in bytes
The magic entry has the value 0x46546C67,
which is the ASCII string "glTF".This is used
to identify the data as a binary glTF
The version deļ¬nes the ļ¬le format version.
The version described here is version 2
The chunkData contains the actual data of the chunk. This may be
the ASCII representation of the JSON data, or binary buļ¬€er data.
The chunkType value deļ¬nes what type of data is contained in the chunkData.
It may be 0x4E4F534A, which is the ASCII string "JSON", for JSON data, or
0x004E4942, which is the ASCII string "BIN", for binary data.
The chunkLength is the length of the chunkData, in bytes
In the standard glTF format, there are two options
for including external binary resources like buļ¬€er
data and textures: They may be referenced via
URIs, or embedded in the JSON part of the glTF
using data URIs. When they are referenced via URIs,
then each external resource implies a new
download request. When they are embedded as
data URIs, the base 64 encoding of the binary data
will increase the ļ¬le size considerably.
To overcome these drawbacks, there is the option
to combine the glTF JSON and the binary data into
a single binary glTF ļ¬le. This is a little-endian ļ¬le,
with the extension ".glb". It contains a header,
which gives basic information about the version
and structure of the data, and one or more
chunks that contain the actual data. The ļ¬rst
chunk always contains the JSON data. The
remaining chunks contain the binary data.
Binary glTF ļ¬les
Extensions
When an extension is used
in a glTF asset, it has to be
listed in the top-level
extensionsUsed property.
The extensionsRequired
property lists the extensions
that are strictly required to
properly load the asset.
"extensionsUsed" : [
"KHR_lights_common",
"CUSTOM_EXTENSION"
]
"extensionsRequired" : [
"KHR_lights_common"
]
"textures" : [
{
...
"extensions" : {
"KHR_lights_common" : {
"lightSource" : true,
},
"CUSTOM_EXTENSION" : {
"customProperty" :
"customValue"
}
}
}
]
Extensions allow adding
arbitrary objects in the
extensions property of
other objects.
The name of such an
object is the same as the
name of the extension,
and it may contain
further, extension-speciļ¬c
properties.
The glTF format allows extensions to add new
functionality, or to simplify the deļ¬nition of
commonly used properties.
Existing extensions
Specular-Glossiness Materials
https://github.com/KhronosGroup/glTF/tree/master/extensions/Khronos/KHR_materials_pbrSpecularGlossiness
This extension is an alternative to the default Metallic-Roughness material model: It allows to deļ¬ne
the material properties based on specular and glossiness values.
Common Materials
https://github.com/KhronosGroup/glTF/tree/master/extensions/Khronos/KHR_materials_cmnBlinnPhong
This extension allows the easy deļ¬nition of non-physically based materials. This is based on the
Blinn-Phong model, which is often used in CAD applications. The material can be deļ¬ned using
a diļ¬€use, specular, and emissive color, and a shininess value.
Common Lights
https://github.com/KhronosGroup/glTF/tree/master/extensions/Khronos/KHR_lights
This extension allows adding diļ¬€erent types of lights to the scene hierarchy. This refers to point lights,
spot lights and directional lights. The lights can be attached to the nodes of the scene hierarchy.
The following extensions are developed and maintained on the Khronos GitHub repository:
WebGL Rendering Techniques
https://github.com/KhronosGroup/glTF/tree/master/extensions/Khronos/KHR_technique_webgl
With this extension, it is possible to deļ¬ne GLSL shaders that should be used for rendering the
glTF asset in OpenGL or WebGL

More Related Content

What's hot

NVIDIA OpenGL 4.6 in 2017
NVIDIA OpenGL 4.6 in 2017NVIDIA OpenGL 4.6 in 2017
NVIDIA OpenGL 4.6 in 2017Mark Kilgard
Ā 
Modern OpenGL Usage: Using Vertex Buffer Objects Well
Modern OpenGL Usage: Using Vertex Buffer Objects Well Modern OpenGL Usage: Using Vertex Buffer Objects Well
Modern OpenGL Usage: Using Vertex Buffer Objects Well Mark Kilgard
Ā 
OpenGL 4.4 - Scene Rendering Techniques
OpenGL 4.4 - Scene Rendering TechniquesOpenGL 4.4 - Scene Rendering Techniques
OpenGL 4.4 - Scene Rendering TechniquesNarann29
Ā 
Approaching zero driver overhead
Approaching zero driver overheadApproaching zero driver overhead
Approaching zero driver overheadCass Everitt
Ā 
Advanced Scenegraph Rendering Pipeline
Advanced Scenegraph Rendering PipelineAdvanced Scenegraph Rendering Pipeline
Advanced Scenegraph Rendering PipelineNarann29
Ā 
Understaing Android EGL
Understaing Android EGLUnderstaing Android EGL
Understaing Android EGLSuhan Lee
Ā 
NVIDIA's OpenGL Functionality
NVIDIA's OpenGL FunctionalityNVIDIA's OpenGL Functionality
NVIDIA's OpenGL FunctionalityMark Kilgard
Ā 
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14AMD Developer Central
Ā 
NVIDIA OpenGL in 2016
NVIDIA OpenGL in 2016NVIDIA OpenGL in 2016
NVIDIA OpenGL in 2016Mark Kilgard
Ā 
BKK16-315 Graphics Stack Update
BKK16-315 Graphics Stack UpdateBKK16-315 Graphics Stack Update
BKK16-315 Graphics Stack UpdateLinaro
Ā 
FrameGraph: Extensible Rendering Architecture in Frostbite
FrameGraph: Extensible Rendering Architecture in FrostbiteFrameGraph: Extensible Rendering Architecture in Frostbite
FrameGraph: Extensible Rendering Architecture in FrostbiteElectronic Arts / DICE
Ā 
Optimizing the Graphics Pipeline with Compute, GDC 2016
Optimizing the Graphics Pipeline with Compute, GDC 2016Optimizing the Graphics Pipeline with Compute, GDC 2016
Optimizing the Graphics Pipeline with Compute, GDC 2016Graham Wihlidal
Ā 
KGC 2016 ģ˜¤ķ”ˆģ†ŒģŠ¤ ė„¤ķŠøģ›Œķ¬ ģ—”ģ§„ Super socket ģ‚¬ģš©ķ•˜źø°
KGC 2016 ģ˜¤ķ”ˆģ†ŒģŠ¤ ė„¤ķŠøģ›Œķ¬ ģ—”ģ§„ Super socket ģ‚¬ģš©ķ•˜źø°KGC 2016 ģ˜¤ķ”ˆģ†ŒģŠ¤ ė„¤ķŠøģ›Œķ¬ ģ—”ģ§„ Super socket ģ‚¬ģš©ķ•˜źø°
KGC 2016 ģ˜¤ķ”ˆģ†ŒģŠ¤ ė„¤ķŠøģ›Œķ¬ ģ—”ģ§„ Super socket ģ‚¬ģš©ķ•˜źø°ķ„ė°° ģµœ
Ā 
Parallel Futures of a Game Engine
Parallel Futures of a Game EngineParallel Futures of a Game Engine
Parallel Futures of a Game EngineJohan Andersson
Ā 
Angel cunado_The Terrain Of KUF2
Angel cunado_The Terrain Of KUF2Angel cunado_The Terrain Of KUF2
Angel cunado_The Terrain Of KUF2drandom
Ā 
Siggraph2016 - The Devil is in the Details: idTech 666
Siggraph2016 - The Devil is in the Details: idTech 666Siggraph2016 - The Devil is in the Details: idTech 666
Siggraph2016 - The Devil is in the Details: idTech 666Tiago Sousa
Ā 

What's hot (20)

OpenXR 1.0 Reference Guide
OpenXR 1.0 Reference GuideOpenXR 1.0 Reference Guide
OpenXR 1.0 Reference Guide
Ā 
OpenGL basics
OpenGL basicsOpenGL basics
OpenGL basics
Ā 
NVIDIA OpenGL 4.6 in 2017
NVIDIA OpenGL 4.6 in 2017NVIDIA OpenGL 4.6 in 2017
NVIDIA OpenGL 4.6 in 2017
Ā 
Modern OpenGL Usage: Using Vertex Buffer Objects Well
Modern OpenGL Usage: Using Vertex Buffer Objects Well Modern OpenGL Usage: Using Vertex Buffer Objects Well
Modern OpenGL Usage: Using Vertex Buffer Objects Well
Ā 
OpenVX 1.3 Reference Guide
OpenVX 1.3 Reference GuideOpenVX 1.3 Reference Guide
OpenVX 1.3 Reference Guide
Ā 
OpenGL 4.4 - Scene Rendering Techniques
OpenGL 4.4 - Scene Rendering TechniquesOpenGL 4.4 - Scene Rendering Techniques
OpenGL 4.4 - Scene Rendering Techniques
Ā 
OpenGL ES 3.1 Reference Card
OpenGL ES 3.1 Reference CardOpenGL ES 3.1 Reference Card
OpenGL ES 3.1 Reference Card
Ā 
Approaching zero driver overhead
Approaching zero driver overheadApproaching zero driver overhead
Approaching zero driver overhead
Ā 
Advanced Scenegraph Rendering Pipeline
Advanced Scenegraph Rendering PipelineAdvanced Scenegraph Rendering Pipeline
Advanced Scenegraph Rendering Pipeline
Ā 
Understaing Android EGL
Understaing Android EGLUnderstaing Android EGL
Understaing Android EGL
Ā 
NVIDIA's OpenGL Functionality
NVIDIA's OpenGL FunctionalityNVIDIA's OpenGL Functionality
NVIDIA's OpenGL Functionality
Ā 
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14
Ā 
NVIDIA OpenGL in 2016
NVIDIA OpenGL in 2016NVIDIA OpenGL in 2016
NVIDIA OpenGL in 2016
Ā 
BKK16-315 Graphics Stack Update
BKK16-315 Graphics Stack UpdateBKK16-315 Graphics Stack Update
BKK16-315 Graphics Stack Update
Ā 
FrameGraph: Extensible Rendering Architecture in Frostbite
FrameGraph: Extensible Rendering Architecture in FrostbiteFrameGraph: Extensible Rendering Architecture in Frostbite
FrameGraph: Extensible Rendering Architecture in Frostbite
Ā 
Optimizing the Graphics Pipeline with Compute, GDC 2016
Optimizing the Graphics Pipeline with Compute, GDC 2016Optimizing the Graphics Pipeline with Compute, GDC 2016
Optimizing the Graphics Pipeline with Compute, GDC 2016
Ā 
KGC 2016 ģ˜¤ķ”ˆģ†ŒģŠ¤ ė„¤ķŠøģ›Œķ¬ ģ—”ģ§„ Super socket ģ‚¬ģš©ķ•˜źø°
KGC 2016 ģ˜¤ķ”ˆģ†ŒģŠ¤ ė„¤ķŠøģ›Œķ¬ ģ—”ģ§„ Super socket ģ‚¬ģš©ķ•˜źø°KGC 2016 ģ˜¤ķ”ˆģ†ŒģŠ¤ ė„¤ķŠøģ›Œķ¬ ģ—”ģ§„ Super socket ģ‚¬ģš©ķ•˜źø°
KGC 2016 ģ˜¤ķ”ˆģ†ŒģŠ¤ ė„¤ķŠøģ›Œķ¬ ģ—”ģ§„ Super socket ģ‚¬ģš©ķ•˜źø°
Ā 
Parallel Futures of a Game Engine
Parallel Futures of a Game EngineParallel Futures of a Game Engine
Parallel Futures of a Game Engine
Ā 
Angel cunado_The Terrain Of KUF2
Angel cunado_The Terrain Of KUF2Angel cunado_The Terrain Of KUF2
Angel cunado_The Terrain Of KUF2
Ā 
Siggraph2016 - The Devil is in the Details: idTech 666
Siggraph2016 - The Devil is in the Details: idTech 666Siggraph2016 - The Devil is in the Details: idTech 666
Siggraph2016 - The Devil is in the Details: idTech 666
Ā 

Similar to glTF 2.0 Reference Guide

Js info vis_toolkit
Js info vis_toolkitJs info vis_toolkit
Js info vis_toolkitnikhilyagnic
Ā 
FIWARE Global Summit - The Way Towards Interoperability between Web Of Things...
FIWARE Global Summit - The Way Towards Interoperability between Web Of Things...FIWARE Global Summit - The Way Towards Interoperability between Web Of Things...
FIWARE Global Summit - The Way Towards Interoperability between Web Of Things...FIWARE
Ā 
Towards Interoperability between W3C Web of Things and NGSI-LD
Towards Interoperability between W3C Web of Things and NGSI-LDTowards Interoperability between W3C Web of Things and NGSI-LD
Towards Interoperability between W3C Web of Things and NGSI-LDJosƩ Manuel Cantera Fonseca
Ā 
C,c++ interview q&a
C,c++ interview q&aC,c++ interview q&a
C,c++ interview q&aKumaran K
Ā 
Hatkit Project - Datafiddler
Hatkit Project - DatafiddlerHatkit Project - Datafiddler
Hatkit Project - Datafiddlerholiman
Ā 
Java script summary
Java script summaryJava script summary
Java script summarymaamir farooq
Ā 
Opensource gis development - part 5
Opensource gis development - part 5Opensource gis development - part 5
Opensource gis development - part 5Andrea Antonello
Ā 
Json to hive_schema_generator
Json to hive_schema_generatorJson to hive_schema_generator
Json to hive_schema_generatorPayal Jain
Ā 
mm-ADT: A Multi-Model Abstract Data Type
mm-ADT: A Multi-Model Abstract Data Typemm-ADT: A Multi-Model Abstract Data Type
mm-ADT: A Multi-Model Abstract Data TypeMarko Rodriguez
Ā 
Code is not text! How graph technologies can help us to understand our code b...
Code is not text! How graph technologies can help us to understand our code b...Code is not text! How graph technologies can help us to understand our code b...
Code is not text! How graph technologies can help us to understand our code b...Andreas Dewes
Ā 
DBVersity MongoDB Online Training Presentations
DBVersity MongoDB Online Training PresentationsDBVersity MongoDB Online Training Presentations
DBVersity MongoDB Online Training PresentationsSrinivas Mutyala
Ā 
Building and Deploying Application to Apache Mesos
Building and Deploying Application to Apache MesosBuilding and Deploying Application to Apache Mesos
Building and Deploying Application to Apache MesosJoe Stein
Ā 
Graph Analyses with Python and NetworkX
Graph Analyses with Python and NetworkXGraph Analyses with Python and NetworkX
Graph Analyses with Python and NetworkXBenjamin Bengfort
Ā 
Interactive SQL POC on Hadoop (Hive, Presto and Hive-on-Tez)
Interactive SQL POC on Hadoop (Hive, Presto and Hive-on-Tez)Interactive SQL POC on Hadoop (Hive, Presto and Hive-on-Tez)
Interactive SQL POC on Hadoop (Hive, Presto and Hive-on-Tez)Sudhir Mallem
Ā 
Apache Arrow Workshop at VLDB 2019 / BOSS Session
Apache Arrow Workshop at VLDB 2019 / BOSS SessionApache Arrow Workshop at VLDB 2019 / BOSS Session
Apache Arrow Workshop at VLDB 2019 / BOSS SessionWes McKinney
Ā 

Similar to glTF 2.0 Reference Guide (20)

Js info vis_toolkit
Js info vis_toolkitJs info vis_toolkit
Js info vis_toolkit
Ā 
FIWARE Global Summit - The Way Towards Interoperability between Web Of Things...
FIWARE Global Summit - The Way Towards Interoperability between Web Of Things...FIWARE Global Summit - The Way Towards Interoperability between Web Of Things...
FIWARE Global Summit - The Way Towards Interoperability between Web Of Things...
Ā 
Towards Interoperability between W3C Web of Things and NGSI-LD
Towards Interoperability between W3C Web of Things and NGSI-LDTowards Interoperability between W3C Web of Things and NGSI-LD
Towards Interoperability between W3C Web of Things and NGSI-LD
Ā 
Elasticsearch
ElasticsearchElasticsearch
Elasticsearch
Ā 
C,c++ interview q&a
C,c++ interview q&aC,c++ interview q&a
C,c++ interview q&a
Ā 
Node js crash course session 5
Node js crash course   session 5Node js crash course   session 5
Node js crash course session 5
Ā 
Hatkit Project - Datafiddler
Hatkit Project - DatafiddlerHatkit Project - Datafiddler
Hatkit Project - Datafiddler
Ā 
Java script summary
Java script summaryJava script summary
Java script summary
Ā 
Opensource gis development - part 5
Opensource gis development - part 5Opensource gis development - part 5
Opensource gis development - part 5
Ā 
Json to hive_schema_generator
Json to hive_schema_generatorJson to hive_schema_generator
Json to hive_schema_generator
Ā 
mm-ADT: A Multi-Model Abstract Data Type
mm-ADT: A Multi-Model Abstract Data Typemm-ADT: A Multi-Model Abstract Data Type
mm-ADT: A Multi-Model Abstract Data Type
Ā 
Code is not text! How graph technologies can help us to understand our code b...
Code is not text! How graph technologies can help us to understand our code b...Code is not text! How graph technologies can help us to understand our code b...
Code is not text! How graph technologies can help us to understand our code b...
Ā 
DBVersity MongoDB Online Training Presentations
DBVersity MongoDB Online Training PresentationsDBVersity MongoDB Online Training Presentations
DBVersity MongoDB Online Training Presentations
Ā 
Couch db
Couch dbCouch db
Couch db
Ā 
Building and Deploying Application to Apache Mesos
Building and Deploying Application to Apache MesosBuilding and Deploying Application to Apache Mesos
Building and Deploying Application to Apache Mesos
Ā 
Graph Analyses with Python and NetworkX
Graph Analyses with Python and NetworkXGraph Analyses with Python and NetworkX
Graph Analyses with Python and NetworkX
Ā 
Interactive SQL POC on Hadoop (Hive, Presto and Hive-on-Tez)
Interactive SQL POC on Hadoop (Hive, Presto and Hive-on-Tez)Interactive SQL POC on Hadoop (Hive, Presto and Hive-on-Tez)
Interactive SQL POC on Hadoop (Hive, Presto and Hive-on-Tez)
Ā 
Vhdl
VhdlVhdl
Vhdl
Ā 
COinS (eng version)
COinS (eng version)COinS (eng version)
COinS (eng version)
Ā 
Apache Arrow Workshop at VLDB 2019 / BOSS Session
Apache Arrow Workshop at VLDB 2019 / BOSS SessionApache Arrow Workshop at VLDB 2019 / BOSS Session
Apache Arrow Workshop at VLDB 2019 / BOSS Session
Ā 

More from The Khronos Group Inc.

Vulkan Ray Tracing Update JP Translation
Vulkan Ray Tracing Update JP TranslationVulkan Ray Tracing Update JP Translation
Vulkan Ray Tracing Update JP TranslationThe Khronos Group Inc.
Ā 
Vulkan Update Japan Virtual Open House Feb 2021
Vulkan Update Japan Virtual Open House Feb 2021Vulkan Update Japan Virtual Open House Feb 2021
Vulkan Update Japan Virtual Open House Feb 2021The Khronos Group Inc.
Ā 
Vulkan Ray Tracing Update Japan Virtual Open House Feb 2021
Vulkan Ray Tracing Update Japan Virtual Open House Feb 2021Vulkan Ray Tracing Update Japan Virtual Open House Feb 2021
Vulkan Ray Tracing Update Japan Virtual Open House Feb 2021The Khronos Group Inc.
Ā 
OpenCL Overview Japan Virtual Open House Feb 2021
OpenCL Overview Japan Virtual Open House Feb 2021OpenCL Overview Japan Virtual Open House Feb 2021
OpenCL Overview Japan Virtual Open House Feb 2021The Khronos Group Inc.
Ā 
Vulkan ML Japan Virtual Open House Feb 2021
Vulkan ML Japan Virtual Open House Feb 2021Vulkan ML Japan Virtual Open House Feb 2021
Vulkan ML Japan Virtual Open House Feb 2021The Khronos Group Inc.
Ā 
glTF Overview Japan Virtual Open House Feb 2021
glTF Overview Japan Virtual Open House Feb 2021glTF Overview Japan Virtual Open House Feb 2021
glTF Overview Japan Virtual Open House Feb 2021The Khronos Group Inc.
Ā 
Khronos Overview Japan Virtual Open House Feb 2021
Khronos Overview Japan Virtual Open House Feb 2021Khronos Overview Japan Virtual Open House Feb 2021
Khronos Overview Japan Virtual Open House Feb 2021The Khronos Group Inc.
Ā 

More from The Khronos Group Inc. (20)

Vulkan Ray Tracing Update JP Translation
Vulkan Ray Tracing Update JP TranslationVulkan Ray Tracing Update JP Translation
Vulkan Ray Tracing Update JP Translation
Ā 
Vulkan ML JP Translation
Vulkan ML JP TranslationVulkan ML JP Translation
Vulkan ML JP Translation
Ā 
OpenCL Overview JP Translation
OpenCL Overview JP TranslationOpenCL Overview JP Translation
OpenCL Overview JP Translation
Ā 
glTF overview JP Translation
glTF overview JP TranslationglTF overview JP Translation
glTF overview JP Translation
Ā 
Khronos Overview JP Translation
Khronos Overview JP TranslationKhronos Overview JP Translation
Khronos Overview JP Translation
Ā 
Vulkan Update Japan Virtual Open House Feb 2021
Vulkan Update Japan Virtual Open House Feb 2021Vulkan Update Japan Virtual Open House Feb 2021
Vulkan Update Japan Virtual Open House Feb 2021
Ā 
Vulkan Ray Tracing Update Japan Virtual Open House Feb 2021
Vulkan Ray Tracing Update Japan Virtual Open House Feb 2021Vulkan Ray Tracing Update Japan Virtual Open House Feb 2021
Vulkan Ray Tracing Update Japan Virtual Open House Feb 2021
Ā 
OpenCL Overview Japan Virtual Open House Feb 2021
OpenCL Overview Japan Virtual Open House Feb 2021OpenCL Overview Japan Virtual Open House Feb 2021
OpenCL Overview Japan Virtual Open House Feb 2021
Ā 
Vulkan ML Japan Virtual Open House Feb 2021
Vulkan ML Japan Virtual Open House Feb 2021Vulkan ML Japan Virtual Open House Feb 2021
Vulkan ML Japan Virtual Open House Feb 2021
Ā 
glTF Overview Japan Virtual Open House Feb 2021
glTF Overview Japan Virtual Open House Feb 2021glTF Overview Japan Virtual Open House Feb 2021
glTF Overview Japan Virtual Open House Feb 2021
Ā 
Khronos Overview Japan Virtual Open House Feb 2021
Khronos Overview Japan Virtual Open House Feb 2021Khronos Overview Japan Virtual Open House Feb 2021
Khronos Overview Japan Virtual Open House Feb 2021
Ā 
SYCL 2020 Specification
SYCL 2020 SpecificationSYCL 2020 Specification
SYCL 2020 Specification
Ā 
OpenXR 0.90 Overview Guide
OpenXR 0.90 Overview GuideOpenXR 0.90 Overview Guide
OpenXR 0.90 Overview Guide
Ā 
SYCL 1.2.1 Reference Card
SYCL 1.2.1 Reference CardSYCL 1.2.1 Reference Card
SYCL 1.2.1 Reference Card
Ā 
OpenCL 2.2 Reference Guide
OpenCL 2.2 Reference GuideOpenCL 2.2 Reference Guide
OpenCL 2.2 Reference Guide
Ā 
OpenVX 1.2 Reference Guide
OpenVX 1.2 Reference GuideOpenVX 1.2 Reference Guide
OpenVX 1.2 Reference Guide
Ā 
OpenVX 1.1 Reference Guide
OpenVX 1.1 Reference GuideOpenVX 1.1 Reference Guide
OpenVX 1.1 Reference Guide
Ā 
Vulkan 1.0 Quick Reference
Vulkan 1.0 Quick ReferenceVulkan 1.0 Quick Reference
Vulkan 1.0 Quick Reference
Ā 
OpenCL 2.1 Reference Guide
OpenCL 2.1 Reference GuideOpenCL 2.1 Reference Guide
OpenCL 2.1 Reference Guide
Ā 
Sycl 1.2 Reference Card
Sycl 1.2 Reference CardSycl 1.2 Reference Card
Sycl 1.2 Reference Card
Ā 

Recently uploaded

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
Ā 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
Ā 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
Ā 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
Ā 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
Ā 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
Ā 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
Ā 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
Ā 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
Ā 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
Ā 
šŸ¬ The future of MySQL is Postgres šŸ˜
šŸ¬  The future of MySQL is Postgres   šŸ˜šŸ¬  The future of MySQL is Postgres   šŸ˜
šŸ¬ The future of MySQL is Postgres šŸ˜RTylerCroy
Ā 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
Ā 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
Ā 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
Ā 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
Ā 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
Ā 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
Ā 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
Ā 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
Ā 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
Ā 

Recently uploaded (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
Ā 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Ā 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Ā 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Ā 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
Ā 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
Ā 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
Ā 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Ā 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
Ā 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
Ā 
šŸ¬ The future of MySQL is Postgres šŸ˜
šŸ¬  The future of MySQL is Postgres   šŸ˜šŸ¬  The future of MySQL is Postgres   šŸ˜
šŸ¬ The future of MySQL is Postgres šŸ˜
Ā 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
Ā 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
Ā 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
Ā 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
Ā 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
Ā 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
Ā 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Ā 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
Ā 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Ā 

glTF 2.0 Reference Guide

  • 1. Page 1glTF 2.0 Quick Reference Guide Rev. 0717www.khronos.org/gltf glTF was designed and speciļ¬ed by the Khronos Group, for the eļ¬ƒcient transfer of 3D content over networks. glTF and the glTF logo are trademarks of the Khronos Group Inc. Further resources The Khronos glTF landing page: https://www.khronos.org/gltf The Khronos glTF GitHub repository: https://github.com/KhronosGroup/glTF glTF - what the ? An overview of the basics of the GL Transmission Format The core of glTF is a JSON ļ¬le that describes the structure and composition of a scene containing 3D models. The top-level elements of this ļ¬le are: These elements are contained in arrays. References between the objects are established by using their indices to look up the objects in the arrays. Ā©2016-2017 Marco Hutter www.marco-hutter.de Feedback: gltf@marco-hutter.de Version 2.0 glTF version 2.0 For glTF 2.0! This overview is non-normative! It is also possible to store the whole asset in a single binary glTF ļ¬le. In this case, the JSON data is stored as a string, followed by the binary data of buļ¬€ers or images. scenes, nodes Basic structure of the scene meshes Geometry of 3D objects materials Deļ¬nitions of how objects should be rendered skins Information for vertex skinning animations Changes of properties over time cameras View conļ¬gurations for the scene textures, images, samplers Surface appearance of objects buļ¬€ers, buļ¬€erViews, accessors Data references and data layout descriptions buļ¬€erView buļ¬€er accessor mesh node scene skincamera animationmaterial texture sampler image Concepts Binary data references The images and buļ¬€ers of a glTF asset may refer to external ļ¬les that contain the data that are required for rendering the 3D content: The data is referred to via URIs, but can also be included directly in the JSON using data URIs. The data URI deļ¬nes the MIME type, and contains the data as a base64 encoded string: "buffers": [ { "uri": "buffer01.bin" "byteLength": 102040, } ], "images": [ { "uri": "image01.png" } ], "data:application/gltf-buffer;base64,AAABAAIAAgA..." "data:image/png;base64,iVBORw0K..." Buļ¬€er data: Image data (PNG): The buļ¬€ers refer to binary ļ¬les (.BIN) that contain geometry- or animation data. The images refer to image ļ¬les (PNG, JPG...) that contain texture data for the models. The conceptual relationships between the top-level elements of a glTF asset are shown here:
  • 2. Page 2 glTF 2.0 Quick Reference Guide Rev. 0717 www.khronos.org/gltf meshes "meshes": [ { "primitives": [ { "mode": 4, "indices": 0, "attributes": { "POSITION": 1, "NORMAL": 2 }, "material": 2 } ] } ], The meshes may contain multiple mesh primitives. These refer to the geometry data that is required for rendering the mesh. Each mesh primitive has a rendering mode, which is a constant indicating whether it should be rendered as POINTS, LINES, or TRIANGLES. The primitive also refers to indices and the attributes of the vertices, using the indices of the accessors for this data. The material that should be used for rendering is also given, by the index of the material. { "primitives": [ { ... "targets": [ { "POSITION": 11, "NORMAL": 13 }, { "POSITION": 21, "NORMAL": 23 } ] } ], "weights": [0, 0.5] } A mesh may deļ¬ne multiple morph targets. Such a morph target describes a deformation of the original mesh. To deļ¬ne a mesh with morph targets, each mesh primitive can contain an array of targets. These are dictionaries that map names of attributes to the indices of accessors that contain the displacements of the geometry for the target. The mesh may also contain an array of weights that deļ¬ne the contribution of each morph target to the ļ¬nal, rendered state of the mesh. Combining multiple morph targets with diļ¬€erent weights allows, for example, modeling diļ¬€erent facial expressions of a character: The weights can be modiļ¬ed with an animation, to interpolate between diļ¬€erent states of the geometry. Position: Normal: (1.2, -2.6, 4.3) (0.0, 1.0, 0.0) (2,7, -1.8, 6.2) (0.71, 0.71, 0.0) (... ) (... ) 2.7 -1.8 6.2 ... 0.71 0.71 0.0 ... POSITION 1.2 -2.6 4.3 0.0 1.0 0.0NORMAL Each attribute is deļ¬ned by mapping the attribute name to the index of the accessor that contains the attribute data. This data will be used as the vertex attributes when rendering the mesh. The attributes may, for example, deļ¬ne the POSITION and the NORMAL of the vertices: A node may contain a local transform. This can be given as a column-major matrix array, or with separate translation, rotation and scale properties, where the rotation is given as a quaternion. The local transform matrix is then computed as M = T * R * S where T, R and S are the matrices that are created from the translation, rotation and scale. The global transform of a node is given by the product of all local transforms on the path from the root to the respective node. scene 0 node 0 node 1 node 2 node 3 node 4 "nodes": [ { "matrix": [ 1,0,0,0, 0,1,0,0, 0,0,1,0, 5,6,7,1 ], ... }, { "translation": [ 0,0,0 ], "rotation": [ 0,0,0,1 ], "scale": [ 1,1,1 ] ... }, ] Each of the nodes can contain an array of indices of its children. This allows modeling a simple scene hierarchy: scenes, nodes "scene": 0, "scenes": [ { "nodes": [ 0, 1, 2 ] } ], "nodes": [ { "children": [ 3, 4 ], ... }, { ... }, { ... }, { ... }, { ... }, ... ], Each node may refer to a mesh or a camera, using indices that point into the meshes and cameras arrays. These elements are then attached to these nodes. During rendering, instances of these elements are created and transformed with the global transform of the node. The glTF JSON may contain scenes (with an optional default scene). Each scene can contain an array of indices of nodes. "nodes": [ { "mesh": 4, ... }, { "camera": 2, ... }, ] Nodes are also used in vertex skinning: A node hierarchy can deļ¬ne the skeleton of an animated character. The node then refers to a mesh and to a skin. The skin contains further information about how the mesh is deformed based on the current skeleton pose. The translation, rotation and scale properties of a node may also be the target of an animation: The animation then describes how one property changes over time. The attached objects will move accordingly, allowing to model moving objects or camera ļ¬‚ights.
  • 3. Page 3glTF 2.0 Quick Reference Guide Rev. 0717www.khronos.org/gltf buļ¬€ers, buļ¬€erViews, accessors "buffers": [ { "byteLength": 35, "uri": "buffer01.bin" } ], Each of the buļ¬€ers refers to a binary data ļ¬le, using a URI. It is the source of one block of raw data with the given byteLength. "bufferViews": [ { "buffer": 0, "byteOffset": 4, "byteLength": 28, "target": 34963 } ], Each of the buļ¬€erViews refers to one buļ¬€er. It has a byteOļ¬€set and a byteLength, deļ¬ning the part of the buļ¬€er that belongs to the buļ¬€erView, and an optional OpenGL buļ¬€er target. "accessors": [ { "bufferView": 0, "byteOffset": 4, "type": "VEC2", "componentType": 5126, "count": 2, "byteStride": 12, "min" : [0.1, 0.2] "max" : [0.9, 0.8] } ] The accessors deļ¬ne how the data of a buļ¬€erView is interpreted. They may deļ¬ne an additional byeOļ¬€set referring to the start of the buļ¬€erView, and contain information about the type and layout of the buļ¬€erView data: buļ¬€er byteLength = 35 buļ¬€erView byteOļ¬€set = 4 byteLength = 28 0 4 8 1612 20 24 28 32 accessor byteOļ¬€set = 4 The buļ¬€er data is read from a ļ¬le: The buļ¬€erView deļ¬nes a segment of the buļ¬€er data: The accessor deļ¬nes an additional oļ¬€set: The accessor deļ¬nes a stride between the elements: The accessor deļ¬nes that the elements are 2D ļ¬‚oat vectors: This data may, for example, be used by a mesh primitive, to access 2D texture coordinates: The data of the buļ¬€erView may be bound as an OpenGL buļ¬€er, using glBindBuffer. Then, the properties of the accessor may be used to deļ¬ne this buļ¬€er as vertex attribute data, by passing them to glVertexAttribPointer when the buļ¬€erView buļ¬€er is bound. byteStride = 12 type = "VEC2" componentType = GL_FLOAT x0 y0 x1 y1 4 8 1612 20 24 28 32 8 1612 20 24 28 32 8 1612 20 24 28 The buļ¬€ers contain the data that is used for the geometry of 3D models, animations, and skinning. The buļ¬€erViews add structural information to this data. The accessors deļ¬ne the exact type and layout of the data. The data may, for example, be deļ¬ned as 2D vectors of ļ¬‚oating point values when the type is "VEC2" and the componentType is GL_FLOAT (5126). The byteStride says how many bytes are between the start of one element and the start of the next, which allows for accessors to deļ¬ne interleaved data. The range of all values is stored in the min and max property. Sparse accessors "accessors": [ { "type": "SCALAR", "componentType": 5126, "count": 10, "sparse": { "count": 4, "values": { "bufferView": 2, }, "indices": { "bufferView": 1, "componentType": 5123 } } } ] When only few elements of an accessor diļ¬€er from a default value (which is often the case for morph targets), then the data can be given in a very compact form using a sparse data description: The sparse data block contains the count of sparse data elements. The accessor deļ¬nes the type of the data (here, scalar ļ¬‚oat values), and the total element count. The values refer to the buļ¬€erView that contains the sparse data values. The target indices for the sparse data values are deļ¬ned with a reference to a buļ¬€erView and the componentType. 0.0 0.0 0.0 0.0 0.0 0.0 1 4 5 7 4.3 9.1 5.2 2.7 0 1 2 3 4 5 6 7 8 9 4.3 9.1 5.2 2.7 values indices sparse (count=4) Final accessor data with 10 ļ¬‚oat values The values are written into the ļ¬nal accessor data, at the positions that are given by the indices:
  • 4. Page 4 glTF 2.0 Quick Reference Guide Rev. 0717 www.khronos.org/gltf materials 1.0 0.75 0.5 0.25 0.0 0.0 0.25 0.5 0.75 1.0 Metal Roughness Each mesh primitive may refer to one of the materials that are contained in a glTF asset. The materials describe how an object should be rendered, based on physical material properties. This allows to apply Physically Based Rendering (PBR) techniques, to make sure that the appearance of the rendered object is consistent among all renderers. The default material model is the Metallic-Roughness-Model. Values between 0.0 and 1.0 are used to describe how much the material characteristics resemble that of a metal, and how rough the surface of the object is. These properties may either be given as individual values that apply to the whole object, or be read from textures. In addition to the properties that are deļ¬ned via the Metallic-Roughness- Model, the material may contain other properties that aļ¬€ect the object appearance: "materials": [ ... { "name": "brushed gold", "pbrMetallicRoughness": { "baseColorFactor": [1,1,1,1], "baseColorTexture": { "index" : 1, "texCoord" : 1 }, "metallicFactor": 1.0, "roughnessFactor": 1.0 } } ], The texture references in a material always contain the index of the texture. They may also contain the texCoord set index. This is the number that determines the TEXCOORD_<n> attribute of the rendered mesh primitive that contains the texture coordinates for this texture, with 0 being the default. "meshes": [ { "primitives": [ { "material": 2, "attributes": { "NORMAL": 3, "POSITION": 1, "TEXCOORD_0": 2, "TEXCOORD_1": 5 }, } ] } ], "textures": [ ... { "source": 4, "sampler": 2 } ], Material properties in textures The normalTexture refers to a texture that contains tangent-space normal information, and a scale factor that will be applied to these normals. The occlusionTexture refers to a texture that deļ¬nes areas of the surface that are occluded from light, and thus rendered darker. This information is contained in the "red" channel of the texture. The occlusion strength is a scaling factor to be applied to these values. The emissiveTexture refers to a texture that may be used to illuminate parts of the object surface: It deļ¬nes the color of the light that is emitted from the surface. The emissiveFactor contains scaling factors for the red, green and blue components of this texture. "materials": [ { "pbrMetallicRoughness": { "baseColorTexture": { "index": 1, "texCoord": 1 }, "baseColorFactor": [ 1.0, 0.75, 0.35, 1.0 ], "metallicRoughnessTexture": { "index": 5, "texCoord": 1 }, "metallicFactor": 1.0, "roughnessFactor": 0.0, } "normalTexture": { "scale": 0.8, "index": 2, "texCoord": 1 }, "occlusionTexture": { "strength": 0.9, "index": 4, "texCoord": 1 }, "emissiveTexture": { "index": 3, "texCoord": 1 }, "emissiveFactor": [0.4, 0.8, 0.6] } ], The baseColorTexture is the main texture that will be applied to the object. The baseColorFactor contains scaling factors for the red, green, blue and alpha component of the color. If no texture is used, these values will deļ¬ne the color of the whole object. The metallicRoughnessTexture contains the metalness value in the "blue" color channel, and the roughness value in the "green" color channel. The metallicFactor and roughnessFactor are multiplied with these values. If no texture is given, then these factors deļ¬ne the reļ¬‚ection characteristics for the whole object. The properties that deļ¬ne a material in the Metallic-Roughness-Model are summarized in the pbrMetallicRoughness object:
  • 5. Page 5glTF 2.0 Quick Reference Guide Rev. 0717www.khronos.org/gltf cameras "cameras": [ { "type": "perspective", "perspective": { "aspectRatio": 1.5, "yfov": 0.65, "zfar": 100, "znear": 0.01 } }, { "type": "orthographic", "orthographic": { "xmag": 1.0, "ymag": 1.0, "zfar": 100, "znear": 0.01 } } ] Each of the nodes may refer to one of the cameras that are deļ¬ned in the glTF asset. There are two types of cameras: perspective and orthographic ones, and they deļ¬ne the projection matrix. The value for the far clipping plane distance of a perspective camera, zfar, is optional. When it is omitted, the camera uses a special projection matrix for inļ¬nite projections. textures, images, samplers The texture consists of a reference to the source of the texture, which is one of the images of the asset, and a reference to a sampler. "textures": [ { "source": 4, "sampler": 2 } ... ], "images": [ ... { "uri": "file01.png" } { "bufferView": 3, "mimeType" : "image/jpeg" } ], The images deļ¬ne the image data used for the texture. This data can be given via a URI that is the location of an image ļ¬le, or by a reference to a buļ¬€erView and a MIME type that deļ¬nes the type of the image data that is stored in the buļ¬€er view. "samplers": [ ... { "magFilter": 9729, "minFilter": 9987, "wrapS": 10497, "wrapT": 10497 } }, The samplers describe the wrapping and scaling of textures. (The constant values correspond to OpenGL constants that can directly be passed to glTexParameter). The textures contain information about textures that may be applied to rendered objects: Textures are referred to by materials to deļ¬ne the basic color of the objects, as well as physical properties that aļ¬€ect the object appearance. skins A glTF asset may contain the information that is necessary to perform vertex skinning. With vertex skinning, it is possible to let the vertices of a mesh be inļ¬‚uenced by the bones of a skeleton, based on its current pose. "nodes": [ { "name" : "Skinned mesh node", "mesh": 0 "skin": 0, }, ... { "name": "Torso", "children": [ 2, 3, 4, 5, 6 ] "rotation": [...], "scale": [ ...], "translation": [...] }, ... { "name": "LegL", "children": [ 7 ], ... }, ... { "name": "FootL", ... }, ... ], "skins": [ { "inverseBindMatrices": 12, "joints": [ 1, 2, 3 ... ] } ], "meshes": [ { "primitives": [ { "attributes": { "POSITION": 0, "JOINTS_0": 1, "WEIGHTS_0": 2 ... }, ] } ], Head LegR LegL ArmR ArmL FootR FootL Torso The mesh primitives of a skinned mesh contain the POSITION attribute that refers to the accessor for the vertex positions, and two special attributes that are required for skinning: A JOINTS_0 and a WEIGHTS_0 attribute, each referring to an accessor. The JOINTS_0 attribute data contains the indices of the joints that should aļ¬€ect the vertex. The WEIGHTS_0 attribute data deļ¬nes the weights indicating how strongly the joint should inļ¬‚uence the vertex. The skins contain an array of joints, which are the indices of nodes that deļ¬ne the skeleton hierarchy, and the inverseBindMatrices, which is a a reference to an accessor that contains one matrix for each joint. A node that refers to a mesh may also refer to a skin. The skeleton hierarchy is modeled with nodes, just like the scene structure: Each joint node may have a local transform and an array of children, and the "bones" of the skeleton are given implicitly, as the connections between the joints. From this information, the skinning matrix can be computed. This is explained in detail in "Computing the skinning matrix". When one of the nodes refers to a camera, then an instance of this camera is created. The camera matrix of this instance is given by the global transform matrix of the node.
  • 6. Page 6 glTF 2.0 Quick Reference Guide Rev. 0717 www.khronos.org/gltf Wiki page about skinning in COLLADA: https://www.khronos.org/collada/wiki/Skinning Section 4-7 in the COLLADA speciļ¬cation: https://www.khronos.org/ļ¬les/collada_spec_1_5.pdf Computing the skinning matrix The skinning matrix describes how the vertices of a mesh are transformed based on the current pose of a skeleton. The skinning matrix is a weighted combination of joint matrices. For each node whose index appears in the joints of the skin, a global transform matrix can be computed. It transforms the mesh from the local space of the joint, based on the current global transform of the joint, and is called globalJointTransform. jointMatrix[j] = inverse(globalTransform) * globalJointTransform[j] * inverseBindMatrix[j]; From these matrices, a jointMatrix may be computed for each joint: Any global transform of the node that contains the mesh and the skin is cancelled out by pre-multiplying the joint matrix with the inverse of this transform. The skin refers to the inverseBindMatrices. This is an accessor which contains one inverse bind matrix for each joint. Each of these matrices transforms the mesh into the local space of the joint. inverseBindMatrix[1] joint2 joint1 joint0 globalJointTransform[1] joint2 joint1 joint0 Computing the joint matrices For implementations based on OpenGL or WebGL, the jointMatrix array will be passed to the vertex shader as a uniform. The primitives of a skinned mesh contain the POSITION, JOINT and WEIGHT attributes, referring to accessors. These accessors contain one element for each vertex: Combining the joint matrices to create the skinning matrix px py pz j0 j1 j2 j3 w0 w1 w2 w3 POSITION JOINTS_0 WEIGHTS_0 vertex 0: px py pz j0 j1 j2 j3 w0 w1 w2 w3vertex n: ... ... ... ... Vertex Shader uniform mat4 u_jointMatrix[12]; attribute vec3 a_position; attribute vec4 a_joint; attribute vec4 a_weight; ... void main(void) { ... mat4 skinMatrix = a_weight.x * u_jointMatrix[int(a_joint.x)] + a_weight.y * u_jointMatrix[int(a_joint.y)] + a_weight.z * u_jointMatrix[int(a_joint.z)] + a_weight.w * u_jointMatrix[int(a_joint.w)]; gl_Position = modelViewProjection * skinMatrix * position; } a_weight.x a_joint.x a_joint.y joint1 joint2 joint0 a_weight.y skinMatrix = 1.0 * jointMatrix[1] + 0.0 * jointMatrix[0] +... skinMatrix = 0.75 * jointMatrix[1] + 0.25 * jointMatrix[0] +... skinMatrix = 0.5 * jointMatrix[1] + 0.5 * jointMatrix[0] +... skinMatrix = 0.25 * jointMatrix[1] + 0.75 * jointMatrix[0] +... skinMatrix = 0.0 * jointMatrix[1] + 1.0 * jointMatrix[0] +... The data of these accessors is passed as attributes to the vertex shader, together with the jointMatrix array. The skinMatrix transforms the vertices based on the skeleton pose, before they are transformed with the model-view- perspective matrix. In the vertex shader, the skinMatrix is computed. It is a linear combination of the joint matrices whose indices are contained in the JOINTS_0 attribute, weighted with the WEIGHTS_0 values: (The vertex skinning in COLLADA is similar to that in glTF)
  • 7. Page 7glTF 2.0 Quick Reference Guide Rev. 0717www.khronos.org/gltf animations "animations": [ { "channels": [ { "target": { "node": 1, "path": "translation" }, "sampler": 0 } ], "samplers": [ { "input": 4, "interpolation": "LINEAR", "output": 5 } ] } ] A glTF asset can contain animations. An animation can be applied to the properties of a node that deļ¬ne the local transform of the node, or to the weights for the morph targets. The sampler looks up the key frames for the current time, in the input data. 0 1 2 3 4 5 6 Global time: Each channel deļ¬nes the target of the animation. This target usually refers to a node, using the index of this node, and to a path, which is the name of the animated property. The path may be "translation", "rotation" or "scale", aļ¬€ecting the local transform of the node, or "weights", in order to animate the weights of the morph targets of the meshes that are referred to by the node. The channel also refers to a sampler, which summarizes the actual animation data. The data of the input accessor of the animation sampler, containing the key frame times During the animation, a "global" animation time (in seconds) is advanced. Each animation consists of two elements: An array of channels and an array of samplers. A sampler refers to the input and output data, using the indices of accessors that provide the data. The input refers to an accessor with scalar ļ¬‚oating-point values, which are the times of the key frames of the animation. The output refers to an accessor that contains the values for the animated property at the respective key frames. The sampler also deļ¬nes an interpolation mode for the animation, which may be "LINEAR", "STEP", "CATMULLROMSPLINE", or "CUBICSPLINE". The data of the output accessor of the animation sampler, containing the key frame values for the animated property 10.0 5.0 -5.0 14.0 3.0 -2.0 18.0 1.0 1.0 24.0 -1.0 4.0 31.0 -3.0 7.0 0.0 0.8 1.6 2.4 3.2 Current time: 1.2 16.0 2.0 -0.5 The corresponding values of the output data are read, and interpolated based on the interpolation mode of the sampler. The interpolated value is forwarded to the animation channel target. Animation samplers Displacement for "POSITION" from morph target 1: Original mesh primitive attribute "POSITION" weights= [0.5,0.0] Displacement for "POSITION" from morph target 0: weights= [0.0,0.5] Rendering Animation channel targets The interpolated value that is provided by an animation sampler may be applied to diļ¬€erent animation channel targets. translation=[2, 0, 0] translation=[3, 2, 0] Animating the translation of a node: rotation= [0.0, 0.0, 0.0, 1.0] rotation= [0.0, 0.0, 0.38, 0.92] Animating the rotation of a skeleton node of a skin: Animating the weights for the morph targets that are deļ¬ned for the primitives of a mesh that is attached to a node:
  • 8. Page 8 glTF 2.0 Quick Reference Guide Rev. 0717 www.khronos.org/gltf chunkLength uint32 12-byte header chunkType uint32 chunkData uchar[] length uint32 version uint32 magic uint32 chunkLength uint32 chunkType uint32 chunkData uchar[] chunk 0 (JSON) chunk 1 (Binary Buļ¬€er) ... The length is the total length of the ļ¬le, in bytes The magic entry has the value 0x46546C67, which is the ASCII string "glTF".This is used to identify the data as a binary glTF The version deļ¬nes the ļ¬le format version. The version described here is version 2 The chunkData contains the actual data of the chunk. This may be the ASCII representation of the JSON data, or binary buļ¬€er data. The chunkType value deļ¬nes what type of data is contained in the chunkData. It may be 0x4E4F534A, which is the ASCII string "JSON", for JSON data, or 0x004E4942, which is the ASCII string "BIN", for binary data. The chunkLength is the length of the chunkData, in bytes In the standard glTF format, there are two options for including external binary resources like buļ¬€er data and textures: They may be referenced via URIs, or embedded in the JSON part of the glTF using data URIs. When they are referenced via URIs, then each external resource implies a new download request. When they are embedded as data URIs, the base 64 encoding of the binary data will increase the ļ¬le size considerably. To overcome these drawbacks, there is the option to combine the glTF JSON and the binary data into a single binary glTF ļ¬le. This is a little-endian ļ¬le, with the extension ".glb". It contains a header, which gives basic information about the version and structure of the data, and one or more chunks that contain the actual data. The ļ¬rst chunk always contains the JSON data. The remaining chunks contain the binary data. Binary glTF ļ¬les Extensions When an extension is used in a glTF asset, it has to be listed in the top-level extensionsUsed property. The extensionsRequired property lists the extensions that are strictly required to properly load the asset. "extensionsUsed" : [ "KHR_lights_common", "CUSTOM_EXTENSION" ] "extensionsRequired" : [ "KHR_lights_common" ] "textures" : [ { ... "extensions" : { "KHR_lights_common" : { "lightSource" : true, }, "CUSTOM_EXTENSION" : { "customProperty" : "customValue" } } } ] Extensions allow adding arbitrary objects in the extensions property of other objects. The name of such an object is the same as the name of the extension, and it may contain further, extension-speciļ¬c properties. The glTF format allows extensions to add new functionality, or to simplify the deļ¬nition of commonly used properties. Existing extensions Specular-Glossiness Materials https://github.com/KhronosGroup/glTF/tree/master/extensions/Khronos/KHR_materials_pbrSpecularGlossiness This extension is an alternative to the default Metallic-Roughness material model: It allows to deļ¬ne the material properties based on specular and glossiness values. Common Materials https://github.com/KhronosGroup/glTF/tree/master/extensions/Khronos/KHR_materials_cmnBlinnPhong This extension allows the easy deļ¬nition of non-physically based materials. This is based on the Blinn-Phong model, which is often used in CAD applications. The material can be deļ¬ned using a diļ¬€use, specular, and emissive color, and a shininess value. Common Lights https://github.com/KhronosGroup/glTF/tree/master/extensions/Khronos/KHR_lights This extension allows adding diļ¬€erent types of lights to the scene hierarchy. This refers to point lights, spot lights and directional lights. The lights can be attached to the nodes of the scene hierarchy. The following extensions are developed and maintained on the Khronos GitHub repository: WebGL Rendering Techniques https://github.com/KhronosGroup/glTF/tree/master/extensions/Khronos/KHR_technique_webgl With this extension, it is possible to deļ¬ne GLSL shaders that should be used for rendering the glTF asset in OpenGL or WebGL