Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3bd5961

Browse files
authored
KHR_materials_iridescence: Update thickness definition (#2442)
1 parent 496c283 commit 3bd5961

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

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)