Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gltf-transform/extensions

Package Overview
Dependencies
Maintainers
1
Versions
191
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gltf-transform/extensions - npm Package Compare versions

Comparing version 4.0.0-alpha.0 to 4.0.0-alpha.1

./dist/extensions.cjs

0

dist/constants.d.ts

@@ -0,0 +0,0 @@ export declare const EXT_MESH_GPU_INSTANCING = "EXT_mesh_gpu_instancing";

export * from './mesh-gpu-instancing.js';
export * from './instanced-mesh.js';

2

dist/ext-mesh-gpu-instancing/instanced-mesh.d.ts

@@ -10,4 +10,2 @@ import { Accessor, ExtensionProperty, IProperty, Nullable, PropertyType } from '@gltf-transform/core';

/**
* # InstancedMesh
*
* Defines GPU instances of a {@link Mesh} under one {@link Node}. See {@link EXTMeshGPUInstancing}.

@@ -14,0 +12,0 @@ */

import { Extension, PropertyType, ReaderContext, WriterContext } from '@gltf-transform/core';
import { InstancedMesh } from './instanced-mesh.js';
/**
* # EXTMeshGPUInstancing
*
* [`EXT_mesh_gpu_instancing`](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/)

@@ -7,0 +5,0 @@ * prepares mesh data for efficient GPU instancing.

@@ -0,0 +0,0 @@ import type { GLTF, TypedArray } from '@gltf-transform/core';

@@ -0,0 +0,0 @@ import type { GLTF } from '@gltf-transform/core';

@@ -0,0 +0,0 @@ import { PreparedAccessor, MeshoptFilter, MeshoptMode } from './constants.js';

export * from './meshopt-compression.js';

@@ -7,4 +7,2 @@ import { Extension, PropertyType, ReaderContext, WriterContext } from '@gltf-transform/core';

/**
* # EXTMeshoptCompression
*
* [`EXT_meshopt_compression`](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Vendor/EXT_meshopt_compression/)

@@ -11,0 +9,0 @@ * provides compression and fast decoding for geometry, morph targets, and animations.

export * from './texture-avif.js';
import { Extension, PropertyType, ReaderContext, WriterContext } from '@gltf-transform/core';
/**
* # TextureAVIF
*
* [`EXT_texture_avif`](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_texture_avif/)

@@ -6,0 +4,0 @@ * enables AVIF images for any material texture.

export * from './texture-webp.js';
import { Extension, PropertyType, ReaderContext, WriterContext } from '@gltf-transform/core';
/**
* # EXTTextureWebP
*
* [`EXT_texture_webp`](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_texture_webp/)

@@ -6,0 +4,0 @@ * enables WebP images for any material texture.

@@ -0,0 +0,0 @@ /** @module extensions */

@@ -0,0 +0,0 @@ import { GLTF, TypedArray } from '@gltf-transform/core';

import { Extension, PropertyType, ReaderContext, WriterContext } from '@gltf-transform/core';
import { EncoderMethod, EncoderOptions } from './encoder.js';
/**
* # KHRDracoMeshCompression
*
* [`KHR_draco_mesh_compression`](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_draco_mesh_compression/)

@@ -7,0 +5,0 @@ * provides advanced compression for mesh geometry.

@@ -0,0 +0,0 @@ import { bbox, Primitive } from '@gltf-transform/core';

export * from './draco-mesh-compression.js';
export * from './lights-punctual.js';
export * from './light.js';

@@ -13,4 +13,2 @@ import { ExtensionProperty, IProperty, Nullable, PropertyType, vec3 } from '@gltf-transform/core';

/**
* # Light
*
* Defines a light attached to a {@link Node}. See {@link KHRLightsPunctual}.

@@ -17,0 +15,0 @@ */

import { Extension, ReaderContext, WriterContext } from '@gltf-transform/core';
import { Light } from './light.js';
/**
* # KHRLightsPunctual
*
* [`KHR_lights_punctual`](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_lights_punctual/) defines three "punctual" light types: directional, point and

@@ -7,0 +5,0 @@ * spot.

@@ -10,4 +10,2 @@ import { ExtensionProperty, IProperty, Nullable, PropertyType, Texture, TextureInfo } from '@gltf-transform/core';

/**
* # Anisotropy
*
* Defines anisotropy (directionally-dependent reflections) on a PBR {@link Material}. See

@@ -43,15 +41,16 @@ * {@link KHRMaterialsAnisotropy}.

/**
* Anisotropy texture. Red and green channels represent the anisotropy direction in [-1, 1]
* tangent, bitangent space. The vector is rotated by anisotropyRotation, and multiplied by
* anisotropyStrength, to obtain the final anisotropy direction and strength.
* Anisotropy texture. Red and green channels represent the anisotropy
* direction in [-1, 1] tangent, bitangent space, to be rotated by
* anisotropyRotation. The blue channel contains strength as [0, 1] to be
* multiplied by anisotropyStrength.
*/
getAnisotropyTexture(): Texture | null;
/**
* Settings affecting the material's use of its anisotropy texture. If no texture is attached,
* {@link TextureInfo} is `null`.
* Settings affecting the material's use of its anisotropy texture. If no
* texture is attached, {@link TextureInfo} is `null`.
*/
getAnisotropyTextureInfo(): TextureInfo | null;
/** Anisotropy texture. See {@link getAnisotropyTexture}. */
/** Anisotropy texture. See {@link Anisotropy.getAnisotropyTexture getAnisotropyTexture}. */
setAnisotropyTexture(texture: Texture | null): this;
}
export {};
export * from './materials-anisotropy.js';
export * from './anisotropy.js';
import { Extension, ReaderContext, WriterContext } from '@gltf-transform/core';
import { Anisotropy } from './anisotropy.js';
/**
* # KHRMaterialsAnisotropy
*
* [`KHR_materials_anisotropy`](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_materials_anisotropy/)

@@ -7,0 +5,0 @@ * defines anisotropy (directionally-dependent reflections) on a PBR material.

@@ -15,4 +15,2 @@ import { ExtensionProperty, IProperty, Nullable, PropertyType, Texture, TextureInfo } from '@gltf-transform/core';

/**
* # Clearcoat
*
* Defines clear coat for a PBR material. See {@link KHRMaterialsClearcoat}.

@@ -30,5 +28,5 @@ */

*/
/** Clearcoat; linear multiplier. See {@link getClearcoatTexture}. */
/** Clearcoat; linear multiplier. See {@link Clearcoat.getClearcoatTexture getClearcoatTexture}. */
getClearcoatFactor(): number;
/** Clearcoat; linear multiplier. See {@link getClearcoatTexture}. */
/** Clearcoat; linear multiplier. See {@link Clearcoat.getClearcoatTexture getClearcoatTexture}. */
setClearcoatFactor(factor: number): this;

@@ -46,3 +44,3 @@ /**

getClearcoatTextureInfo(): TextureInfo | null;
/** Sets clearcoat texture. See {@link getClearcoatTexture}. */
/** Sets clearcoat texture. See {@link Clearcoat.getClearcoatTexture getClearcoatTexture}. */
setClearcoatTexture(texture: Texture | null): this;

