KHRLightsPunctual

KHR_lights_punctual defines three "punctual" light types: directional, point and spot.

Punctual lights are parameterized, infinitely small points that emit light in well-defined directions and intensities. Lights are referenced by nodes and inherit the transform of that node.

Properties:

Example

import { KHRLightsPunctual, Light, LightType } from '@gltf-transform/extensions';

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

// Create a Light property.
const light = lightsExtension.createLight()
.setType(LightType.POINT)
.setIntensity(2.0)
.setColor([1.0, 0.0, 0.0]);

// Attach the property to a Material.
node.setExtension('KHR_lights_punctual', light);

Hierarchy

Static properties

EXTENSION_NAME: "KHR_lights_punctual"

Properties

extensionName: "KHR_lights_punctual"

Methods

  • createLight(name?: string): Light
  • 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.