KHRMaterialsPBRSpecularGlossiness

KHR_materials_pbrSpecularGlossiness converts a PBR material from the default metal/rough workflow to a spec/gloss workflow.

NOTICE: The spec/gloss workflow does not support other PBR extensions such as clearcoat, transmission, IOR, etc. For the complete PBR feature set and specular data, use the KHRMaterialsSpecular extension instead, which provides specular data within a metal/rough workflow.

Illustration

Figure: Components of a PBR spec/gloss material. Source: Khronos Group.

Properties:

Example

import { KHRMaterialsPBRSpecularGlossiness } from '@gltf-transform/extensions';

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

// Create a PBRSpecularGlossiness property.
const specGloss = specGlossExtension.createPBRSpecularGlossiness()
    .setSpecularFactor(1.0);

// // Assign to a Material.
material.setExtension('KHR_materials_pbrSpecularGlossiness', specGloss);

Hierarchy

Static properties

EXTENSION_NAME: "KHR_materials_pbrSpecularGlossiness"

Properties

extensionName: "KHR_materials_pbrSpecularGlossiness"
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.