KHRMaterialsSpecular

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

KHRMaterialsSpecular 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 KHRMaterialsSpecular class provides a single ExtensionProperty type, Specular, which may be attached to any Material instance. For example:

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

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

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

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

Hierarchy

Static properties

EXTENSION_NAME: "KHR_materials_specular"

Properties

extensionName: "KHR_materials_specular"
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

  • 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.