3d-force-graph 1.72.1 → 1.72.3
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/dist/3d-force-graph.d.ts
CHANGED
|
@@ -78,4 +78,4 @@ type ForceGraph3DInstance = ForceGraph3DGenericInstance<ForceGraph3DInstance>;
|
|
|
78
78
|
|
|
79
79
|
declare function ForceGraph3D(configOptions?: ConfigOptions): ForceGraph3DInstance;
|
|
80
80
|
|
|
81
|
-
export { ConfigOptions, ForceGraph3DGenericInstance, ForceGraph3DInstance, ForceGraph3D as default };
|
|
81
|
+
export { type ConfigOptions, type ForceGraph3DGenericInstance, type ForceGraph3DInstance, ForceGraph3D as default };
|
package/dist/3d-force-graph.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Version 1.72.
|
|
1
|
+
// Version 1.72.3 3d-force-graph - https://github.com/vasturiano/3d-force-graph
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
@@ -35,26 +35,26 @@
|
|
|
35
35
|
var css_248z$1 = ".graph-info-msg {\n top: 50%;\n width: 100%;\n text-align: center;\n color: lavender;\n opacity: 0.7;\n font-size: 22px;\n position: absolute;\n font-family: Sans-serif;\n}\n\n.scene-container .clickable {\n cursor: pointer;\n}\n\n.scene-container .grabbable {\n cursor: move;\n cursor: grab;\n cursor: -moz-grab;\n cursor: -webkit-grab;\n}\n\n.scene-container .grabbable:active {\n cursor: grabbing;\n cursor: -moz-grabbing;\n cursor: -webkit-grabbing;\n}";
|
|
36
36
|
styleInject$1(css_248z$1);
|
|
37
37
|
|
|
38
|
-
function ownKeys$2(
|
|
39
|
-
var
|
|
38
|
+
function ownKeys$2(e, r) {
|
|
39
|
+
var t = Object.keys(e);
|
|
40
40
|
if (Object.getOwnPropertySymbols) {
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
return Object.getOwnPropertyDescriptor(
|
|
44
|
-
})),
|
|
41
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
42
|
+
r && (o = o.filter(function (r) {
|
|
43
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
44
|
+
})), t.push.apply(t, o);
|
|
45
45
|
}
|
|
46
|
-
return
|
|
46
|
+
return t;
|
|
47
47
|
}
|
|
48
|
-
function _objectSpread2$2(
|
|
49
|
-
for (var
|
|
50
|
-
var
|
|
51
|
-
|
|
52
|
-
_defineProperty$3(
|
|
53
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(
|
|
54
|
-
Object.defineProperty(
|
|
48
|
+
function _objectSpread2$2(e) {
|
|
49
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
50
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
51
|
+
r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) {
|
|
52
|
+
_defineProperty$3(e, r, t[r]);
|
|
53
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) {
|
|
54
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
-
return
|
|
57
|
+
return e;
|
|
58
58
|
}
|
|
59
59
|
function _defineProperty$3(obj, key, value) {
|
|
60
60
|
key = _toPropertyKey$5(key);
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
* Copyright 2010-2023 Three.js Authors
|
|
116
116
|
* SPDX-License-Identifier: MIT
|
|
117
117
|
*/
|
|
118
|
-
const REVISION = '
|
|
118
|
+
const REVISION = '156';
|
|
119
119
|
|
|
120
120
|
const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
|
|
121
121
|
const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
|
|
@@ -232,6 +232,8 @@
|
|
|
232
232
|
const RGBA_ASTC_12x10_Format = 37820;
|
|
233
233
|
const RGBA_ASTC_12x12_Format = 37821;
|
|
234
234
|
const RGBA_BPTC_Format = 36492;
|
|
235
|
+
const RGB_BPTC_SIGNED_Format = 36494;
|
|
236
|
+
const RGB_BPTC_UNSIGNED_Format = 36495;
|
|
235
237
|
const RED_RGTC1_Format = 36283;
|
|
236
238
|
const SIGNED_RED_RGTC1_Format = 36284;
|
|
237
239
|
const RED_GREEN_RGTC2_Format = 36285;
|
|
@@ -984,8 +986,8 @@
|
|
|
984
986
|
|
|
985
987
|
roundToZero() {
|
|
986
988
|
|
|
987
|
-
this.x =
|
|
988
|
-
this.y =
|
|
989
|
+
this.x = Math.trunc( this.x );
|
|
990
|
+
this.y = Math.trunc( this.y );
|
|
989
991
|
|
|
990
992
|
return this;
|
|
991
993
|
|
|
@@ -1575,6 +1577,14 @@
|
|
|
1575
1577
|
|
|
1576
1578
|
}
|
|
1577
1579
|
|
|
1580
|
+
function createCanvasElement() {
|
|
1581
|
+
|
|
1582
|
+
const canvas = createElementNS( 'canvas' );
|
|
1583
|
+
canvas.style.display = 'block';
|
|
1584
|
+
return canvas;
|
|
1585
|
+
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1578
1588
|
const _cache = {};
|
|
1579
1589
|
|
|
1580
1590
|
function warnOnce( message ) {
|
|
@@ -1966,7 +1976,7 @@
|
|
|
1966
1976
|
|
|
1967
1977
|
}
|
|
1968
1978
|
|
|
1969
|
-
let
|
|
1979
|
+
let _textureId = 0;
|
|
1970
1980
|
|
|
1971
1981
|
class Texture extends EventDispatcher {
|
|
1972
1982
|
|
|
@@ -1976,7 +1986,7 @@
|
|
|
1976
1986
|
|
|
1977
1987
|
this.isTexture = true;
|
|
1978
1988
|
|
|
1979
|
-
Object.defineProperty( this, 'id', { value:
|
|
1989
|
+
Object.defineProperty( this, 'id', { value: _textureId ++ } );
|
|
1980
1990
|
|
|
1981
1991
|
this.uuid = generateUUID();
|
|
1982
1992
|
|
|
@@ -2786,10 +2796,10 @@
|
|
|
2786
2796
|
|
|
2787
2797
|
roundToZero() {
|
|
2788
2798
|
|
|
2789
|
-
this.x =
|
|
2790
|
-
this.y =
|
|
2791
|
-
this.z =
|
|
2792
|
-
this.w =
|
|
2799
|
+
this.x = Math.trunc( this.x );
|
|
2800
|
+
this.y = Math.trunc( this.y );
|
|
2801
|
+
this.z = Math.trunc( this.z );
|
|
2802
|
+
this.w = Math.trunc( this.w );
|
|
2793
2803
|
|
|
2794
2804
|
return this;
|
|
2795
2805
|
|
|
@@ -4182,9 +4192,9 @@
|
|
|
4182
4192
|
|
|
4183
4193
|
roundToZero() {
|
|
4184
4194
|
|
|
4185
|
-
this.x =
|
|
4186
|
-
this.y =
|
|
4187
|
-
this.z =
|
|
4195
|
+
this.x = Math.trunc( this.x );
|
|
4196
|
+
this.y = Math.trunc( this.y );
|
|
4197
|
+
this.z = Math.trunc( this.z );
|
|
4188
4198
|
|
|
4189
4199
|
return this;
|
|
4190
4200
|
|
|
@@ -7414,20 +7424,7 @@
|
|
|
7414
7424
|
|
|
7415
7425
|
clear() {
|
|
7416
7426
|
|
|
7417
|
-
|
|
7418
|
-
|
|
7419
|
-
const object = this.children[ i ];
|
|
7420
|
-
|
|
7421
|
-
object.parent = null;
|
|
7422
|
-
|
|
7423
|
-
object.dispatchEvent( _removedEvent );
|
|
7424
|
-
|
|
7425
|
-
}
|
|
7426
|
-
|
|
7427
|
-
this.children.length = 0;
|
|
7428
|
-
|
|
7429
|
-
return this;
|
|
7430
|
-
|
|
7427
|
+
return this.remove( ... this.children );
|
|
7431
7428
|
|
|
7432
7429
|
}
|
|
7433
7430
|
|
|
@@ -8318,7 +8315,7 @@
|
|
|
8318
8315
|
|
|
8319
8316
|
}
|
|
8320
8317
|
|
|
8321
|
-
let
|
|
8318
|
+
let _materialId = 0;
|
|
8322
8319
|
|
|
8323
8320
|
class Material extends EventDispatcher {
|
|
8324
8321
|
|
|
@@ -8328,7 +8325,7 @@
|
|
|
8328
8325
|
|
|
8329
8326
|
this.isMaterial = true;
|
|
8330
8327
|
|
|
8331
|
-
Object.defineProperty( this, 'id', { value:
|
|
8328
|
+
Object.defineProperty( this, 'id', { value: _materialId ++ } );
|
|
8332
8329
|
|
|
8333
8330
|
this.uuid = generateUUID();
|
|
8334
8331
|
|
|
@@ -9914,7 +9911,7 @@
|
|
|
9914
9911
|
|
|
9915
9912
|
}
|
|
9916
9913
|
|
|
9917
|
-
let _id$
|
|
9914
|
+
let _id$2 = 0;
|
|
9918
9915
|
|
|
9919
9916
|
const _m1 = /*@__PURE__*/ new Matrix4();
|
|
9920
9917
|
const _obj = /*@__PURE__*/ new Object3D();
|
|
@@ -9931,7 +9928,7 @@
|
|
|
9931
9928
|
|
|
9932
9929
|
this.isBufferGeometry = true;
|
|
9933
9930
|
|
|
9934
|
-
Object.defineProperty( this, 'id', { value: _id$
|
|
9931
|
+
Object.defineProperty( this, 'id', { value: _id$2 ++ } );
|
|
9935
9932
|
|
|
9936
9933
|
this.uuid = generateUUID();
|
|
9937
9934
|
|
|
@@ -11036,7 +11033,7 @@
|
|
|
11036
11033
|
|
|
11037
11034
|
}
|
|
11038
11035
|
|
|
11039
|
-
this.material = source.material;
|
|
11036
|
+
this.material = Array.isArray( source.material ) ? source.material.slice() : source.material;
|
|
11040
11037
|
this.geometry = source.geometry;
|
|
11041
11038
|
|
|
11042
11039
|
return this;
|
|
@@ -13326,7 +13323,7 @@
|
|
|
13326
13323
|
|
|
13327
13324
|
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";
|
|
13328
13325
|
|
|
13329
|
-
var map_fragment = "#ifdef USE_MAP\n\
|
|
13326
|
+
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";
|
|
13330
13327
|
|
|
13331
13328
|
var map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif";
|
|
13332
13329
|
|
|
@@ -13420,7 +13417,7 @@
|
|
|
13420
13417
|
|
|
13421
13418
|
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}";
|
|
13422
13419
|
|
|
13423
|
-
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}";
|
|
13420
|
+
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}";
|
|
13424
13421
|
|
|
13425
13422
|
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}";
|
|
13426
13423
|
|
|
@@ -14240,24 +14237,15 @@
|
|
|
14240
14237
|
|
|
14241
14238
|
}
|
|
14242
14239
|
|
|
14243
|
-
const
|
|
14244
|
-
const environmentBlendMode = xr.getEnvironmentBlendMode();
|
|
14240
|
+
const environmentBlendMode = renderer.xr.getEnvironmentBlendMode();
|
|
14245
14241
|
|
|
14246
|
-
|
|
14242
|
+
if ( environmentBlendMode === 'additive' ) {
|
|
14247
14243
|
|
|
14248
|
-
|
|
14249
|
-
forceClear = true;
|
|
14250
|
-
break;
|
|
14244
|
+
state.buffers.color.setClear( 0, 0, 0, 1, premultipliedAlpha );
|
|
14251
14245
|
|
|
14252
|
-
|
|
14253
|
-
state.buffers.color.setClear( 0, 0, 0, 1, premultipliedAlpha );
|
|
14254
|
-
forceClear = true;
|
|
14255
|
-
break;
|
|
14246
|
+
} else if ( environmentBlendMode === 'alpha-blend' ) {
|
|
14256
14247
|
|
|
14257
|
-
|
|
14258
|
-
state.buffers.color.setClear( 0, 0, 0, 0, premultipliedAlpha );
|
|
14259
|
-
forceClear = true;
|
|
14260
|
-
break;
|
|
14248
|
+
state.buffers.color.setClear( 0, 0, 0, 0, premultipliedAlpha );
|
|
14261
14249
|
|
|
14262
14250
|
}
|
|
14263
14251
|
|
|
@@ -19372,6 +19360,8 @@
|
|
|
19372
19360
|
|
|
19373
19361
|
parameters.useLegacyLights ? '#define LEGACY_LIGHTS' : '',
|
|
19374
19362
|
|
|
19363
|
+
parameters.decodeVideoTexture ? '#define DECODE_VIDEO_TEXTURE' : '',
|
|
19364
|
+
|
|
19375
19365
|
parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
|
|
19376
19366
|
( parameters.logarithmicDepthBuffer && parameters.rendererExtensionFragDepth ) ? '#define USE_LOGDEPTHBUF_EXT' : '',
|
|
19377
19367
|
|
|
@@ -19606,7 +19596,7 @@
|
|
|
19606
19596
|
|
|
19607
19597
|
}
|
|
19608
19598
|
|
|
19609
|
-
let _id = 0;
|
|
19599
|
+
let _id$1 = 0;
|
|
19610
19600
|
|
|
19611
19601
|
class WebGLShaderCache {
|
|
19612
19602
|
|
|
@@ -19720,7 +19710,7 @@
|
|
|
19720
19710
|
|
|
19721
19711
|
constructor( code ) {
|
|
19722
19712
|
|
|
19723
|
-
this.id = _id ++;
|
|
19713
|
+
this.id = _id$1 ++;
|
|
19724
19714
|
|
|
19725
19715
|
this.code = code;
|
|
19726
19716
|
this.usedTimes = 0;
|
|
@@ -20059,6 +20049,8 @@
|
|
|
20059
20049
|
toneMapping: toneMapping,
|
|
20060
20050
|
useLegacyLights: renderer._useLegacyLights,
|
|
20061
20051
|
|
|
20052
|
+
decodeVideoTexture: HAS_MAP && ( material.map.isVideoTexture === true ) && ( material.map.colorSpace === SRGBColorSpace ),
|
|
20053
|
+
|
|
20062
20054
|
premultipliedAlpha: material.premultipliedAlpha,
|
|
20063
20055
|
|
|
20064
20056
|
doubleSided: material.side === DoubleSide,
|
|
@@ -20260,6 +20252,8 @@
|
|
|
20260
20252
|
_programLayers.enable( 17 );
|
|
20261
20253
|
if ( parameters.pointsUvs )
|
|
20262
20254
|
_programLayers.enable( 18 );
|
|
20255
|
+
if ( parameters.decodeVideoTexture )
|
|
20256
|
+
_programLayers.enable( 19 );
|
|
20263
20257
|
|
|
20264
20258
|
array.push( _programLayers.mask );
|
|
20265
20259
|
|
|
@@ -23820,7 +23814,7 @@
|
|
|
23820
23814
|
glFormat = utils.convert( texture.format, texture.colorSpace );
|
|
23821
23815
|
|
|
23822
23816
|
let glType = utils.convert( texture.type ),
|
|
23823
|
-
glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace );
|
|
23817
|
+
glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace, texture.isVideoTexture );
|
|
23824
23818
|
|
|
23825
23819
|
setTextureParameters( textureType, texture, supportsMips );
|
|
23826
23820
|
|
|
@@ -25099,13 +25093,13 @@
|
|
|
25099
25093
|
const format = texture.format;
|
|
25100
25094
|
const type = texture.type;
|
|
25101
25095
|
|
|
25102
|
-
if ( texture.isCompressedTexture === true || texture.format === _SRGBAFormat ) return image;
|
|
25096
|
+
if ( texture.isCompressedTexture === true || texture.isVideoTexture === true || texture.format === _SRGBAFormat ) return image;
|
|
25103
25097
|
|
|
25104
25098
|
if ( colorSpace !== LinearSRGBColorSpace && colorSpace !== NoColorSpace ) {
|
|
25105
25099
|
|
|
25106
25100
|
// sRGB
|
|
25107
25101
|
|
|
25108
|
-
if ( colorSpace === SRGBColorSpace ) {
|
|
25102
|
+
if ( colorSpace === SRGBColorSpace || colorSpace === DisplayP3ColorSpace ) {
|
|
25109
25103
|
|
|
25110
25104
|
if ( isWebGL2 === false ) {
|
|
25111
25105
|
|
|
@@ -25171,6 +25165,9 @@
|
|
|
25171
25165
|
|
|
25172
25166
|
}
|
|
25173
25167
|
|
|
25168
|
+
const LinearTransferFunction = 0;
|
|
25169
|
+
const SRGBTransferFunction = 1;
|
|
25170
|
+
|
|
25174
25171
|
function WebGLUtils( gl, extensions, capabilities ) {
|
|
25175
25172
|
|
|
25176
25173
|
const isWebGL2 = capabilities.isWebGL2;
|
|
@@ -25179,6 +25176,8 @@
|
|
|
25179
25176
|
|
|
25180
25177
|
let extension;
|
|
25181
25178
|
|
|
25179
|
+
const transferFunction = ( colorSpace === SRGBColorSpace || colorSpace === DisplayP3ColorSpace ) ? SRGBTransferFunction : LinearTransferFunction;
|
|
25180
|
+
|
|
25182
25181
|
if ( p === UnsignedByteType ) return gl.UNSIGNED_BYTE;
|
|
25183
25182
|
if ( p === UnsignedShort4444Type ) return gl.UNSIGNED_SHORT_4_4_4_4;
|
|
25184
25183
|
if ( p === UnsignedShort5551Type ) return gl.UNSIGNED_SHORT_5_5_5_1;
|
|
@@ -25245,7 +25244,7 @@
|
|
|
25245
25244
|
|
|
25246
25245
|
if ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format || p === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) {
|
|
25247
25246
|
|
|
25248
|
-
if (
|
|
25247
|
+
if ( transferFunction === SRGBTransferFunction ) {
|
|
25249
25248
|
|
|
25250
25249
|
extension = extensions.get( 'WEBGL_compressed_texture_s3tc_srgb' );
|
|
25251
25250
|
|
|
@@ -25330,8 +25329,8 @@
|
|
|
25330
25329
|
|
|
25331
25330
|
if ( extension !== null ) {
|
|
25332
25331
|
|
|
25333
|
-
if ( p === RGB_ETC2_Format ) return (
|
|
25334
|
-
if ( p === RGBA_ETC2_EAC_Format ) return (
|
|
25332
|
+
if ( p === RGB_ETC2_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ETC2 : extension.COMPRESSED_RGB8_ETC2;
|
|
25333
|
+
if ( p === RGBA_ETC2_EAC_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : extension.COMPRESSED_RGBA8_ETC2_EAC;
|
|
25335
25334
|
|
|
25336
25335
|
} else {
|
|
25337
25336
|
|
|
@@ -25353,20 +25352,20 @@
|
|
|
25353
25352
|
|
|
25354
25353
|
if ( extension !== null ) {
|
|
25355
25354
|
|
|
25356
|
-
if ( p === RGBA_ASTC_4x4_Format ) return (
|
|
25357
|
-
if ( p === RGBA_ASTC_5x4_Format ) return (
|
|
25358
|
-
if ( p === RGBA_ASTC_5x5_Format ) return (
|
|
25359
|
-
if ( p === RGBA_ASTC_6x5_Format ) return (
|
|
25360
|
-
if ( p === RGBA_ASTC_6x6_Format ) return (
|
|
25361
|
-
if ( p === RGBA_ASTC_8x5_Format ) return (
|
|
25362
|
-
if ( p === RGBA_ASTC_8x6_Format ) return (
|
|
25363
|
-
if ( p === RGBA_ASTC_8x8_Format ) return (
|
|
25364
|
-
if ( p === RGBA_ASTC_10x5_Format ) return (
|
|
25365
|
-
if ( p === RGBA_ASTC_10x6_Format ) return (
|
|
25366
|
-
if ( p === RGBA_ASTC_10x8_Format ) return (
|
|
25367
|
-
if ( p === RGBA_ASTC_10x10_Format ) return (
|
|
25368
|
-
if ( p === RGBA_ASTC_12x10_Format ) return (
|
|
25369
|
-
if ( p === RGBA_ASTC_12x12_Format ) return (
|
|
25355
|
+
if ( p === RGBA_ASTC_4x4_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : extension.COMPRESSED_RGBA_ASTC_4x4_KHR;
|
|
25356
|
+
if ( p === RGBA_ASTC_5x4_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : extension.COMPRESSED_RGBA_ASTC_5x4_KHR;
|
|
25357
|
+
if ( p === RGBA_ASTC_5x5_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : extension.COMPRESSED_RGBA_ASTC_5x5_KHR;
|
|
25358
|
+
if ( p === RGBA_ASTC_6x5_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : extension.COMPRESSED_RGBA_ASTC_6x5_KHR;
|
|
25359
|
+
if ( p === RGBA_ASTC_6x6_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : extension.COMPRESSED_RGBA_ASTC_6x6_KHR;
|
|
25360
|
+
if ( p === RGBA_ASTC_8x5_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : extension.COMPRESSED_RGBA_ASTC_8x5_KHR;
|
|
25361
|
+
if ( p === RGBA_ASTC_8x6_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : extension.COMPRESSED_RGBA_ASTC_8x6_KHR;
|
|
25362
|
+
if ( p === RGBA_ASTC_8x8_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : extension.COMPRESSED_RGBA_ASTC_8x8_KHR;
|
|
25363
|
+
if ( p === RGBA_ASTC_10x5_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : extension.COMPRESSED_RGBA_ASTC_10x5_KHR;
|
|
25364
|
+
if ( p === RGBA_ASTC_10x6_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : extension.COMPRESSED_RGBA_ASTC_10x6_KHR;
|
|
25365
|
+
if ( p === RGBA_ASTC_10x8_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : extension.COMPRESSED_RGBA_ASTC_10x8_KHR;
|
|
25366
|
+
if ( p === RGBA_ASTC_10x10_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : extension.COMPRESSED_RGBA_ASTC_10x10_KHR;
|
|
25367
|
+
if ( p === RGBA_ASTC_12x10_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : extension.COMPRESSED_RGBA_ASTC_12x10_KHR;
|
|
25368
|
+
if ( p === RGBA_ASTC_12x12_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : extension.COMPRESSED_RGBA_ASTC_12x12_KHR;
|
|
25370
25369
|
|
|
25371
25370
|
} else {
|
|
25372
25371
|
|
|
@@ -25378,13 +25377,15 @@
|
|
|
25378
25377
|
|
|
25379
25378
|
// BPTC
|
|
25380
25379
|
|
|
25381
|
-
if ( p === RGBA_BPTC_Format ) {
|
|
25380
|
+
if ( p === RGBA_BPTC_Format || p === RGB_BPTC_SIGNED_Format || p === RGB_BPTC_UNSIGNED_Format ) {
|
|
25382
25381
|
|
|
25383
25382
|
extension = extensions.get( 'EXT_texture_compression_bptc' );
|
|
25384
25383
|
|
|
25385
25384
|
if ( extension !== null ) {
|
|
25386
25385
|
|
|
25387
|
-
if ( p === RGBA_BPTC_Format ) return (
|
|
25386
|
+
if ( p === RGBA_BPTC_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : extension.COMPRESSED_RGBA_BPTC_UNORM_EXT;
|
|
25387
|
+
if ( p === RGB_BPTC_SIGNED_Format ) return extension.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;
|
|
25388
|
+
if ( p === RGB_BPTC_UNSIGNED_Format ) return extension.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT;
|
|
25388
25389
|
|
|
25389
25390
|
} else {
|
|
25390
25391
|
|
|
@@ -26426,14 +26427,6 @@
|
|
|
26426
26427
|
camera.matrix.decompose( camera.position, camera.quaternion, camera.scale );
|
|
26427
26428
|
camera.updateMatrixWorld( true );
|
|
26428
26429
|
|
|
26429
|
-
const children = camera.children;
|
|
26430
|
-
|
|
26431
|
-
for ( let i = 0, l = children.length; i < l; i ++ ) {
|
|
26432
|
-
|
|
26433
|
-
children[ i ].updateMatrixWorld( true );
|
|
26434
|
-
|
|
26435
|
-
}
|
|
26436
|
-
|
|
26437
26430
|
camera.projectionMatrix.copy( cameraXR.projectionMatrix );
|
|
26438
26431
|
camera.projectionMatrixInverse.copy( cameraXR.projectionMatrixInverse );
|
|
26439
26432
|
|
|
@@ -27596,14 +27589,6 @@
|
|
|
27596
27589
|
|
|
27597
27590
|
}
|
|
27598
27591
|
|
|
27599
|
-
function createCanvasElement() {
|
|
27600
|
-
|
|
27601
|
-
const canvas = createElementNS( 'canvas' );
|
|
27602
|
-
canvas.style.display = 'block';
|
|
27603
|
-
return canvas;
|
|
27604
|
-
|
|
27605
|
-
}
|
|
27606
|
-
|
|
27607
27592
|
class WebGLRenderer {
|
|
27608
27593
|
|
|
27609
27594
|
constructor( parameters = {} ) {
|
|
@@ -29329,48 +29314,28 @@
|
|
|
29329
29314
|
|
|
29330
29315
|
if ( refreshProgram || _currentCamera !== camera ) {
|
|
29331
29316
|
|
|
29332
|
-
|
|
29333
|
-
|
|
29334
|
-
if ( capabilities.logarithmicDepthBuffer ) {
|
|
29335
|
-
|
|
29336
|
-
p_uniforms.setValue( _gl, 'logDepthBufFC',
|
|
29337
|
-
2.0 / ( Math.log( camera.far + 1.0 ) / Math.LN2 ) );
|
|
29338
|
-
|
|
29339
|
-
}
|
|
29317
|
+
// common camera uniforms
|
|
29340
29318
|
|
|
29341
|
-
|
|
29319
|
+
p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix );
|
|
29320
|
+
p_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse );
|
|
29342
29321
|
|
|
29343
|
-
|
|
29322
|
+
const uCamPos = p_uniforms.map.cameraPosition;
|
|
29344
29323
|
|
|
29345
|
-
|
|
29346
|
-
// now, in case this material supports lights - or later, when
|
|
29347
|
-
// the next material that does gets activated:
|
|
29324
|
+
if ( uCamPos !== undefined ) {
|
|
29348
29325
|
|
|
29349
|
-
|
|
29350
|
-
refreshLights = true; // remains set until update done
|
|
29326
|
+
uCamPos.setValue( _gl, _vector3.setFromMatrixPosition( camera.matrixWorld ) );
|
|
29351
29327
|
|
|
29352
29328
|
}
|
|
29353
29329
|
|
|
29354
|
-
|
|
29355
|
-
// (shader material also gets them for the sake of genericity)
|
|
29356
|
-
|
|
29357
|
-
if ( material.isShaderMaterial ||
|
|
29358
|
-
material.isMeshPhongMaterial ||
|
|
29359
|
-
material.isMeshToonMaterial ||
|
|
29360
|
-
material.isMeshStandardMaterial ||
|
|
29361
|
-
material.envMap ) {
|
|
29362
|
-
|
|
29363
|
-
const uCamPos = p_uniforms.map.cameraPosition;
|
|
29364
|
-
|
|
29365
|
-
if ( uCamPos !== undefined ) {
|
|
29366
|
-
|
|
29367
|
-
uCamPos.setValue( _gl,
|
|
29368
|
-
_vector3.setFromMatrixPosition( camera.matrixWorld ) );
|
|
29330
|
+
if ( capabilities.logarithmicDepthBuffer ) {
|
|
29369
29331
|
|
|
29370
|
-
|
|
29332
|
+
p_uniforms.setValue( _gl, 'logDepthBufFC',
|
|
29333
|
+
2.0 / ( Math.log( camera.far + 1.0 ) / Math.LN2 ) );
|
|
29371
29334
|
|
|
29372
29335
|
}
|
|
29373
29336
|
|
|
29337
|
+
// consider moving isOrthographic to UniformLib and WebGLMaterials, see https://github.com/mrdoob/three.js/pull/26467#issuecomment-1645185067
|
|
29338
|
+
|
|
29374
29339
|
if ( material.isMeshPhongMaterial ||
|
|
29375
29340
|
material.isMeshToonMaterial ||
|
|
29376
29341
|
material.isMeshLambertMaterial ||
|
|
@@ -29382,16 +29347,16 @@
|
|
|
29382
29347
|
|
|
29383
29348
|
}
|
|
29384
29349
|
|
|
29385
|
-
if (
|
|
29386
|
-
material.isMeshToonMaterial ||
|
|
29387
|
-
material.isMeshLambertMaterial ||
|
|
29388
|
-
material.isMeshBasicMaterial ||
|
|
29389
|
-
material.isMeshStandardMaterial ||
|
|
29390
|
-
material.isShaderMaterial ||
|
|
29391
|
-
material.isShadowMaterial ||
|
|
29392
|
-
object.isSkinnedMesh ) {
|
|
29350
|
+
if ( _currentCamera !== camera ) {
|
|
29393
29351
|
|
|
29394
|
-
|
|
29352
|
+
_currentCamera = camera;
|
|
29353
|
+
|
|
29354
|
+
// lighting uniforms depend on the camera so enforce an update
|
|
29355
|
+
// now, in case this material supports lights - or later, when
|
|
29356
|
+
// the next material that does gets activated:
|
|
29357
|
+
|
|
29358
|
+
refreshMaterial = true; // set to true on material change
|
|
29359
|
+
refreshLights = true; // remains set until update done
|
|
29395
29360
|
|
|
29396
29361
|
}
|
|
29397
29362
|
|
|
@@ -30161,7 +30126,7 @@
|
|
|
30161
30126
|
|
|
30162
30127
|
super.copy( source, recursive );
|
|
30163
30128
|
|
|
30164
|
-
this.material = source.material;
|
|
30129
|
+
this.material = Array.isArray( source.material ) ? source.material.slice() : source.material;
|
|
30165
30130
|
this.geometry = source.geometry;
|
|
30166
30131
|
|
|
30167
30132
|
return this;
|
|
@@ -43168,7 +43133,7 @@ function InsertStackElement(node, body) {
|
|
|
43168
43133
|
|
|
43169
43134
|
const twoPI = 2 * Math.PI;
|
|
43170
43135
|
|
|
43171
|
-
return function update() {
|
|
43136
|
+
return function update( deltaTime = null ) {
|
|
43172
43137
|
|
|
43173
43138
|
const position = scope.object.position;
|
|
43174
43139
|
|
|
@@ -43182,7 +43147,7 @@ function InsertStackElement(node, body) {
|
|
|
43182
43147
|
|
|
43183
43148
|
if ( scope.autoRotate && state === STATE.NONE ) {
|
|
43184
43149
|
|
|
43185
|
-
rotateLeft( getAutoRotationAngle() );
|
|
43150
|
+
rotateLeft( getAutoRotationAngle( deltaTime ) );
|
|
43186
43151
|
|
|
43187
43152
|
}
|
|
43188
43153
|
|
|
@@ -43461,9 +43426,17 @@ function InsertStackElement(node, body) {
|
|
|
43461
43426
|
const pointers = [];
|
|
43462
43427
|
const pointerPositions = {};
|
|
43463
43428
|
|
|
43464
|
-
function getAutoRotationAngle() {
|
|
43429
|
+
function getAutoRotationAngle( deltaTime ) {
|
|
43465
43430
|
|
|
43466
|
-
|
|
43431
|
+
if ( deltaTime !== null ) {
|
|
43432
|
+
|
|
43433
|
+
return ( 2 * Math.PI / 60 * scope.autoRotateSpeed ) * deltaTime;
|
|
43434
|
+
|
|
43435
|
+
} else {
|
|
43436
|
+
|
|
43437
|
+
return 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed;
|
|
43438
|
+
|
|
43439
|
+
}
|
|
43467
43440
|
|
|
43468
43441
|
}
|
|
43469
43442
|
|
|
@@ -43615,7 +43588,7 @@ function InsertStackElement(node, body) {
|
|
|
43615
43588
|
mouse.x = ( x / w ) * 2 - 1;
|
|
43616
43589
|
mouse.y = - ( y / h ) * 2 + 1;
|
|
43617
43590
|
|
|
43618
|
-
dollyDirection.set( mouse.x, mouse.y, 1 ).unproject( object ).sub( object.position ).normalize();
|
|
43591
|
+
dollyDirection.set( mouse.x, mouse.y, 1 ).unproject( scope.object ).sub( scope.object.position ).normalize();
|
|
43619
43592
|
|
|
43620
43593
|
}
|
|
43621
43594
|
|
|
@@ -45181,7 +45154,7 @@ function InsertStackElement(node, body) {
|
|
|
45181
45154
|
|
|
45182
45155
|
class RenderPass extends Pass {
|
|
45183
45156
|
|
|
45184
|
-
constructor( scene, camera, overrideMaterial, clearColor, clearAlpha ) {
|
|
45157
|
+
constructor( scene, camera, overrideMaterial = null, clearColor = null, clearAlpha = null ) {
|
|
45185
45158
|
|
|
45186
45159
|
super();
|
|
45187
45160
|
|
|
@@ -45191,7 +45164,7 @@ function InsertStackElement(node, body) {
|
|
|
45191
45164
|
this.overrideMaterial = overrideMaterial;
|
|
45192
45165
|
|
|
45193
45166
|
this.clearColor = clearColor;
|
|
45194
|
-
this.clearAlpha =
|
|
45167
|
+
this.clearAlpha = clearAlpha;
|
|
45195
45168
|
|
|
45196
45169
|
this.clear = true;
|
|
45197
45170
|
this.clearDepth = false;
|
|
@@ -45207,7 +45180,7 @@ function InsertStackElement(node, body) {
|
|
|
45207
45180
|
|
|
45208
45181
|
let oldClearAlpha, oldOverrideMaterial;
|
|
45209
45182
|
|
|
45210
|
-
if ( this.overrideMaterial !==
|
|
45183
|
+
if ( this.overrideMaterial !== null ) {
|
|
45211
45184
|
|
|
45212
45185
|
oldOverrideMaterial = this.scene.overrideMaterial;
|
|
45213
45186
|
|
|
@@ -45215,16 +45188,21 @@ function InsertStackElement(node, body) {
|
|
|
45215
45188
|
|
|
45216
45189
|
}
|
|
45217
45190
|
|
|
45218
|
-
if ( this.clearColor ) {
|
|
45191
|
+
if ( this.clearColor !== null ) {
|
|
45219
45192
|
|
|
45220
45193
|
renderer.getClearColor( this._oldClearColor );
|
|
45221
|
-
|
|
45194
|
+
renderer.setClearColor( this.clearColor );
|
|
45195
|
+
|
|
45196
|
+
}
|
|
45222
45197
|
|
|
45223
|
-
|
|
45198
|
+
if ( this.clearAlpha !== null ) {
|
|
45199
|
+
|
|
45200
|
+
oldClearAlpha = renderer.getClearAlpha();
|
|
45201
|
+
renderer.setClearAlpha( this.clearAlpha );
|
|
45224
45202
|
|
|
45225
45203
|
}
|
|
45226
45204
|
|
|
45227
|
-
if ( this.clearDepth ) {
|
|
45205
|
+
if ( this.clearDepth == true ) {
|
|
45228
45206
|
|
|
45229
45207
|
renderer.clearDepth();
|
|
45230
45208
|
|
|
@@ -45232,17 +45210,30 @@ function InsertStackElement(node, body) {
|
|
|
45232
45210
|
|
|
45233
45211
|
renderer.setRenderTarget( this.renderToScreen ? null : readBuffer );
|
|
45234
45212
|
|
|
45235
|
-
|
|
45236
|
-
|
|
45213
|
+
if ( this.clear === true ) {
|
|
45214
|
+
|
|
45215
|
+
// TODO: Avoid using autoClear properties, see https://github.com/mrdoob/three.js/pull/15571#issuecomment-465669600
|
|
45216
|
+
renderer.clear( renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil );
|
|
45217
|
+
|
|
45218
|
+
}
|
|
45219
|
+
|
|
45237
45220
|
renderer.render( this.scene, this.camera );
|
|
45238
45221
|
|
|
45239
|
-
|
|
45222
|
+
// restore
|
|
45223
|
+
|
|
45224
|
+
if ( this.clearColor !== null ) {
|
|
45240
45225
|
|
|
45241
|
-
renderer.setClearColor( this._oldClearColor
|
|
45226
|
+
renderer.setClearColor( this._oldClearColor );
|
|
45242
45227
|
|
|
45243
45228
|
}
|
|
45244
45229
|
|
|
45245
|
-
if ( this.
|
|
45230
|
+
if ( this.clearAlpha !== null ) {
|
|
45231
|
+
|
|
45232
|
+
renderer.setClearAlpha( oldClearAlpha );
|
|
45233
|
+
|
|
45234
|
+
}
|
|
45235
|
+
|
|
45236
|
+
if ( this.overrideMaterial !== null ) {
|
|
45246
45237
|
|
|
45247
45238
|
this.scene.overrideMaterial = oldOverrideMaterial;
|
|
45248
45239
|
|
|
@@ -47485,7 +47476,7 @@ function InsertStackElement(node, body) {
|
|
|
47485
47476
|
|
|
47486
47477
|
function linkKapsule (kapsulePropName, kapsuleType) {
|
|
47487
47478
|
var dummyK = new kapsuleType(); // To extract defaults
|
|
47488
|
-
|
|
47479
|
+
dummyK._destructor && dummyK._destructor();
|
|
47489
47480
|
return {
|
|
47490
47481
|
linkProp: function linkProp(prop) {
|
|
47491
47482
|
// link property config
|