@gltf-transform/functions
Advanced tools
Comparing version 4.0.10 to 4.1.0
@@ -39,2 +39,3 @@ export * from './center.js'; | ||
export * from './transform-primitive.js'; | ||
export * from './uninstance.js'; | ||
export * from './unlit.js'; | ||
@@ -41,0 +42,0 @@ export * from './unpartition.js'; |
@@ -8,3 +8,3 @@ import { Transform } from '@gltf-transform/core'; | ||
/** | ||
* Creates GPU instances (with `EXT_mesh_gpu_instancing`) for shared {@link Mesh} references. In | ||
* Creates GPU instances (with {@link EXTMeshGPUInstancing}) for shared {@link Mesh} references. In | ||
* engines supporting the extension, reused Meshes will be drawn with GPU instancing, greatly | ||
@@ -11,0 +11,0 @@ * reducing draw calls and improving performance in many cases. If you're not sure that identical |
@@ -44,6 +44,37 @@ import { Transform } from '@gltf-transform/core'; | ||
* Quantizes vertex attributes with `KHR_mesh_quantization`, reducing the size and memory footprint | ||
* of the file. | ||
* of the file. Conceptually, quantization refers to snapping values to regular intervals; vertex | ||
* positions are snapped to a 3D grid, UVs to a 2D grid, and so on. When quantized to <= 16 bits, | ||
* larger component types may be more compactly stored as 16-bit or 8-bit attributes. | ||
* | ||
* Often, it can be useful to quantize to precision lower than the maximum allowed by the component | ||
* type. Positions quantized to 14 bits in a 16-bit accessor will occupy 16 bits in VRAM, but they | ||
* can be compressed further for network compression with lossless encodings such as ZSTD. | ||
* | ||
* Vertex positions are shifted into [-1,1] or [0,1] range before quantization. Compensating for | ||
* that shift, a transform is applied to the parent {@link Node}, or inverse bind matrices for a | ||
* {@link Skin} if applicable. Materials using {@link KHRMaterialsVolume} are adjusted to maintain | ||
* appearance. In future releases, UVs may also be transformed with {@link KHRTextureTransform}. | ||
* Currently UVs outside of [0,1] range are not quantized. | ||
* | ||
* In most cases, quantization requires {@link KHRMeshQuantization}; the extension will be added | ||
* automatically when `quantize()` is applied. When applying meshopt compression with | ||
* {@link EXTMeshoptCompression}, quantization is usually applied before compression. | ||
* | ||
* Example: | ||
* | ||
* ```javascript | ||
* import { quantize } from '@gltf-transform/functions'; | ||
* | ||
* await document.transform( | ||
* quantize({ | ||
* quantizePosition: 14, | ||
* quantizeNormal: 10, | ||
* }), | ||
* ); | ||
* ``` | ||
* | ||
* For the inverse operation, see {@link dequantize}. | ||
* | ||
* @category Transforms | ||
*/ | ||
export declare function quantize(_options?: QuantizeOptions): Transform; |
{ | ||
"name": "@gltf-transform/functions", | ||
"version": "4.0.10", | ||
"version": "4.1.0", | ||
"repository": "github:donmccurdy/glTF-Transform", | ||
@@ -38,4 +38,4 @@ "homepage": "https://gltf-transform.dev/functions.html", | ||
"dependencies": { | ||
"@gltf-transform/core": "^4.0.10", | ||
"@gltf-transform/extensions": "^4.0.10", | ||
"@gltf-transform/core": "^4.1.0", | ||
"@gltf-transform/extensions": "^4.1.0", | ||
"ktx-parse": "^0.7.1", | ||
@@ -57,3 +57,3 @@ "ndarray": "^1.0.19", | ||
}, | ||
"gitHead": "fca2821e10f3b6a609a4b5779229b04827fc6a76" | ||
"gitHead": "5cebdbbaf10b2d8d3e2a410ad1360d23dfe4aaff" | ||
} |
@@ -45,2 +45,3 @@ export * from './center.js'; | ||
export * from './transform-primitive.js'; | ||
export * from './uninstance.js'; | ||
export * from './unlit.js'; | ||
@@ -47,0 +48,0 @@ export * from './unpartition.js'; |
@@ -17,3 +17,3 @@ import { Document, ILogger, MathUtils, Mesh, Node, Primitive, Transform, vec3, vec4 } from '@gltf-transform/core'; | ||
/** | ||
* Creates GPU instances (with `EXT_mesh_gpu_instancing`) for shared {@link Mesh} references. In | ||
* Creates GPU instances (with {@link EXTMeshGPUInstancing}) for shared {@link Mesh} references. In | ||
* engines supporting the extension, reused Meshes will be drawn with GPU instancing, greatly | ||
@@ -20,0 +20,0 @@ * reducing draw calls and improving performance in many cases. If you're not sure that identical |
@@ -99,4 +99,35 @@ import { | ||
* Quantizes vertex attributes with `KHR_mesh_quantization`, reducing the size and memory footprint | ||
* of the file. | ||
* of the file. Conceptually, quantization refers to snapping values to regular intervals; vertex | ||
* positions are snapped to a 3D grid, UVs to a 2D grid, and so on. When quantized to <= 16 bits, | ||
* larger component types may be more compactly stored as 16-bit or 8-bit attributes. | ||
* | ||
* Often, it can be useful to quantize to precision lower than the maximum allowed by the component | ||
* type. Positions quantized to 14 bits in a 16-bit accessor will occupy 16 bits in VRAM, but they | ||
* can be compressed further for network compression with lossless encodings such as ZSTD. | ||
* | ||
* Vertex positions are shifted into [-1,1] or [0,1] range before quantization. Compensating for | ||
* that shift, a transform is applied to the parent {@link Node}, or inverse bind matrices for a | ||
* {@link Skin} if applicable. Materials using {@link KHRMaterialsVolume} are adjusted to maintain | ||
* appearance. In future releases, UVs may also be transformed with {@link KHRTextureTransform}. | ||
* Currently UVs outside of [0,1] range are not quantized. | ||
* | ||
* In most cases, quantization requires {@link KHRMeshQuantization}; the extension will be added | ||
* automatically when `quantize()` is applied. When applying meshopt compression with | ||
* {@link EXTMeshoptCompression}, quantization is usually applied before compression. | ||
* | ||
* Example: | ||
* | ||
* ```javascript | ||
* import { quantize } from '@gltf-transform/functions'; | ||
* | ||
* await document.transform( | ||
* quantize({ | ||
* quantizePosition: 14, | ||
* quantizeNormal: 10, | ||
* }), | ||
* ); | ||
* ``` | ||
* | ||
* For the inverse operation, see {@link dequantize}. | ||
* | ||
* @category Transforms | ||
@@ -103,0 +134,0 @@ */ |
@@ -145,5 +145,7 @@ import type { NdArray } from 'ndarray'; | ||
const _longFormatter = new Intl.NumberFormat(undefined, { maximumFractionDigits: 0 }); | ||
/** @hidden */ | ||
export function formatLong(x: number): string { | ||
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','); | ||
return _longFormatter.format(x); | ||
} | ||
@@ -150,0 +152,0 @@ |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2190233
104
22598