From 3bd5961905ab2f9fa33cc7fd94de2b2a83e6d142 Mon Sep 17 00:00:00 2001 From: Alexey Knyazev <3479527+lexaknyazev@users.noreply.github.com> Date: Thu, 26 Sep 2024 01:00:05 +0400 Subject: [PATCH] KHR_materials_iridescence: Update thickness definition (#2442) --- .../2.0/Khronos/KHR_materials_iridescence/README.md | 8 ++++++-- .../schema/material.KHR_materials_iridescence.schema.json | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/extensions/2.0/Khronos/KHR_materials_iridescence/README.md b/extensions/2.0/Khronos/KHR_materials_iridescence/README.md index 4c6e945815..cf1f1f5354 100644 --- a/extensions/2.0/Khronos/KHR_materials_iridescence/README.md +++ b/extensions/2.0/Khronos/KHR_materials_iridescence/README.md @@ -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: diff --git a/extensions/2.0/Khronos/KHR_materials_iridescence/schema/material.KHR_materials_iridescence.schema.json b/extensions/2.0/Khronos/KHR_materials_iridescence/schema/material.KHR_materials_iridescence.schema.json index 5f3e45f03d..2d8e06517f 100644 --- a/extensions/2.0/Khronos/KHR_materials_iridescence/schema/material.KHR_materials_iridescence.schema.json +++ b/extensions/2.0/Khronos/KHR_materials_iridescence/schema/material.KHR_materials_iridescence.schema.json @@ -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" } ],