KHR_materials_specular adjusts the strength of the specular reflection in the dielectric BRDF.

MaterialsSpecular is a better alternative to the older KHR_materials_pbrSpecularGlossiness extension, and provides specular information while remaining within a metal/rough PBR workflow. A value of zero disables the specular reflection, resulting in a pure diffuse material.

Properties:

Example

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

import { MaterialsSpecular, Specular } from '@gltf-transform/extensions';

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

// Create a Specular property.
const specular = specularExtension.createSpecular()
    .setSpecularFactor(1.0);

// Attach the property to a Material.
material.setExtension('KHR_materials_specular', specular);

Hierarchy

  • Extension
    • MaterialsSpecular

Properties

extensionName: "KHR_materials_specular" = ...

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