KHR_materials_iridescence defines iridescence (thin film interference) on a PBR material.

Iridescence describes an effect where hue varies depending on the viewing angle and illumination angle: A thin-film of a semi-transparent layer results in inter-reflections and due to thin-film interference, certain wavelengths get absorbed or amplified. Iridescence can be seen on soap bubbles, oil films, or on the wings of many insects. With this extension, thickness and index of refraction (IOR) of the thin-film can be specified, enabling iridescent materials.

Properties:

Example

The MaterialsIridescence class provides a single ExtensionProperty type, Iridescence, which may be attached to any Material instance. For example:

import { MaterialsIridescence, Iridescence } from '@gltf-transform/extensions';

// Create an Extension attached to the Document.
const iridescenceExtension = document.createExtension(MaterialsIridescence);

// Create an Iridescence property.
const iridescence = iridescenceExtension.createIridescence()
    .setIridescenceFactor(1.0)
    .setIridescenceIOR(1.8);

// Attach the property to a Material.
material.setExtension('KHR_materials_iridescence', iridescence);

Hierarchy

  • Extension
    • MaterialsIridescence

Properties

extensionName: "KHR_materials_iridescence" = ...

Methods

  • dispose(): void
  • Disables and removes the extension from the Document.

  • isRequired(): boolean
  • Indicates to the client whether it is OK to load the asset when this extension is not recognized. Optional extensions are generally preferred, if there is not a good reason to require a client to completely fail when an extension isn't known.

  • Indicates to the client whether it is OK to load the asset when this extension is not recognized. Optional extensions are generally preferred, if there is not a good reason to require a client to completely fail when an extension isn't known.

Function symbol, f(📦) → 📦, where the argument and output are a box labeled 'glTF'.

Made by Don McCurdy TypeDoc documentation Copyright 2021 under MIT license