Skip to content

Commit dbc415e

Browse files
committed
Merge branch 'main' into 3d-tiles-next
2 parents 00578e2 + 0251c5c commit dbc415e

File tree

18 files changed

+199
-142
lines changed

18 files changed

+199
-142
lines changed

.github/workflows/CI.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
steps:
2525
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
26-
- uses: actions/checkout@v2
26+
- uses: actions/checkout@v4
2727

2828
# Build spec targets
2929
- name: spec-generate
@@ -32,7 +32,7 @@ jobs:
3232
make Specification.html Specification.pdf
3333
3434
- name: Archive generated files
35-
uses: actions/upload-artifact@v2
35+
uses: actions/upload-artifact@v4
3636
with:
3737
name: spec-outputs
3838
path: |

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ SPDX-License-Identifier: CC-BY-4.0
77
<img src="specification/figures/glTF_RGB_June16.svg" width="340" height="170" />
88
</p>
99

10-
[![Join the Slack group](https://img.shields.io/badge/chat-on%20slack-blue.svg)](https://www.khr.io/slack)
10+
[![Join glTF Discord](https://img.shields.io/badge/discuss-on%20discord-blue.svg)](https://khr.io/khrdiscord)
1111
[![Join the forums](https://img.shields.io/badge/discuss-in%20forums-blue.svg)](https://community.khronos.org/c/gltf-general)
12+
[![Join the Slack group](https://img.shields.io/badge/chat-on%20slack-blue.svg)](https://www.khr.io/slack)
1213

1314
glTF™ (GL Transmission Format) is a royalty-free specification for the efficient transmission and loading of 3D scenes and models by applications. glTF minimizes both the size of 3D assets, and the runtime processing needed to unpack and use those assets. glTF defines an extensible, common publishing format for 3D content tools and services that streamlines authoring workflows and enables interoperable use of content across the industry.
1415

extensions/2.0/Khronos/KHR_animation_pointer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ See [Appendix](#appendix-full-khronos-copyright-statement) for full Khronos Copy
2020

2121
## Status
2222

23-
Release Candidate
23+
Complete, Ratified by the Khronos Group
2424

2525
## Dependencies
2626

extensions/2.0/Khronos/KHR_materials_anisotropy/README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,24 @@ Sample values:
6464

6565
| | Type | Description | Required |
6666
| ----------------------- | -------- | ------------------------- | ------------------ |
67-
| **anisotropyStrength** | `number` | The anisotropy strength. When anisotropyTexture is present, this value is multiplied by the blue channel. | No, default: `0.0` |
68-
| **anisotropyRotation** | `number` | The rotation of the anisotropy in tangent, bitangent space, measured in radians counter-clockwise from the tangent. When anisotropyTexture is present, anisotropyRotation provides additional rotation to the vectors in the texture. | No, default: `0.0` |
69-
| **anisotropyTexture** | [`textureInfo`](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-textureinfo) | The anisotropy texture. Red and green channels represent the anisotropy direction in [-1, 1] tangent, bitangent space, to be rotated by anisotropyRotation. The blue channel contains strength as [0, 1] to be multiplied by anisotropyStrength. | No |
67+
| **anisotropyStrength** | `number` | The anisotropy strength. When the anisotropy texture is present, this value is multiplied by the texture's blue channel. | No, default: `0.0` |
68+
| **anisotropyRotation** | `number` | The rotation of the anisotropy in tangent, bitangent space, measured in radians counter-clockwise from the tangent. When the anisotropy texture is present, this value provides additional rotation to the vectors in the texture. | No, default: `0.0` |
69+
| **anisotropyTexture** | [`textureInfo`](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-textureinfo) | The anisotropy texture. Red and green channels represent the anisotropy direction in $[-1, 1]$ tangent, bitangent space to be rotated by the anisotropy rotation. The blue channel contains strength as $[0, 1]$ to be multiplied by the anisotropy strength. | No |
7070

7171
## Anisotropy
7272

7373
Two new material properties are introduced: a strength parameter and the direction in which the specular reflection elongates relative to the surface tangents.
74-
The strength parameter is a dimensionless number in the range `[0, 1]` and increases the roughness along a chosen direction. The default direction aligns with the tangent to the mesh as described in the glTF 2.0 specification, [Meshes section](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#meshes).
74+
The strength parameter is a dimensionless number in the range $[0, 1]$ and increases the roughness along a chosen direction. The default direction aligns with the tangent to the mesh as described in the glTF 2.0 specification, [Meshes section](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#meshes).
7575

76-
All meshes with materials that use anisotropy **SHOULD** supply `TANGENT` vectors as a mesh attribute. If `TANGENT` vectors are not supplied for such a mesh, the mesh **MUST** supply a `normalTexture`, and tangents are computed according to rules in the [Meshes section](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#meshes) of the glTF specification. Likewise when `TANGENT` vectors are not supplied for a mesh, the mesh **MUST NOT** supply different texture coordinates on the `normalTexture` and `anisotropyTexture`.
76+
A mesh primitive using an anisotropy material **MUST** have a defined tangent space, i.e., it **MUST** have `NORMAL` and `TANGENT` attributes or its base material **MUST** have a normal texture. When the mesh primitive does not have `NORMAL` or `TANGENT` vectors, they are computed as defined in the glTF 2.0 specification.
7777

78-
The `anisotropyTexture`, when supplied, encodes XY components of the direction vector in tangent space as red and green values, and strength as blue values, all stored with linear transfer function. After dequantization, red and green 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 does not require remapping. When `anisotropyTexture` is not supplied, the default value is red 1.0 (X 1.0), green 0.5 (Y 0.0), and blue 1.0 (strength 1.0). The direction of this XY vector specifies the per-texel direction of increased anisotropy roughness in tangent, bitangent space, prior to being rotated by `anisotropyRotation`. The blue channel contains strength as [0.0 .. 1.0] to be multiplied by `anisotropyStrength` to determine the per-texel anisotropy strength.
78+
Since the glTF 2.0 specification does not mandate any particular tangent space derivation algorithm, mesh primitives using anisotropy materials **SHOULD** always provide their `NORMAL` and `TANGENT` vectors.
79+
80+
When the material has both `normalTexture` and `anisotropyTexture` properties defined, these textures **SHOULD** use the same texture coordinates because they operate in the same tangent space and their texel values are usually correlated to each other.
81+
82+
The anisotropy texture, when supplied, encodes XY components of the anisotropy direction vector in tangent space as red and green values, and the anisotropy strength as blue values, all stored with linear transfer function. After dequantization, red and green texel values **MUST** be mapped as follows: red $[0, 1]$ to X $[-1, 1]$, green $[0, 1]$ to Y $[-1, 1]$. Blue does not require remapping. When the anisotropy texture is not supplied, the default dequantized texel value is $(1.0; 0.5; 1.0)$, which corresponds to the $(1; 0)$ direction vector (+X axis) and full strength.
83+
84+
The direction of this XY vector specifies the per-texel direction of increased anisotropy roughness in tangent, bitangent space, prior to being rotated by the `anisotropyRotation` property value. After dequantization, the blue channel contains strength as $[0, 1]$ to be multiplied by the `anisotropyStrength` property value to determine the per-texel anisotropy strength.
7985

8086
> **Note:** The direction vector of the anisotropy is the direction in which highlights will be stretched. The direction of the micro-grooves in the material causing the anisotropy will run perpendicular.
8187

extensions/2.0/Khronos/KHR_materials_anisotropy/schema/material.KHR_materials_anisotropy.schema.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@
1111
"default": 0.0,
1212
"minimum": 0.0,
1313
"maximum": 1.0,
14-
"gltf_detailedDescription": "The anisotropy strength. When anisotropyTexture is present, this value is multiplied by the blue channel."
14+
"gltf_detailedDescription": "The anisotropy strength. When the anisotropy texture is present, this value is multiplied by the texture's blue channel."
1515
},
1616
"anisotropyRotation": {
1717
"type": "number",
1818
"description": "The rotation of the anisotropy.",
1919
"default": 0.0,
20-
"gltf_detailedDescription": "The rotation of the anisotropy in tangent, bitangent space, measured in radians counter-clockwise from the tangent. When anisotropyTexture is present, anisotropyRotation provides additional rotation to the vectors in the texture."
20+
"gltf_detailedDescription": "The rotation of the anisotropy in tangent, bitangent space, measured in radians counter-clockwise from the tangent. When the anisotropy texture is present, this value provides additional rotation to the vectors in the texture."
2121
},
2222
"anisotropyTexture": {
2323
"allOf": [ { "$ref": "textureInfo.schema.json" } ],
2424
"description": "The anisotropy texture.",
25-
"gltf_detailedDescription": "The anisotropy texture. Red and green channels represent the anisotropy direction in [-1, 1] tangent, bitangent space, to be rotated by anisotropyRotation. The blue channel contains strength as [0, 1] to be multiplied by anisotropyStrength."
25+
"gltf_detailedDescription": "The anisotropy texture. Red and green channels represent the anisotropy direction in $[-1, 1]$ tangent, bitangent space, to be rotated by the anisotropy rotation. The blue channel contains strength as $[0, 1]$ to be multiplied by the anisotropy strength."
2626
},
2727
"extensions": { },
2828
"extras": { }

extensions/2.0/Khronos/KHR_materials_clearcoat/README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ clearcoatRoughness = clearcoatRoughnessFactor * clearcoatRoughnessTexture.g
7777

7878
If `clearcoatNormalTexture` is not given, no normal mapping is applied to the clear coat layer, even if normal mapping is applied to the base material. Otherwise, `clearcoatNormalTexture` may be a reference to the same normal map used by the base material, or any other compatible normal map.
7979

80+
A mesh primitive using a clearcoat material with a clearcoat normal texture **MUST** have a defined tangent space, i.e., it **MUST** have `NORMAL` and `TANGENT` attributes or its base material **MUST** have a normal texture. When the mesh primitive does not have `NORMAL` or `TANGENT` vectors, they are computed as defined in the glTF 2.0 specification.
81+
82+
Since the glTF 2.0 specification does not mandate any particular tangent space derivation algorithm, mesh primitives using clearcoat materials with clearcoat normal textures **SHOULD** always provide their `NORMAL` and `TANGENT` vectors.
83+
84+
When the material has both `normalTexture` and `clearcoatNormalTexture` properties defined, these textures **SHOULD** use the same texture coordinates because they operate in the same tangent space and their texel values are usually correlated to each other.
85+
8086
The clearcoat effect is modeled via a microfacet BRDF. The BRDF is layered on top of the glTF 2.0 Metallic-Roughness material, including emission and all extensions, using a new `fresnel_coat` function:
8187

8288
```
@@ -117,35 +123,33 @@ The `fresnel_coat` function is computed using the Schlick Fresnel term from the
117123
```
118124
function fresnel_coat(normal, ior, weight, base, layer) {
119125
f0 = ((1-ior)/(1+ior))^2
120-
fr = f0 + (1 - f0)*(1 - abs(NdotV))^5 // N = normal
126+
fr = f0 + (1 - f0)*(1 - abs(dot(V, normal)))^5
121127
return mix(base, layer, weight * fr)
122128
}
123129
```
124130

125131
Applying the functions we arrive at the coated material
126132

127133
```
128-
coated_material = mix(material, clearcoat_brdf(clearcoatRughness^2), clearcoat * (0.04 + (1 - 0.04) * (1 - NdotV)^5))
134+
coated_material = mix(material, clearcoat_brdf(clearcoatRoughness^2), clearcoat * (0.04 + (1 - 0.04) * (1 - VdotNc)^5))
129135
```
130136

131137
and finally, substituting and simplifying, using some symbols from [Appendix B](https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#appendix-b-brdf-implementation) and `Nc` for the clearcoat normal:
132138

133139
```
134-
clearcoatFresnel = 0.04 + (1 - 0.04) * (1 - abs(VdotNc))^5
135-
clearcoatAlpha = clearcoatRoughness^2
136-
137-
f_clearcoat = clearcoatFresnel * D(clearcoatAlpha) * G / (4 * abs(VdotNc) * abs(LdotNc))
140+
clearcoat_fresnel = 0.04 + (1 - 0.04) * (1 - abs(VdotNc))^5
141+
clearcoat_alpha = clearcoatRoughness^2
142+
clearcoat_brdf = D(clearcoat_alpha) * G(clearcoat_alpha) / (4 * abs(VdotNc) * abs(LdotNc))
138143
139-
coated_material = (f_diffuse + f_specular) * (1 - clearcoat * clearcoatFresnel) +
140-
f_clearcoat * clearcoat
144+
coated_material = mix(material, clearcoat_brdf, clearcoat * clearcoat_fresnel)
141145
```
142146

143147
#### Emission
144148

145149
The clearcoat layer is on top of emission in the layering stack. Consequently, the emission is darkened by the Fresnel term.
146150

147151
```
148-
coated_emission = emission * (0.04 + (1 - 0.04) * (1 - NdotV)^5)
152+
coated_emission = emission * (1 - clearcoat * clearcoat_fresnel)
149153
```
150154

151155
#### Discussion

extensions/2.0/Khronos/KHR_materials_dispersion/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ See [Appendix](#appendix-full-khronos-copyright-statement) for full Khronos Copy
1616

1717
## Status
1818

19-
Release Candidate
19+
Complete, Ratified by the Khronos Group
2020

2121
## Dependencies
2222

extensions/2.0/Khronos/KHR_materials_ior/README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Written against the glTF 2.0 spec.
4747

4848
## Overview
4949

50-
The dielectric BRDF of the metallic-roughness material in glTF uses a fixed value of 1.5 for the index of refraction. This is a good fit for many plastics and glass, but not for other materials like water or asphalt, sapphire or diamond. This extensions allows users to set the index of refraction to a certain value.
50+
The dielectric BRDF of the metallic-roughness material in glTF uses a fixed value of 1.5 for the index of refraction. This is a good fit for many plastics and glass, but not for other materials like water or asphalt, sapphire or diamond. This extension allows users to set the index of refraction to a certain value.
5151

5252
## Extending Materials
5353

@@ -94,7 +94,21 @@ dielectric_brdf =
9494
α = roughness^2))
9595
```
9696

97-
Valid values for `ior` are numbers greater than or equal to 1. In addition, a value of 0 is allowed. This value gives full weight to `layer`, i.e., the Fresnel term evaluates to 1 independent of the view or light direction. It is useful in combination with `KHR_materials_specular` to seamlessly support the specular-glossiness workflow.
97+
Valid values for `ior` are numbers greater than or equal to one. As a special case, a value of zero is allowed as described below.
98+
99+
### Specular-Glossiness Backwards Compatibility Mode
100+
101+
Setting IOR to zero permanently switches the material into a special specular-glossiness backwards compatibility mode designed to ease content transition from the legacy specular-glossiness model (previously available via `KHR_materials_pbrSpecularGlossiness` extension) to the glTF 2.0 core metallic-roughness PBR model.
102+
103+
This mode has the following implications:
104+
105+
- The effective IOR becomes positive infinity and the Fresnel term **MUST** evaluate to `1.0` independently of the view or light direction.
106+
107+
- All material features **MUST** treat IOR as having a very large value representing positive infinity, subject to numerical precision. For example, this would cause the `dispersion` property (as defined in `KHR_materials_dispersion`) to have no effect on the material appearance.
108+
109+
- This mode cannot be toggled dynamically, e.g., with `KHR_animation_pointer` or `KHR_interactivity` extensions. If the IOR property is set to zero in JSON, glTF Asset Object Model updates of it **MUST** be ignored.
110+
111+
- A value of zero (as well as any other value less than one) **MUST NOT** be used in an animation sampler targeting the IOR property, even if the IOR is set to zero in glTF JSON.
98112

99113
## Implementation
100114

@@ -103,10 +117,10 @@ Valid values for `ior` are numbers greater than or equal to 1. In addition, a va
103117
The extension changes the computation of the Fresnel term defined in [Appendix B](https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#appendix-b-brdf-implementation) to the following:
104118

105119
```
106-
const dielectricSpecular = ((ior - 1)/(ior + 1))^2
120+
dielectric_f0 = ((ior - 1)/(ior + 1))^2
107121
```
108122

109-
Note that for the default index of refraction `ior = 1.5` this term evaluates to `dielectricSpecular = 0.04`.
123+
Note that for the default index of refraction `ior = 1.5` this term evaluates to `dielectric_f0 = 0.04`.
110124

111125
## Interaction with other extensions
112126

extensions/2.0/Khronos/KHR_materials_iridescence/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,17 @@ iridescence = iridescenceFactor * iridescenceTexture.r
7676

7777
If `iridescenceFactor` is zero (default), the iridescence extension has no effect on the material.
7878
All textures in this extension use a single channel in linear space.
79-
The thickness of the thin-film is set to `iridescenceThicknessMaximum` if `iridescenceThicknessTexture` is not given.
80-
If `iridescenceThicknessTexture` is set, the thickness of the thin-film varies between `iridescenceThicknessMinimum` and `iridescenceThicknessMaximum` as follows:
79+
80+
The thickness of the thin-film is defined by the `iridescenceThicknessMinimum`, `iridescenceThicknessMaximum`, and `iridescenceThicknessTexture` properties. The `iridescenceThicknessMinimum` and `iridescenceThicknessMaximum` values correspond to the sampled thickness texture values of 0.0 and 1.0 respectively, thus defining the effective range of the thin-film thickness as follows:
8181

8282
```glsl
8383
thickness = mix(iridescenceThicknessMinimum, iridescenceThicknessMaximum, iridescenceThicknessTexture.g)
8484
```
8585

86+
The `iridescenceThicknessMinimum` value **MAY** be greater than `iridescenceThicknessMaximum` value.
87+
88+
If the thickness texture is not present, it is implicitly sampled as 1.0 so the thin-film thickness is uniformly set to the `iridescenceThicknessMaximum` value.
89+
8690
Aside from light direction and IOR, the thickness of the thin-film defines the variation in hue.
8791
This effect is the result of constructive and destructive interferences of certain wavelengths.
8892
If the the optical path difference between the ray reflected at the thin-film and the ray reflected at the base material is half the wavelength (λ), the resulting 180 degree phase shift is cancelling out the reflected light:

extensions/2.0/Khronos/KHR_materials_iridescence/schema/material.KHR_materials_iridescence.schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828
"description": "The minimum thickness of the thin-film layer given in nanometers.",
2929
"default": 100.0,
3030
"minimum": 0.0,
31-
"gltf_detailedDescription": "The minimum thickness of the thin-film layer given in nanometers. The value **MUST** be less than or equal to the value of `iridescenceThicknessMaximum`."
31+
"gltf_detailedDescription": "The minimum thickness of the thin-film layer given in nanometers."
3232
},
3333
"iridescenceThicknessMaximum": {
3434
"type": "number",
3535
"description": "The maximum thickness of the thin-film layer given in nanometers.",
3636
"default": 400.0,
3737
"minimum": 0.0,
38-
"gltf_detailedDescription": "The maximum thickness of the thin-film layer given in nanometers. The value **MUST** be greater than or equal to the value of `iridescenceThicknessMinimum`."
38+
"gltf_detailedDescription": "The maximum thickness of the thin-film layer given in nanometers."
3939
},
4040
"iridescenceThicknessTexture": {
4141
"allOf": [ { "$ref": "textureInfo.schema.json" } ],

0 commit comments

Comments
 (0)