super-three 0.155.0 → 0.156.0
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 +107 -125
- package/build/three.js +107 -125
- package/build/three.min.js +1 -1
- package/build/three.module.js +104 -126
- package/build/three.module.min.js +1 -1
- package/examples/jsm/controls/OrbitControls.js +13 -5
- package/examples/jsm/csm/CSMShader.js +35 -1
- package/examples/jsm/libs/tween.module.js +790 -735
- package/examples/jsm/libs/utif.module.js +1644 -1558
- package/examples/jsm/loaders/DDSLoader.js +46 -3
- package/examples/jsm/loaders/EXRLoader.js +4 -4
- package/examples/jsm/loaders/FBXLoader.js +2 -0
- package/examples/jsm/loaders/GLTFLoader.js +17 -7
- package/examples/jsm/loaders/KTX2Loader.js +126 -77
- package/examples/jsm/loaders/LogLuvLoader.js +2 -2
- package/examples/jsm/loaders/MMDLoader.js +10 -7
- package/examples/jsm/loaders/RGBELoader.js +48 -66
- package/examples/jsm/loaders/STLLoader.js +7 -0
- package/examples/jsm/nodes/Nodes.js +3 -0
- package/examples/jsm/nodes/accessors/BufferAttributeNode.js +28 -2
- package/examples/jsm/nodes/accessors/CubeTextureNode.js +18 -3
- package/examples/jsm/nodes/accessors/ExtendedMaterialNode.js +2 -4
- package/examples/jsm/nodes/accessors/LineMaterialNode.js +31 -0
- package/examples/jsm/nodes/accessors/MaterialNode.js +55 -33
- package/examples/jsm/nodes/accessors/MaterialReferenceNode.js +3 -0
- package/examples/jsm/nodes/accessors/Object3DNode.js +2 -2
- package/examples/jsm/nodes/accessors/TextureNode.js +6 -2
- package/examples/jsm/nodes/accessors/TextureStoreNode.js +29 -0
- package/examples/jsm/nodes/core/AttributeNode.js +2 -2
- package/examples/jsm/nodes/core/Node.js +17 -1
- package/examples/jsm/nodes/core/NodeBuilder.js +94 -12
- package/examples/jsm/nodes/core/NodeUniform.js +1 -1
- package/examples/jsm/nodes/core/OutputStructNode.js +58 -0
- package/examples/jsm/nodes/core/PropertyNode.js +2 -0
- package/examples/jsm/nodes/core/StackNode.js +4 -4
- package/examples/jsm/nodes/core/StructTypeNode.js +24 -0
- package/examples/jsm/nodes/display/ViewportNode.js +19 -5
- package/examples/jsm/nodes/materials/LineDashedNodeMaterial.js +54 -0
- package/examples/jsm/nodes/materials/Materials.js +1 -0
- package/examples/jsm/nodes/materials/NodeMaterial.js +12 -3
- package/examples/jsm/nodes/math/HashNode.js +35 -0
- package/examples/jsm/nodes/shadernode/ShaderNode.js +4 -0
- package/examples/jsm/nodes/utils/SplitNode.js +1 -1
- package/examples/jsm/postprocessing/FilmPass.js +3 -5
- package/examples/jsm/postprocessing/RenderPass.js +30 -12
- package/examples/jsm/postprocessing/SAOPass.js +23 -98
- package/examples/jsm/postprocessing/SSAOPass.js +10 -30
- package/examples/jsm/renderers/common/Backend.js +11 -8
- package/examples/jsm/renderers/common/Binding.js +6 -0
- package/examples/jsm/renderers/common/Bindings.js +5 -4
- package/examples/jsm/renderers/common/Pipelines.js +2 -2
- package/examples/jsm/renderers/common/RenderContexts.js +26 -1
- package/examples/jsm/renderers/common/RenderList.js +12 -4
- package/examples/jsm/renderers/common/RenderObject.js +6 -2
- package/examples/jsm/renderers/common/Renderer.js +12 -3
- package/examples/jsm/renderers/common/SampledTexture.js +2 -1
- package/examples/jsm/renderers/common/Sampler.js +1 -1
- package/examples/jsm/renderers/common/StorageBuffer.js +1 -1
- package/examples/jsm/renderers/common/Textures.js +155 -15
- package/examples/jsm/renderers/common/nodes/NodeSampledTexture.js +2 -2
- package/examples/jsm/renderers/common/nodes/NodeSampler.js +1 -1
- package/examples/jsm/renderers/common/nodes/Nodes.js +43 -9
- package/examples/jsm/renderers/webgl/WebGLBackend.js +607 -0
- package/examples/jsm/renderers/webgl/nodes/GLSLNodeBuilder.js +118 -17
- package/examples/jsm/renderers/webgl/utils/WebGLAttributeUtils.js +84 -0
- package/examples/jsm/renderers/webgl/utils/WebGLExtensions.js +26 -0
- package/examples/jsm/renderers/webgl/utils/WebGLState.js +529 -0
- package/examples/jsm/renderers/webgl/utils/WebGLTextureUtils.js +199 -0
- package/examples/jsm/renderers/webgl/utils/WebGLUtils.js +242 -0
- package/examples/jsm/renderers/webgl-legacy/nodes/GLSL1NodeBuilder.js +340 -0
- package/examples/jsm/renderers/{webgl → webgl-legacy}/nodes/WebGLNodeBuilder.js +1 -1
- package/examples/jsm/renderers/webgpu/WebGPUBackend.js +279 -40
- package/examples/jsm/renderers/webgpu/WebGPURenderer.js +18 -2
- package/examples/jsm/renderers/webgpu/nodes/WGSLNodeBuilder.js +89 -59
- package/examples/jsm/renderers/webgpu/nodes/WGSLNodeFunction.js +2 -2
- package/examples/jsm/renderers/webgpu/utils/WebGPUBindingUtils.js +15 -2
- package/examples/jsm/renderers/webgpu/utils/WebGPUPipelineUtils.js +34 -9
- package/examples/jsm/renderers/webgpu/utils/WebGPUTextureUtils.js +26 -135
- package/examples/jsm/renderers/webgpu/utils/WebGPUUtils.js +6 -5
- package/examples/jsm/shaders/FilmShader.js +11 -54
- package/examples/jsm/shaders/SAOShader.js +0 -13
- package/examples/jsm/shaders/SSAOShader.js +33 -26
- package/package.json +1 -1
- package/src/Three.js +1 -0
- package/src/audio/Audio.js +6 -0
- package/src/constants.js +4 -1
- package/src/core/Object3D.js +1 -14
- package/src/core/UniformsGroup.js +2 -2
- package/src/loaders/DataTextureLoader.js +0 -2
- package/src/materials/Material.js +2 -2
- package/src/math/Vector2.js +2 -2
- package/src/math/Vector3.js +3 -3
- package/src/math/Vector4.js +4 -4
- package/src/objects/Line.js +1 -1
- package/src/objects/Mesh.js +1 -1
- package/src/objects/Points.js +1 -1
- package/src/renderers/WebGLRenderer.js +21 -49
- package/src/renderers/shaders/ShaderChunk/map_fragment.glsl.js +11 -1
- package/src/renderers/shaders/ShaderLib/background.glsl.js +8 -0
- package/src/renderers/webgl/WebGLBackground.js +5 -14
- package/src/renderers/webgl/WebGLProgram.js +2 -0
- package/src/renderers/webgl/WebGLPrograms.js +5 -1
- package/src/renderers/webgl/WebGLTextures.js +4 -4
- package/src/renderers/webgl/WebGLUtils.js +27 -20
- package/src/textures/Texture.js +2 -2
- package/src/utils.js +9 -1
- /package/examples/jsm/renderers/{webgl → webgl-legacy}/nodes/SlotNode.js +0 -0
- /package/examples/jsm/renderers/{webgl → webgl-legacy}/nodes/WebGLNodes.js +0 -0
package/build/three.js
CHANGED
|
@@ -10,7 +10,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
10
10
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.THREE = {}));
|
|
11
11
|
})(this, (function (exports) { 'use strict';
|
|
12
12
|
|
|
13
|
-
const REVISION = '
|
|
13
|
+
const REVISION = '156';
|
|
14
14
|
|
|
15
15
|
const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
|
|
16
16
|
const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
|
|
@@ -134,6 +134,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
134
134
|
const RGBA_ASTC_12x10_Format = 37820;
|
|
135
135
|
const RGBA_ASTC_12x12_Format = 37821;
|
|
136
136
|
const RGBA_BPTC_Format = 36492;
|
|
137
|
+
const RGB_BPTC_SIGNED_Format = 36494;
|
|
138
|
+
const RGB_BPTC_UNSIGNED_Format = 36495;
|
|
137
139
|
const RED_RGTC1_Format = 36283;
|
|
138
140
|
const SIGNED_RED_RGTC1_Format = 36284;
|
|
139
141
|
const RED_GREEN_RGTC2_Format = 36285;
|
|
@@ -166,6 +168,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
166
168
|
const SRGBColorSpace = 'srgb';
|
|
167
169
|
const LinearSRGBColorSpace = 'srgb-linear';
|
|
168
170
|
const DisplayP3ColorSpace = 'display-p3';
|
|
171
|
+
const LinearDisplayP3ColorSpace = 'display-p3-linear';
|
|
169
172
|
|
|
170
173
|
const ZeroStencilOp = 0;
|
|
171
174
|
const KeepStencilOp = 7680;
|
|
@@ -926,8 +929,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
926
929
|
|
|
927
930
|
roundToZero() {
|
|
928
931
|
|
|
929
|
-
this.x =
|
|
930
|
-
this.y =
|
|
932
|
+
this.x = Math.trunc( this.x );
|
|
933
|
+
this.y = Math.trunc( this.y );
|
|
931
934
|
|
|
932
935
|
return this;
|
|
933
936
|
|
|
@@ -1535,6 +1538,14 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
1535
1538
|
|
|
1536
1539
|
}
|
|
1537
1540
|
|
|
1541
|
+
function createCanvasElement() {
|
|
1542
|
+
|
|
1543
|
+
const canvas = createElementNS( 'canvas' );
|
|
1544
|
+
canvas.style.display = 'block';
|
|
1545
|
+
return canvas;
|
|
1546
|
+
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1538
1549
|
const _cache = {};
|
|
1539
1550
|
|
|
1540
1551
|
function warnOnce( message ) {
|
|
@@ -1926,7 +1937,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
1926
1937
|
|
|
1927
1938
|
}
|
|
1928
1939
|
|
|
1929
|
-
let
|
|
1940
|
+
let _textureId = 0;
|
|
1930
1941
|
|
|
1931
1942
|
class Texture extends EventDispatcher {
|
|
1932
1943
|
|
|
@@ -1936,7 +1947,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
1936
1947
|
|
|
1937
1948
|
this.isTexture = true;
|
|
1938
1949
|
|
|
1939
|
-
Object.defineProperty( this, 'id', { value:
|
|
1950
|
+
Object.defineProperty( this, 'id', { value: _textureId ++ } );
|
|
1940
1951
|
|
|
1941
1952
|
this.uuid = generateUUID();
|
|
1942
1953
|
|
|
@@ -2746,10 +2757,10 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
2746
2757
|
|
|
2747
2758
|
roundToZero() {
|
|
2748
2759
|
|
|
2749
|
-
this.x =
|
|
2750
|
-
this.y =
|
|
2751
|
-
this.z =
|
|
2752
|
-
this.w =
|
|
2760
|
+
this.x = Math.trunc( this.x );
|
|
2761
|
+
this.y = Math.trunc( this.y );
|
|
2762
|
+
this.z = Math.trunc( this.z );
|
|
2763
|
+
this.w = Math.trunc( this.w );
|
|
2753
2764
|
|
|
2754
2765
|
return this;
|
|
2755
2766
|
|
|
@@ -4257,9 +4268,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
4257
4268
|
|
|
4258
4269
|
roundToZero() {
|
|
4259
4270
|
|
|
4260
|
-
this.x =
|
|
4261
|
-
this.y =
|
|
4262
|
-
this.z =
|
|
4271
|
+
this.x = Math.trunc( this.x );
|
|
4272
|
+
this.y = Math.trunc( this.y );
|
|
4273
|
+
this.z = Math.trunc( this.z );
|
|
4263
4274
|
|
|
4264
4275
|
return this;
|
|
4265
4276
|
|
|
@@ -7489,20 +7500,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
7489
7500
|
|
|
7490
7501
|
clear() {
|
|
7491
7502
|
|
|
7492
|
-
|
|
7493
|
-
|
|
7494
|
-
const object = this.children[ i ];
|
|
7495
|
-
|
|
7496
|
-
object.parent = null;
|
|
7497
|
-
|
|
7498
|
-
object.dispatchEvent( _removedEvent );
|
|
7499
|
-
|
|
7500
|
-
}
|
|
7501
|
-
|
|
7502
|
-
this.children.length = 0;
|
|
7503
|
-
|
|
7504
|
-
return this;
|
|
7505
|
-
|
|
7503
|
+
return this.remove( ... this.children );
|
|
7506
7504
|
|
|
7507
7505
|
}
|
|
7508
7506
|
|
|
@@ -8393,7 +8391,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
8393
8391
|
|
|
8394
8392
|
}
|
|
8395
8393
|
|
|
8396
|
-
let
|
|
8394
|
+
let _materialId = 0;
|
|
8397
8395
|
|
|
8398
8396
|
class Material extends EventDispatcher {
|
|
8399
8397
|
|
|
@@ -8403,7 +8401,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
8403
8401
|
|
|
8404
8402
|
this.isMaterial = true;
|
|
8405
8403
|
|
|
8406
|
-
Object.defineProperty( this, 'id', { value:
|
|
8404
|
+
Object.defineProperty( this, 'id', { value: _materialId ++ } );
|
|
8407
8405
|
|
|
8408
8406
|
this.uuid = generateUUID();
|
|
8409
8407
|
|
|
@@ -10372,7 +10370,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
10372
10370
|
|
|
10373
10371
|
}
|
|
10374
10372
|
|
|
10375
|
-
let _id$
|
|
10373
|
+
let _id$2 = 0;
|
|
10376
10374
|
|
|
10377
10375
|
const _m1 = /*@__PURE__*/ new Matrix4();
|
|
10378
10376
|
const _obj = /*@__PURE__*/ new Object3D();
|
|
@@ -10389,7 +10387,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
10389
10387
|
|
|
10390
10388
|
this.isBufferGeometry = true;
|
|
10391
10389
|
|
|
10392
|
-
Object.defineProperty( this, 'id', { value: _id$
|
|
10390
|
+
Object.defineProperty( this, 'id', { value: _id$2 ++ } );
|
|
10393
10391
|
|
|
10394
10392
|
this.uuid = generateUUID();
|
|
10395
10393
|
|
|
@@ -11494,7 +11492,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
11494
11492
|
|
|
11495
11493
|
}
|
|
11496
11494
|
|
|
11497
|
-
this.material = source.material;
|
|
11495
|
+
this.material = Array.isArray( source.material ) ? source.material.slice() : source.material;
|
|
11498
11496
|
this.geometry = source.geometry;
|
|
11499
11497
|
|
|
11500
11498
|
return this;
|
|
@@ -13784,7 +13782,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
13784
13782
|
|
|
13785
13783
|
var logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif";
|
|
13786
13784
|
|
|
13787
|
-
var map_fragment = "#ifdef USE_MAP\n\
|
|
13785
|
+
var map_fragment = "#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif";
|
|
13788
13786
|
|
|
13789
13787
|
var map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif";
|
|
13790
13788
|
|
|
@@ -13878,7 +13876,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
13878
13876
|
|
|
13879
13877
|
const vertex$h = "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}";
|
|
13880
13878
|
|
|
13881
|
-
const fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}";
|
|
13879
|
+
const fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}";
|
|
13882
13880
|
|
|
13883
13881
|
const vertex$g = "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}";
|
|
13884
13882
|
|
|
@@ -14698,24 +14696,15 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
14698
14696
|
|
|
14699
14697
|
}
|
|
14700
14698
|
|
|
14701
|
-
const
|
|
14702
|
-
const environmentBlendMode = xr.getEnvironmentBlendMode();
|
|
14699
|
+
const environmentBlendMode = renderer.xr.getEnvironmentBlendMode();
|
|
14703
14700
|
|
|
14704
|
-
|
|
14701
|
+
if ( environmentBlendMode === 'additive' ) {
|
|
14705
14702
|
|
|
14706
|
-
|
|
14707
|
-
forceClear = true;
|
|
14708
|
-
break;
|
|
14703
|
+
state.buffers.color.setClear( 0, 0, 0, 1, premultipliedAlpha );
|
|
14709
14704
|
|
|
14710
|
-
|
|
14711
|
-
state.buffers.color.setClear( 0, 0, 0, 1, premultipliedAlpha );
|
|
14712
|
-
forceClear = true;
|
|
14713
|
-
break;
|
|
14705
|
+
} else if ( environmentBlendMode === 'alpha-blend' ) {
|
|
14714
14706
|
|
|
14715
|
-
|
|
14716
|
-
state.buffers.color.setClear( 0, 0, 0, 0, premultipliedAlpha );
|
|
14717
|
-
forceClear = true;
|
|
14718
|
-
break;
|
|
14707
|
+
state.buffers.color.setClear( 0, 0, 0, 0, premultipliedAlpha );
|
|
14719
14708
|
|
|
14720
14709
|
}
|
|
14721
14710
|
|
|
@@ -19830,6 +19819,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
19830
19819
|
|
|
19831
19820
|
parameters.useLegacyLights ? '#define LEGACY_LIGHTS' : '',
|
|
19832
19821
|
|
|
19822
|
+
parameters.decodeVideoTexture ? '#define DECODE_VIDEO_TEXTURE' : '',
|
|
19823
|
+
|
|
19833
19824
|
parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
|
|
19834
19825
|
( parameters.logarithmicDepthBuffer && parameters.rendererExtensionFragDepth ) ? '#define USE_LOGDEPTHBUF_EXT' : '',
|
|
19835
19826
|
|
|
@@ -20064,7 +20055,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
20064
20055
|
|
|
20065
20056
|
}
|
|
20066
20057
|
|
|
20067
|
-
let _id = 0;
|
|
20058
|
+
let _id$1 = 0;
|
|
20068
20059
|
|
|
20069
20060
|
class WebGLShaderCache {
|
|
20070
20061
|
|
|
@@ -20178,7 +20169,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
20178
20169
|
|
|
20179
20170
|
constructor( code ) {
|
|
20180
20171
|
|
|
20181
|
-
this.id = _id ++;
|
|
20172
|
+
this.id = _id$1 ++;
|
|
20182
20173
|
|
|
20183
20174
|
this.code = code;
|
|
20184
20175
|
this.usedTimes = 0;
|
|
@@ -20517,6 +20508,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
20517
20508
|
toneMapping: toneMapping,
|
|
20518
20509
|
useLegacyLights: renderer._useLegacyLights,
|
|
20519
20510
|
|
|
20511
|
+
decodeVideoTexture: HAS_MAP && ( material.map.isVideoTexture === true ) && ( material.map.colorSpace === SRGBColorSpace ),
|
|
20512
|
+
|
|
20520
20513
|
premultipliedAlpha: material.premultipliedAlpha,
|
|
20521
20514
|
|
|
20522
20515
|
doubleSided: material.side === DoubleSide,
|
|
@@ -20718,6 +20711,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
20718
20711
|
_programLayers.enable( 17 );
|
|
20719
20712
|
if ( parameters.pointsUvs )
|
|
20720
20713
|
_programLayers.enable( 18 );
|
|
20714
|
+
if ( parameters.decodeVideoTexture )
|
|
20715
|
+
_programLayers.enable( 19 );
|
|
20721
20716
|
|
|
20722
20717
|
array.push( _programLayers.mask );
|
|
20723
20718
|
|
|
@@ -24278,7 +24273,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
24278
24273
|
glFormat = utils.convert( texture.format, texture.colorSpace );
|
|
24279
24274
|
|
|
24280
24275
|
let glType = utils.convert( texture.type ),
|
|
24281
|
-
glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace );
|
|
24276
|
+
glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace, texture.isVideoTexture );
|
|
24282
24277
|
|
|
24283
24278
|
setTextureParameters( textureType, texture, supportsMips );
|
|
24284
24279
|
|
|
@@ -25557,13 +25552,13 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
25557
25552
|
const format = texture.format;
|
|
25558
25553
|
const type = texture.type;
|
|
25559
25554
|
|
|
25560
|
-
if ( texture.isCompressedTexture === true || texture.format === _SRGBAFormat ) return image;
|
|
25555
|
+
if ( texture.isCompressedTexture === true || texture.isVideoTexture === true || texture.format === _SRGBAFormat ) return image;
|
|
25561
25556
|
|
|
25562
25557
|
if ( colorSpace !== LinearSRGBColorSpace && colorSpace !== NoColorSpace ) {
|
|
25563
25558
|
|
|
25564
25559
|
// sRGB
|
|
25565
25560
|
|
|
25566
|
-
if ( colorSpace === SRGBColorSpace ) {
|
|
25561
|
+
if ( colorSpace === SRGBColorSpace || colorSpace === DisplayP3ColorSpace ) {
|
|
25567
25562
|
|
|
25568
25563
|
if ( isWebGL2 === false ) {
|
|
25569
25564
|
|
|
@@ -25629,6 +25624,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
25629
25624
|
|
|
25630
25625
|
}
|
|
25631
25626
|
|
|
25627
|
+
const LinearTransferFunction = 0;
|
|
25628
|
+
const SRGBTransferFunction = 1;
|
|
25629
|
+
|
|
25632
25630
|
function WebGLUtils( gl, extensions, capabilities ) {
|
|
25633
25631
|
|
|
25634
25632
|
const isWebGL2 = capabilities.isWebGL2;
|
|
@@ -25637,6 +25635,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
25637
25635
|
|
|
25638
25636
|
let extension;
|
|
25639
25637
|
|
|
25638
|
+
const transferFunction = ( colorSpace === SRGBColorSpace || colorSpace === DisplayP3ColorSpace ) ? SRGBTransferFunction : LinearTransferFunction;
|
|
25639
|
+
|
|
25640
25640
|
if ( p === UnsignedByteType ) return gl.UNSIGNED_BYTE;
|
|
25641
25641
|
if ( p === UnsignedShort4444Type ) return gl.UNSIGNED_SHORT_4_4_4_4;
|
|
25642
25642
|
if ( p === UnsignedShort5551Type ) return gl.UNSIGNED_SHORT_5_5_5_1;
|
|
@@ -25703,7 +25703,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
25703
25703
|
|
|
25704
25704
|
if ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format || p === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) {
|
|
25705
25705
|
|
|
25706
|
-
if (
|
|
25706
|
+
if ( transferFunction === SRGBTransferFunction ) {
|
|
25707
25707
|
|
|
25708
25708
|
extension = extensions.get( 'WEBGL_compressed_texture_s3tc_srgb' );
|
|
25709
25709
|
|
|
@@ -25788,8 +25788,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
25788
25788
|
|
|
25789
25789
|
if ( extension !== null ) {
|
|
25790
25790
|
|
|
25791
|
-
if ( p === RGB_ETC2_Format ) return (
|
|
25792
|
-
if ( p === RGBA_ETC2_EAC_Format ) return (
|
|
25791
|
+
if ( p === RGB_ETC2_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ETC2 : extension.COMPRESSED_RGB8_ETC2;
|
|
25792
|
+
if ( p === RGBA_ETC2_EAC_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : extension.COMPRESSED_RGBA8_ETC2_EAC;
|
|
25793
25793
|
|
|
25794
25794
|
} else {
|
|
25795
25795
|
|
|
@@ -25811,20 +25811,20 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
25811
25811
|
|
|
25812
25812
|
if ( extension !== null ) {
|
|
25813
25813
|
|
|
25814
|
-
if ( p === RGBA_ASTC_4x4_Format ) return (
|
|
25815
|
-
if ( p === RGBA_ASTC_5x4_Format ) return (
|
|
25816
|
-
if ( p === RGBA_ASTC_5x5_Format ) return (
|
|
25817
|
-
if ( p === RGBA_ASTC_6x5_Format ) return (
|
|
25818
|
-
if ( p === RGBA_ASTC_6x6_Format ) return (
|
|
25819
|
-
if ( p === RGBA_ASTC_8x5_Format ) return (
|
|
25820
|
-
if ( p === RGBA_ASTC_8x6_Format ) return (
|
|
25821
|
-
if ( p === RGBA_ASTC_8x8_Format ) return (
|
|
25822
|
-
if ( p === RGBA_ASTC_10x5_Format ) return (
|
|
25823
|
-
if ( p === RGBA_ASTC_10x6_Format ) return (
|
|
25824
|
-
if ( p === RGBA_ASTC_10x8_Format ) return (
|
|
25825
|
-
if ( p === RGBA_ASTC_10x10_Format ) return (
|
|
25826
|
-
if ( p === RGBA_ASTC_12x10_Format ) return (
|
|
25827
|
-
if ( p === RGBA_ASTC_12x12_Format ) return (
|
|
25814
|
+
if ( p === RGBA_ASTC_4x4_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : extension.COMPRESSED_RGBA_ASTC_4x4_KHR;
|
|
25815
|
+
if ( p === RGBA_ASTC_5x4_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : extension.COMPRESSED_RGBA_ASTC_5x4_KHR;
|
|
25816
|
+
if ( p === RGBA_ASTC_5x5_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : extension.COMPRESSED_RGBA_ASTC_5x5_KHR;
|
|
25817
|
+
if ( p === RGBA_ASTC_6x5_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : extension.COMPRESSED_RGBA_ASTC_6x5_KHR;
|
|
25818
|
+
if ( p === RGBA_ASTC_6x6_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : extension.COMPRESSED_RGBA_ASTC_6x6_KHR;
|
|
25819
|
+
if ( p === RGBA_ASTC_8x5_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : extension.COMPRESSED_RGBA_ASTC_8x5_KHR;
|
|
25820
|
+
if ( p === RGBA_ASTC_8x6_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : extension.COMPRESSED_RGBA_ASTC_8x6_KHR;
|
|
25821
|
+
if ( p === RGBA_ASTC_8x8_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : extension.COMPRESSED_RGBA_ASTC_8x8_KHR;
|
|
25822
|
+
if ( p === RGBA_ASTC_10x5_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : extension.COMPRESSED_RGBA_ASTC_10x5_KHR;
|
|
25823
|
+
if ( p === RGBA_ASTC_10x6_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : extension.COMPRESSED_RGBA_ASTC_10x6_KHR;
|
|
25824
|
+
if ( p === RGBA_ASTC_10x8_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : extension.COMPRESSED_RGBA_ASTC_10x8_KHR;
|
|
25825
|
+
if ( p === RGBA_ASTC_10x10_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : extension.COMPRESSED_RGBA_ASTC_10x10_KHR;
|
|
25826
|
+
if ( p === RGBA_ASTC_12x10_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : extension.COMPRESSED_RGBA_ASTC_12x10_KHR;
|
|
25827
|
+
if ( p === RGBA_ASTC_12x12_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : extension.COMPRESSED_RGBA_ASTC_12x12_KHR;
|
|
25828
25828
|
|
|
25829
25829
|
} else {
|
|
25830
25830
|
|
|
@@ -25836,13 +25836,15 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
25836
25836
|
|
|
25837
25837
|
// BPTC
|
|
25838
25838
|
|
|
25839
|
-
if ( p === RGBA_BPTC_Format ) {
|
|
25839
|
+
if ( p === RGBA_BPTC_Format || p === RGB_BPTC_SIGNED_Format || p === RGB_BPTC_UNSIGNED_Format ) {
|
|
25840
25840
|
|
|
25841
25841
|
extension = extensions.get( 'EXT_texture_compression_bptc' );
|
|
25842
25842
|
|
|
25843
25843
|
if ( extension !== null ) {
|
|
25844
25844
|
|
|
25845
|
-
if ( p === RGBA_BPTC_Format ) return (
|
|
25845
|
+
if ( p === RGBA_BPTC_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : extension.COMPRESSED_RGBA_BPTC_UNORM_EXT;
|
|
25846
|
+
if ( p === RGB_BPTC_SIGNED_Format ) return extension.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;
|
|
25847
|
+
if ( p === RGB_BPTC_UNSIGNED_Format ) return extension.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT;
|
|
25846
25848
|
|
|
25847
25849
|
} else {
|
|
25848
25850
|
|
|
@@ -28630,14 +28632,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
28630
28632
|
|
|
28631
28633
|
}
|
|
28632
28634
|
|
|
28633
|
-
function createCanvasElement() {
|
|
28634
|
-
|
|
28635
|
-
const canvas = createElementNS( 'canvas' );
|
|
28636
|
-
canvas.style.display = 'block';
|
|
28637
|
-
return canvas;
|
|
28638
|
-
|
|
28639
|
-
}
|
|
28640
|
-
|
|
28641
28635
|
class WebGLRenderer {
|
|
28642
28636
|
|
|
28643
28637
|
constructor( parameters = {} ) {
|
|
@@ -30368,48 +30362,28 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
30368
30362
|
|
|
30369
30363
|
if ( refreshProgram || _currentCamera !== camera ) {
|
|
30370
30364
|
|
|
30371
|
-
|
|
30372
|
-
|
|
30373
|
-
if ( capabilities.logarithmicDepthBuffer ) {
|
|
30374
|
-
|
|
30375
|
-
p_uniforms.setValue( _gl, 'logDepthBufFC',
|
|
30376
|
-
2.0 / ( Math.log( camera.far + 1.0 ) / Math.LN2 ) );
|
|
30365
|
+
// common camera uniforms
|
|
30377
30366
|
|
|
30378
|
-
|
|
30367
|
+
p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix );
|
|
30368
|
+
p_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse );
|
|
30379
30369
|
|
|
30380
|
-
|
|
30370
|
+
const uCamPos = p_uniforms.map.cameraPosition;
|
|
30381
30371
|
|
|
30382
|
-
|
|
30372
|
+
if ( uCamPos !== undefined ) {
|
|
30383
30373
|
|
|
30384
|
-
|
|
30385
|
-
// now, in case this material supports lights - or later, when
|
|
30386
|
-
// the next material that does gets activated:
|
|
30387
|
-
|
|
30388
|
-
refreshMaterial = true; // set to true on material change
|
|
30389
|
-
refreshLights = true; // remains set until update done
|
|
30374
|
+
uCamPos.setValue( _gl, _vector3.setFromMatrixPosition( camera.matrixWorld ) );
|
|
30390
30375
|
|
|
30391
30376
|
}
|
|
30392
30377
|
|
|
30393
|
-
|
|
30394
|
-
// (shader material also gets them for the sake of genericity)
|
|
30395
|
-
|
|
30396
|
-
if ( material.isShaderMaterial ||
|
|
30397
|
-
material.isMeshPhongMaterial ||
|
|
30398
|
-
material.isMeshToonMaterial ||
|
|
30399
|
-
material.isMeshStandardMaterial ||
|
|
30400
|
-
material.envMap ) {
|
|
30401
|
-
|
|
30402
|
-
const uCamPos = p_uniforms.map.cameraPosition;
|
|
30403
|
-
|
|
30404
|
-
if ( uCamPos !== undefined ) {
|
|
30405
|
-
|
|
30406
|
-
uCamPos.setValue( _gl,
|
|
30407
|
-
_vector3.setFromMatrixPosition( camera.matrixWorld ) );
|
|
30378
|
+
if ( capabilities.logarithmicDepthBuffer ) {
|
|
30408
30379
|
|
|
30409
|
-
|
|
30380
|
+
p_uniforms.setValue( _gl, 'logDepthBufFC',
|
|
30381
|
+
2.0 / ( Math.log( camera.far + 1.0 ) / Math.LN2 ) );
|
|
30410
30382
|
|
|
30411
30383
|
}
|
|
30412
30384
|
|
|
30385
|
+
// consider moving isOrthographic to UniformLib and WebGLMaterials, see https://github.com/mrdoob/three.js/pull/26467#issuecomment-1645185067
|
|
30386
|
+
|
|
30413
30387
|
if ( material.isMeshPhongMaterial ||
|
|
30414
30388
|
material.isMeshToonMaterial ||
|
|
30415
30389
|
material.isMeshLambertMaterial ||
|
|
@@ -30421,16 +30395,16 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
30421
30395
|
|
|
30422
30396
|
}
|
|
30423
30397
|
|
|
30424
|
-
if (
|
|
30425
|
-
|
|
30426
|
-
|
|
30427
|
-
|
|
30428
|
-
|
|
30429
|
-
material
|
|
30430
|
-
material
|
|
30431
|
-
object.isSkinnedMesh ) {
|
|
30398
|
+
if ( _currentCamera !== camera ) {
|
|
30399
|
+
|
|
30400
|
+
_currentCamera = camera;
|
|
30401
|
+
|
|
30402
|
+
// lighting uniforms depend on the camera so enforce an update
|
|
30403
|
+
// now, in case this material supports lights - or later, when
|
|
30404
|
+
// the next material that does gets activated:
|
|
30432
30405
|
|
|
30433
|
-
|
|
30406
|
+
refreshMaterial = true; // set to true on material change
|
|
30407
|
+
refreshLights = true; // remains set until update done
|
|
30434
30408
|
|
|
30435
30409
|
}
|
|
30436
30410
|
|
|
@@ -32987,7 +32961,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
32987
32961
|
|
|
32988
32962
|
super.copy( source, recursive );
|
|
32989
32963
|
|
|
32990
|
-
this.material = source.material;
|
|
32964
|
+
this.material = Array.isArray( source.material ) ? source.material.slice() : source.material;
|
|
32991
32965
|
this.geometry = source.geometry;
|
|
32992
32966
|
|
|
32993
32967
|
return this;
|
|
@@ -33308,7 +33282,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
33308
33282
|
|
|
33309
33283
|
super.copy( source, recursive );
|
|
33310
33284
|
|
|
33311
|
-
this.material = source.material;
|
|
33285
|
+
this.material = Array.isArray( source.material ) ? source.material.slice() : source.material;
|
|
33312
33286
|
this.geometry = source.geometry;
|
|
33313
33287
|
|
|
33314
33288
|
return this;
|
|
@@ -43144,8 +43118,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
43144
43118
|
|
|
43145
43119
|
}
|
|
43146
43120
|
|
|
43147
|
-
if ( ! texData ) return onError(); // TODO: Remove this when all loaders properly throw errors
|
|
43148
|
-
|
|
43149
43121
|
if ( texData.image !== undefined ) {
|
|
43150
43122
|
|
|
43151
43123
|
texture.image = texData.image;
|
|
@@ -46566,6 +46538,12 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
46566
46538
|
|
|
46567
46539
|
disconnect() {
|
|
46568
46540
|
|
|
46541
|
+
if ( this._connected === false ) {
|
|
46542
|
+
|
|
46543
|
+
return;
|
|
46544
|
+
|
|
46545
|
+
}
|
|
46546
|
+
|
|
46569
46547
|
if ( this.filters.length > 0 ) {
|
|
46570
46548
|
|
|
46571
46549
|
this.source.disconnect( this.filters[ 0 ] );
|
|
@@ -49814,7 +49792,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
49814
49792
|
|
|
49815
49793
|
}
|
|
49816
49794
|
|
|
49817
|
-
let
|
|
49795
|
+
let _id = 0;
|
|
49818
49796
|
|
|
49819
49797
|
class UniformsGroup extends EventDispatcher {
|
|
49820
49798
|
|
|
@@ -49824,7 +49802,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
49824
49802
|
|
|
49825
49803
|
this.isUniformsGroup = true;
|
|
49826
49804
|
|
|
49827
|
-
Object.defineProperty( this, 'id', { value:
|
|
49805
|
+
Object.defineProperty( this, 'id', { value: _id ++ } );
|
|
49828
49806
|
|
|
49829
49807
|
this.name = '';
|
|
49830
49808
|
|
|
@@ -52268,6 +52246,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
52268
52246
|
exports.LineDashedMaterial = LineDashedMaterial;
|
|
52269
52247
|
exports.LineLoop = LineLoop;
|
|
52270
52248
|
exports.LineSegments = LineSegments;
|
|
52249
|
+
exports.LinearDisplayP3ColorSpace = LinearDisplayP3ColorSpace;
|
|
52271
52250
|
exports.LinearEncoding = LinearEncoding;
|
|
52272
52251
|
exports.LinearFilter = LinearFilter;
|
|
52273
52252
|
exports.LinearInterpolant = LinearInterpolant;
|
|
@@ -52384,6 +52363,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
52384
52363
|
exports.RGBA_S3TC_DXT1_Format = RGBA_S3TC_DXT1_Format;
|
|
52385
52364
|
exports.RGBA_S3TC_DXT3_Format = RGBA_S3TC_DXT3_Format;
|
|
52386
52365
|
exports.RGBA_S3TC_DXT5_Format = RGBA_S3TC_DXT5_Format;
|
|
52366
|
+
exports.RGB_BPTC_SIGNED_Format = RGB_BPTC_SIGNED_Format;
|
|
52367
|
+
exports.RGB_BPTC_UNSIGNED_Format = RGB_BPTC_UNSIGNED_Format;
|
|
52387
52368
|
exports.RGB_ETC1_Format = RGB_ETC1_Format;
|
|
52388
52369
|
exports.RGB_ETC2_Format = RGB_ETC2_Format;
|
|
52389
52370
|
exports.RGB_PVRTC_2BPPV1_Format = RGB_PVRTC_2BPPV1_Format;
|
|
@@ -52493,6 +52474,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
52493
52474
|
exports.ZeroSlopeEnding = ZeroSlopeEnding;
|
|
52494
52475
|
exports.ZeroStencilOp = ZeroStencilOp;
|
|
52495
52476
|
exports._SRGBAFormat = _SRGBAFormat;
|
|
52477
|
+
exports.createCanvasElement = createCanvasElement;
|
|
52496
52478
|
exports.sRGBEncoding = sRGBEncoding;
|
|
52497
52479
|
|
|
52498
52480
|
}));
|