Skip to content

Commit

Permalink
Merge branch 'main' into KHR_texture_procedurals
Browse files Browse the repository at this point in the history
  • Loading branch information
kwokcb committed Nov 18, 2024
2 parents b24ce23 + 2c5681a commit 2dd5f10
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

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

# Build spec targets
- name: spec-generate
Expand All @@ -32,7 +32,7 @@ jobs:
make Specification.html Specification.pdf
- name: Archive generated files
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: spec-outputs
path: |
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ Please provide spec feedback by submitting [issues](https://github.com/KhronosGr
<a href="https://www.khronos.org/developers/reference-cards/">Khronos reference cards</a>
</sup><br>
<sup>
<a href=https://github.com/randall2835/gltfOverviewJapanese/releases/download/v0.1/gltfOverview2.0-Japanese.png>Japanese translation</a> by <a href=https://github.com/randall2835/gltfOverviewJapanese>Takuto Takahashi</a>
<a href=https://github.com/randall2835/gltfOverviewJapanese/releases/tag/v0.1>Japanese translation</a> |
<a href=https://github.com/randall2835/gltfOverviewJapanese/releases/download/v0.1/gltfOverview2.0-Japanese.pdf>PDF</a> |
by <a href=https://github.com/randall2835/gltfOverviewJapanese>Takuto Takahashi</a><br>
<a href=https://github.com/leeyeel/gltfOverview-Chinese/releases/tag/v2.0.0d>Chinese translation</a> |
<a href=https://github.com/leeyeel/gltfOverview-Chinese/releases/download/v2.0.0d/gltfOverview2.0-cn.pdf>PDF</a> |
by <a href=https://github.com/leeyeel/gltfOverview-Chinese>@leeyeel</a><br>
</sup>
</p>

Expand Down
16 changes: 15 additions & 1 deletion extensions/2.0/Khronos/KHR_materials_ior/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,21 @@ dielectric_brdf =
α = roughness^2))
```

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.
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.

### Specular-Glossiness Backwards Compatibility Mode

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.

This mode has the following implications:

- The effective IOR becomes positive infinity and the Fresnel term **MUST** evaluate to `1.0` independently of the view or light direction.

- 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.

- 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.

- 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.

## Implementation

Expand Down
8 changes: 6 additions & 2 deletions extensions/2.0/Khronos/KHR_materials_iridescence/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,17 @@ iridescence = iridescenceFactor * iridescenceTexture.r

If `iridescenceFactor` is zero (default), the iridescence extension has no effect on the material.
All textures in this extension use a single channel in linear space.
The thickness of the thin-film is set to `iridescenceThicknessMaximum` if `iridescenceThicknessTexture` is not given.
If `iridescenceThicknessTexture` is set, the thickness of the thin-film varies between `iridescenceThicknessMinimum` and `iridescenceThicknessMaximum` as follows:

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:

```glsl
thickness = mix(iridescenceThicknessMinimum, iridescenceThicknessMaximum, iridescenceThicknessTexture.g)
```

The `iridescenceThicknessMinimum` value **MAY** be greater than `iridescenceThicknessMaximum` value.

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.

Aside from light direction and IOR, the thickness of the thin-film defines the variation in hue.
This effect is the result of constructive and destructive interferences of certain wavelengths.
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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
"description": "The minimum thickness of the thin-film layer given in nanometers.",
"default": 100.0,
"minimum": 0.0,
"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`."
"gltf_detailedDescription": "The minimum thickness of the thin-film layer given in nanometers."
},
"iridescenceThicknessMaximum": {
"type": "number",
"description": "The maximum thickness of the thin-film layer given in nanometers.",
"default": 400.0,
"minimum": 0.0,
"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`."
"gltf_detailedDescription": "The maximum thickness of the thin-film layer given in nanometers."
},
"iridescenceThicknessTexture": {
"allOf": [ { "$ref": "textureInfo.schema.json" } ],
Expand Down
1 change: 1 addition & 0 deletions extensions/Prefixes.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ To request a prefix, submit a [GitHub issue](https://github.com/KhronosGroup/glT
| `MAXAR` | Maxar Technologies | https://www.maxar.com/ | [#1869](https://github.com/KhronosGroup/glTF/issues/1869) |
| `MESHOPT` | meshoptimizer | https://meshoptimizer.org/ | [#1634](https://github.com/KhronosGroup/glTF/issues/1634) |
| `MIRROR` | The Mirror Megaverse Inc. | https://www.themirror.space/<br>`khronos at themirror.space` | [#2230](https://github.com/KhronosGroup/glTF/issues/2230) |
| `MODUPLAY` | Moduplay Group Pty Ltd. | https://moduplaygroup.com.au/<br>`matthew.h at moduplay.com.au` | [#2445](https://github.com/KhronosGroup/glTF/issues/2445) |
| `MOZ` | Mozilla Corporation | https://www.mozilla.org/ | [#1349](https://github.com/KhronosGroup/glTF/issues/1349) |
| `MPEG` | The Moving Picture Experts Group | https://www.mpeg.org | [#1754](https://github.com/KhronosGroup/glTF/issues/1754) |
| `MSFT` | Microsoft Corporation | https://www.microsoft.com/ | [#1164](https://github.com/KhronosGroup/glTF/pull/1164) |
Expand Down

0 comments on commit 2dd5f10

Please sign in to comment.