three-stdlib 2.8.2 → 2.8.3
Sign up to get free protection for your applications and to get access to all the features.
- package/{BufferGeometryUtils-582025b8.js → BufferGeometryUtils-1a7a235c.js} +2 -1
- package/{BufferGeometryUtils-9eb5c2e7.js → BufferGeometryUtils-971dfde3.js} +0 -0
- package/animation/MMDAnimationHelper.d.ts +17 -17
- package/animation/MMDPhysics.d.ts +3 -3
- package/csm/CSM.d.ts +47 -22
- package/csm/CSMHelper.d.ts +20 -7
- package/effects/OutlineEffect.d.ts +4 -4
- package/effects/OutlineEffect.js +8 -2
- package/exporters/GLTFExporter.js +5 -10
- package/geometries/ConvexGeometry.d.ts +1 -1
- package/geometries/ParametricGeometries.d.ts +4 -2
- package/helpers/RectAreaLightHelper.d.ts +3 -3
- package/loaders/AssimpLoader.js +39 -10
- package/loaders/ColladaLoader.js +22 -5
- package/loaders/EXRLoader.js +5 -1
- package/loaders/FBXLoader.js +10 -2
- package/loaders/GLTFLoader.d.ts +44 -20
- package/loaders/LDrawLoader.d.ts +6 -0
- package/loaders/MTLLoader.d.ts +18 -18
- package/loaders/RGBMLoader.d.ts +10 -10
- package/loaders/RGBMLoader.js +253 -178
- package/loaders/SVGLoader.d.ts +5 -3
- package/loaders/SVGLoader.js +10 -5
- package/loaders/lwo/IFFParser.js +4 -1
- package/math/OBB.d.ts +1 -1
- package/misc/GPUComputationRenderer.d.ts +8 -6
- package/misc/MD2CharacterComplex.js +9 -2
- package/misc/Volume.d.ts +2 -0
- package/modifiers/EdgeSplitModifier.cjs.js +1 -1
- package/modifiers/SimplifyModifier.cjs.js +1 -1
- package/nodes/inputs/ColorNode.d.ts +2 -2
- package/nodes/inputs/TextureNode.d.ts +3 -2
- package/nodes/materials/StandardNodeMaterial.d.ts +1 -1
- package/nodes/materials/nodes/StandardNode.d.ts +1 -0
- package/nodes/utils/ColorSpaceNode.d.ts +1 -1
- package/nodes/utils/JoinNode.d.ts +1 -0
- package/objects/MarchingCubes.d.ts +12 -4
- package/objects/Reflector.d.ts +4 -2
- package/objects/ReflectorForSSRPass.d.ts +6 -6
- package/objects/Refractor.d.ts +4 -2
- package/objects/Water.d.ts +4 -3
- package/objects/Water2.d.ts +12 -3
- package/package.json +1 -1
- package/postprocessing/ClearPass.d.ts +3 -3
- package/postprocessing/SAOPass.d.ts +3 -2
- package/postprocessing/SSAARenderPass.d.ts +3 -3
- package/postprocessing/SSAOPass.d.ts +3 -2
- package/postprocessing/SSRPass.d.ts +14 -17
- package/postprocessing/TAARenderPass.d.ts +2 -2
- package/renderers/CSS2DRenderer.d.ts +5 -1
- package/renderers/CSS3DRenderer.d.ts +5 -1
- package/renderers/webgpu/WebGPUTextures.js +62 -41
- package/shaders/SSRShader.d.ts +1 -2
- package/utils/BufferGeometryUtils.cjs.js +1 -1
- package/utils/BufferGeometryUtils.js +2 -1
- package/utils/LDrawUtils.cjs.js +1 -1
- package/utils/LDrawUtils.d.ts +5 -0
- package/utils/LDrawUtils.js +1 -1
- package/utils/RoughnessMipmapper.js +5 -1
- package/utils/SceneUtils.d.ts +10 -12
- package/utils/ShadowMapViewer.js +4 -1
- package/webxr/XRHandModelFactory.d.ts +3 -3
- package/webxr/XRHandPrimitiveModel.d.ts +1 -1
- package/csm/Frustum.d.ts +0 -16
- package/csm/Shader.d.ts +0 -6
- package/loaders/XLoader.d.ts +0 -19
- package/shaders/FresnelShader.d.ts +0 -13
- package/shaders/ParallaxShader.d.ts +0 -20
- package/utils/RoughnessMipmapper.d.ts +0 -7
- package/webxr/XRHandOculusMeshModel.d.ts +0 -23
@@ -365,47 +365,68 @@ class WebGPUTextures {
|
|
365
365
|
|
366
366
|
_getBlockData(format) {
|
367
367
|
// this method is only relevant for compressed texture formats
|
368
|
-
if (format === GPUTextureFormat.BC1RGBAUnorm || format === GPUTextureFormat.BC1RGBAUnormSRGB)
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
if (format === GPUTextureFormat.
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
if (format === GPUTextureFormat.
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
368
|
+
if (format === GPUTextureFormat.BC1RGBAUnorm || format === GPUTextureFormat.BC1RGBAUnormSRGB) {
|
369
|
+
return {
|
370
|
+
byteLength: 8,
|
371
|
+
width: 4,
|
372
|
+
height: 4
|
373
|
+
};
|
374
|
+
} // DXT1
|
375
|
+
|
376
|
+
|
377
|
+
if (format === GPUTextureFormat.BC2RGBAUnorm || format === GPUTextureFormat.BC2RGBAUnormSRGB) {
|
378
|
+
return {
|
379
|
+
byteLength: 16,
|
380
|
+
width: 4,
|
381
|
+
height: 4
|
382
|
+
};
|
383
|
+
} // DXT3
|
384
|
+
|
385
|
+
|
386
|
+
if (format === GPUTextureFormat.BC3RGBAUnorm || format === GPUTextureFormat.BC3RGBAUnormSRGB) {
|
387
|
+
return {
|
388
|
+
byteLength: 16,
|
389
|
+
width: 4,
|
390
|
+
height: 4
|
391
|
+
};
|
392
|
+
} // DXT5
|
393
|
+
|
394
|
+
|
395
|
+
if (format === GPUTextureFormat.BC4RUnorm || format === GPUTextureFormat.BC4RSNorm) {
|
396
|
+
return {
|
397
|
+
byteLength: 8,
|
398
|
+
width: 4,
|
399
|
+
height: 4
|
400
|
+
};
|
401
|
+
} // RGTC1
|
402
|
+
|
403
|
+
|
404
|
+
if (format === GPUTextureFormat.BC5RGUnorm || format === GPUTextureFormat.BC5RGSnorm) {
|
405
|
+
return {
|
406
|
+
byteLength: 16,
|
407
|
+
width: 4,
|
408
|
+
height: 4
|
409
|
+
};
|
410
|
+
} // RGTC2
|
411
|
+
|
412
|
+
|
413
|
+
if (format === GPUTextureFormat.BC6HRGBUFloat || format === GPUTextureFormat.BC6HRGBFloat) {
|
414
|
+
return {
|
415
|
+
byteLength: 16,
|
416
|
+
width: 4,
|
417
|
+
height: 4
|
418
|
+
};
|
419
|
+
} // BPTC (float)
|
420
|
+
|
421
|
+
|
422
|
+
if (format === GPUTextureFormat.BC7RGBAUnorm || format === GPUTextureFormat.BC7RGBAUnormSRGB) {
|
423
|
+
return {
|
424
|
+
byteLength: 16,
|
425
|
+
width: 4,
|
426
|
+
height: 4
|
427
|
+
};
|
428
|
+
} // BPTC (unorm)
|
429
|
+
|
409
430
|
}
|
410
431
|
|
411
432
|
_getBytesPerTexel(format) {
|
package/shaders/SSRShader.d.ts
CHANGED
@@ -27,8 +27,7 @@ export interface SSRShader {
|
|
27
27
|
opacity: IUniform<number>;
|
28
28
|
maxDistance: IUniform<number>;
|
29
29
|
cameraRange: IUniform<number>;
|
30
|
-
|
31
|
-
thickTolerance: IUniform<number>;
|
30
|
+
thickness: IUniform<number>;
|
32
31
|
};
|
33
32
|
vertexShader: string;
|
34
33
|
fragmentShader: string;
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("three"),require("../types/helpers.cjs.js");var e=require("../BufferGeometryUtils-
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("three"),require("../types/helpers.cjs.js");var e=require("../BufferGeometryUtils-971dfde3.js");exports.computeMorphedAttributes=e.computeMorphedAttributes,exports.estimateBytesUsed=e.estimateBytesUsed,exports.interleaveAttributes=e.interleaveAttributes,exports.mergeBufferAttributes=e.mergeBufferAttributes,exports.mergeBufferGeometries=e.mergeBufferGeometries,exports.mergeVertices=e.mergeVertices,exports.toTrianglesDrawMode=e.toTrianglesDrawMode;
|
@@ -485,7 +485,8 @@ function computeMorphedAttributes(object) {
|
|
485
485
|
|
486
486
|
const morphInfluences = object.morphTargetInfluences;
|
487
487
|
|
488
|
-
if (
|
488
|
+
if ( // @ts-expect-error
|
489
|
+
material.morphTargets && morphAttribute && morphInfluences) {
|
489
490
|
_morphA.set(0, 0, 0);
|
490
491
|
|
491
492
|
_morphB.set(0, 0, 0);
|
package/utils/LDrawUtils.cjs.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("three"),r=require("../BufferGeometryUtils-
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("three"),r=require("../BufferGeometryUtils-971dfde3.js");require("../types/helpers.cjs.js");exports.LDrawUtils=class{static mergeObject(e){function i(r,e,i,n){const a=new t.BufferGeometry,o=r.getAttribute("position").array,s=3===i?r.getAttribute("normal").array:null,u=Math.min(e.count,Math.floor(o.length/3)-e.start),l=3*e.start,c=3*(e.start+u),f=o.subarray(l,c),m=null!==s?s.subarray(l,c):null;if(a.setAttribute("position",new t.BufferAttribute(f,3)),null!==m&&a.setAttribute("normal",new t.BufferAttribute(m,3)),n){const e=r.getAttribute("control0").array.subarray(l,c),i=r.getAttribute("control1").array.subarray(l,c),n=r.getAttribute("direction").array.subarray(l,c);a.setAttribute("control0",new t.BufferAttribute(e,3,!1)),a.setAttribute("control1",new t.BufferAttribute(i,3,!1)),a.setAttribute("direction",new t.BufferAttribute(n,3,!1))}return a}function n(t,r,e){const i=e[t.uuid];i?i.arr.push(r):e[t.uuid]={mat:t,arr:[r]}}function a(t,r){if(!t)return;const e=t.array,i=Math.floor(e.length/3);let n=0;for(let t=0;t<i;t++){const t=e[n],i=e[n+1],a=e[n+2];e[n]=e[n+3],e[n+1]=e[n+4],e[n+2]=e[n+5],e[n+3]=t,e[n+4]=i,e[n+5]=a,n+=3*r}}const o={},s={},u={};e.updateMatrixWorld(!0);const l=new t.Matrix3;e.traverse((t=>{if(t.isMesh|t.isLineSegments){const r=t.isMesh?3:2,e=t.geometry.clone();t.matrixWorld.determinant()<0&&(a(e.attributes.position,r),a(e.attributes.normal,r)),e.applyMatrix4(t.matrixWorld),t.isConditionalLine&&(e.attributes.control0.applyMatrix4(t.matrixWorld),e.attributes.control1.applyMatrix4(t.matrixWorld),l.getNormalMatrix(t.matrixWorld),e.attributes.direction.applyNormalMatrix(l));const c=t.isMesh?o:t.isConditionalLine?u:s;if(Array.isArray(t.material))for(const a in e.groups){const o=e.groups[a];n(t.material[o.materialIndex],i(e,o,r,t.isConditionalLine),c)}else n(t.material,e,c)}}));const c=new t.Group,f=Object.keys(o);for(const e in f){const i=o[f[e]],n=r.mergeBufferGeometries(i.arr);c.add(new t.Mesh(n,i.mat))}const m=Object.keys(s);for(const e in m){const i=s[m[e]],n=r.mergeBufferGeometries(i.arr);c.add(new t.LineSegments(n,i.mat))}const b=Object.keys(u);for(const e in b){const i=u[b[e]],n=r.mergeBufferGeometries(i.arr),a=new t.LineSegments(n,i.mat);a.isConditionalLine=!0,c.add(a)}return c.userData.constructionStep=0,c.userData.numConstructionSteps=1,c}};
|
package/utils/LDrawUtils.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Matrix3, Group, Mesh, LineSegments, BufferGeometry, BufferAttribute } from 'three';
|
2
|
-
import { m as mergeBufferGeometries } from '../BufferGeometryUtils-
|
2
|
+
import { m as mergeBufferGeometries } from '../BufferGeometryUtils-1a7a235c.js';
|
3
3
|
import '../types/helpers.js';
|
4
4
|
|
5
5
|
class LDrawUtils {
|
@@ -31,7 +31,11 @@ RoughnessMipmapper.prototype = {
|
|
31
31
|
roughnessMap,
|
32
32
|
normalMap
|
33
33
|
} = material;
|
34
|
-
|
34
|
+
|
35
|
+
if (roughnessMap === null || normalMap === null || !roughnessMap.generateMipmaps || material.userData.roughnessUpdated) {
|
36
|
+
return;
|
37
|
+
}
|
38
|
+
|
35
39
|
material.userData.roughnessUpdated = true;
|
36
40
|
var width = Math.max(roughnessMap.image.width, normalMap.image.width);
|
37
41
|
var height = Math.max(roughnessMap.image.height, normalMap.image.height);
|
package/utils/SceneUtils.d.ts
CHANGED
@@ -1,14 +1,12 @@
|
|
1
1
|
import { BufferGeometry, Group, InstancedMesh, Material, Object3D, Scene } from 'three';
|
2
2
|
|
3
|
-
export
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
function attach(child: Object3D, scene: Scene, parent: Object3D): void;
|
14
|
-
}
|
3
|
+
export function createMeshesFromInstancedMesh(instancedMesh: InstancedMesh): Group;
|
4
|
+
export function createMultiMaterialObject(geometry: BufferGeometry, materials: Material[]): Group;
|
5
|
+
/**
|
6
|
+
* @deprecated Use scene.attach( child ) instead.
|
7
|
+
*/
|
8
|
+
export function detach(child: Object3D, parent: Object3D, scene: Scene): void;
|
9
|
+
/**
|
10
|
+
* @deprecated Use parent.attach( child ) instead.
|
11
|
+
*/
|
12
|
+
export function attach(child: Object3D, scene: Scene, parent: Object3D): void;
|
package/utils/ShadowMapViewer.js
CHANGED
@@ -111,7 +111,10 @@ var ShadowMapViewer = function (light) {
|
|
111
111
|
var width = scope.size.width;
|
112
112
|
var height = scope.size.height;
|
113
113
|
mesh.position.set(-window.innerWidth / 2 + width / 2 + this.x, window.innerHeight / 2 - height / 2 - this.y, 0);
|
114
|
-
|
114
|
+
|
115
|
+
if (doRenderLabel) {
|
116
|
+
labelMesh.position.set(mesh.position.x, mesh.position.y - scope.size.height / 2 + labelCanvas.height / 2, 0);
|
117
|
+
}
|
115
118
|
}
|
116
119
|
};
|
117
120
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import { Group, Object3D } from 'three';
|
2
2
|
|
3
3
|
import { XRHandPrimitiveModel, XRHandPrimitiveModelOptions } from './XRHandPrimitiveModel';
|
4
|
-
import {
|
4
|
+
import { XRHandMeshModel } from './XRHandMeshModel';
|
5
5
|
|
6
6
|
export type XRHandModelHandedness = 'left' | 'right';
|
7
7
|
|
8
8
|
export class XRHandModel extends Object3D {
|
9
9
|
constructor();
|
10
10
|
|
11
|
-
motionController: XRHandPrimitiveModel |
|
11
|
+
motionController: XRHandPrimitiveModel | XRHandMeshModel;
|
12
12
|
}
|
13
13
|
|
14
14
|
export class XRHandModelFactory {
|
@@ -20,6 +20,6 @@ export class XRHandModelFactory {
|
|
20
20
|
createHandModel(
|
21
21
|
controller: Group,
|
22
22
|
profile?: 'spheres' | 'boxes' | 'oculus',
|
23
|
-
options?: XRHandPrimitiveModelOptions
|
23
|
+
options?: XRHandPrimitiveModelOptions,
|
24
24
|
): XRHandModel;
|
25
25
|
}
|
@@ -3,7 +3,7 @@ import { Group, Texture } from 'three';
|
|
3
3
|
import { XRHandModel, XRHandModelHandedness } from './XRHandModelFactory';
|
4
4
|
|
5
5
|
export interface XRHandPrimitiveModelOptions {
|
6
|
-
primitive?: 'sphere' | 'box';
|
6
|
+
primitive?: 'sphere' | 'box' | undefined;
|
7
7
|
}
|
8
8
|
|
9
9
|
export class XRHandPrimitiveModel {
|
package/csm/Frustum.d.ts
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
export default class Frustum {
|
2
|
-
constructor(data: any);
|
3
|
-
vertices: {
|
4
|
-
near: any[];
|
5
|
-
far: any[];
|
6
|
-
};
|
7
|
-
setFromProjectionMatrix(
|
8
|
-
projectionMatrix: any,
|
9
|
-
maxFar: any,
|
10
|
-
): {
|
11
|
-
near: any[];
|
12
|
-
far: any[];
|
13
|
-
};
|
14
|
-
split(breaks: any, target: any): void;
|
15
|
-
toSpace(cameraMatrix: any, target: any): void;
|
16
|
-
}
|
package/csm/Shader.d.ts
DELETED
package/loaders/XLoader.d.ts
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
import { Mesh, Loader, LoadingManager } from 'three';
|
2
|
-
|
3
|
-
export interface XResult {
|
4
|
-
animations: object[];
|
5
|
-
models: Mesh[];
|
6
|
-
}
|
7
|
-
|
8
|
-
export class XLoader extends Loader {
|
9
|
-
constructor(manager?: LoadingManager);
|
10
|
-
|
11
|
-
load(
|
12
|
-
url: string,
|
13
|
-
onLoad: (object: XResult) => void,
|
14
|
-
onProgress?: (event: ProgressEvent) => void,
|
15
|
-
onError?: (event: ErrorEvent) => void,
|
16
|
-
): void;
|
17
|
-
loadAsync(url: string, onProgress?: (event: ProgressEvent) => void): Promise<XResult>;
|
18
|
-
parse(data: ArrayBuffer | string, onLoad: (object: object) => void): object;
|
19
|
-
}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import { Uniform } from 'three';
|
2
|
-
|
3
|
-
export const FresnelShader: {
|
4
|
-
uniforms: {
|
5
|
-
mRefractionRatio: Uniform;
|
6
|
-
mFresnelBias: Uniform;
|
7
|
-
mFresnelPower: Uniform;
|
8
|
-
mFresnelScale: Uniform;
|
9
|
-
tCube: Uniform;
|
10
|
-
};
|
11
|
-
vertexShader: string;
|
12
|
-
fragmentShader: string;
|
13
|
-
};
|
@@ -1,20 +0,0 @@
|
|
1
|
-
import { Uniform } from 'three';
|
2
|
-
|
3
|
-
export const ParallaxShader: {
|
4
|
-
modes: {
|
5
|
-
none: string;
|
6
|
-
basic: string;
|
7
|
-
steep: string;
|
8
|
-
occlusion: string;
|
9
|
-
relief: string;
|
10
|
-
};
|
11
|
-
uniforms: {
|
12
|
-
bumpMap: Uniform;
|
13
|
-
map: Uniform;
|
14
|
-
parallaxScale: Uniform;
|
15
|
-
parallaxMinLayers: Uniform;
|
16
|
-
parallaxMaxLayers: Uniform;
|
17
|
-
};
|
18
|
-
vertexShader: string;
|
19
|
-
fragmentShader: string;
|
20
|
-
};
|
@@ -1,23 +0,0 @@
|
|
1
|
-
import { Group, Object3D } from 'three';
|
2
|
-
|
3
|
-
import { XRHandModel, XRHandModelHandedness } from './XRHandModelFactory';
|
4
|
-
|
5
|
-
export interface XRHandOculusMeshModelOptions {
|
6
|
-
model: 'lowpoly';
|
7
|
-
}
|
8
|
-
|
9
|
-
export class XRHandOculusMeshModel {
|
10
|
-
controller: Group;
|
11
|
-
handModel: XRHandModel;
|
12
|
-
bones: Array<Object3D | null>;
|
13
|
-
|
14
|
-
constructor(
|
15
|
-
handModel: XRHandModel,
|
16
|
-
controller: Group,
|
17
|
-
path: string,
|
18
|
-
handedness: XRHandModelHandedness,
|
19
|
-
options: XRHandOculusMeshModelOptions,
|
20
|
-
);
|
21
|
-
|
22
|
-
updateMesh: () => void;
|
23
|
-
}
|