@@ -52,5 +50,11 @@ /**********************************************************************************************

*/
/** Clearcoat roughness; linear multiplier. See {@link getClearcoatRoughnessTexture}. */
/**
* Clearcoat roughness; linear multiplier.
* See {@link Clearcoat.getClearcoatRoughnessTexture getClearcoatRoughnessTexture}.
*/
getClearcoatRoughnessFactor(): number;
/** Clearcoat roughness; linear multiplier. See {@link getClearcoatRoughnessTexture}. */
/**
* Clearcoat roughness; linear multiplier.
* See {@link Clearcoat.getClearcoatRoughnessTexture getClearcoatRoughnessTexture}.
*/
setClearcoatRoughnessFactor(factor: number): this;

@@ -67,3 +71,6 @@ /**

getClearcoatRoughnessTextureInfo(): TextureInfo | null;
/** Sets clearcoat roughness texture. See {@link getClearcoatRoughnessTexture}. */
/**
* Sets clearcoat roughness texture.
* See {@link Clearcoat.getClearcoatRoughnessTexture getClearcoatRoughnessTexture}.
*/
setClearcoatRoughnessTexture(texture: Texture | null): this;

@@ -73,5 +80,5 @@ /**********************************************************************************************

*/
/** Clearcoat normal scale. See {@link getClearcoatNormalTexture}. */
/** Clearcoat normal scale. See {@link Clearcoat.getClearcoatNormalTexture getClearcoatNormalTexture}. */
getClearcoatNormalScale(): number;
/** Clearcoat normal scale. See {@link getClearcoatNormalTexture}. */
/** Clearcoat normal scale. See {@link Clearcoat.getClearcoatNormalTexture getClearcoatNormalTexture}. */
setClearcoatNormalScale(scale: number): this;

@@ -87,5 +94,5 @@ /**

getClearcoatNormalTextureInfo(): TextureInfo | null;
/** Sets clearcoat normal texture. See {@link getClearcoatNormalTexture}. */
/** Sets clearcoat normal texture. See {@link Clearcoat.getClearcoatNormalTexture getClearcoatNormalTexture}. */
setClearcoatNormalTexture(texture: Texture | null): this;
}
export {};
export * from './materials-clearcoat.js';
export * from './clearcoat.js';
import { Extension, ReaderContext, WriterContext } from '@gltf-transform/core';
import { Clearcoat } from './clearcoat.js';
/**
* # KHRMaterialsClearcoat
*
* [KHR_materials_clearcoat](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_materials_clearcoat/)

@@ -7,0 +5,0 @@ * defines a clear coating on a glTF PBR material.

@@ -7,4 +7,2 @@ import { ExtensionProperty, IProperty, Nullable, PropertyType } from '@gltf-transform/core';

/**
* # EmissiveStrength
*
* Defines emissive strength for a PBR {@link Material}, allowing high-dynamic-range

@@ -11,0 +9,0 @@ * (HDR) emissive materials. See {@link KHRMaterialsEmissiveStrength}.

export * from './materials-emissive-strength.js';
export * from './emissive-strength.js';
import { Extension, ReaderContext, WriterContext } from '@gltf-transform/core';
import { EmissiveStrength } from './emissive-strength.js';
/**
* # KHRMaterialsEmissiveStrength
*
* [KHR_materials_emissive_strength](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_materials_emissive_strength/)

@@ -7,0 +5,0 @@ * defines emissive strength and enables high-dynamic-range (HDR) emissive materials.

export * from './materials-ior.js';
export * from './ior.js';

@@ -7,4 +7,2 @@ import { ExtensionProperty, IProperty, Nullable, PropertyType } from '@gltf-transform/core';

/**
* # IOR
*
* Defines index of refraction for a PBR {@link Material}. See {@link KHRMaterialsIOR}.

@@ -11,0 +9,0 @@ */

import { Extension, ReaderContext, WriterContext } from '@gltf-transform/core';
import { IOR } from './ior.js';
/**
* # KHRMaterialsIOR
*
* [KHR_materials_ior](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_materials_ior/)

@@ -7,0 +5,0 @@ * defines index of refraction on a glTF PBR material.

export * from './materials-iridescence.js';
export * from './iridescence.js';

@@ -14,4 +14,2 @@ import { ExtensionProperty, IProperty, Nullable, PropertyType, Texture, TextureInfo } from '@gltf-transform/core';

/**
* # Iridescence
*
* Defines iridescence (thin film interference) on a PBR {@link Material}. See {@link KHRMaterialsIridescence}.

@@ -29,5 +27,5 @@ */

*/
/** Iridescence; linear multiplier. See {@link getIridescenceTexture}. */
/** Iridescence; linear multiplier. See {@link Iridescence.getIridescenceTexture getIridescenceTexture}. */
getIridescenceFactor(): number;
/** Iridescence; linear multiplier. See {@link getIridescenceTexture}. */
/** Iridescence; linear multiplier. See {@link Iridescence.getIridescenceTexture getIridescenceTexture}. */
setIridescenceFactor(factor: number): this;

@@ -46,3 +44,3 @@ /**

getIridescenceTextureInfo(): TextureInfo | null;
/** Iridescence intensity. See {@link getIridescenceTexture}. */
/** Iridescence intensity. See {@link Iridescence.getIridescenceTexture getIridescenceTexture}. */
setIridescenceTexture(texture: Texture | null): this;

@@ -77,5 +75,8 @@ /**********************************************************************************************

getIridescenceThicknessTextureInfo(): TextureInfo | null;
/** Sets iridescence thickness texture. See {@link getIridescenceThicknessTexture}. */
/**
* Sets iridescence thickness texture.
* See {@link Iridescence.getIridescenceThicknessTexture getIridescenceThicknessTexture}.
*/
setIridescenceThicknessTexture(texture: Texture | null): this;
}
export {};
import { Extension, ReaderContext, WriterContext } from '@gltf-transform/core';
import { Iridescence } from './iridescence.js';
/**
* # KHRMaterialsIridescence
*
* [`KHR_materials_iridescence`](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_materials_iridescence/)

@@ -7,0 +5,0 @@ * defines iridescence (thin film interference) on a PBR material.

export * from './materials-pbr-specular-glossiness.js';
export * from './pbr-specular-glossiness.js';
import { Extension, ReaderContext, WriterContext } from '@gltf-transform/core';
import { PBRSpecularGlossiness } from './pbr-specular-glossiness.js';
/**
* # KHRMaterialsPBRSpecularGlossiness
*
* [`KHR_materials_pbrSpecularGlossiness`](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/)

@@ -7,0 +5,0 @@ * converts a PBR material from the default metal/rough workflow to a spec/gloss workflow.

@@ -13,4 +13,2 @@ import { ExtensionProperty, IProperty, Nullable, PropertyType, Texture, TextureInfo, vec3, vec4 } from '@gltf-transform/core';

/**
* # PBRSpecularGlossiness
*
* Converts a {@link Material} to a spec/gloss workflow. See {@link KHRMaterialsPBRSpecularGlossiness}.

@@ -28,5 +26,5 @@ */

