@plastic-software/three 0.179.0 → 0.180.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/three.cjs +167 -107
- package/build/three.core.js +112 -20
- package/build/three.core.min.js +1 -1
- package/build/three.module.js +56 -90
- package/build/three.module.min.js +1 -1
- package/build/three.tsl.js +30 -5
- package/build/three.tsl.min.js +1 -1
- package/build/three.webgpu.js +2896 -1048
- package/build/three.webgpu.min.js +1 -1
- package/build/three.webgpu.nodes.js +2896 -1048
- package/build/three.webgpu.nodes.min.js +1 -1
- package/examples/jsm/Addons.js +1 -1
- package/examples/jsm/controls/ArcballControls.js +7 -7
- package/examples/jsm/controls/DragControls.js +6 -56
- package/examples/jsm/controls/FirstPersonControls.js +2 -2
- package/examples/jsm/controls/PointerLockControls.js +0 -8
- package/examples/jsm/exporters/GLTFExporter.js +30 -22
- package/examples/jsm/exporters/KTX2Exporter.js +4 -2
- package/examples/jsm/exporters/PLYExporter.js +1 -1
- package/examples/jsm/libs/ktx-parse.module.js +1 -1
- package/examples/jsm/lines/Line2.js +3 -3
- package/examples/jsm/lines/LineGeometry.js +1 -1
- package/examples/jsm/lines/LineSegments2.js +2 -2
- package/examples/jsm/lines/Wireframe.js +2 -2
- package/examples/jsm/lines/WireframeGeometry2.js +1 -1
- package/examples/jsm/lines/webgpu/LineSegments2.js +1 -1
- package/examples/jsm/lines/webgpu/Wireframe.js +1 -1
- package/examples/jsm/loaders/ColladaLoader.js +1 -1
- package/examples/jsm/loaders/EXRLoader.js +5 -5
- package/examples/jsm/loaders/GLTFLoader.js +9 -5
- package/examples/jsm/loaders/HDRCubeTextureLoader.js +5 -5
- package/examples/jsm/loaders/HDRLoader.js +486 -0
- package/examples/jsm/loaders/KTX2Loader.js +112 -32
- package/examples/jsm/loaders/RGBELoader.js +7 -473
- package/examples/jsm/loaders/TTFLoader.js +4 -4
- package/examples/jsm/loaders/UltraHDRLoader.js +1 -1
- package/examples/jsm/loaders/lwo/IFFParser.js +1 -1
- package/examples/jsm/materials/WoodNodeMaterial.js +533 -0
- package/examples/jsm/math/ColorSpaces.js +19 -1
- package/examples/jsm/math/ConvexHull.js +2 -2
- package/examples/jsm/math/Lut.js +2 -2
- package/examples/jsm/misc/MD2CharacterComplex.js +1 -1
- package/examples/jsm/misc/ProgressiveLightMap.js +1 -1
- package/examples/jsm/misc/Volume.js +1 -1
- package/examples/jsm/postprocessing/OutlinePass.js +1 -1
- package/examples/jsm/postprocessing/SSRPass.js +37 -8
- package/examples/jsm/shaders/UnpackDepthRGBAShader.js +1 -1
- package/examples/jsm/transpiler/GLSLDecoder.js +22 -19
- package/examples/jsm/transpiler/TSLEncoder.js +2 -10
- package/examples/jsm/transpiler/WGSLEncoder.js +24 -0
- package/examples/jsm/tsl/display/AnamorphicNode.js +27 -4
- package/examples/jsm/tsl/display/BloomNode.js +3 -3
- package/examples/jsm/tsl/display/ChromaticAberrationNode.js +2 -1
- package/examples/jsm/tsl/display/DepthOfFieldNode.js +439 -90
- package/examples/jsm/tsl/display/GTAONode.js +8 -0
- package/examples/jsm/tsl/display/GaussianBlurNode.js +47 -35
- package/examples/jsm/tsl/display/OutlineNode.js +2 -2
- package/examples/jsm/tsl/display/SSRNode.js +180 -65
- package/examples/jsm/tsl/display/TRAANode.js +1 -1
- package/examples/jsm/tsl/display/boxBlur.js +64 -0
- package/examples/jsm/tsl/display/hashBlur.js +15 -18
- package/examples/jsm/utils/BufferGeometryUtils.js +1 -1
- package/examples/jsm/utils/ShadowMapViewerGPU.js +12 -5
- package/examples/jsm/webxr/OculusHandModel.js +1 -1
- package/package.json +1 -1
- package/src/Three.Core.js +1 -0
- package/src/Three.TSL.js +29 -4
- package/src/animation/AnimationClip.js +17 -2
- package/src/constants.js +11 -3
- package/src/core/BufferGeometry.js +2 -2
- package/src/extras/TextureUtils.js +2 -1
- package/src/extras/lib/earcut.js +1 -1
- package/src/lights/webgpu/ProjectorLight.js +1 -1
- package/src/materials/Material.js +12 -0
- package/src/materials/MeshDistanceMaterial.js +1 -1
- package/src/materials/nodes/PointsNodeMaterial.js +81 -28
- package/src/materials/nodes/SpriteNodeMaterial.js +3 -15
- package/src/materials/nodes/manager/NodeMaterialObserver.js +1 -1
- package/src/math/ColorManagement.js +7 -1
- package/src/nodes/Nodes.js +3 -0
- package/src/nodes/TSL.js +3 -0
- package/src/nodes/accessors/BufferNode.js +1 -1
- package/src/nodes/accessors/Camera.js +133 -7
- package/src/nodes/accessors/ClippingNode.js +6 -5
- package/src/nodes/accessors/CubeTextureNode.js +2 -2
- package/src/nodes/accessors/InstanceNode.js +3 -1
- package/src/nodes/accessors/Object3DNode.js +1 -1
- package/src/nodes/accessors/ReferenceBaseNode.js +1 -1
- package/src/nodes/accessors/ReferenceNode.js +1 -1
- package/src/nodes/accessors/Texture3DNode.js +13 -0
- package/src/nodes/accessors/TextureNode.js +71 -19
- package/src/nodes/code/FunctionCallNode.js +19 -0
- package/src/nodes/code/FunctionNode.js +23 -0
- package/src/nodes/core/AssignNode.js +4 -3
- package/src/nodes/core/ContextNode.js +24 -0
- package/src/nodes/core/Node.js +16 -20
- package/src/nodes/core/NodeBuilder.js +48 -14
- package/src/nodes/core/NodeFrame.js +1 -1
- package/src/nodes/core/NodeUniform.js +1 -1
- package/src/nodes/core/NodeUtils.js +1 -2
- package/src/nodes/core/StackNode.js +29 -4
- package/src/nodes/core/StructNode.js +5 -5
- package/src/nodes/core/StructTypeNode.js +1 -0
- package/src/nodes/core/SubBuildNode.js +2 -2
- package/src/nodes/core/UniformNode.js +16 -9
- package/src/nodes/core/VarNode.js +0 -21
- package/src/nodes/display/FrontFacingNode.js +4 -8
- package/src/nodes/display/PassNode.js +1 -1
- package/src/nodes/display/ScreenNode.js +42 -13
- package/src/nodes/display/ViewportDepthTextureNode.js +16 -4
- package/src/nodes/display/ViewportSharedTextureNode.js +12 -0
- package/src/nodes/display/ViewportTextureNode.js +42 -12
- package/src/nodes/gpgpu/SubgroupFunctionNode.js +430 -0
- package/src/nodes/lighting/LightsNode.js +1 -1
- package/src/nodes/math/BitcastNode.js +156 -0
- package/src/nodes/math/ConditionalNode.js +18 -2
- package/src/nodes/math/MathNode.js +3 -15
- package/src/nodes/math/OperatorNode.js +4 -3
- package/src/nodes/tsl/TSLCore.js +432 -152
- package/src/nodes/utils/JoinNode.js +3 -1
- package/src/nodes/utils/MemberNode.js +58 -7
- package/src/nodes/utils/RTTNode.js +1 -1
- package/src/nodes/utils/ReflectorNode.js +51 -7
- package/src/nodes/utils/SampleNode.js +12 -2
- package/src/nodes/utils/SplitNode.js +11 -0
- package/src/nodes/utils/Timer.js +0 -47
- package/src/objects/BatchedMesh.js +2 -2
- package/src/objects/LOD.js +1 -1
- package/src/objects/Sprite.js +2 -2
- package/src/renderers/WebGLRenderer.js +1 -10
- package/src/renderers/common/Attributes.js +1 -1
- package/src/renderers/common/Backend.js +19 -1
- package/src/renderers/common/Bindings.js +2 -0
- package/src/renderers/common/ChainMap.js +1 -1
- package/src/renderers/common/DataMap.js +1 -1
- package/src/renderers/common/Pipelines.js +1 -1
- package/src/renderers/common/RenderContext.js +2 -2
- package/src/renderers/common/RenderObject.js +14 -2
- package/src/renderers/common/Renderer.js +39 -19
- package/src/renderers/common/SampledTexture.js +1 -1
- package/src/renderers/common/Sampler.js +25 -13
- package/src/renderers/common/Textures.js +34 -12
- package/src/renderers/common/TimestampQueryPool.js +3 -3
- package/src/renderers/common/XRManager.js +35 -19
- package/src/renderers/common/nodes/NodeBuilderState.js +1 -1
- package/src/renderers/common/nodes/NodeLibrary.js +5 -5
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_pars_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +7 -15
- package/src/renderers/shaders/ShaderLib/depth.glsl.js +1 -1
- package/src/renderers/webgl/WebGLProgram.js +4 -4
- package/src/renderers/webgl/WebGLShadowMap.js +1 -1
- package/src/renderers/webgl/WebGLTextures.js +1 -0
- package/src/renderers/webgl/WebGLUtils.js +3 -2
- package/src/renderers/webgl-fallback/WebGLBackend.js +186 -135
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +110 -17
- package/src/renderers/webgl-fallback/utils/WebGLState.js +1 -1
- package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +52 -3
- package/src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js +9 -10
- package/src/renderers/webgl-fallback/utils/WebGLUtils.js +3 -2
- package/src/renderers/webgpu/WebGPUBackend.js +35 -31
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +124 -34
- package/src/renderers/webgpu/utils/WebGPUConstants.js +2 -2
- package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +9 -18
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +114 -25
- package/src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js +3 -3
- package/src/renderers/webxr/WebXRManager.js +39 -24
- package/src/textures/ExternalTexture.js +15 -4
- package/src/textures/Source.js +1 -1
- package/src/textures/VideoTexture.js +0 -3
- package/examples/jsm/loaders/RGBMLoader.js +0 -1148
package/examples/jsm/Addons.js
CHANGED
|
@@ -89,6 +89,7 @@ export * from './loaders/FBXLoader.js';
|
|
|
89
89
|
export * from './loaders/FontLoader.js';
|
|
90
90
|
export * from './loaders/GCodeLoader.js';
|
|
91
91
|
export * from './loaders/GLTFLoader.js';
|
|
92
|
+
export * from './loaders/HDRLoader.js';
|
|
92
93
|
export * from './loaders/HDRCubeTextureLoader.js';
|
|
93
94
|
export * from './loaders/IESLoader.js';
|
|
94
95
|
export * from './loaders/KMZLoader.js';
|
|
@@ -110,7 +111,6 @@ export * from './loaders/PLYLoader.js';
|
|
|
110
111
|
export * from './loaders/PVRLoader.js';
|
|
111
112
|
export * from './loaders/RGBELoader.js';
|
|
112
113
|
export * from './loaders/UltraHDRLoader.js';
|
|
113
|
-
export * from './loaders/RGBMLoader.js';
|
|
114
114
|
export * from './loaders/STLLoader.js';
|
|
115
115
|
export * from './loaders/SVGLoader.js';
|
|
116
116
|
export * from './loaders/TDSLoader.js';
|
|
@@ -1315,7 +1315,7 @@ class ArcballControls extends Controls {
|
|
|
1315
1315
|
*
|
|
1316
1316
|
* @param {'PAN'|'ROTATE'|'ZOOM'|'FOV'} operation - The operation to be performed ('PAN', 'ROTATE', 'ZOOM', 'FOV').
|
|
1317
1317
|
* @param {0|1|2|'WHEEL'} mouse - A mouse button (0, 1, 2) or 'WHEEL' for wheel notches.
|
|
1318
|
-
* @param {'CTRL'|'SHIFT'
|
|
1318
|
+
* @param {?('CTRL'|'SHIFT')} [key=null] - The keyboard modifier ('CTRL', 'SHIFT') or null if key is not needed.
|
|
1319
1319
|
* @returns {boolean} `true` if the mouse action has been successfully added, `false` otherwise.
|
|
1320
1320
|
*/
|
|
1321
1321
|
setMouseAction( operation, mouse, key = null ) {
|
|
@@ -1396,7 +1396,7 @@ class ArcballControls extends Controls {
|
|
|
1396
1396
|
* Remove a mouse action by specifying its mouse/key combination.
|
|
1397
1397
|
*
|
|
1398
1398
|
* @param {0|1|2|'WHEEL'} mouse - A mouse button (0, 1, 2) or 'WHEEL' for wheel notches.
|
|
1399
|
-
* @param {'CTRL'|'SHIFT'
|
|
1399
|
+
* @param {?('CTRL'|'SHIFT')} key - The keyboard modifier ('CTRL', 'SHIFT') or null if key is not needed.
|
|
1400
1400
|
* @returns {boolean} `true` if the operation has been successfully removed, `false` otherwise.
|
|
1401
1401
|
*/
|
|
1402
1402
|
unsetMouseAction( mouse, key = null ) {
|
|
@@ -1421,8 +1421,8 @@ class ArcballControls extends Controls {
|
|
|
1421
1421
|
*
|
|
1422
1422
|
* @private
|
|
1423
1423
|
* @param {0|1|2|'WHEEL'} mouse - Mouse button index (0, 1, 2) or 'WHEEL' for wheel notches.
|
|
1424
|
-
* @param {'CTRL'|'SHIFT'
|
|
1425
|
-
* @returns {'PAN'|'ROTATE'|'ZOOM'|'FOV'
|
|
1424
|
+
* @param {?('CTRL'|'SHIFT')} key - Keyboard modifier.
|
|
1425
|
+
* @returns {?('PAN'|'ROTATE'|'ZOOM'|'FOV')} The operation if it has been found, `null` otherwise.
|
|
1426
1426
|
*/
|
|
1427
1427
|
getOpFromAction( mouse, key ) {
|
|
1428
1428
|
|
|
@@ -1463,7 +1463,7 @@ class ArcballControls extends Controls {
|
|
|
1463
1463
|
*
|
|
1464
1464
|
* @private
|
|
1465
1465
|
* @param {0|1|2} mouse - Mouse button index (0, 1, 2)
|
|
1466
|
-
* @param {'CTRL'|'SHIFT'
|
|
1466
|
+
* @param {?('CTRL'|'SHIFT')} key - Keyboard modifier
|
|
1467
1467
|
* @returns {?STATE} The FSA state obtained from the operation associated to mouse/keyboard combination.
|
|
1468
1468
|
*/
|
|
1469
1469
|
getOpStateFromAction( mouse, key ) {
|
|
@@ -2509,8 +2509,8 @@ class ArcballControls extends Controls {
|
|
|
2509
2509
|
* Sets values in transformation object.
|
|
2510
2510
|
*
|
|
2511
2511
|
* @private
|
|
2512
|
-
* @param {Matrix4} [camera=null] - Transformation to be applied to the camera.
|
|
2513
|
-
* @param {Matrix4} [gizmos=null] - Transformation to be applied to gizmos.
|
|
2512
|
+
* @param {?Matrix4} [camera=null] - Transformation to be applied to the camera.
|
|
2513
|
+
* @param {?Matrix4} [gizmos=null] - Transformation to be applied to gizmos.
|
|
2514
2514
|
*/
|
|
2515
2515
|
setTransformationMatrices( camera = null, gizmos = null ) {
|
|
2516
2516
|
|
|
@@ -234,56 +234,6 @@ class DragControls extends Controls {
|
|
|
234
234
|
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
-
getRaycaster() {
|
|
238
|
-
|
|
239
|
-
console.warn( 'THREE.DragControls: getRaycaster() has been deprecated. Use controls.raycaster instead.' ); // @deprecated r169
|
|
240
|
-
|
|
241
|
-
return this.raycaster;
|
|
242
|
-
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
setObjects( objects ) {
|
|
246
|
-
|
|
247
|
-
console.warn( 'THREE.DragControls: setObjects() has been deprecated. Use controls.objects instead.' ); // @deprecated r169
|
|
248
|
-
|
|
249
|
-
this.objects = objects;
|
|
250
|
-
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
getObjects() {
|
|
254
|
-
|
|
255
|
-
console.warn( 'THREE.DragControls: getObjects() has been deprecated. Use controls.objects instead.' ); // @deprecated r169
|
|
256
|
-
|
|
257
|
-
return this.objects;
|
|
258
|
-
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
activate() {
|
|
262
|
-
|
|
263
|
-
console.warn( 'THREE.DragControls: activate() has been renamed to connect().' ); // @deprecated r169
|
|
264
|
-
this.connect();
|
|
265
|
-
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
deactivate() {
|
|
269
|
-
|
|
270
|
-
console.warn( 'THREE.DragControls: deactivate() has been renamed to disconnect().' ); // @deprecated r169
|
|
271
|
-
this.disconnect();
|
|
272
|
-
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
set mode( value ) {
|
|
276
|
-
|
|
277
|
-
console.warn( 'THREE.DragControls: The .mode property has been removed. Define the type of transformation via the .mouseButtons or .touches properties.' ); // @deprecated r169
|
|
278
|
-
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
get mode() {
|
|
282
|
-
|
|
283
|
-
console.warn( 'THREE.DragControls: The .mode property has been removed. Define the type of transformation via the .mouseButtons or .touches properties.' ); // @deprecated r169
|
|
284
|
-
|
|
285
|
-
}
|
|
286
|
-
|
|
287
237
|
}
|
|
288
238
|
|
|
289
239
|
function onPointerMove( event ) {
|
|
@@ -305,6 +255,7 @@ function onPointerMove( event ) {
|
|
|
305
255
|
if ( raycaster.ray.intersectPlane( _plane, _intersection ) ) {
|
|
306
256
|
|
|
307
257
|
_selected.position.copy( _intersection.sub( _offset ).applyMatrix4( _inverseMatrix ) );
|
|
258
|
+
this.dispatchEvent( { type: 'drag', object: _selected } );
|
|
308
259
|
|
|
309
260
|
}
|
|
310
261
|
|
|
@@ -313,11 +264,10 @@ function onPointerMove( event ) {
|
|
|
313
264
|
_diff.subVectors( _pointer, _previousPointer ).multiplyScalar( this.rotateSpeed );
|
|
314
265
|
_selected.rotateOnWorldAxis( _up, _diff.x );
|
|
315
266
|
_selected.rotateOnWorldAxis( _right.normalize(), - _diff.y );
|
|
267
|
+
this.dispatchEvent( { type: 'drag', object: _selected } );
|
|
316
268
|
|
|
317
269
|
}
|
|
318
270
|
|
|
319
|
-
this.dispatchEvent( { type: 'drag', object: _selected } );
|
|
320
|
-
|
|
321
271
|
_previousPointer.copy( _pointer );
|
|
322
272
|
|
|
323
273
|
} else {
|
|
@@ -414,21 +364,21 @@ function onPointerDown( event ) {
|
|
|
414
364
|
|
|
415
365
|
_inverseMatrix.copy( _selected.parent.matrixWorld ).invert();
|
|
416
366
|
_offset.copy( _intersection ).sub( _worldPosition.setFromMatrixPosition( _selected.matrixWorld ) );
|
|
367
|
+
domElement.style.cursor = 'move';
|
|
368
|
+
this.dispatchEvent( { type: 'dragstart', object: _selected } );
|
|
417
369
|
|
|
418
370
|
} else if ( this.state === STATE.ROTATE ) {
|
|
419
371
|
|
|
420
372
|
// the controls only support Y+ up
|
|
421
373
|
_up.set( 0, 1, 0 ).applyQuaternion( camera.quaternion ).normalize();
|
|
422
374
|
_right.set( 1, 0, 0 ).applyQuaternion( camera.quaternion ).normalize();
|
|
375
|
+
domElement.style.cursor = 'move';
|
|
376
|
+
this.dispatchEvent( { type: 'dragstart', object: _selected } );
|
|
423
377
|
|
|
424
378
|
}
|
|
425
379
|
|
|
426
380
|
}
|
|
427
381
|
|
|
428
|
-
domElement.style.cursor = 'move';
|
|
429
|
-
|
|
430
|
-
this.dispatchEvent( { type: 'dragstart', object: _selected } );
|
|
431
|
-
|
|
432
382
|
}
|
|
433
383
|
|
|
434
384
|
_previousPointer.copy( _pointer );
|
|
@@ -194,8 +194,8 @@ class FirstPersonControls extends Controls {
|
|
|
194
194
|
window.removeEventListener( 'keydown', this._onKeyDown );
|
|
195
195
|
window.removeEventListener( 'keyup', this._onKeyUp );
|
|
196
196
|
|
|
197
|
-
this.domElement.removeEventListener( '
|
|
198
|
-
this.domElement.removeEventListener( '
|
|
197
|
+
this.domElement.removeEventListener( 'pointermove', this._onPointerMove );
|
|
198
|
+
this.domElement.removeEventListener( 'pointerdown', this._onPointerDown );
|
|
199
199
|
this.domElement.removeEventListener( 'pointerup', this._onPointerUp );
|
|
200
200
|
this.domElement.removeEventListener( 'contextmenu', this._onContextMenu );
|
|
201
201
|
|
|
@@ -141,14 +141,6 @@ class PointerLockControls extends Controls {
|
|
|
141
141
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
getObject() {
|
|
145
|
-
|
|
146
|
-
console.warn( 'THREE.PointerLockControls: getObject() has been deprecated. Use controls.object instead.' ); // @deprecated r169
|
|
147
|
-
|
|
148
|
-
return this.object;
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
|
|
152
144
|
/**
|
|
153
145
|
* Returns the look direction of the camera.
|
|
154
146
|
*
|
|
@@ -543,32 +543,36 @@ function getCanvas() {
|
|
|
543
543
|
|
|
544
544
|
function getToBlobPromise( canvas, mimeType ) {
|
|
545
545
|
|
|
546
|
-
if (
|
|
546
|
+
if ( typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas ) {
|
|
547
547
|
|
|
548
|
-
|
|
548
|
+
let quality;
|
|
549
549
|
|
|
550
|
-
|
|
550
|
+
// Blink's implementation of convertToBlob seems to default to a quality level of 100%
|
|
551
|
+
// Use the Blink default quality levels of toBlob instead so that file sizes are comparable.
|
|
552
|
+
if ( mimeType === 'image/jpeg' ) {
|
|
551
553
|
|
|
552
|
-
|
|
554
|
+
quality = 0.92;
|
|
553
555
|
|
|
554
|
-
|
|
555
|
-
// Use the Blink default quality levels of toBlob instead so that file sizes are comparable.
|
|
556
|
-
if ( mimeType === 'image/jpeg' ) {
|
|
556
|
+
} else if ( mimeType === 'image/webp' ) {
|
|
557
557
|
|
|
558
|
-
|
|
558
|
+
quality = 0.8;
|
|
559
559
|
|
|
560
|
-
|
|
560
|
+
}
|
|
561
561
|
|
|
562
|
-
|
|
562
|
+
return canvas.convertToBlob( {
|
|
563
563
|
|
|
564
|
-
|
|
564
|
+
type: mimeType,
|
|
565
|
+
quality: quality
|
|
565
566
|
|
|
566
|
-
|
|
567
|
+
} );
|
|
567
568
|
|
|
568
|
-
|
|
569
|
-
quality: quality
|
|
569
|
+
} else {
|
|
570
570
|
|
|
571
|
-
|
|
571
|
+
// HTMLCanvasElement code path
|
|
572
|
+
|
|
573
|
+
return new Promise( ( resolve ) => canvas.toBlob( resolve, mimeType ) );
|
|
574
|
+
|
|
575
|
+
}
|
|
572
576
|
|
|
573
577
|
}
|
|
574
578
|
|
|
@@ -757,7 +761,7 @@ class GLTFWriter {
|
|
|
757
761
|
/**
|
|
758
762
|
* Serializes a userData.
|
|
759
763
|
*
|
|
760
|
-
* @param {THREE.Object3D|THREE.Material} object
|
|
764
|
+
* @param {THREE.Object3D|THREE.Material|THREE.BufferGeometry|THREE.AnimationClip} object
|
|
761
765
|
* @param {Object} objectDef
|
|
762
766
|
*/
|
|
763
767
|
serializeUserData( object, objectDef ) {
|
|
@@ -1555,7 +1559,7 @@ class GLTFWriter {
|
|
|
1555
1559
|
/**
|
|
1556
1560
|
* Process material
|
|
1557
1561
|
* @param {THREE.Material} material Material to process
|
|
1558
|
-
* @return {Promise
|
|
1562
|
+
* @return {Promise<?number>} Index of the processed material in the "materials" array
|
|
1559
1563
|
*/
|
|
1560
1564
|
async processMaterialAsync( material ) {
|
|
1561
1565
|
|
|
@@ -1731,7 +1735,7 @@ class GLTFWriter {
|
|
|
1731
1735
|
/**
|
|
1732
1736
|
* Process mesh
|
|
1733
1737
|
* @param {THREE.Mesh} mesh Mesh to process
|
|
1734
|
-
* @return {Promise
|
|
1738
|
+
* @return {Promise<?number>} Index of the processed mesh in the "meshes" array
|
|
1735
1739
|
*/
|
|
1736
1740
|
async processMeshAsync( mesh ) {
|
|
1737
1741
|
|
|
@@ -2185,7 +2189,7 @@ class GLTFWriter {
|
|
|
2185
2189
|
*
|
|
2186
2190
|
* @param {THREE.AnimationClip} clip
|
|
2187
2191
|
* @param {THREE.Object3D} root
|
|
2188
|
-
* @return {number
|
|
2192
|
+
* @return {?number}
|
|
2189
2193
|
*/
|
|
2190
2194
|
processAnimation( clip, root ) {
|
|
2191
2195
|
|
|
@@ -2279,11 +2283,15 @@ class GLTFWriter {
|
|
|
2279
2283
|
|
|
2280
2284
|
}
|
|
2281
2285
|
|
|
2282
|
-
|
|
2286
|
+
const animationDef = {
|
|
2283
2287
|
name: clip.name || 'clip_' + json.animations.length,
|
|
2284
2288
|
samplers: samplers,
|
|
2285
2289
|
channels: channels
|
|
2286
|
-
}
|
|
2290
|
+
};
|
|
2291
|
+
|
|
2292
|
+
this.serializeUserData( clip, animationDef );
|
|
2293
|
+
|
|
2294
|
+
json.animations.push( animationDef );
|
|
2287
2295
|
|
|
2288
2296
|
return json.animations.length - 1;
|
|
2289
2297
|
|
|
@@ -2291,7 +2299,7 @@ class GLTFWriter {
|
|
|
2291
2299
|
|
|
2292
2300
|
/**
|
|
2293
2301
|
* @param {THREE.Object3D} object
|
|
2294
|
-
* @return {number
|
|
2302
|
+
* @return {?number}
|
|
2295
2303
|
*/
|
|
2296
2304
|
processSkin( object ) {
|
|
2297
2305
|
|
|
@@ -17,8 +17,8 @@ import {
|
|
|
17
17
|
} from 'three';
|
|
18
18
|
|
|
19
19
|
import {
|
|
20
|
+
createDefaultContainer,
|
|
20
21
|
write,
|
|
21
|
-
KTX2Container,
|
|
22
22
|
KHR_DF_CHANNEL_RGBSDA_ALPHA,
|
|
23
23
|
KHR_DF_CHANNEL_RGBSDA_BLUE,
|
|
24
24
|
KHR_DF_CHANNEL_RGBSDA_GREEN,
|
|
@@ -191,7 +191,7 @@ export class KTX2Exporter {
|
|
|
191
191
|
|
|
192
192
|
const array = texture.image.data;
|
|
193
193
|
const channelCount = getChannelCount( texture );
|
|
194
|
-
const container =
|
|
194
|
+
const container = createDefaultContainer();
|
|
195
195
|
|
|
196
196
|
container.vkFormat = VK_FORMAT_MAP[ texture.format ][ texture.type ][ texture.colorSpace ];
|
|
197
197
|
container.typeSize = array.BYTES_PER_ELEMENT;
|
|
@@ -257,6 +257,8 @@ export class KTX2Exporter {
|
|
|
257
257
|
|
|
258
258
|
//
|
|
259
259
|
|
|
260
|
+
container.levelCount = 1;
|
|
261
|
+
|
|
260
262
|
container.levels = [ {
|
|
261
263
|
|
|
262
264
|
levelData: new Uint8Array( array.buffer, array.byteOffset, array.byteLength ),
|
|
@@ -31,7 +31,7 @@ class PLYExporter {
|
|
|
31
31
|
* @param {Object3D} object - The 3D object to export.
|
|
32
32
|
* @param {PLYExporter~OnDone} onDone - A callback function that is executed when the export has finished.
|
|
33
33
|
* @param {PLYExporter~Options} options - The export options.
|
|
34
|
-
* @return {?string|ArrayBuffer} The exported PLY.
|
|
34
|
+
* @return {?(string|ArrayBuffer)} The exported PLY.
|
|
35
35
|
*/
|
|
36
36
|
parse( object, onDone, options = {} ) {
|
|
37
37
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=0,e=1,n=2,i=3,s=0,a=0,r=2,o=0,l=1,f=160,h=161,U=162,c=163,_=166,p=0,g=1,y=0,x=1,u=2,b=3,d=4,w=5,m=6,D=7,B=8,L=9,v=10,A=11,k=12,V=13,I=14,S=15,F=16,O=17,E=18,T=0,C=1,M=2,P=3,z=4,W=5,H=6,N=7,K=8,X=9,R=10,Y=11,j=0,q=1,G=2,J=13,Q=14,Z=15,$=128,tt=64,et=32,nt=16,it=0,st=1,at=2,rt=3,ot=4,lt=5,ft=6,ht=7,Ut=8,ct=9,_t=10,pt=13,gt=14,yt=15,xt=16,ut=17,bt=20,dt=21,wt=22,mt=23,Dt=24,Bt=27,Lt=28,vt=29,At=30,kt=31,Vt=34,It=35,St=36,Ft=37,Ot=38,Et=41,Tt=42,Ct=43,Mt=44,Pt=45,zt=48,Wt=49,Ht=50,Nt=58,Kt=59,Xt=62,Rt=63,Yt=64,jt=65,qt=68,Gt=69,Jt=70,Qt=71,Zt=74,$t=75,te=76,ee=77,ne=78,ie=81,se=82,ae=83,re=84,oe=85,le=88,fe=89,he=90,Ue=91,ce=92,_e=95,pe=96,ge=97,ye=98,xe=99,ue=100,be=101,de=102,we=103,me=104,De=105,Be=106,Le=107,ve=108,Ae=109,ke=110,Ve=111,Ie=112,Se=113,Fe=114,Oe=115,Ee=116,Te=117,Ce=118,Me=119,Pe=120,ze=121,We=122,He=123,Ne=124,Ke=125,Xe=126,Re=127,Ye=128,je=129,qe=130,Ge=131,Je=132,Qe=133,Ze=134,$e=135,tn=136,en=137,nn=138,sn=139,an=140,rn=141,on=142,ln=143,fn=144,hn=145,Un=146,cn=147,_n=148,pn=149,gn=150,yn=151,xn=152,un=153,bn=154,dn=155,wn=156,mn=157,Dn=158,Bn=159,Ln=160,vn=161,An=162,kn=163,Vn=164,In=165,Sn=166,Fn=167,On=168,En=169,Tn=170,Cn=171,Mn=172,Pn=173,zn=174,Wn=175,Hn=176,Nn=177,Kn=178,Xn=179,Rn=180,Yn=181,jn=182,qn=183,Gn=184,Jn=1000156007,Qn=1000156008,Zn=1000156009,$n=1000156010,ti=1000156011,ei=1000156017,ni=1000156018,ii=1000156019,si=1000156020,ai=1000156021,ri=1000054e3,oi=1000054001,li=1000054002,fi=1000054003,hi=1000054004,Ui=1000054005,ci=1000054006,_i=1000054007,pi=1000066e3,gi=1000066001,yi=1000066002,xi=1000066003,ui=1000066004,bi=1000066005,di=1000066006,wi=1000066007,mi=1000066008,Di=1000066009,Bi=1000066010,Li=1000066011,vi=1000066012,Ai=1000066013,ki=100034e4,Vi=1000340001;class Ii{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class Si{constructor(t,e,n,i){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(t.buffer,t.byteOffset+e,n),this._littleEndian=i,this._offset=0}_nextUint8(){const t=this._dataView.getUint8(this._offset);return this._offset+=1,t}_nextUint16(){const t=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,t}_nextUint32(){const t=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,t}_nextUint64(){const t=this._dataView.getUint32(this._offset,this._littleEndian)+2**32*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,t}_nextInt32(){const t=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,t}_nextUint8Array(t){const e=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,t);return this._offset+=t,e}_skip(t){return this._offset+=t,this}_scan(t,e){void 0===e&&(e=0);const n=this._offset;let i=0;for(;this._dataView.getUint8(this._offset)!==e&&i<t;)i++,this._offset++;return i<t&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,i)}}const Fi=new Uint8Array([0]),Oi=[171,75,84,88,32,50,48,187,13,10,26,10];function Ei(t){return(new TextEncoder).encode(t)}function Ti(t){return(new TextDecoder).decode(t)}function Ci(t){let e=0;for(const n of t)e+=n.byteLength;const n=new Uint8Array(e);let i=0;for(const e of t)n.set(new Uint8Array(e),i),i+=e.byteLength;return n}function Mi(t,e){return void 0===e&&(e=4),Math.ceil(t/e)*e-t}function Pi(t){const e=new Uint8Array(t.buffer,t.byteOffset,Oi.length);if(e[0]!==Oi[0]||e[1]!==Oi[1]||e[2]!==Oi[2]||e[3]!==Oi[3]||e[4]!==Oi[4]||e[5]!==Oi[5]||e[6]!==Oi[6]||e[7]!==Oi[7]||e[8]!==Oi[8]||e[9]!==Oi[9]||e[10]!==Oi[10]||e[11]!==Oi[11])throw new Error("Missing KTX 2.0 identifier.");const n=new Ii,i=17*Uint32Array.BYTES_PER_ELEMENT,s=new Si(t,Oi.length,i,!0);n.vkFormat=s._nextUint32(),n.typeSize=s._nextUint32(),n.pixelWidth=s._nextUint32(),n.pixelHeight=s._nextUint32(),n.pixelDepth=s._nextUint32(),n.layerCount=s._nextUint32(),n.faceCount=s._nextUint32();const a=s._nextUint32();n.supercompressionScheme=s._nextUint32();const r=s._nextUint32(),o=s._nextUint32(),l=s._nextUint32(),f=s._nextUint32(),h=s._nextUint64(),U=s._nextUint64(),c=new Si(t,Oi.length+i,3*a*8,!0);for(let e=0;e<a;e++)n.levels.push({levelData:new Uint8Array(t.buffer,t.byteOffset+c._nextUint64(),c._nextUint64()),uncompressedByteLength:c._nextUint64()});const _=new Si(t,r,o,!0),p={vendorId:_._skip(4)._nextUint16(),descriptorType:_._nextUint16(),versionNumber:_._nextUint16(),descriptorBlockSize:_._nextUint16(),colorModel:_._nextUint8(),colorPrimaries:_._nextUint8(),transferFunction:_._nextUint8(),flags:_._nextUint8(),texelBlockDimension:[_._nextUint8(),_._nextUint8(),_._nextUint8(),_._nextUint8()],bytesPlane:[_._nextUint8(),_._nextUint8(),_._nextUint8(),_._nextUint8(),_._nextUint8(),_._nextUint8(),_._nextUint8(),_._nextUint8()],samples:[]},g=(p.descriptorBlockSize/4-6)/4;for(let t=0;t<g;t++){const e={bitOffset:_._nextUint16(),bitLength:_._nextUint8(),channelType:_._nextUint8(),samplePosition:[_._nextUint8(),_._nextUint8(),_._nextUint8(),_._nextUint8()],sampleLower:-Infinity,sampleUpper:Infinity};64&e.channelType?(e.sampleLower=_._nextInt32(),e.sampleUpper=_._nextInt32()):(e.sampleLower=_._nextUint32(),e.sampleUpper=_._nextUint32()),p.samples[t]=e}n.dataFormatDescriptor.length=0,n.dataFormatDescriptor.push(p);const y=new Si(t,l,f,!0);for(;y._offset<f;){const t=y._nextUint32(),e=y._scan(t),i=Ti(e);if(n.keyValue[i]=y._nextUint8Array(t-e.byteLength-1),i.match(/^ktx/i)){const t=Ti(n.keyValue[i]);n.keyValue[i]=t.substring(0,t.lastIndexOf("\0"))}y._skip(t%4?4-t%4:0)}if(U<=0)return n;const x=new Si(t,h,U,!0),u=x._nextUint16(),b=x._nextUint16(),d=x._nextUint32(),w=x._nextUint32(),m=x._nextUint32(),D=x._nextUint32(),B=[];for(let t=0;t<a;t++)B.push({imageFlags:x._nextUint32(),rgbSliceByteOffset:x._nextUint32(),rgbSliceByteLength:x._nextUint32(),alphaSliceByteOffset:x._nextUint32(),alphaSliceByteLength:x._nextUint32()});const L=h+x._offset,v=L+d,A=v+w,k=A+m,V=new Uint8Array(t.buffer,t.byteOffset+L,d),I=new Uint8Array(t.buffer,t.byteOffset+v,w),S=new Uint8Array(t.buffer,t.byteOffset+A,m),F=new Uint8Array(t.buffer,t.byteOffset+k,D);return n.globalData={endpointCount:u,selectorCount:b,imageDescs:B,endpointsData:V,selectorsData:I,tablesData:S,extendedData:F},n}const zi={keepWriter:!1};function Wi(t,e){void 0===e&&(e={}),e={...zi,...e};let n=new ArrayBuffer(0);if(t.globalData){const e=new ArrayBuffer(20+5*t.globalData.imageDescs.length*4),i=new DataView(e);i.setUint16(0,t.globalData.endpointCount,!0),i.setUint16(2,t.globalData.selectorCount,!0),i.setUint32(4,t.globalData.endpointsData.byteLength,!0),i.setUint32(8,t.globalData.selectorsData.byteLength,!0),i.setUint32(12,t.globalData.tablesData.byteLength,!0),i.setUint32(16,t.globalData.extendedData.byteLength,!0);for(let e=0;e<t.globalData.imageDescs.length;e++){const n=t.globalData.imageDescs[e];i.setUint32(20+5*e*4+0,n.imageFlags,!0),i.setUint32(20+5*e*4+4,n.rgbSliceByteOffset,!0),i.setUint32(20+5*e*4+8,n.rgbSliceByteLength,!0),i.setUint32(20+5*e*4+12,n.alphaSliceByteOffset,!0),i.setUint32(20+5*e*4+16,n.alphaSliceByteLength,!0)}n=Ci([e,t.globalData.endpointsData,t.globalData.selectorsData,t.globalData.tablesData,t.globalData.extendedData])}const i=[];let s=t.keyValue;e.keepWriter||(s={...t.keyValue,KTXwriter:"KTX-Parse v0.7.1"});for(const t in s){const e=s[t],n=Ei(t),a="string"==typeof e?Ci([Ei(e),Fi]):e,r=n.byteLength+1+a.byteLength,o=Mi(r,4);i.push(Ci([new Uint32Array([r]),n,Fi,a,new Uint8Array(o).fill(0)]))}const a=Ci(i);if(1!==t.dataFormatDescriptor.length||0!==t.dataFormatDescriptor[0].descriptorType)throw new Error("Only BASICFORMAT Data Format Descriptor output supported.");const r=t.dataFormatDescriptor[0],o=new ArrayBuffer(28+16*r.samples.length),l=new DataView(o),f=24+16*r.samples.length;if(l.setUint32(0,o.byteLength,!0),l.setUint16(4,r.vendorId,!0),l.setUint16(6,r.descriptorType,!0),l.setUint16(8,r.versionNumber,!0),l.setUint16(10,f,!0),l.setUint8(12,r.colorModel),l.setUint8(13,r.colorPrimaries),l.setUint8(14,r.transferFunction),l.setUint8(15,r.flags),!Array.isArray(r.texelBlockDimension))throw new Error("texelBlockDimension is now an array. For dimensionality `d`, set `d - 1`.");l.setUint8(16,r.texelBlockDimension[0]),l.setUint8(17,r.texelBlockDimension[1]),l.setUint8(18,r.texelBlockDimension[2]),l.setUint8(19,r.texelBlockDimension[3]);for(let t=0;t<8;t++)l.setUint8(20+t,r.bytesPlane[t]);for(let t=0;t<r.samples.length;t++){const e=r.samples[t],n=28+16*t;if(e.channelID)throw new Error("channelID has been renamed to channelType.");l.setUint16(n+0,e.bitOffset,!0),l.setUint8(n+2,e.bitLength),l.setUint8(n+3,e.channelType),l.setUint8(n+4,e.samplePosition[0]),l.setUint8(n+5,e.samplePosition[1]),l.setUint8(n+6,e.samplePosition[2]),l.setUint8(n+7,e.samplePosition[3]),64&e.channelType?(l.setInt32(n+8,e.sampleLower,!0),l.setInt32(n+12,e.sampleUpper,!0)):(l.setUint32(n+8,e.sampleLower,!0),l.setUint32(n+12,e.sampleUpper,!0))}const h=Oi.length+68+3*t.levels.length*8,U=h+o.byteLength;let c=n.byteLength>0?U+a.byteLength:0;c%8&&(c+=8-c%8);const _=[],p=new DataView(new ArrayBuffer(3*t.levels.length*8)),g=new Uint32Array(t.levels.length);let y=0;0===t.supercompressionScheme&&(y=function(t,e){const n=Math.max(t,4),i=Math.min(t,4);let s=n;for(;s%i!=0;)s+=n;return s}(function(t){return t.levels[0].levelData.byteLength/function(t,e){let n=1;const i=[t.pixelWidth,t.pixelHeight,t.pixelDepth],s=function(t){const[e,n,i]=t.dataFormatDescriptor[0].texelBlockDimension;return[e+1,n+1,i+1]}(t);for(let t=0;t<3;t++)if(i[t]>0){const e=Math.ceil(Math.floor(i[t]*Math.pow(2,-0))/s[t]);n*=Math.max(1,e)}return t.layerCount>0&&(n*=t.layerCount),t.faceCount>0&&(n*=t.faceCount),n}(t)}(t)));let x=(c||U+a.byteLength)+n.byteLength;for(let e=t.levels.length-1;e>=0;e--){if(x%y){const t=Mi(x,y);_.push(new Uint8Array(t)),x+=t}const n=t.levels[e];_.push(n.levelData),g[e]=x,x+=n.levelData.byteLength}for(let e=0;e<t.levels.length;e++){const n=t.levels[e];p.setBigUint64(24*e+0,BigInt(g[e]),!0),p.setBigUint64(24*e+8,BigInt(n.levelData.byteLength),!0),p.setBigUint64(24*e+16,BigInt(n.uncompressedByteLength),!0)}const u=new ArrayBuffer(68),b=new DataView(u);return b.setUint32(0,t.vkFormat,!0),b.setUint32(4,t.typeSize,!0),b.setUint32(8,t.pixelWidth,!0),b.setUint32(12,t.pixelHeight,!0),b.setUint32(16,t.pixelDepth,!0),b.setUint32(20,t.layerCount,!0),b.setUint32(24,t.faceCount,!0),b.setUint32(28,t.levels.length,!0),b.setUint32(32,t.supercompressionScheme,!0),b.setUint32(36,h,!0),b.setUint32(40,o.byteLength,!0),b.setUint32(44,U,!0),b.setUint32(48,a.byteLength,!0),b.setBigUint64(52,BigInt(n.byteLength>0?c:0),!0),b.setBigUint64(60,BigInt(n.byteLength),!0),new Uint8Array(Ci([new Uint8Array(Oi).buffer,u,p.buffer,o,a,c>0?new ArrayBuffer(c-(U+a.byteLength)):new ArrayBuffer(0),n,..._]))}export{Z as KHR_DF_CHANNEL_RGBSDA_ALPHA,G as KHR_DF_CHANNEL_RGBSDA_BLUE,Q as KHR_DF_CHANNEL_RGBSDA_DEPTH,q as KHR_DF_CHANNEL_RGBSDA_GREEN,j as KHR_DF_CHANNEL_RGBSDA_RED,J as KHR_DF_CHANNEL_RGBSDA_STENCIL,g as KHR_DF_FLAG_ALPHA_PREMULTIPLIED,p as KHR_DF_FLAG_ALPHA_STRAIGHT,s as KHR_DF_KHR_DESCRIPTORTYPE_BASICFORMAT,U as KHR_DF_MODEL_ASTC,f as KHR_DF_MODEL_ETC1,c as KHR_DF_MODEL_ETC1S,h as KHR_DF_MODEL_ETC2,l as KHR_DF_MODEL_RGBSDA,_ as KHR_DF_MODEL_UASTC,o as KHR_DF_MODEL_UNSPECIFIED,H as KHR_DF_PRIMARIES_ACES,N as KHR_DF_PRIMARIES_ACESCC,Y as KHR_DF_PRIMARIES_ADOBERGB,z as KHR_DF_PRIMARIES_BT2020,M as KHR_DF_PRIMARIES_BT601_EBU,P as KHR_DF_PRIMARIES_BT601_SMPTE,C as KHR_DF_PRIMARIES_BT709,W as KHR_DF_PRIMARIES_CIEXYZ,R as KHR_DF_PRIMARIES_DISPLAYP3,K as KHR_DF_PRIMARIES_NTSC1953,X as KHR_DF_PRIMARIES_PAL525,T as KHR_DF_PRIMARIES_UNSPECIFIED,et as KHR_DF_SAMPLE_DATATYPE_EXPONENT,$ as KHR_DF_SAMPLE_DATATYPE_FLOAT,nt as KHR_DF_SAMPLE_DATATYPE_LINEAR,tt as KHR_DF_SAMPLE_DATATYPE_SIGNED,F as KHR_DF_TRANSFER_ACESCC,O as KHR_DF_TRANSFER_ACESCCT,E as KHR_DF_TRANSFER_ADOBERGB,D as KHR_DF_TRANSFER_BT1886,k as KHR_DF_TRANSFER_DCIP3,L as KHR_DF_TRANSFER_HLG_EOTF,B as KHR_DF_TRANSFER_HLG_OETF,b as KHR_DF_TRANSFER_ITU,x as KHR_DF_TRANSFER_LINEAR,d as KHR_DF_TRANSFER_NTSC,I as KHR_DF_TRANSFER_PAL625_EOTF,V as KHR_DF_TRANSFER_PAL_OETF,v as KHR_DF_TRANSFER_PQ_EOTF,A as KHR_DF_TRANSFER_PQ_OETF,w as KHR_DF_TRANSFER_SLOG,m as KHR_DF_TRANSFER_SLOG2,u as KHR_DF_TRANSFER_SRGB,S as KHR_DF_TRANSFER_ST240,y as KHR_DF_TRANSFER_UNSPECIFIED,a as KHR_DF_VENDORID_KHRONOS,r as KHR_DF_VERSION,e as KHR_SUPERCOMPRESSION_BASISLZ,t as KHR_SUPERCOMPRESSION_NONE,i as KHR_SUPERCOMPRESSION_ZLIB,n as KHR_SUPERCOMPRESSION_ZSTD,Ii as KTX2Container,Ut as VK_FORMAT_A1R5G5B5_UNORM_PACK16,Gt as VK_FORMAT_A2B10G10R10_SINT_PACK32,jt as VK_FORMAT_A2B10G10R10_SNORM_PACK32,qt as VK_FORMAT_A2B10G10R10_UINT_PACK32,Yt as VK_FORMAT_A2B10G10R10_UNORM_PACK32,Rt as VK_FORMAT_A2R10G10B10_SINT_PACK32,Kt as VK_FORMAT_A2R10G10B10_SNORM_PACK32,Xt as VK_FORMAT_A2R10G10B10_UINT_PACK32,Nt as VK_FORMAT_A2R10G10B10_UNORM_PACK32,Vi as VK_FORMAT_A4B4G4R4_UNORM_PACK16_EXT,ki as VK_FORMAT_A4R4G4B4_UNORM_PACK16_EXT,Li as VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT,Rn as VK_FORMAT_ASTC_10x10_SRGB_BLOCK,Xn as VK_FORMAT_ASTC_10x10_UNORM_BLOCK,mi as VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT,zn as VK_FORMAT_ASTC_10x5_SRGB_BLOCK,Pn as VK_FORMAT_ASTC_10x5_UNORM_BLOCK,Di as VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT,Hn as VK_FORMAT_ASTC_10x6_SRGB_BLOCK,Wn as VK_FORMAT_ASTC_10x6_UNORM_BLOCK,Bi as VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT,Kn as VK_FORMAT_ASTC_10x8_SRGB_BLOCK,Nn as VK_FORMAT_ASTC_10x8_UNORM_BLOCK,vi as VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT,jn as VK_FORMAT_ASTC_12x10_SRGB_BLOCK,Yn as VK_FORMAT_ASTC_12x10_UNORM_BLOCK,Ai as VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT,Gn as VK_FORMAT_ASTC_12x12_SRGB_BLOCK,qn as VK_FORMAT_ASTC_12x12_UNORM_BLOCK,pi as VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT,Dn as VK_FORMAT_ASTC_4x4_SRGB_BLOCK,mn as VK_FORMAT_ASTC_4x4_UNORM_BLOCK,gi as VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT,Ln as VK_FORMAT_ASTC_5x4_SRGB_BLOCK,Bn as VK_FORMAT_ASTC_5x4_UNORM_BLOCK,yi as VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT,An as VK_FORMAT_ASTC_5x5_SRGB_BLOCK,vn as VK_FORMAT_ASTC_5x5_UNORM_BLOCK,xi as VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT,Vn as VK_FORMAT_ASTC_6x5_SRGB_BLOCK,kn as VK_FORMAT_ASTC_6x5_UNORM_BLOCK,ui as VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT,Sn as VK_FORMAT_ASTC_6x6_SRGB_BLOCK,In as VK_FORMAT_ASTC_6x6_UNORM_BLOCK,bi as VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT,On as VK_FORMAT_ASTC_8x5_SRGB_BLOCK,Fn as VK_FORMAT_ASTC_8x5_UNORM_BLOCK,di as VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT,Tn as VK_FORMAT_ASTC_8x6_SRGB_BLOCK,En as VK_FORMAT_ASTC_8x6_UNORM_BLOCK,wi as VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT,Mn as VK_FORMAT_ASTC_8x8_SRGB_BLOCK,Cn as VK_FORMAT_ASTC_8x8_UNORM_BLOCK,We as VK_FORMAT_B10G11R11_UFLOAT_PACK32,ti as VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16,ai as VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16,rt as VK_FORMAT_B4G4R4A4_UNORM_PACK16,ht as VK_FORMAT_B5G5R5A1_UNORM_PACK16,lt as VK_FORMAT_B5G6R5_UNORM_PACK16,Wt as VK_FORMAT_B8G8R8A8_SINT,Pt as VK_FORMAT_B8G8R8A8_SNORM,Ht as VK_FORMAT_B8G8R8A8_SRGB,zt as VK_FORMAT_B8G8R8A8_UINT,Mt as VK_FORMAT_B8G8R8A8_UNORM,It as VK_FORMAT_B8G8R8_SINT,kt as VK_FORMAT_B8G8R8_SNORM,St as VK_FORMAT_B8G8R8_SRGB,Vt as VK_FORMAT_B8G8R8_UINT,At as VK_FORMAT_B8G8R8_UNORM,Ze as VK_FORMAT_BC1_RGBA_SRGB_BLOCK,Qe as VK_FORMAT_BC1_RGBA_UNORM_BLOCK,Je as VK_FORMAT_BC1_RGB_SRGB_BLOCK,Ge as VK_FORMAT_BC1_RGB_UNORM_BLOCK,tn as VK_FORMAT_BC2_SRGB_BLOCK,$e as VK_FORMAT_BC2_UNORM_BLOCK,nn as VK_FORMAT_BC3_SRGB_BLOCK,en as VK_FORMAT_BC3_UNORM_BLOCK,an as VK_FORMAT_BC4_SNORM_BLOCK,sn as VK_FORMAT_BC4_UNORM_BLOCK,on as VK_FORMAT_BC5_SNORM_BLOCK,rn as VK_FORMAT_BC5_UNORM_BLOCK,fn as VK_FORMAT_BC6H_SFLOAT_BLOCK,ln as VK_FORMAT_BC6H_UFLOAT_BLOCK,Un as VK_FORMAT_BC7_SRGB_BLOCK,hn as VK_FORMAT_BC7_UNORM_BLOCK,Ne as VK_FORMAT_D16_UNORM,Ye as VK_FORMAT_D16_UNORM_S8_UINT,je as VK_FORMAT_D24_UNORM_S8_UINT,Xe as VK_FORMAT_D32_SFLOAT,qe as VK_FORMAT_D32_SFLOAT_S8_UINT,He as VK_FORMAT_E5B9G9R9_UFLOAT_PACK32,wn as VK_FORMAT_EAC_R11G11_SNORM_BLOCK,dn as VK_FORMAT_EAC_R11G11_UNORM_BLOCK,bn as VK_FORMAT_EAC_R11_SNORM_BLOCK,un as VK_FORMAT_EAC_R11_UNORM_BLOCK,gn as VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK,pn as VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK,xn as VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK,yn as VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK,_n as VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK,cn as VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK,$n as VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16,si as VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16,hi as VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG,ri as VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG,Ui as VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG,oi as VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG,ci as VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG,li as VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG,_i as VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG,fi as VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG,Zn as VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16,Qn as VK_FORMAT_R10X6G10X6_UNORM_2PACK16,Jn as VK_FORMAT_R10X6_UNORM_PACK16,ii as VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16,ni as VK_FORMAT_R12X4G12X4_UNORM_2PACK16,ei as VK_FORMAT_R12X4_UNORM_PACK16,ge as VK_FORMAT_R16G16B16A16_SFLOAT,pe as VK_FORMAT_R16G16B16A16_SINT,ce as VK_FORMAT_R16G16B16A16_SNORM,_e as VK_FORMAT_R16G16B16A16_UINT,Ue as VK_FORMAT_R16G16B16A16_UNORM,he as VK_FORMAT_R16G16B16_SFLOAT,fe as VK_FORMAT_R16G16B16_SINT,oe as VK_FORMAT_R16G16B16_SNORM,le as VK_FORMAT_R16G16B16_UINT,re as VK_FORMAT_R16G16B16_UNORM,ae as VK_FORMAT_R16G16_SFLOAT,se as VK_FORMAT_R16G16_SINT,ne as VK_FORMAT_R16G16_SNORM,ie as VK_FORMAT_R16G16_UINT,ee as VK_FORMAT_R16G16_UNORM,te as VK_FORMAT_R16_SFLOAT,$t as VK_FORMAT_R16_SINT,Qt as VK_FORMAT_R16_SNORM,Zt as VK_FORMAT_R16_UINT,Jt as VK_FORMAT_R16_UNORM,Ae as VK_FORMAT_R32G32B32A32_SFLOAT,ve as VK_FORMAT_R32G32B32A32_SINT,Le as VK_FORMAT_R32G32B32A32_UINT,Be as VK_FORMAT_R32G32B32_SFLOAT,De as VK_FORMAT_R32G32B32_SINT,me as VK_FORMAT_R32G32B32_UINT,we as VK_FORMAT_R32G32_SFLOAT,de as VK_FORMAT_R32G32_SINT,be as VK_FORMAT_R32G32_UINT,ue as VK_FORMAT_R32_SFLOAT,xe as VK_FORMAT_R32_SINT,ye as VK_FORMAT_R32_UINT,at as VK_FORMAT_R4G4B4A4_UNORM_PACK16,st as VK_FORMAT_R4G4_UNORM_PACK8,ft as VK_FORMAT_R5G5B5A1_UNORM_PACK16,ot as VK_FORMAT_R5G6B5_UNORM_PACK16,ze as VK_FORMAT_R64G64B64A64_SFLOAT,Pe as VK_FORMAT_R64G64B64A64_SINT,Me as VK_FORMAT_R64G64B64A64_UINT,Ce as VK_FORMAT_R64G64B64_SFLOAT,Te as VK_FORMAT_R64G64B64_SINT,Ee as VK_FORMAT_R64G64B64_UINT,Oe as VK_FORMAT_R64G64_SFLOAT,Fe as VK_FORMAT_R64G64_SINT,Se as VK_FORMAT_R64G64_UINT,Ie as VK_FORMAT_R64_SFLOAT,Ve as VK_FORMAT_R64_SINT,ke as VK_FORMAT_R64_UINT,Tt as VK_FORMAT_R8G8B8A8_SINT,Ot as VK_FORMAT_R8G8B8A8_SNORM,Ct as VK_FORMAT_R8G8B8A8_SRGB,Et as VK_FORMAT_R8G8B8A8_UINT,Ft as VK_FORMAT_R8G8B8A8_UNORM,Lt as VK_FORMAT_R8G8B8_SINT,Dt as VK_FORMAT_R8G8B8_SNORM,vt as VK_FORMAT_R8G8B8_SRGB,Bt as VK_FORMAT_R8G8B8_UINT,mt as VK_FORMAT_R8G8B8_UNORM,dt as VK_FORMAT_R8G8_SINT,ut as VK_FORMAT_R8G8_SNORM,wt as VK_FORMAT_R8G8_SRGB,bt as VK_FORMAT_R8G8_UINT,xt as VK_FORMAT_R8G8_UNORM,gt as VK_FORMAT_R8_SINT,_t as VK_FORMAT_R8_SNORM,yt as VK_FORMAT_R8_SRGB,pt as VK_FORMAT_R8_UINT,ct as VK_FORMAT_R8_UNORM,Re as VK_FORMAT_S8_UINT,it as VK_FORMAT_UNDEFINED,Ke as VK_FORMAT_X8_D24_UNORM_PACK32,Pi as read,Wi as write};
|
|
1
|
+
const t=0,e=1,n=2,i=3,s=0,a=0,r=2,o=0,l=1,f=160,c=161,U=162,h=163,p=166,_=0,u=1,g=0,x=1,y=2,b=3,m=4,d=5,D=6,w=7,v=8,B=9,L=10,A=11,k=12,I=13,V=14,C=15,F=16,O=17,T=18,S=0,E=1,P=2,M=3,N=4,W=5,H=6,z=7,j=8,K=9,X=10,Y=11,R=0,G=1,q=2,J=13,Q=14,Z=15,$=128,tt=64,et=32,nt=16,it=0,st=1,at=2,rt=3,ot=4,lt=5,ft=6,ct=7,Ut=8,ht=9,pt=10,_t=13,ut=14,gt=15,xt=16,yt=17,bt=20,mt=21,dt=22,Dt=23,wt=24,vt=27,Bt=28,Lt=29,At=30,kt=31,It=34,Vt=35,Ct=36,Ft=37,Ot=38,Tt=41,St=42,Et=43,Pt=44,Mt=45,Nt=48,Wt=49,Ht=50,zt=58,jt=59,Kt=62,Xt=63,Yt=64,Rt=65,Gt=68,qt=69,Jt=70,Qt=71,Zt=74,$t=75,te=76,ee=77,ne=78,ie=81,se=82,ae=83,re=84,oe=85,le=88,fe=89,ce=90,Ue=91,he=92,pe=95,_e=96,ue=97,ge=98,xe=99,ye=100,be=101,me=102,de=103,De=104,we=105,ve=106,Be=107,Le=108,Ae=109,ke=110,Ie=111,Ve=112,Ce=113,Fe=114,Oe=115,Te=116,Se=117,Ee=118,Pe=119,Me=120,Ne=121,We=122,He=123,ze=124,je=125,Ke=126,Xe=127,Ye=128,Re=129,Ge=130,qe=131,Je=132,Qe=133,Ze=134,$e=135,tn=136,en=137,nn=138,sn=139,an=140,rn=141,on=142,ln=143,fn=144,cn=145,Un=146,hn=147,pn=148,_n=149,un=150,gn=151,xn=152,yn=153,bn=154,mn=155,dn=156,Dn=157,wn=158,vn=159,Bn=160,Ln=161,An=162,kn=163,In=164,Vn=165,Cn=166,Fn=167,On=168,Tn=169,Sn=170,En=171,Pn=172,Mn=173,Nn=174,Wn=175,Hn=176,zn=177,jn=178,Kn=179,Xn=180,Yn=181,Rn=182,Gn=183,qn=184,Jn=1000156007,Qn=1000156008,Zn=1000156009,$n=1000156010,ti=1000156011,ei=1000156017,ni=1000156018,ii=1000156019,si=1000156020,ai=1000156021,ri=1000054e3,oi=1000054001,li=1000054002,fi=1000054003,ci=1000054004,Ui=1000054005,hi=1000054006,pi=1000054007,_i=1000066e3,ui=1000066001,gi=1000066002,xi=1000066003,yi=1000066004,bi=1000066005,mi=1000066006,di=1000066007,Di=1000066008,wi=1000066009,vi=1000066010,Bi=1000066011,Li=1000066012,Ai=1000066013,ki=100034e4,Ii=1000340001;function Vi(){return{vkFormat:0,typeSize:1,pixelWidth:0,pixelHeight:0,pixelDepth:0,layerCount:0,faceCount:1,levelCount:0,supercompressionScheme:0,levels:[],dataFormatDescriptor:[{vendorId:0,descriptorType:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],keyValue:{},globalData:null}}class Ci{constructor(t,e,n,i){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(t.buffer,t.byteOffset+e,n),this._littleEndian=i,this._offset=0}_nextUint8(){const t=this._dataView.getUint8(this._offset);return this._offset+=1,t}_nextUint16(){const t=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,t}_nextUint32(){const t=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,t}_nextUint64(){const t=this._dataView.getUint32(this._offset,this._littleEndian)+2**32*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,t}_nextInt32(){const t=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,t}_nextUint8Array(t){const e=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,t);return this._offset+=t,e}_skip(t){return this._offset+=t,this}_scan(t,e=0){const n=this._offset;let i=0;for(;this._dataView.getUint8(this._offset)!==e&&i<t;)i++,this._offset++;return i<t&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,i)}}const Fi=new Uint8Array([0]),Oi=[171,75,84,88,32,50,48,187,13,10,26,10];function Ti(t){return(new TextEncoder).encode(t)}function Si(t){return(new TextDecoder).decode(t)}function Ei(t){let e=0;for(const n of t)e+=n.byteLength;const n=new Uint8Array(e);let i=0;for(const e of t)n.set(new Uint8Array(e),i),i+=e.byteLength;return n}function Pi(t,e=4){return Math.ceil(t/e)*e-t}function Mi(t){const e=new Uint8Array(t.buffer,t.byteOffset,Oi.length);if(e[0]!==Oi[0]||e[1]!==Oi[1]||e[2]!==Oi[2]||e[3]!==Oi[3]||e[4]!==Oi[4]||e[5]!==Oi[5]||e[6]!==Oi[6]||e[7]!==Oi[7]||e[8]!==Oi[8]||e[9]!==Oi[9]||e[10]!==Oi[10]||e[11]!==Oi[11])throw new Error("Missing KTX 2.0 identifier.");const n={vkFormat:0,typeSize:1,pixelWidth:0,pixelHeight:0,pixelDepth:0,layerCount:0,faceCount:1,levelCount:0,supercompressionScheme:0,levels:[],dataFormatDescriptor:[{vendorId:0,descriptorType:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],keyValue:{},globalData:null},i=17*Uint32Array.BYTES_PER_ELEMENT,s=new Ci(t,Oi.length,i,!0);n.vkFormat=s._nextUint32(),n.typeSize=s._nextUint32(),n.pixelWidth=s._nextUint32(),n.pixelHeight=s._nextUint32(),n.pixelDepth=s._nextUint32(),n.layerCount=s._nextUint32(),n.faceCount=s._nextUint32(),n.levelCount=s._nextUint32(),n.supercompressionScheme=s._nextUint32();const a=s._nextUint32(),r=s._nextUint32(),o=s._nextUint32(),l=s._nextUint32(),f=s._nextUint64(),c=s._nextUint64(),U=3*Math.max(n.levelCount,1)*8,h=new Ci(t,Oi.length+i,U,!0);for(let e=0,i=Math.max(n.levelCount,1);e<i;e++)n.levels.push({levelData:new Uint8Array(t.buffer,t.byteOffset+h._nextUint64(),h._nextUint64()),uncompressedByteLength:h._nextUint64()});const p=new Ci(t,a,r,!0);p._skip(4);const _=p._nextUint16(),u=p._nextUint16(),g=p._nextUint16(),x=p._nextUint16(),y={vendorId:_,descriptorType:u,versionNumber:g,colorModel:p._nextUint8(),colorPrimaries:p._nextUint8(),transferFunction:p._nextUint8(),flags:p._nextUint8(),texelBlockDimension:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],bytesPlane:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],samples:[]},b=(x/4-6)/4;for(let t=0;t<b;t++){const e={bitOffset:p._nextUint16(),bitLength:p._nextUint8(),channelType:p._nextUint8(),samplePosition:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],sampleLower:Number.NEGATIVE_INFINITY,sampleUpper:Number.POSITIVE_INFINITY};64&e.channelType?(e.sampleLower=p._nextInt32(),e.sampleUpper=p._nextInt32()):(e.sampleLower=p._nextUint32(),e.sampleUpper=p._nextUint32()),y.samples[t]=e}n.dataFormatDescriptor.length=0,n.dataFormatDescriptor.push(y);const m=new Ci(t,o,l,!0);for(;m._offset<l;){const t=m._nextUint32(),e=m._scan(t),i=Si(e);if(n.keyValue[i]=m._nextUint8Array(t-e.byteLength-1),i.match(/^ktx/i)){const t=Si(n.keyValue[i]);n.keyValue[i]=t.substring(0,t.lastIndexOf("\0"))}m._skip(t%4?4-t%4:0)}if(c<=0)return n;const d=new Ci(t,f,c,!0),D=d._nextUint16(),w=d._nextUint16(),v=d._nextUint32(),B=d._nextUint32(),L=d._nextUint32(),A=d._nextUint32(),k=[];for(let t=0,e=Math.max(n.levelCount,1);t<e;t++)k.push({imageFlags:d._nextUint32(),rgbSliceByteOffset:d._nextUint32(),rgbSliceByteLength:d._nextUint32(),alphaSliceByteOffset:d._nextUint32(),alphaSliceByteLength:d._nextUint32()});const I=f+d._offset,V=I+v,C=V+B,F=C+L,O=new Uint8Array(t.buffer,t.byteOffset+I,v),T=new Uint8Array(t.buffer,t.byteOffset+V,B),S=new Uint8Array(t.buffer,t.byteOffset+C,L),E=new Uint8Array(t.buffer,t.byteOffset+F,A);return n.globalData={endpointCount:D,selectorCount:w,imageDescs:k,endpointsData:O,selectorsData:T,tablesData:S,extendedData:E},n}function Ni(){return Ni=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ni.apply(null,arguments)}const Wi={keepWriter:!1};function Hi(t,e={}){e=Ni({},Wi,e);let n=new ArrayBuffer(0);if(t.globalData){const e=new ArrayBuffer(20+5*t.globalData.imageDescs.length*4),i=new DataView(e);i.setUint16(0,t.globalData.endpointCount,!0),i.setUint16(2,t.globalData.selectorCount,!0),i.setUint32(4,t.globalData.endpointsData.byteLength,!0),i.setUint32(8,t.globalData.selectorsData.byteLength,!0),i.setUint32(12,t.globalData.tablesData.byteLength,!0),i.setUint32(16,t.globalData.extendedData.byteLength,!0);for(let e=0;e<t.globalData.imageDescs.length;e++){const n=t.globalData.imageDescs[e];i.setUint32(20+5*e*4+0,n.imageFlags,!0),i.setUint32(20+5*e*4+4,n.rgbSliceByteOffset,!0),i.setUint32(20+5*e*4+8,n.rgbSliceByteLength,!0),i.setUint32(20+5*e*4+12,n.alphaSliceByteOffset,!0),i.setUint32(20+5*e*4+16,n.alphaSliceByteLength,!0)}n=Ei([e,t.globalData.endpointsData,t.globalData.selectorsData,t.globalData.tablesData,t.globalData.extendedData])}const i=[],s=Object.entries(Ni({},t.keyValue,!e.keepWriter&&{KTXwriter:"KTX-Parse v1.0.1"}));s.sort((t,e)=>t[0]>e[0]?1:-1);for(const[t,e]of s){const n=Ti(t),s="string"==typeof e?Ei([Ti(e),Fi]):e,a=n.byteLength+1+s.byteLength,r=Pi(a,4);i.push(Ei([new Uint32Array([a]),n,Fi,s,new Uint8Array(r).fill(0)]))}const a=Ei(i);if(1!==t.dataFormatDescriptor.length||0!==t.dataFormatDescriptor[0].descriptorType)throw new Error("Only BASICFORMAT Data Format Descriptor output supported.");const r=t.dataFormatDescriptor[0],o=new ArrayBuffer(28+16*r.samples.length),l=new DataView(o),f=24+16*r.samples.length;if(l.setUint32(0,o.byteLength,!0),l.setUint16(4,r.vendorId,!0),l.setUint16(6,r.descriptorType,!0),l.setUint16(8,r.versionNumber,!0),l.setUint16(10,f,!0),l.setUint8(12,r.colorModel),l.setUint8(13,r.colorPrimaries),l.setUint8(14,r.transferFunction),l.setUint8(15,r.flags),!Array.isArray(r.texelBlockDimension))throw new Error("texelBlockDimension is now an array. For dimensionality `d`, set `d - 1`.");l.setUint8(16,r.texelBlockDimension[0]),l.setUint8(17,r.texelBlockDimension[1]),l.setUint8(18,r.texelBlockDimension[2]),l.setUint8(19,r.texelBlockDimension[3]);for(let t=0;t<8;t++)l.setUint8(20+t,r.bytesPlane[t]);for(let t=0;t<r.samples.length;t++){const e=r.samples[t],n=28+16*t;l.setUint16(n+0,e.bitOffset,!0),l.setUint8(n+2,e.bitLength),l.setUint8(n+3,e.channelType),l.setUint8(n+4,e.samplePosition[0]),l.setUint8(n+5,e.samplePosition[1]),l.setUint8(n+6,e.samplePosition[2]),l.setUint8(n+7,e.samplePosition[3]),64&e.channelType?(l.setInt32(n+8,e.sampleLower,!0),l.setInt32(n+12,e.sampleUpper,!0)):(l.setUint32(n+8,e.sampleLower,!0),l.setUint32(n+12,e.sampleUpper,!0))}const c=Oi.length+68+3*t.levels.length*8,U=c+o.byteLength;let h=n.byteLength>0?U+a.byteLength:0;h%8&&(h+=8-h%8);const p=[],_=new DataView(new ArrayBuffer(3*t.levels.length*8)),u=new Uint32Array(t.levels.length);let g=0;0===t.supercompressionScheme&&(g=function(t){const e=Math.max(t,4),n=Math.min(t,4);let i=e;for(;i%n!==0;)i+=e;return i}(function(t){return t.levels[0].levelData.byteLength/function(t){let e=1;const n=[t.pixelWidth,t.pixelHeight,t.pixelDepth],i=function(t){const[e,n,i]=t.dataFormatDescriptor[0].texelBlockDimension;return[e+1,n+1,i+1]}(t);for(let t=0;t<3;t++)if(n[t]>0){const s=Math.ceil(Math.floor(1*n[t])/i[t]);e*=Math.max(1,s)}return t.layerCount>0&&(e*=t.layerCount),t.faceCount>0&&(e*=t.faceCount),e}(t)}(t)));let x=(h||U+a.byteLength)+n.byteLength;for(let e=t.levels.length-1;e>=0;e--){if(x%g){const t=Pi(x,g);p.push(new Uint8Array(t)),x+=t}const n=t.levels[e];p.push(n.levelData),u[e]=x,x+=n.levelData.byteLength}for(let e=0;e<t.levels.length;e++){const n=t.levels[e];_.setBigUint64(24*e+0,BigInt(u[e]),!0),_.setBigUint64(24*e+8,BigInt(n.levelData.byteLength),!0),_.setBigUint64(24*e+16,BigInt(n.uncompressedByteLength),!0)}const y=new ArrayBuffer(68),b=new DataView(y);return b.setUint32(0,t.vkFormat,!0),b.setUint32(4,t.typeSize,!0),b.setUint32(8,t.pixelWidth,!0),b.setUint32(12,t.pixelHeight,!0),b.setUint32(16,t.pixelDepth,!0),b.setUint32(20,t.layerCount,!0),b.setUint32(24,t.faceCount,!0),b.setUint32(28,t.levelCount,!0),b.setUint32(32,t.supercompressionScheme,!0),b.setUint32(36,c,!0),b.setUint32(40,o.byteLength,!0),b.setUint32(44,U,!0),b.setUint32(48,a.byteLength,!0),b.setBigUint64(52,BigInt(n.byteLength>0?h:0),!0),b.setBigUint64(60,BigInt(n.byteLength),!0),new Uint8Array(Ei([new Uint8Array(Oi).buffer,y,_.buffer,o,a,h>0?new ArrayBuffer(h-(U+a.byteLength)):new ArrayBuffer(0),n,...p]))}export{Z as KHR_DF_CHANNEL_RGBSDA_ALPHA,q as KHR_DF_CHANNEL_RGBSDA_BLUE,Q as KHR_DF_CHANNEL_RGBSDA_DEPTH,G as KHR_DF_CHANNEL_RGBSDA_GREEN,R as KHR_DF_CHANNEL_RGBSDA_RED,J as KHR_DF_CHANNEL_RGBSDA_STENCIL,u as KHR_DF_FLAG_ALPHA_PREMULTIPLIED,_ as KHR_DF_FLAG_ALPHA_STRAIGHT,s as KHR_DF_KHR_DESCRIPTORTYPE_BASICFORMAT,U as KHR_DF_MODEL_ASTC,f as KHR_DF_MODEL_ETC1,h as KHR_DF_MODEL_ETC1S,c as KHR_DF_MODEL_ETC2,l as KHR_DF_MODEL_RGBSDA,p as KHR_DF_MODEL_UASTC,o as KHR_DF_MODEL_UNSPECIFIED,H as KHR_DF_PRIMARIES_ACES,z as KHR_DF_PRIMARIES_ACESCC,Y as KHR_DF_PRIMARIES_ADOBERGB,N as KHR_DF_PRIMARIES_BT2020,P as KHR_DF_PRIMARIES_BT601_EBU,M as KHR_DF_PRIMARIES_BT601_SMPTE,E as KHR_DF_PRIMARIES_BT709,W as KHR_DF_PRIMARIES_CIEXYZ,X as KHR_DF_PRIMARIES_DISPLAYP3,j as KHR_DF_PRIMARIES_NTSC1953,K as KHR_DF_PRIMARIES_PAL525,S as KHR_DF_PRIMARIES_UNSPECIFIED,et as KHR_DF_SAMPLE_DATATYPE_EXPONENT,$ as KHR_DF_SAMPLE_DATATYPE_FLOAT,nt as KHR_DF_SAMPLE_DATATYPE_LINEAR,tt as KHR_DF_SAMPLE_DATATYPE_SIGNED,F as KHR_DF_TRANSFER_ACESCC,O as KHR_DF_TRANSFER_ACESCCT,T as KHR_DF_TRANSFER_ADOBERGB,w as KHR_DF_TRANSFER_BT1886,k as KHR_DF_TRANSFER_DCIP3,B as KHR_DF_TRANSFER_HLG_EOTF,v as KHR_DF_TRANSFER_HLG_OETF,b as KHR_DF_TRANSFER_ITU,x as KHR_DF_TRANSFER_LINEAR,m as KHR_DF_TRANSFER_NTSC,V as KHR_DF_TRANSFER_PAL625_EOTF,I as KHR_DF_TRANSFER_PAL_OETF,L as KHR_DF_TRANSFER_PQ_EOTF,A as KHR_DF_TRANSFER_PQ_OETF,d as KHR_DF_TRANSFER_SLOG,D as KHR_DF_TRANSFER_SLOG2,y as KHR_DF_TRANSFER_SRGB,C as KHR_DF_TRANSFER_ST240,g as KHR_DF_TRANSFER_UNSPECIFIED,a as KHR_DF_VENDORID_KHRONOS,r as KHR_DF_VERSION,e as KHR_SUPERCOMPRESSION_BASISLZ,t as KHR_SUPERCOMPRESSION_NONE,i as KHR_SUPERCOMPRESSION_ZLIB,n as KHR_SUPERCOMPRESSION_ZSTD,Ut as VK_FORMAT_A1R5G5B5_UNORM_PACK16,qt as VK_FORMAT_A2B10G10R10_SINT_PACK32,Rt as VK_FORMAT_A2B10G10R10_SNORM_PACK32,Gt as VK_FORMAT_A2B10G10R10_UINT_PACK32,Yt as VK_FORMAT_A2B10G10R10_UNORM_PACK32,Xt as VK_FORMAT_A2R10G10B10_SINT_PACK32,jt as VK_FORMAT_A2R10G10B10_SNORM_PACK32,Kt as VK_FORMAT_A2R10G10B10_UINT_PACK32,zt as VK_FORMAT_A2R10G10B10_UNORM_PACK32,Ii as VK_FORMAT_A4B4G4R4_UNORM_PACK16_EXT,ki as VK_FORMAT_A4R4G4B4_UNORM_PACK16_EXT,Bi as VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT,Xn as VK_FORMAT_ASTC_10x10_SRGB_BLOCK,Kn as VK_FORMAT_ASTC_10x10_UNORM_BLOCK,Di as VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT,Nn as VK_FORMAT_ASTC_10x5_SRGB_BLOCK,Mn as VK_FORMAT_ASTC_10x5_UNORM_BLOCK,wi as VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT,Hn as VK_FORMAT_ASTC_10x6_SRGB_BLOCK,Wn as VK_FORMAT_ASTC_10x6_UNORM_BLOCK,vi as VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT,jn as VK_FORMAT_ASTC_10x8_SRGB_BLOCK,zn as VK_FORMAT_ASTC_10x8_UNORM_BLOCK,Li as VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT,Rn as VK_FORMAT_ASTC_12x10_SRGB_BLOCK,Yn as VK_FORMAT_ASTC_12x10_UNORM_BLOCK,Ai as VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT,qn as VK_FORMAT_ASTC_12x12_SRGB_BLOCK,Gn as VK_FORMAT_ASTC_12x12_UNORM_BLOCK,_i as VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT,wn as VK_FORMAT_ASTC_4x4_SRGB_BLOCK,Dn as VK_FORMAT_ASTC_4x4_UNORM_BLOCK,ui as VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT,Bn as VK_FORMAT_ASTC_5x4_SRGB_BLOCK,vn as VK_FORMAT_ASTC_5x4_UNORM_BLOCK,gi as VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT,An as VK_FORMAT_ASTC_5x5_SRGB_BLOCK,Ln as VK_FORMAT_ASTC_5x5_UNORM_BLOCK,xi as VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT,In as VK_FORMAT_ASTC_6x5_SRGB_BLOCK,kn as VK_FORMAT_ASTC_6x5_UNORM_BLOCK,yi as VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT,Cn as VK_FORMAT_ASTC_6x6_SRGB_BLOCK,Vn as VK_FORMAT_ASTC_6x6_UNORM_BLOCK,bi as VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT,On as VK_FORMAT_ASTC_8x5_SRGB_BLOCK,Fn as VK_FORMAT_ASTC_8x5_UNORM_BLOCK,mi as VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT,Sn as VK_FORMAT_ASTC_8x6_SRGB_BLOCK,Tn as VK_FORMAT_ASTC_8x6_UNORM_BLOCK,di as VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT,Pn as VK_FORMAT_ASTC_8x8_SRGB_BLOCK,En as VK_FORMAT_ASTC_8x8_UNORM_BLOCK,We as VK_FORMAT_B10G11R11_UFLOAT_PACK32,ti as VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16,ai as VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16,rt as VK_FORMAT_B4G4R4A4_UNORM_PACK16,ct as VK_FORMAT_B5G5R5A1_UNORM_PACK16,lt as VK_FORMAT_B5G6R5_UNORM_PACK16,Wt as VK_FORMAT_B8G8R8A8_SINT,Mt as VK_FORMAT_B8G8R8A8_SNORM,Ht as VK_FORMAT_B8G8R8A8_SRGB,Nt as VK_FORMAT_B8G8R8A8_UINT,Pt as VK_FORMAT_B8G8R8A8_UNORM,Vt as VK_FORMAT_B8G8R8_SINT,kt as VK_FORMAT_B8G8R8_SNORM,Ct as VK_FORMAT_B8G8R8_SRGB,It as VK_FORMAT_B8G8R8_UINT,At as VK_FORMAT_B8G8R8_UNORM,Ze as VK_FORMAT_BC1_RGBA_SRGB_BLOCK,Qe as VK_FORMAT_BC1_RGBA_UNORM_BLOCK,Je as VK_FORMAT_BC1_RGB_SRGB_BLOCK,qe as VK_FORMAT_BC1_RGB_UNORM_BLOCK,tn as VK_FORMAT_BC2_SRGB_BLOCK,$e as VK_FORMAT_BC2_UNORM_BLOCK,nn as VK_FORMAT_BC3_SRGB_BLOCK,en as VK_FORMAT_BC3_UNORM_BLOCK,an as VK_FORMAT_BC4_SNORM_BLOCK,sn as VK_FORMAT_BC4_UNORM_BLOCK,on as VK_FORMAT_BC5_SNORM_BLOCK,rn as VK_FORMAT_BC5_UNORM_BLOCK,fn as VK_FORMAT_BC6H_SFLOAT_BLOCK,ln as VK_FORMAT_BC6H_UFLOAT_BLOCK,Un as VK_FORMAT_BC7_SRGB_BLOCK,cn as VK_FORMAT_BC7_UNORM_BLOCK,ze as VK_FORMAT_D16_UNORM,Ye as VK_FORMAT_D16_UNORM_S8_UINT,Re as VK_FORMAT_D24_UNORM_S8_UINT,Ke as VK_FORMAT_D32_SFLOAT,Ge as VK_FORMAT_D32_SFLOAT_S8_UINT,He as VK_FORMAT_E5B9G9R9_UFLOAT_PACK32,dn as VK_FORMAT_EAC_R11G11_SNORM_BLOCK,mn as VK_FORMAT_EAC_R11G11_UNORM_BLOCK,bn as VK_FORMAT_EAC_R11_SNORM_BLOCK,yn as VK_FORMAT_EAC_R11_UNORM_BLOCK,un as VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK,_n as VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK,xn as VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK,gn as VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK,pn as VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK,hn as VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK,$n as VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16,si as VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16,ci as VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG,ri as VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG,Ui as VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG,oi as VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG,hi as VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG,li as VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG,pi as VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG,fi as VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG,Zn as VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16,Qn as VK_FORMAT_R10X6G10X6_UNORM_2PACK16,Jn as VK_FORMAT_R10X6_UNORM_PACK16,ii as VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16,ni as VK_FORMAT_R12X4G12X4_UNORM_2PACK16,ei as VK_FORMAT_R12X4_UNORM_PACK16,ue as VK_FORMAT_R16G16B16A16_SFLOAT,_e as VK_FORMAT_R16G16B16A16_SINT,he as VK_FORMAT_R16G16B16A16_SNORM,pe as VK_FORMAT_R16G16B16A16_UINT,Ue as VK_FORMAT_R16G16B16A16_UNORM,ce as VK_FORMAT_R16G16B16_SFLOAT,fe as VK_FORMAT_R16G16B16_SINT,oe as VK_FORMAT_R16G16B16_SNORM,le as VK_FORMAT_R16G16B16_UINT,re as VK_FORMAT_R16G16B16_UNORM,ae as VK_FORMAT_R16G16_SFLOAT,se as VK_FORMAT_R16G16_SINT,ne as VK_FORMAT_R16G16_SNORM,ie as VK_FORMAT_R16G16_UINT,ee as VK_FORMAT_R16G16_UNORM,te as VK_FORMAT_R16_SFLOAT,$t as VK_FORMAT_R16_SINT,Qt as VK_FORMAT_R16_SNORM,Zt as VK_FORMAT_R16_UINT,Jt as VK_FORMAT_R16_UNORM,Ae as VK_FORMAT_R32G32B32A32_SFLOAT,Le as VK_FORMAT_R32G32B32A32_SINT,Be as VK_FORMAT_R32G32B32A32_UINT,ve as VK_FORMAT_R32G32B32_SFLOAT,we as VK_FORMAT_R32G32B32_SINT,De as VK_FORMAT_R32G32B32_UINT,de as VK_FORMAT_R32G32_SFLOAT,me as VK_FORMAT_R32G32_SINT,be as VK_FORMAT_R32G32_UINT,ye as VK_FORMAT_R32_SFLOAT,xe as VK_FORMAT_R32_SINT,ge as VK_FORMAT_R32_UINT,at as VK_FORMAT_R4G4B4A4_UNORM_PACK16,st as VK_FORMAT_R4G4_UNORM_PACK8,ft as VK_FORMAT_R5G5B5A1_UNORM_PACK16,ot as VK_FORMAT_R5G6B5_UNORM_PACK16,Ne as VK_FORMAT_R64G64B64A64_SFLOAT,Me as VK_FORMAT_R64G64B64A64_SINT,Pe as VK_FORMAT_R64G64B64A64_UINT,Ee as VK_FORMAT_R64G64B64_SFLOAT,Se as VK_FORMAT_R64G64B64_SINT,Te as VK_FORMAT_R64G64B64_UINT,Oe as VK_FORMAT_R64G64_SFLOAT,Fe as VK_FORMAT_R64G64_SINT,Ce as VK_FORMAT_R64G64_UINT,Ve as VK_FORMAT_R64_SFLOAT,Ie as VK_FORMAT_R64_SINT,ke as VK_FORMAT_R64_UINT,St as VK_FORMAT_R8G8B8A8_SINT,Ot as VK_FORMAT_R8G8B8A8_SNORM,Et as VK_FORMAT_R8G8B8A8_SRGB,Tt as VK_FORMAT_R8G8B8A8_UINT,Ft as VK_FORMAT_R8G8B8A8_UNORM,Bt as VK_FORMAT_R8G8B8_SINT,wt as VK_FORMAT_R8G8B8_SNORM,Lt as VK_FORMAT_R8G8B8_SRGB,vt as VK_FORMAT_R8G8B8_UINT,Dt as VK_FORMAT_R8G8B8_UNORM,mt as VK_FORMAT_R8G8_SINT,yt as VK_FORMAT_R8G8_SNORM,dt as VK_FORMAT_R8G8_SRGB,bt as VK_FORMAT_R8G8_UINT,xt as VK_FORMAT_R8G8_UNORM,ut as VK_FORMAT_R8_SINT,pt as VK_FORMAT_R8_SNORM,gt as VK_FORMAT_R8_SRGB,_t as VK_FORMAT_R8_UINT,ht as VK_FORMAT_R8_UNORM,Xe as VK_FORMAT_S8_UINT,it as VK_FORMAT_UNDEFINED,je as VK_FORMAT_X8_D24_UNORM_PACK32,Vi as createDefaultContainer,Mi as read,Hi as write};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LineSegments2 } from '
|
|
2
|
-
import { LineGeometry } from '
|
|
3
|
-
import { LineMaterial } from '
|
|
1
|
+
import { LineSegments2 } from './LineSegments2.js';
|
|
2
|
+
import { LineGeometry } from './LineGeometry.js';
|
|
3
|
+
import { LineMaterial } from './LineMaterial.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* A polyline drawn between vertices.
|
|
@@ -10,8 +10,8 @@ import {
|
|
|
10
10
|
Vector3,
|
|
11
11
|
Vector4
|
|
12
12
|
} from 'three';
|
|
13
|
-
import { LineSegmentsGeometry } from '
|
|
14
|
-
import { LineMaterial } from '
|
|
13
|
+
import { LineSegmentsGeometry } from './LineSegmentsGeometry.js';
|
|
14
|
+
import { LineMaterial } from './LineMaterial.js';
|
|
15
15
|
|
|
16
16
|
const _viewport = new Vector4();
|
|
17
17
|
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
Vector3,
|
|
6
6
|
Vector4
|
|
7
7
|
} from 'three';
|
|
8
|
-
import { LineSegmentsGeometry } from '
|
|
9
|
-
import { LineMaterial } from '
|
|
8
|
+
import { LineSegmentsGeometry } from './LineSegmentsGeometry.js';
|
|
9
|
+
import { LineMaterial } from './LineMaterial.js';
|
|
10
10
|
|
|
11
11
|
const _start = new Vector3();
|
|
12
12
|
const _end = new Vector3();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WireframeGeometry
|
|
3
3
|
} from 'three';
|
|
4
|
-
import { LineSegmentsGeometry } from '
|
|
4
|
+
import { LineSegmentsGeometry } from './LineSegmentsGeometry.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* A special type of line segments geometry intended for wireframe rendering.
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
Line2NodeMaterial,
|
|
13
13
|
Vector2
|
|
14
14
|
} from 'three/webgpu';
|
|
15
|
-
import { LineSegmentsGeometry } from '
|
|
15
|
+
import { LineSegmentsGeometry } from '../LineSegmentsGeometry.js';
|
|
16
16
|
|
|
17
17
|
const _start = new Vector3();
|
|
18
18
|
const _end = new Vector3();
|
|
@@ -113,7 +113,7 @@ class ColladaLoader extends Loader {
|
|
|
113
113
|
*
|
|
114
114
|
* @param {string} text - The raw Collada data as a string.
|
|
115
115
|
* @param {string} path - The asset path.
|
|
116
|
-
* @return {{scene:Group,animations:Array<AnimationClip>,kinematics:Object}} An object representing the parsed asset.
|
|
116
|
+
* @return {?{scene:Group,animations:Array<AnimationClip>,kinematics:Object}} An object representing the parsed asset.
|
|
117
117
|
*/
|
|
118
118
|
parse( text, path ) {
|
|
119
119
|
|
|
@@ -2515,7 +2515,7 @@ class EXRLoader extends DataTextureLoader {
|
|
|
2515
2515
|
EXRDecoder.outputChannels = 1;
|
|
2516
2516
|
EXRDecoder.decodeChannels = { R: 0 };
|
|
2517
2517
|
|
|
2518
|
-
} else
|
|
2518
|
+
} else {
|
|
2519
2519
|
|
|
2520
2520
|
invalidOutput = true;
|
|
2521
2521
|
|
|
@@ -2549,7 +2549,7 @@ class EXRLoader extends DataTextureLoader {
|
|
|
2549
2549
|
EXRDecoder.outputChannels = 1;
|
|
2550
2550
|
EXRDecoder.decodeChannels = { Y: 0 };
|
|
2551
2551
|
|
|
2552
|
-
} else
|
|
2552
|
+
} else {
|
|
2553
2553
|
|
|
2554
2554
|
invalidOutput = true;
|
|
2555
2555
|
|
|
@@ -2563,7 +2563,7 @@ class EXRLoader extends DataTextureLoader {
|
|
|
2563
2563
|
|
|
2564
2564
|
}
|
|
2565
2565
|
|
|
2566
|
-
if (invalidOutput) throw new Error( 'EXRLoader.parse: invalid output format for specified file.' );
|
|
2566
|
+
if ( invalidOutput ) throw new Error( 'EXRLoader.parse: invalid output format for specified file.' );
|
|
2567
2567
|
|
|
2568
2568
|
if ( EXRDecoder.type == 1 ) {
|
|
2569
2569
|
|
|
@@ -2712,12 +2712,12 @@ class EXRLoader extends DataTextureLoader {
|
|
|
2712
2712
|
if ( this.outputFormat == RGBAFormat ) {
|
|
2713
2713
|
|
|
2714
2714
|
for ( let i = 0; i < byteArray.length; i += 4 )
|
|
2715
|
-
byteArray
|
|
2715
|
+
byteArray[ i + 2 ] = ( byteArray[ i + 1 ] = byteArray[ i ] );
|
|
2716
2716
|
|
|
2717
2717
|
} else if ( this.outputFormat == RGFormat ) {
|
|
2718
2718
|
|
|
2719
2719
|
for ( let i = 0; i < byteArray.length; i += 2 )
|
|
2720
|
-
byteArray
|
|
2720
|
+
byteArray[ i + 1 ] = byteArray[ i ];
|
|
2721
2721
|
|
|
2722
2722
|
}
|
|
2723
2723
|
|
|
@@ -2376,7 +2376,7 @@ function addUnknownExtensionsToUserData( knownExtensions, object, objectDef ) {
|
|
|
2376
2376
|
/**
|
|
2377
2377
|
*
|
|
2378
2378
|
* @private
|
|
2379
|
-
* @param {Object3D|Material|BufferGeometry|Object} object
|
|
2379
|
+
* @param {Object3D|Material|BufferGeometry|Object|AnimationClip} object
|
|
2380
2380
|
* @param {GLTF.definition} gltfDef
|
|
2381
2381
|
*/
|
|
2382
2382
|
function assignExtrasToUserData( object, gltfDef ) {
|
|
@@ -2943,7 +2943,7 @@ class GLTFParser {
|
|
|
2943
2943
|
* @private
|
|
2944
2944
|
* @param {string} type
|
|
2945
2945
|
* @param {number} index
|
|
2946
|
-
* @return {Promise<Object3D|Material|
|
|
2946
|
+
* @return {Promise<Object3D|Material|Texture|AnimationClip|ArrayBuffer|Object>}
|
|
2947
2947
|
*/
|
|
2948
2948
|
getDependency( type, index ) {
|
|
2949
2949
|
|
|
@@ -3283,7 +3283,7 @@ class GLTFParser {
|
|
|
3283
3283
|
*
|
|
3284
3284
|
* @private
|
|
3285
3285
|
* @param {number} textureIndex
|
|
3286
|
-
* @return {Promise
|
|
3286
|
+
* @return {Promise<?Texture>}
|
|
3287
3287
|
*/
|
|
3288
3288
|
loadTexture( textureIndex ) {
|
|
3289
3289
|
|
|
@@ -4020,7 +4020,7 @@ class GLTFParser {
|
|
|
4020
4020
|
*
|
|
4021
4021
|
* @private
|
|
4022
4022
|
* @param {number} cameraIndex
|
|
4023
|
-
* @return {Promise<
|
|
4023
|
+
* @return {Promise<Camera>|undefined}
|
|
4024
4024
|
*/
|
|
4025
4025
|
loadCamera( cameraIndex ) {
|
|
4026
4026
|
|
|
@@ -4213,7 +4213,11 @@ class GLTFParser {
|
|
|
4213
4213
|
|
|
4214
4214
|
}
|
|
4215
4215
|
|
|
4216
|
-
|
|
4216
|
+
const animation = new AnimationClip( animationName, undefined, tracks );
|
|
4217
|
+
|
|
4218
|
+
assignExtrasToUserData( animation, animationDef );
|
|
4219
|
+
|
|
4220
|
+
return animation;
|
|
4217
4221
|
|
|
4218
4222
|
} );
|
|
4219
4223
|
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
LinearSRGBColorSpace,
|
|
9
9
|
Loader
|
|
10
10
|
} from 'three';
|
|
11
|
-
import {
|
|
11
|
+
import { HDRLoader } from '../loaders/HDRLoader.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* A loader for loading HDR cube textures.
|
|
@@ -40,9 +40,9 @@ class HDRCubeTextureLoader extends Loader {
|
|
|
40
40
|
* The internal HDR loader that loads the
|
|
41
41
|
* individual textures for each cube face.
|
|
42
42
|
*
|
|
43
|
-
|
|
43
|
+
* @type {HDRLoader}
|
|
44
44
|
*/
|
|
45
|
-
this.hdrLoader = new
|
|
45
|
+
this.hdrLoader = new HDRLoader();
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* The texture type.
|
|
@@ -147,8 +147,8 @@ class HDRCubeTextureLoader extends Loader {
|
|
|
147
147
|
/**
|
|
148
148
|
* Sets the texture type.
|
|
149
149
|
*
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
* @param {(HalfFloatType|FloatType)} value - The texture type to set.
|
|
151
|
+
* @return {HDRCubeTextureLoader} A reference to this loader.
|
|
152
152
|
*/
|
|
153
153
|
setDataType( value ) {
|
|
154
154
|
|