Skip to content

Commit

Permalink
KHR_materials_iridescence: Update thickness definition (#2442)
Browse files Browse the repository at this point in the history
  • Loading branch information
lexaknyazev authored Sep 25, 2024
1 parent 496c283 commit 3bd5961
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
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

0 comments on commit 3bd5961

Please sign in to comment.