*/
/** Diffuse; Linear-sRGB components. See {@link getDiffuseTexture}. */
/** Diffuse; Linear-sRGB components. See {@link PBRSpecularGlossiness.getDiffuseTexture getDiffuseTexture}. */
getDiffuseFactor(): vec4;
/** Diffuse; Linear-sRGB components. See {@link getDiffuseTexture}. */
/** Diffuse; Linear-sRGB components. See {@link PBRSpecularGlossiness.getDiffuseTexture getDiffuseTexture}. */
setDiffuseFactor(factor: vec4): this;

@@ -47,3 +45,3 @@ /** Diffuse; sRGB hexadecimal color. */

getDiffuseTextureInfo(): TextureInfo | null;
/** Sets diffuse texture. See {@link getDiffuseTexture}. */
/** Sets diffuse texture. See {@link PBRSpecularGlossiness.getDiffuseTexture getDiffuseTexture}. */
setDiffuseTexture(texture: Texture | null): this;

@@ -50,0 +48,0 @@ /**********************************************************************************************

export * from './materials-sheen.js';
export * from './sheen.js';
import { Extension, ReaderContext, WriterContext } from '@gltf-transform/core';
import { Sheen } from './sheen.js';
/**
* # KHRMaterialsSheen
*
* [`KHR_materials_sheen`](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_sheen/)

@@ -7,0 +5,0 @@ * defines a velvet-like sheen layered on a glTF PBR material.

@@ -12,4 +12,2 @@ import { ExtensionProperty, IProperty, Nullable, PropertyType, Texture, TextureInfo, vec3 } from '@gltf-transform/core';

/**
* # Sheen
*
* Defines sheen on a PBR {@link Material}. See {@link KHRMaterialsSheen}.

@@ -44,3 +42,3 @@ */

getSheenColorTextureInfo(): TextureInfo | null;
/** Sets sheen color texture. See {@link getSheenColorTexture}. */
/** Sets sheen color texture. See {@link Sheen.getSheenColorTexture getSheenColorTexture}. */
setSheenColorTexture(texture: Texture | null): this;

@@ -50,5 +48,5 @@ /**********************************************************************************************

*/
/** Sheen roughness; linear multiplier. See {@link getSheenRoughnessTexture}. */
/** Sheen roughness; linear multiplier. See {@link Sheen.getSheenRoughnessTexture getSheenRoughnessTexture}. */
getSheenRoughnessFactor(): number;
/** Sheen roughness; linear multiplier. See {@link getSheenRoughnessTexture}. */
/** Sheen roughness; linear multiplier. See {@link Sheen.getSheenRoughnessTexture getSheenRoughnessTexture}. */
setSheenRoughnessFactor(factor: number): this;

@@ -55,0 +53,0 @@ /**

export * from './materials-specular.js';
export * from './specular.js';
import { Extension, ReaderContext, WriterContext } from '@gltf-transform/core';
import { Specular } from './specular.js';
/**
* # KHRMaterialsSpecular
*
* [`KHR_materials_specular`](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_materials_specular/)

@@ -7,0 +5,0 @@ * adjusts the strength of the specular reflection in the dielectric BRDF.

@@ -12,4 +12,2 @@ import { ExtensionProperty, IProperty, Nullable, PropertyType, Texture, TextureInfo, vec3 } from '@gltf-transform/core';

/**
* # Specular
*
* Defines specular reflectivity on a PBR {@link Material}. See {@link KHRMaterialsSpecular}.

@@ -27,13 +25,13 @@ */

*/
/** Specular; linear multiplier. See {@link getSpecularTexture}. */
/** Specular; linear multiplier. See {@link Specular.getSpecularTexture getSpecularTexture}. */
getSpecularFactor(): number;
/** Specular; linear multiplier. See {@link getSpecularTexture}. */
/** Specular; linear multiplier. See {@link Specular.getSpecularTexture getSpecularTexture}. */
setSpecularFactor(factor: number): this;
/** Specular color; Linear-sRGB components. See {@link getSpecularTexture}. */
/** Specular color; Linear-sRGB components. See {@link Specular.getSpecularTexture getSpecularTexture}. */
getSpecularColorFactor(): vec3;
/** Specular color; Linear-sRGB components. See {@link getSpecularTexture}. */
/** Specular color; Linear-sRGB components. See {@link Specular.getSpecularTexture getSpecularTexture}. */
setSpecularColorFactor(factor: vec3): this;
/** Specular color; sRGB hexadecimal color. See {@link getSpecularTexture} */
/** Specular color; sRGB hexadecimal color. See {@link Specular.getSpecularTexture getSpecularTexture} */
getSpecularColorHex(): number;
/** Specular color; sRGB hexadecimal color. See {@link getSpecularTexture} */
/** Specular color; sRGB hexadecimal color. See {@link Specular.getSpecularTexture getSpecularTexture} */
setSpecularColorHex(hex: number): this;

@@ -54,3 +52,3 @@ /**

getSpecularTextureInfo(): TextureInfo | null;
/** Sets specular texture. See {@link getSpecularTexture}. */
/** Sets specular texture. See {@link Specular.getSpecularTexture getSpecularTexture}. */
setSpecularTexture(texture: Texture | null): this;

@@ -70,5 +68,5 @@ /**

getSpecularColorTextureInfo(): TextureInfo | null;
/** Sets specular color texture. See {@link getSpecularColorTexture}. */
/** Sets specular color texture. See {@link Specular.getSpecularColorTexture getSpecularColorTexture}. */
setSpecularColorTexture(texture: Texture | null): this;
}
export {};
export * from './materials-transmission.js';
export * from './transmission.js';
import { Extension, ReaderContext, WriterContext } from '@gltf-transform/core';
import { Transmission } from './transmission.js';
/**
* # KHRMaterialsTransmission
*
* [`KHR_materials_transmission`](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_materials_transmission/)

@@ -7,0 +5,0 @@ * provides a common type of optical transparency: infinitely-thin materials with no refraction,

@@ -9,4 +9,2 @@ import { ExtensionProperty, IProperty, Nullable, PropertyType, Texture, TextureInfo } from '@gltf-transform/core';

/**
* # Transmission
*
* Defines optical transmission on a PBR {@link Material}. See {@link KHRMaterialsTransmission}.

@@ -24,5 +22,5 @@ */

*/
/** Transmission; linear multiplier. See {@link getTransmissionTexture}. */
/** Transmission; linear multiplier. See {@link Transmission.getTransmissionTexture getTransmissionTexture}. */
getTransmissionFactor(): number;
/** Transmission; linear multiplier. See {@link getTransmissionTexture}. */
/** Transmission; linear multiplier. See {@link Transmission.getTransmissionTexture getTransmissionTexture}. */
setTransmissionFactor(factor: number): this;

