KHRMaterialsIOR

KHR_materials_ior defines index of refraction on a glTF PBR material.

The dielectric BRDF of the metallic-roughness material in glTF uses a fixed value of 1.5 for the index of refraction. This is a good fit for many plastics and glass, but not for other materials like water or asphalt, sapphire or diamond. KHR_materials_ior allows users to set the index of refraction to a certain value.

Properties:

Example

import { KHRMaterialsIOR, IOR } from '@gltf-transform/extensions';

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

// Create IOR property.
const ior = iorExtension.createIOR().setIOR(1.0);

// Assign to a Material.
material.setExtension('KHR_materials_ior', ior);

Hierarchy

Static properties

EXTENSION_NAME: "KHR_materials_ior"

Properties

extensionName: "KHR_materials_ior"
prereadTypes: import("/Users/donmccurdy/Documents/Projects/glTF-Transform/packages/core/src/constants").PropertyType[]
prewriteTypes: import("/Users/donmccurdy/Documents/Projects/glTF-Transform/packages/core/src/constants").PropertyType[]

Methods

  • createIOR(): IOR
  • dispose(): void
  • 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.

  • listProperties(): ExtensionProperty[]
  • 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, where the argument and output are a box labeled 'glTF'.

Made by Don McCurdy. Documentation built with greendoc and published under Creative Commons Attribution 3.0.