@@ -41,5 +39,5 @@ /**

getTransmissionTextureInfo(): TextureInfo | null;
/** Sets transmission texture. See {@link getTransmissionTexture}. */
/** Sets transmission texture. See {@link Transmission.getTransmissionTexture getTransmissionTexture}. */
setTransmissionTexture(texture: Texture | null): this;
}
export {};
export * from './materials-unlit.js';
export * from './unlit.js';
import { Extension, ReaderContext, WriterContext } from '@gltf-transform/core';
import { Unlit } from './unlit.js';
/**
* # KHRMaterialsUnlit
*
* [`KHR_materials_unlit`](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_materials_unlit/)

@@ -7,0 +5,0 @@ * defines an unlit shading model for use in glTF 2.0 materials.

@@ -5,4 +5,2 @@ import { ExtensionProperty } from '@gltf-transform/core';

/**
* # Unlit
*
* Converts a PBR {@link Material} to an unlit shading model. See {@link KHRMaterialsUnlit}.

@@ -9,0 +7,0 @@ */

@@ -0,0 +0,0 @@ export * from './materials-variants.js';

@@ -8,4 +8,2 @@ import { ExtensionProperty, IProperty, Nullable, PropertyType } from '@gltf-transform/core';

/**
* # MappingList
*
* List of material variant {@link Mapping}s. See {@link KHRMaterialsVariants}.

@@ -12,0 +10,0 @@ */

@@ -9,4 +9,2 @@ import { ExtensionProperty, IProperty, Material, Nullable } from '@gltf-transform/core';

/**
* # Mapping
*
* Maps {@link Variant}s to {@link Material}s. See {@link KHRMaterialsVariants}.

@@ -13,0 +11,0 @@ */

@@ -6,8 +6,6 @@ import { Extension, ReaderContext, WriterContext } from '@gltf-transform/core';

/**
* # KHRMaterialsVariants
*
* [`KHR_materials_variants`](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_variants/)
* defines alternate {@link Material} states for any {@link Primitive} in the scene.
*
* ![Illustration](/media/extensions/khr-materials-variants.png)
* ![Illustration](/media/extensions/khr-materials-variants.jpg)
*

@@ -14,0 +12,0 @@ * > _**Figure:** A sneaker, in three material variants. Source: Khronos Group._

import { ExtensionProperty } from '@gltf-transform/core';
import { KHR_MATERIALS_VARIANTS } from '../constants.js';
/**
* # Variant
*
* Defines a variant of a {@link Material}. See {@link KHRMaterialsVariants}.

@@ -7,0 +5,0 @@ */

export * from './materials-volume.js';
export * from './volume.js';
import { Extension, ReaderContext, WriterContext } from '@gltf-transform/core';
import { Volume } from './volume.js';
/**
* # KHRMaterialsVolume
*
* [KHR_materials_volume](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_materials_volume/)

@@ -7,0 +5,0 @@ * adds refraction, absorption, or scattering to a glTF PBR material already using transmission or

@@ -11,4 +11,2 @@ import { ExtensionProperty, IProperty, Nullable, PropertyType, Texture, TextureInfo, vec3 } from '@gltf-transform/core';

/**
* # Volume
*
* Defines volume on a PBR {@link Material}. See {@link KHRMaterialsVolume}.

@@ -15,0 +13,0 @@ */

export * from './mesh-quantization.js';
import { Extension, ReaderContext, WriterContext } from '@gltf-transform/core';
/**
* # KHRMeshQuantization
*
* [`KHR_mesh_quantization`](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_mesh_quantization/)

@@ -6,0 +4,0 @@ * expands allowed component types for vertex attributes to include 16- and 8-bit storage.

export * from './texture-basisu.js';
import { Extension, PropertyType, ReaderContext, WriterContext } from '@gltf-transform/core';
/**
* # KHRTextureBasisu
*
* [`KHR_texture_basisu`](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu)

@@ -39,3 +37,3 @@ * enables KTX2 GPU textures with Basis Universal supercompression for any material texture.

* compress the image data first, then pass the `.ktx2` payload to {@link Texture.setImage}. The
* [glTF-Transform CLI](/cli.html) has functions to help with this, or any similar KTX2-capable
* glTF-Transform CLI has functions to help with this, or any similar KTX2-capable
* utility will work.

@@ -42,0 +40,0 @@ *

export * from './texture-transform.js';
export * from './transform.js';
import { Extension, ReaderContext, WriterContext } from '@gltf-transform/core';
import { Transform } from './transform.js';
/**
* # KHRTextureTransform
*
* [`KHR_texture_transform`](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_texture_transform/)

@@ -7,0 +5,0 @@ * adds offset, rotation, and scale to {@link TextureInfo} properties.

@@ -11,4 +11,2 @@ import { ExtensionProperty, IProperty, Nullable, vec2 } from '@gltf-transform/core';

/**
* # Transform
*
* Defines UV transform for a {@link TextureInfo}. See {@link KHRTextureTransform}.

@@ -15,0 +13,0 @@ */

export * from './packet.js';
export * from './xmp.js';

@@ -12,4 +12,2 @@ import { Nullable, PropertyType, ExtensionProperty, IProperty } from '@gltf-transform/core';

/**
* # Packet
*
* Defines an XMP packet associated with a Document or Property. See {@link KHRXMP}.

@@ -16,0 +14,0 @@ */

import { Extension, ReaderContext, WriterContext } from '@gltf-transform/core';
import { Packet } from './packet.js';
/**
* # KHRXMP
*
* [KHR_xmp_json_ld](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_xmp_json_ld/)

@@ -7,0 +5,0 @@ * defines XMP metadata associated with a glTF asset.

{
"name": "@gltf-transform/extensions",
"version": "4.0.0-alpha.0",
"version": "4.0.0-alpha.1",
"repository": "github:donmccurdy/glTF-Transform",

@@ -26,4 +26,4 @@ "homepage": "https://gltf-transform.donmccurdy.com/extensions.html",

"scripts": {
"dist": "microbundle --format modern,cjs --no-compress",
"watch": "microbundle watch --format modern,cjs --no-compress",
"dist": "microbundle --format modern,cjs",
"watch": "microbundle watch --format modern,cjs",
"watch:debug": "microbundle watch --format modern,cjs --no-compress"

@@ -39,3 +39,3 @@ },

"dependencies": {
"@gltf-transform/core": "^4.0.0-alpha.0",
"@gltf-transform/core": "^4.0.0-alpha.1",
"ktx-parse": "^0.5.0"

@@ -49,3 +49,3 @@ },

],
"gitHead": "8d80d1ffa893ba3a337cffbf638cc84f75c44a5d"
"gitHead": "fb71aa67ca90f719b2d8d2d8fc759c49d5f9aa45"
}

@@ -11,74 +11,7 @@ # @gltf-transform/extensions

- Project Documentation: https://gltf-transform.donmccurdy.com/
- Package Documentation: https://gltf-transform.donmccurdy.com/extensions.html
- Package Documentation: https://gltf-transform.donmccurdy.com/extensions
## Quickstart
Install the scripting packages:
```bash
npm install --save @gltf-transform/core @gltf-transform/extensions @gltf-transform/functions
```
Read and write glTF scenes with platform I/O utilities [WebIO](https://gltf-transform.donmccurdy.com/classes/core.webio.html), [NodeIO](https://gltf-transform.donmccurdy.com/classes/core.nodeio.html), or [DenoIO](https://gltf-transform.donmccurdy.com/classes/core.denoio.html):
```typescript
import { Document, NodeIO } from '@gltf-transform/core';
import { KHRONOS_EXTENSIONS } from '@gltf-transform/extensions';
import draco3d from 'draco3dgltf';
// Configure I/O.
const io = new NodeIO()
.registerExtensions(KHRONOS_EXTENSIONS)
.registerDependencies({
'draco3d.decoder': await draco3d.createDecoderModule(), // Optional.
'draco3d.encoder': await draco3d.createEncoderModule(), // Optional.
});
// Read from URL.
const document = await io.read('path/to/model.glb');
// Write to byte array (Uint8Array).
const glb = await io.writeBinary(document);
```
To perform changes to an existing glTF [Document](https://gltf-transform.donmccurdy.com/classes/core.document.html), import off-the-shelf scripts from the [Functions](https://gltf-transform.donmccurdy.com/functions.html) package, or write your own using API classes like [Material](https://gltf-transform.donmccurdy.com/classes/core.material.html), [Primitive](https://gltf-transform.donmccurdy.com/classes/core.primitive.html), and [Texture](https://gltf-transform.donmccurdy.com/classes/core.texture.html).
```typescript
import { resample, prune, dedup, draco, textureCompress } from '@gltf-transform/functions';
import * as sharp from 'sharp'; // Node.js only.
await document.transform(
// Losslessly resample animation frames.
resample(),
// Remove unused nodes, textures, or other data.
prune(),
// Remove duplicate vertex or texture data, if any.
dedup(),
// Compress mesh geometry with Draco.
draco(),
// Convert textures to WebP (Requires glTF Transform v3 and Node.js).
textureCompress({
encoder: sharp,
targetFormat: 'webp',
resize: [1024, 2024],
}),
// Custom transform.
backfaceCulling({cull: true}),
);
// Custom transform: enable/disable backface culling.
function backfaceCulling(options) {
return (document) => {
for (const material of document.getRoot().listMaterials()) {
material.setDoubleSided(!options.cull);
}
};
}
```
To learn how glTF-Transform works, and the architecture of the scripting API, start with [Concepts](https://gltf-transform.donmccurdy.com/concepts.html). To try out the scripting API without installing anything, visit [gltf.report/](https://gltf.report/), load a glTF model, and open the *Script* tab.
## Credits
See [*Credits*](https://gltf-transform.donmccurdy.com/credits.html).
See [*Credits*](https://gltf-transform.donmccurdy.com/credits).

@@ -85,0 +18,0 @@ ## License

@@ -12,4 +12,2 @@ import { Accessor, ExtensionProperty, IProperty, Nullable, PropertyType } from '@gltf-transform/core';

/**
* # InstancedMesh
*
* Defines GPU instances of a {@link Mesh} under one {@link Node}. See {@link EXTMeshGPUInstancing}.

@@ -16,0 +14,0 @@ */

@@ -14,4 +14,2 @@ import { Extension, PropertyType, ReaderContext, WriterContext } from '@gltf-transform/core';

/**
* # EXTMeshGPUInstancing
*
* [`EXT_mesh_gpu_instancing`](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/)

@@ -18,0 +16,0 @@ * prepares mesh data for efficient GPU instancing.

@@ -32,4 +32,2 @@ import {

/**
* # EXTMeshoptCompression
*
* [`EXT_meshopt_compression`](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Vendor/EXT_meshopt_compression/)

@@ -36,0 +34,0 @@ * provides compression and fast decoding for geometry, morph targets, and animations.

@@ -58,4 +58,2 @@ import {

/**
* # TextureAVIF
*
* [`EXT_texture_avif`](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_texture_avif/)

@@ -62,0 +60,0 @@ * enables AVIF images for any material texture.

@@ -63,4 +63,2 @@ import {

/**
* # EXTTextureWebP
*
* [`EXT_texture_webp`](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_texture_webp/)

@@ -67,0 +65,0 @@ * enables WebP images for any material texture.

@@ -41,4 +41,2 @@ import {

/**
* # KHRDracoMeshCompression
*
* [`KHR_draco_mesh_compression`](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_draco_mesh_compression/)

@@ -45,0 +43,0 @@ * provides advanced compression for mesh geometry.

@@ -17,4 +17,2 @@ import { ExtensionProperty, IProperty, Nullable, PropertyType, vec3 } from '@gltf-transform/core';

/**
* # Light
*
* Defines a light attached to a {@link Node}. See {@link KHRLightsPunctual}.

@@ -21,0 +19,0 @@ */

@@ -28,4 +28,2 @@ import { Extension, MathUtils, ReaderContext, WriterContext, vec3 } from '@gltf-transform/core';

/**
* # KHRLightsPunctual
*
* [`KHR_lights_punctual`](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_lights_punctual/) defines three "punctual" light types: directional, point and

@@ -32,0 +30,0 @@ * spot.

@@ -19,7 +19,5 @@ import {

const { R, G } = TextureChannel;
const { R, G, B } = TextureChannel;
/**
* # Anisotropy
*
* Defines anisotropy (directionally-dependent reflections) on a PBR {@link Material}. See

@@ -84,5 +82,6 @@ * {@link KHRMaterialsAnisotropy}.

/**
* Anisotropy texture. Red and green channels represent the anisotropy direction in [-1, 1]
* tangent, bitangent space. The vector is rotated by anisotropyRotation, and multiplied by
* anisotropyStrength, to obtain the final anisotropy direction and strength.
* Anisotropy texture. Red and green channels represent the anisotropy
* direction in [-1, 1] tangent, bitangent space, to be rotated by
* anisotropyRotation. The blue channel contains strength as [0, 1] to be
* multiplied by anisotropyStrength.
*/

@@ -94,4 +93,4 @@ public getAnisotropyTexture(): Texture | null {

/**
* Settings affecting the material's use of its anisotropy texture. If no texture is attached,
* {@link TextureInfo} is `null`.
* Settings affecting the material's use of its anisotropy texture. If no
* texture is attached, {@link TextureInfo} is `null`.
*/

@@ -102,6 +101,6 @@ public getAnisotropyTextureInfo(): TextureInfo | null {

/** Anisotropy texture. See {@link getAnisotropyTexture}. */
/** Anisotropy texture. See {@link Anisotropy.getAnisotropyTexture getAnisotropyTexture}. */
public setAnisotropyTexture(texture: Texture | null): this {
return this.setRef('anisotropyTexture', texture, { channels: R | G });
return this.setRef('anisotropyTexture', texture, { channels: R | G | B });
}
}

@@ -14,4 +14,2 @@ import { Extension, GLTF, ReaderContext, WriterContext } from '@gltf-transform/core';

/**
* # KHRMaterialsAnisotropy
*
* [`KHR_materials_anisotropy`](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_materials_anisotropy/)

@@ -18,0 +16,0 @@ * defines anisotropy (directionally-dependent reflections) on a PBR material.

@@ -29,4 +29,2 @@ import {

/**
* # Clearcoat
*
* Defines clear coat for a PBR material. See {@link KHRMaterialsClearcoat}.

@@ -66,3 +64,3 @@ */

/** Clearcoat; linear multiplier. See {@link getClearcoatTexture}. */
/** Clearcoat; linear multiplier. See {@link Clearcoat.getClearcoatTexture getClearcoatTexture}. */
public getClearcoatFactor(): number {

@@ -72,3 +70,3 @@ return this.get('clearcoatFactor');

/** Clearcoat; linear multiplier. See {@link getClearcoatTexture}. */
/** Clearcoat; linear multiplier. See {@link Clearcoat.getClearcoatTexture getClearcoatTexture}. */
public setClearcoatFactor(factor: number): this {

@@ -95,3 +93,3 @@ return this.set('clearcoatFactor', factor);

/** Sets clearcoat texture. See {@link getClearcoatTexture}. */
/** Sets clearcoat texture. See {@link Clearcoat.getClearcoatTexture getClearcoatTexture}. */
public setClearcoatTexture(texture: Texture | null): this {

@@ -105,3 +103,6 @@ return this.setRef('clearcoatTexture', texture, { channels: R });

/** Clearcoat roughness; linear multiplier. See {@link getClearcoatRoughnessTexture}. */
/**
* Clearcoat roughness; linear multiplier.
* See {@link Clearcoat.getClearcoatRoughnessTexture getClearcoatRoughnessTexture}.
*/
public getClearcoatRoughnessFactor(): number {

@@ -111,3 +112,6 @@ return this.get('clearcoatRoughnessFactor');

/** Clearcoat roughness; linear multiplier. See {@link getClearcoatRoughnessTexture}. */
/**
* Clearcoat roughness; linear multiplier.
* See {@link Clearcoat.getClearcoatRoughnessTexture getClearcoatRoughnessTexture}.
*/
public setClearcoatRoughnessFactor(factor: number): this {

@@ -133,3 +137,6 @@ return this.set('clearcoatRoughnessFactor', factor);

/** Sets clearcoat roughness texture. See {@link getClearcoatRoughnessTexture}. */
/**
* Sets clearcoat roughness texture.
* See {@link Clearcoat.getClearcoatRoughnessTexture getClearcoatRoughnessTexture}.
*/
public setClearcoatRoughnessTexture(texture: Texture | null): this {

@@ -143,3 +150,3 @@ return this.setRef('clearcoatRoughnessTexture', texture, { channels: G });

/** Clearcoat normal scale. See {@link getClearcoatNormalTexture}. */
/** Clearcoat normal scale. See {@link Clearcoat.getClearcoatNormalTexture getClearcoatNormalTexture}. */
public getClearcoatNormalScale(): number {

@@ -149,3 +156,3 @@ return this.get('clearcoatNormalScale');

/** Clearcoat normal scale. See {@link getClearcoatNormalTexture}. */
/** Clearcoat normal scale. See {@link Clearcoat.getClearcoatNormalTexture getClearcoatNormalTexture}. */
public setClearcoatNormalScale(scale: number): this {

@@ -170,3 +177,3 @@ return this.set('clearcoatNormalScale', scale);

/** Sets clearcoat normal texture. See {@link getClearcoatNormalTexture}. */
/** Sets clearcoat normal texture. See {@link Clearcoat.getClearcoatNormalTexture getClearcoatNormalTexture}. */
public setClearcoatNormalTexture(texture: Texture | null): this {

@@ -173,0 +180,0 @@ return this.setRef('clearcoatNormalTexture', texture, { channels: R | G | B });

@@ -16,4 +16,2 @@ import { Extension, GLTF, ReaderContext, WriterContext } from '@gltf-transform/core';

/**
* # KHRMaterialsClearcoat
*
* [KHR_materials_clearcoat](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_materials_clearcoat/)

@@ -20,0 +18,0 @@ * defines a clear coating on a glTF PBR material.

@@ -9,4 +9,2 @@ import { ExtensionProperty, IProperty, Nullable, PropertyType } from '@gltf-transform/core';

/**
* # EmissiveStrength
*
* Defines emissive strength for a PBR {@link Material}, allowing high-dynamic-range

@@ -13,0 +11,0 @@ * (HDR) emissive materials. See {@link KHRMaterialsEmissiveStrength}.

@@ -12,4 +12,2 @@ import { Extension, ReaderContext, WriterContext } from '@gltf-transform/core';

/**
* # KHRMaterialsEmissiveStrength
*
* [KHR_materials_emissive_strength](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_materials_emissive_strength/)

@@ -16,0 +14,0 @@ * defines emissive strength and enables high-dynamic-range (HDR) emissive materials.

@@ -9,4 +9,2 @@ import { ExtensionProperty, IProperty, Nullable, PropertyType } from '@gltf-transform/core';

/**
* # IOR
*
* Defines index of refraction for a PBR {@link Material}. See {@link KHRMaterialsIOR}.

@@ -13,0 +11,0 @@ */

@@ -12,4 +12,2 @@ import { Extension, ReaderContext, WriterContext } from '@gltf-transform/core';

/**
* # KHRMaterialsIOR
*
* [KHR_materials_ior](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_materials_ior/)

@@ -16,0 +14,0 @@ * defines index of refraction on a glTF PBR material.

@@ -26,4 +26,2 @@ import {

/**
* # Iridescence
*
* Defines iridescence (thin film interference) on a PBR {@link Material}. See {@link KHRMaterialsIridescence}.

@@ -60,3 +58,3 @@ */

/** Iridescence; linear multiplier. See {@link getIridescenceTexture}. */
/** Iridescence; linear multiplier. See {@link Iridescence.getIridescenceTexture getIridescenceTexture}. */
public getIridescenceFactor(): number {

@@ -66,3 +64,3 @@ return this.get('iridescenceFactor');

/** Iridescence; linear multiplier. See {@link getIridescenceTexture}. */
/** Iridescence; linear multiplier. See {@link Iridescence.getIridescenceTexture getIridescenceTexture}. */
public setIridescenceFactor(factor: number): this {

@@ -90,3 +88,3 @@ return this.set('iridescenceFactor', factor);

/** Iridescence intensity. See {@link getIridescenceTexture}. */
/** Iridescence intensity. See {@link Iridescence.getIridescenceTexture getIridescenceTexture}. */
public setIridescenceTexture(texture: Texture | null): this {

@@ -150,3 +148,6 @@ return this.setRef('iridescenceTexture', texture, { channels: R });

/** Sets iridescence thickness texture. See {@link getIridescenceThicknessTexture}. */
/**
* Sets iridescence thickness texture.
* See {@link Iridescence.getIridescenceThicknessTexture getIridescenceThicknessTexture}.
*/
public setIridescenceThicknessTexture(texture: Texture | null): this {

@@ -153,0 +154,0 @@ return this.setRef('iridescenceThicknessTexture', texture, { channels: G });

@@ -17,4 +17,2 @@ import { Extension, GLTF, ReaderContext, WriterContext } from '@gltf-transform/core';

/**
* # KHRMaterialsIridescence
*
* [`KHR_materials_iridescence`](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_materials_iridescence/)

@@ -21,0 +19,0 @@ * defines iridescence (thin film interference) on a PBR material.

@@ -16,4 +16,2 @@ import { Extension, GLTF, ReaderContext, WriterContext, vec3, vec4 } from '@gltf-transform/core';

/**
* # KHRMaterialsPBRSpecularGlossiness
*
* [`KHR_materials_pbrSpecularGlossiness`](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/)

@@ -20,0 +18,0 @@ * converts a PBR material from the default metal/rough workflow to a spec/gloss workflow.

@@ -28,4 +28,2 @@ import {

/**
* # PBRSpecularGlossiness
*
* Converts a {@link Material} to a spec/gloss workflow. See {@link KHRMaterialsPBRSpecularGlossiness}.

@@ -61,3 +59,3 @@ */

/** Diffuse; Linear-sRGB components. See {@link getDiffuseTexture}. */
/** Diffuse; Linear-sRGB components. See {@link PBRSpecularGlossiness.getDiffuseTexture getDiffuseTexture}. */
public getDiffuseFactor(): vec4 {

@@ -67,3 +65,3 @@ return this.get('diffuseFactor');

/** Diffuse; Linear-sRGB components. See {@link getDiffuseTexture}. */
/** Diffuse; Linear-sRGB components. See {@link PBRSpecularGlossiness.getDiffuseTexture getDiffuseTexture}. */
public setDiffuseFactor(factor: vec4): this {

@@ -100,5 +98,5 @@ return this.set('diffuseFactor', factor);

/** Sets diffuse texture. See {@link getDiffuseTexture}. */
/** Sets diffuse texture. See {@link PBRSpecularGlossiness.getDiffuseTexture getDiffuseTexture}. */
public setDiffuseTexture(texture: Texture | null): this {
return this.setRef('diffuseTexture', texture, { channels: R | G | B | A });
return this.setRef('diffuseTexture', texture, { channels: R | G | B | A, isColor: true });
}

@@ -105,0 +103,0 @@

@@ -15,4 +15,2 @@ import { Extension, GLTF, ReaderContext, WriterContext, vec3 } from '@gltf-transform/core';

/**
* # KHRMaterialsSheen
*
* [`KHR_materials_sheen`](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_sheen/)

@@ -19,0 +17,0 @@ * defines a velvet-like sheen layered on a glTF PBR material.

@@ -26,4 +26,2 @@ import {

/**
* # Sheen
*
* Defines sheen on a PBR {@link Material}. See {@link KHRMaterialsSheen}.

@@ -94,5 +92,5 @@ */

/** Sets sheen color texture. See {@link getSheenColorTexture}. */
/** Sets sheen color texture. See {@link Sheen.getSheenColorTexture getSheenColorTexture}. */
public setSheenColorTexture(texture: Texture | null): this {
return this.setRef('sheenColorTexture', texture, { channels: R | G | B });
return this.setRef('sheenColorTexture', texture, { channels: R | G | B, isColor: true });
}

@@ -104,3 +102,3 @@

/** Sheen roughness; linear multiplier. See {@link getSheenRoughnessTexture}. */
/** Sheen roughness; linear multiplier. See {@link Sheen.getSheenRoughnessTexture getSheenRoughnessTexture}. */
public getSheenRoughnessFactor(): number {

@@ -110,3 +108,3 @@ return this.get('sheenRoughnessFactor');

/** Sheen roughness; linear multiplier. See {@link getSheenRoughnessTexture}. */
/** Sheen roughness; linear multiplier. See {@link Sheen.getSheenRoughnessTexture getSheenRoughnessTexture}. */
public setSheenRoughnessFactor(factor: number): this {

@@ -113,0 +111,0 @@ return this.set('sheenRoughnessFactor', factor);

@@ -15,4 +15,2 @@ import { Extension, GLTF, ReaderContext, WriterContext, vec3, MathUtils } from '@gltf-transform/core';

/**
* # KHRMaterialsSpecular
*
* [`KHR_materials_specular`](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_materials_specular/)

@@ -19,0 +17,0 @@ * adjusts the strength of the specular reflection in the dielectric BRDF.

@@ -26,4 +26,2 @@ import {

/**
* # Specular
*
* Defines specular reflectivity on a PBR {@link Material}. See {@link KHRMaterialsSpecular}.

@@ -58,3 +56,3 @@ */

/** Specular; linear multiplier. See {@link getSpecularTexture}. */
/** Specular; linear multiplier. See {@link Specular.getSpecularTexture getSpecularTexture}. */
public getSpecularFactor(): number {

@@ -64,3 +62,3 @@ return this.get('specularFactor');

/** Specular; linear multiplier. See {@link getSpecularTexture}. */
/** Specular; linear multiplier. See {@link Specular.getSpecularTexture getSpecularTexture}. */
public setSpecularFactor(factor: number): this {

@@ -70,3 +68,3 @@ return this.set('specularFactor', factor);

/** Specular color; Linear-sRGB components. See {@link getSpecularTexture}. */
/** Specular color; Linear-sRGB components. See {@link Specular.getSpecularTexture getSpecularTexture}. */
public getSpecularColorFactor(): vec3 {

@@ -76,3 +74,3 @@ return this.get('specularColorFactor');

/** Specular color; Linear-sRGB components. See {@link getSpecularTexture}. */
/** Specular color; Linear-sRGB components. See {@link Specular.getSpecularTexture getSpecularTexture}. */
public setSpecularColorFactor(factor: vec3): this {

@@ -82,3 +80,3 @@ return this.set('specularColorFactor', factor);

/** Specular color; sRGB hexadecimal color. See {@link getSpecularTexture} */
/** Specular color; sRGB hexadecimal color. See {@link Specular.getSpecularTexture getSpecularTexture} */
public getSpecularColorHex(): number {

@@ -88,3 +86,3 @@ return ColorUtils.factorToHex(this.getSpecularColorFactor());

/** Specular color; sRGB hexadecimal color. See {@link getSpecularTexture} */
/** Specular color; sRGB hexadecimal color. See {@link Specular.getSpecularTexture getSpecularTexture} */
public setSpecularColorHex(hex: number): this {

@@ -115,3 +113,3 @@ const factor = this.getSpecularColorFactor().slice() as vec3;

/** Sets specular texture. See {@link getSpecularTexture}. */
/** Sets specular texture. See {@link Specular.getSpecularTexture getSpecularTexture}. */
public setSpecularTexture(texture: Texture | null): this {

@@ -140,6 +138,6 @@ return this.setRef('specularTexture', texture, { channels: A });

/** Sets specular color texture. See {@link getSpecularColorTexture}. */
/** Sets specular color texture. See {@link Specular.getSpecularColorTexture getSpecularColorTexture}. */
public setSpecularColorTexture(texture: Texture | null): this {
return this.setRef('specularColorTexture', texture, { channels: R | G | B });
return this.setRef('specularColorTexture', texture, { channels: R | G | B, isColor: true });
}
}

@@ -13,4 +13,2 @@ import { Extension, GLTF, ReaderContext, WriterContext } from '@gltf-transform/core';

/**
* # KHRMaterialsTransmission
*
* [`KHR_materials_transmission`](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_materials_transmission/)

@@ -17,0 +15,0 @@ * provides a common type of optical transparency: infinitely-thin materials with no refraction,

@@ -21,4 +21,2 @@ import {

/**
* # Transmission
*
* Defines optical transmission on a PBR {@link Material}. See {@link KHRMaterialsTransmission}.

@@ -50,3 +48,3 @@ */

/** Transmission; linear multiplier. See {@link getTransmissionTexture}. */
/** Transmission; linear multiplier. See {@link Transmission.getTransmissionTexture getTransmissionTexture}. */
public getTransmissionFactor(): number {

@@ -56,3 +54,3 @@ return this.get('transmissionFactor');

/** Transmission; linear multiplier. See {@link getTransmissionTexture}. */
/** Transmission; linear multiplier. See {@link Transmission.getTransmissionTexture getTransmissionTexture}. */
public setTransmissionFactor(factor: number): this {

@@ -80,3 +78,3 @@ return this.set('transmissionFactor', factor);

/** Sets transmission texture. See {@link getTransmissionTexture}. */
/** Sets transmission texture. See {@link Transmission.getTransmissionTexture getTransmissionTexture}. */
public setTransmissionTexture(texture: Texture | null): this {

@@ -83,0 +81,0 @@ return this.setRef('transmissionTexture', texture, { channels: R });

@@ -8,4 +8,2 @@ import { Extension, ReaderContext, WriterContext } from '@gltf-transform/core';

/**
* # KHRMaterialsUnlit
*
* [`KHR_materials_unlit`](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_materials_unlit/)

@@ -12,0 +10,0 @@ * defines an unlit shading model for use in glTF 2.0 materials.

@@ -6,4 +6,2 @@ import { ExtensionProperty } from '@gltf-transform/core';

/**
* # Unlit
*
* Converts a PBR {@link Material} to an unlit shading model. See {@link KHRMaterialsUnlit}.

@@ -10,0 +8,0 @@ */

@@ -10,4 +10,2 @@ import { ExtensionProperty, IProperty, Nullable, PropertyType } from '@gltf-transform/core';

/**
* # MappingList
*
* List of material variant {@link Mapping}s. See {@link KHRMaterialsVariants}.

@@ -14,0 +12,0 @@ */

@@ -11,4 +11,2 @@ import { ExtensionProperty, IProperty, Material, Nullable } from '@gltf-transform/core';

/**
* # Mapping
*
* Maps {@link Variant}s to {@link Material}s. See {@link KHRMaterialsVariants}.

@@ -15,0 +13,0 @@ */

@@ -27,8 +27,6 @@ import { Extension, ReaderContext, WriterContext } from '@gltf-transform/core';

/**
* # KHRMaterialsVariants
*
* [`KHR_materials_variants`](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_variants/)
* defines alternate {@link Material} states for any {@link Primitive} in the scene.
*
* ![Illustration](/media/extensions/khr-materials-variants.png)
* ![Illustration](/media/extensions/khr-materials-variants.jpg)
*

@@ -35,0 +33,0 @@ * > _**Figure:** A sneaker, in three material variants. Source: Khronos Group._

@@ -5,4 +5,2 @@ import { ExtensionProperty } from '@gltf-transform/core';

/**
* # Variant
*
* Defines a variant of a {@link Material}. See {@link KHRMaterialsVariants}.

@@ -9,0 +7,0 @@ */

@@ -15,4 +15,2 @@ import { Extension, GLTF, ReaderContext, WriterContext, vec3, MathUtils } from '@gltf-transform/core';

/**
* # KHRMaterialsVolume
*
* [KHR_materials_volume](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_materials_volume/)

@@ -19,0 +17,0 @@ * adds refraction, absorption, or scattering to a glTF PBR material already using transmission or

@@ -25,4 +25,2 @@ import {

/**
* # Volume
*
* Defines volume on a PBR {@link Material}. See {@link KHRMaterialsVolume}.

@@ -29,0 +27,0 @@ */

@@ -7,4 +7,2 @@ import { Extension, ReaderContext, WriterContext } from '@gltf-transform/core';

/**
* # KHRMeshQuantization
*
* [`KHR_mesh_quantization`](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_mesh_quantization/)

@@ -11,0 +9,0 @@ * expands allowed component types for vertex attributes to include 16- and 8-bit storage.

@@ -74,4 +74,2 @@ import { read as readKTX, KHR_DF_MODEL_ETC1S, KHR_DF_MODEL_UASTC } from 'ktx-parse';

/**
* # KHRTextureBasisu
*
* [`KHR_texture_basisu`](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu)

@@ -111,3 +109,3 @@ * enables KTX2 GPU textures with Basis Universal supercompression for any material texture.

* compress the image data first, then pass the `.ktx2` payload to {@link Texture.setImage}. The
* [glTF-Transform CLI](/cli.html) has functions to help with this, or any similar KTX2-capable
* glTF-Transform CLI has functions to help with this, or any similar KTX2-capable
* utility will work.

@@ -114,0 +112,0 @@ *

@@ -15,4 +15,2 @@ import { Extension, MathUtils, ReaderContext, WriterContext, vec2 } from '@gltf-transform/core';

/**
* # KHRTextureTransform
*
* [`KHR_texture_transform`](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_texture_transform/)

@@ -19,0 +17,0 @@ * adds offset, rotation, and scale to {@link TextureInfo} properties.

@@ -13,4 +13,2 @@ import { ExtensionProperty, IProperty, Nullable, vec2 } from '@gltf-transform/core';

/**
* # Transform
*
* Defines UV transform for a {@link TextureInfo}. See {@link KHRTextureTransform}.

@@ -17,0 +15,0 @@ */

@@ -26,4 +26,2 @@ import { Nullable, PropertyType, ExtensionProperty, IProperty } from '@gltf-transform/core';

/**
* # Packet
*
* Defines an XMP packet associated with a Document or Property. See {@link KHRXMP}.

@@ -30,0 +28,0 @@ */

@@ -39,4 +39,2 @@ import {

/**
* # KHRXMP
*
* [KHR_xmp_json_ld](https://github.com/KhronosGroup/gltf/blob/main/extensions/2.0/Khronos/KHR_xmp_json_ld/)

@@ -43,0 +41,0 @@ * defines XMP metadata associated with a glTF asset.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc