globe.gl 2.29.2 → 2.29.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/globe.gl.js +157 -166
- package/dist/globe.gl.js.map +1 -1
- package/dist/globe.gl.min.js +5 -5
- package/dist/globe.gl.mjs +19 -19
- package/package.json +1 -1
package/dist/globe.gl.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Version 2.29.
|
|
1
|
+
// Version 2.29.3 globe.gl - https://github.com/vasturiano/globe.gl
|
|
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 = ".scene-container .clickable {\n cursor: pointer;\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
|
|
47
|
-
}
|
|
48
|
-
function _objectSpread2$2(
|
|
49
|
-
for (var
|
|
50
|
-
var
|
|
51
|
-
|
|
52
|
-
_defineProperty$3(
|
|
53
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(
|
|
54
|
-
Object.defineProperty(
|
|
46
|
+
return t;
|
|
47
|
+
}
|
|
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$7(key);
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
* Copyright 2010-2023 Three.js Authors
|
|
143
143
|
* SPDX-License-Identifier: MIT
|
|
144
144
|
*/
|
|
145
|
-
const REVISION = '
|
|
145
|
+
const REVISION = '156';
|
|
146
146
|
|
|
147
147
|
const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
|
|
148
148
|
const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
|
|
@@ -259,6 +259,8 @@
|
|
|
259
259
|
const RGBA_ASTC_12x10_Format = 37820;
|
|
260
260
|
const RGBA_ASTC_12x12_Format = 37821;
|
|
261
261
|
const RGBA_BPTC_Format = 36492;
|
|
262
|
+
const RGB_BPTC_SIGNED_Format = 36494;
|
|
263
|
+
const RGB_BPTC_UNSIGNED_Format = 36495;
|
|
262
264
|
const RED_RGTC1_Format = 36283;
|
|
263
265
|
const SIGNED_RED_RGTC1_Format = 36284;
|
|
264
266
|
const RED_GREEN_RGTC2_Format = 36285;
|
|
@@ -1014,8 +1016,8 @@
|
|
|
1014
1016
|
|
|
1015
1017
|
roundToZero() {
|
|
1016
1018
|
|
|
1017
|
-
this.x =
|
|
1018
|
-
this.y =
|
|
1019
|
+
this.x = Math.trunc( this.x );
|
|
1020
|
+
this.y = Math.trunc( this.y );
|
|
1019
1021
|
|
|
1020
1022
|
return this;
|
|
1021
1023
|
|
|
@@ -1605,6 +1607,14 @@
|
|
|
1605
1607
|
|
|
1606
1608
|
}
|
|
1607
1609
|
|
|
1610
|
+
function createCanvasElement() {
|
|
1611
|
+
|
|
1612
|
+
const canvas = createElementNS( 'canvas' );
|
|
1613
|
+
canvas.style.display = 'block';
|
|
1614
|
+
return canvas;
|
|
1615
|
+
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1608
1618
|
const _cache = {};
|
|
1609
1619
|
|
|
1610
1620
|
function warnOnce( message ) {
|
|
@@ -1996,7 +2006,7 @@
|
|
|
1996
2006
|
|
|
1997
2007
|
}
|
|
1998
2008
|
|
|
1999
|
-
let
|
|
2009
|
+
let _textureId = 0;
|
|
2000
2010
|
|
|
2001
2011
|
class Texture extends EventDispatcher {
|
|
2002
2012
|
|
|
@@ -2006,7 +2016,7 @@
|
|
|
2006
2016
|
|
|
2007
2017
|
this.isTexture = true;
|
|
2008
2018
|
|
|
2009
|
-
Object.defineProperty( this, 'id', { value:
|
|
2019
|
+
Object.defineProperty( this, 'id', { value: _textureId ++ } );
|
|
2010
2020
|
|
|
2011
2021
|
this.uuid = generateUUID();
|
|
2012
2022
|
|
|
@@ -2816,10 +2826,10 @@
|
|
|
2816
2826
|
|
|
2817
2827
|
roundToZero() {
|
|
2818
2828
|
|
|
2819
|
-
this.x =
|
|
2820
|
-
this.y =
|
|
2821
|
-
this.z =
|
|
2822
|
-
this.w =
|
|
2829
|
+
this.x = Math.trunc( this.x );
|
|
2830
|
+
this.y = Math.trunc( this.y );
|
|
2831
|
+
this.z = Math.trunc( this.z );
|
|
2832
|
+
this.w = Math.trunc( this.w );
|
|
2823
2833
|
|
|
2824
2834
|
return this;
|
|
2825
2835
|
|
|
@@ -4212,9 +4222,9 @@
|
|
|
4212
4222
|
|
|
4213
4223
|
roundToZero() {
|
|
4214
4224
|
|
|
4215
|
-
this.x =
|
|
4216
|
-
this.y =
|
|
4217
|
-
this.z =
|
|
4225
|
+
this.x = Math.trunc( this.x );
|
|
4226
|
+
this.y = Math.trunc( this.y );
|
|
4227
|
+
this.z = Math.trunc( this.z );
|
|
4218
4228
|
|
|
4219
4229
|
return this;
|
|
4220
4230
|
|
|
@@ -7444,20 +7454,7 @@
|
|
|
7444
7454
|
|
|
7445
7455
|
clear() {
|
|
7446
7456
|
|
|
7447
|
-
|
|
7448
|
-
|
|
7449
|
-
const object = this.children[ i ];
|
|
7450
|
-
|
|
7451
|
-
object.parent = null;
|
|
7452
|
-
|
|
7453
|
-
object.dispatchEvent( _removedEvent );
|
|
7454
|
-
|
|
7455
|
-
}
|
|
7456
|
-
|
|
7457
|
-
this.children.length = 0;
|
|
7458
|
-
|
|
7459
|
-
return this;
|
|
7460
|
-
|
|
7457
|
+
return this.remove( ... this.children );
|
|
7461
7458
|
|
|
7462
7459
|
}
|
|
7463
7460
|
|
|
@@ -8348,7 +8345,7 @@
|
|
|
8348
8345
|
|
|
8349
8346
|
}
|
|
8350
8347
|
|
|
8351
|
-
let
|
|
8348
|
+
let _materialId = 0;
|
|
8352
8349
|
|
|
8353
8350
|
class Material extends EventDispatcher {
|
|
8354
8351
|
|
|
@@ -8358,7 +8355,7 @@
|
|
|
8358
8355
|
|
|
8359
8356
|
this.isMaterial = true;
|
|
8360
8357
|
|
|
8361
|
-
Object.defineProperty( this, 'id', { value:
|
|
8358
|
+
Object.defineProperty( this, 'id', { value: _materialId ++ } );
|
|
8362
8359
|
|
|
8363
8360
|
this.uuid = generateUUID();
|
|
8364
8361
|
|
|
@@ -9944,7 +9941,7 @@
|
|
|
9944
9941
|
|
|
9945
9942
|
}
|
|
9946
9943
|
|
|
9947
|
-
let _id$
|
|
9944
|
+
let _id$2 = 0;
|
|
9948
9945
|
|
|
9949
9946
|
const _m1 = /*@__PURE__*/ new Matrix4();
|
|
9950
9947
|
const _obj = /*@__PURE__*/ new Object3D();
|
|
@@ -9961,7 +9958,7 @@
|
|
|
9961
9958
|
|
|
9962
9959
|
this.isBufferGeometry = true;
|
|
9963
9960
|
|
|
9964
|
-
Object.defineProperty( this, 'id', { value: _id$
|
|
9961
|
+
Object.defineProperty( this, 'id', { value: _id$2 ++ } );
|
|
9965
9962
|
|
|
9966
9963
|
this.uuid = generateUUID();
|
|
9967
9964
|
|
|
@@ -11066,7 +11063,7 @@
|
|
|
11066
11063
|
|
|
11067
11064
|
}
|
|
11068
11065
|
|
|
11069
|
-
this.material = source.material;
|
|
11066
|
+
this.material = Array.isArray( source.material ) ? source.material.slice() : source.material;
|
|
11070
11067
|
this.geometry = source.geometry;
|
|
11071
11068
|
|
|
11072
11069
|
return this;
|
|
@@ -13356,7 +13353,7 @@
|
|
|
13356
13353
|
|
|
13357
13354
|
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";
|
|
13358
13355
|
|
|
13359
|
-
var map_fragment = "#ifdef USE_MAP\n\
|
|
13356
|
+
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";
|
|
13360
13357
|
|
|
13361
13358
|
var map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif";
|
|
13362
13359
|
|
|
@@ -13450,7 +13447,7 @@
|
|
|
13450
13447
|
|
|
13451
13448
|
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}";
|
|
13452
13449
|
|
|
13453
|
-
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}";
|
|
13450
|
+
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}";
|
|
13454
13451
|
|
|
13455
13452
|
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}";
|
|
13456
13453
|
|
|
@@ -14270,24 +14267,15 @@
|
|
|
14270
14267
|
|
|
14271
14268
|
}
|
|
14272
14269
|
|
|
14273
|
-
const
|
|
14274
|
-
const environmentBlendMode = xr.getEnvironmentBlendMode();
|
|
14270
|
+
const environmentBlendMode = renderer.xr.getEnvironmentBlendMode();
|
|
14275
14271
|
|
|
14276
|
-
|
|
14272
|
+
if ( environmentBlendMode === 'additive' ) {
|
|
14277
14273
|
|
|
14278
|
-
|
|
14279
|
-
forceClear = true;
|
|
14280
|
-
break;
|
|
14274
|
+
state.buffers.color.setClear( 0, 0, 0, 1, premultipliedAlpha );
|
|
14281
14275
|
|
|
14282
|
-
|
|
14283
|
-
state.buffers.color.setClear( 0, 0, 0, 1, premultipliedAlpha );
|
|
14284
|
-
forceClear = true;
|
|
14285
|
-
break;
|
|
14276
|
+
} else if ( environmentBlendMode === 'alpha-blend' ) {
|
|
14286
14277
|
|
|
14287
|
-
|
|
14288
|
-
state.buffers.color.setClear( 0, 0, 0, 0, premultipliedAlpha );
|
|
14289
|
-
forceClear = true;
|
|
14290
|
-
break;
|
|
14278
|
+
state.buffers.color.setClear( 0, 0, 0, 0, premultipliedAlpha );
|
|
14291
14279
|
|
|
14292
14280
|
}
|
|
14293
14281
|
|
|
@@ -19402,6 +19390,8 @@
|
|
|
19402
19390
|
|
|
19403
19391
|
parameters.useLegacyLights ? '#define LEGACY_LIGHTS' : '',
|
|
19404
19392
|
|
|
19393
|
+
parameters.decodeVideoTexture ? '#define DECODE_VIDEO_TEXTURE' : '',
|
|
19394
|
+
|
|
19405
19395
|
parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
|
|
19406
19396
|
( parameters.logarithmicDepthBuffer && parameters.rendererExtensionFragDepth ) ? '#define USE_LOGDEPTHBUF_EXT' : '',
|
|
19407
19397
|
|
|
@@ -19636,7 +19626,7 @@
|
|
|
19636
19626
|
|
|
19637
19627
|
}
|
|
19638
19628
|
|
|
19639
|
-
let _id = 0;
|
|
19629
|
+
let _id$1 = 0;
|
|
19640
19630
|
|
|
19641
19631
|
class WebGLShaderCache {
|
|
19642
19632
|
|
|
@@ -19750,7 +19740,7 @@
|
|
|
19750
19740
|
|
|
19751
19741
|
constructor( code ) {
|
|
19752
19742
|
|
|
19753
|
-
this.id = _id ++;
|
|
19743
|
+
this.id = _id$1 ++;
|
|
19754
19744
|
|
|
19755
19745
|
this.code = code;
|
|
19756
19746
|
this.usedTimes = 0;
|
|
@@ -20089,6 +20079,8 @@
|
|
|
20089
20079
|
toneMapping: toneMapping,
|
|
20090
20080
|
useLegacyLights: renderer._useLegacyLights,
|
|
20091
20081
|
|
|
20082
|
+
decodeVideoTexture: HAS_MAP && ( material.map.isVideoTexture === true ) && ( material.map.colorSpace === SRGBColorSpace ),
|
|
20083
|
+
|
|
20092
20084
|
premultipliedAlpha: material.premultipliedAlpha,
|
|
20093
20085
|
|
|
20094
20086
|
doubleSided: material.side === DoubleSide,
|
|
@@ -20290,6 +20282,8 @@
|
|
|
20290
20282
|
_programLayers.enable( 17 );
|
|
20291
20283
|
if ( parameters.pointsUvs )
|
|
20292
20284
|
_programLayers.enable( 18 );
|
|
20285
|
+
if ( parameters.decodeVideoTexture )
|
|
20286
|
+
_programLayers.enable( 19 );
|
|
20293
20287
|
|
|
20294
20288
|
array.push( _programLayers.mask );
|
|
20295
20289
|
|
|
@@ -23850,7 +23844,7 @@
|
|
|
23850
23844
|
glFormat = utils.convert( texture.format, texture.colorSpace );
|
|
23851
23845
|
|
|
23852
23846
|
let glType = utils.convert( texture.type ),
|
|
23853
|
-
glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace );
|
|
23847
|
+
glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace, texture.isVideoTexture );
|
|
23854
23848
|
|
|
23855
23849
|
setTextureParameters( textureType, texture, supportsMips );
|
|
23856
23850
|
|
|
@@ -25129,13 +25123,13 @@
|
|
|
25129
25123
|
const format = texture.format;
|
|
25130
25124
|
const type = texture.type;
|
|
25131
25125
|
|
|
25132
|
-
if ( texture.isCompressedTexture === true || texture.format === _SRGBAFormat ) return image;
|
|
25126
|
+
if ( texture.isCompressedTexture === true || texture.isVideoTexture === true || texture.format === _SRGBAFormat ) return image;
|
|
25133
25127
|
|
|
25134
25128
|
if ( colorSpace !== LinearSRGBColorSpace && colorSpace !== NoColorSpace ) {
|
|
25135
25129
|
|
|
25136
25130
|
// sRGB
|
|
25137
25131
|
|
|
25138
|
-
if ( colorSpace === SRGBColorSpace ) {
|
|
25132
|
+
if ( colorSpace === SRGBColorSpace || colorSpace === DisplayP3ColorSpace ) {
|
|
25139
25133
|
|
|
25140
25134
|
if ( isWebGL2 === false ) {
|
|
25141
25135
|
|
|
@@ -25201,6 +25195,9 @@
|
|
|
25201
25195
|
|
|
25202
25196
|
}
|
|
25203
25197
|
|
|
25198
|
+
const LinearTransferFunction = 0;
|
|
25199
|
+
const SRGBTransferFunction = 1;
|
|
25200
|
+
|
|
25204
25201
|
function WebGLUtils( gl, extensions, capabilities ) {
|
|
25205
25202
|
|
|
25206
25203
|
const isWebGL2 = capabilities.isWebGL2;
|
|
@@ -25209,6 +25206,8 @@
|
|
|
25209
25206
|
|
|
25210
25207
|
let extension;
|
|
25211
25208
|
|
|
25209
|
+
const transferFunction = ( colorSpace === SRGBColorSpace || colorSpace === DisplayP3ColorSpace ) ? SRGBTransferFunction : LinearTransferFunction;
|
|
25210
|
+
|
|
25212
25211
|
if ( p === UnsignedByteType ) return gl.UNSIGNED_BYTE;
|
|
25213
25212
|
if ( p === UnsignedShort4444Type ) return gl.UNSIGNED_SHORT_4_4_4_4;
|
|
25214
25213
|
if ( p === UnsignedShort5551Type ) return gl.UNSIGNED_SHORT_5_5_5_1;
|
|
@@ -25275,7 +25274,7 @@
|
|
|
25275
25274
|
|
|
25276
25275
|
if ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format || p === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) {
|
|
25277
25276
|
|
|
25278
|
-
if (
|
|
25277
|
+
if ( transferFunction === SRGBTransferFunction ) {
|
|
25279
25278
|
|
|
25280
25279
|
extension = extensions.get( 'WEBGL_compressed_texture_s3tc_srgb' );
|
|
25281
25280
|
|
|
@@ -25360,8 +25359,8 @@
|
|
|
25360
25359
|
|
|
25361
25360
|
if ( extension !== null ) {
|
|
25362
25361
|
|
|
25363
|
-
if ( p === RGB_ETC2_Format ) return (
|
|
25364
|
-
if ( p === RGBA_ETC2_EAC_Format ) return (
|
|
25362
|
+
if ( p === RGB_ETC2_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ETC2 : extension.COMPRESSED_RGB8_ETC2;
|
|
25363
|
+
if ( p === RGBA_ETC2_EAC_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : extension.COMPRESSED_RGBA8_ETC2_EAC;
|
|
25365
25364
|
|
|
25366
25365
|
} else {
|
|
25367
25366
|
|
|
@@ -25383,20 +25382,20 @@
|
|
|
25383
25382
|
|
|
25384
25383
|
if ( extension !== null ) {
|
|
25385
25384
|
|
|
25386
|
-
if ( p === RGBA_ASTC_4x4_Format ) return (
|
|
25387
|
-
if ( p === RGBA_ASTC_5x4_Format ) return (
|
|
25388
|
-
if ( p === RGBA_ASTC_5x5_Format ) return (
|
|
25389
|
-
if ( p === RGBA_ASTC_6x5_Format ) return (
|
|
25390
|
-
if ( p === RGBA_ASTC_6x6_Format ) return (
|
|
25391
|
-
if ( p === RGBA_ASTC_8x5_Format ) return (
|
|
25392
|
-
if ( p === RGBA_ASTC_8x6_Format ) return (
|
|
25393
|
-
if ( p === RGBA_ASTC_8x8_Format ) return (
|
|
25394
|
-
if ( p === RGBA_ASTC_10x5_Format ) return (
|
|
25395
|
-
if ( p === RGBA_ASTC_10x6_Format ) return (
|
|
25396
|
-
if ( p === RGBA_ASTC_10x8_Format ) return (
|
|
25397
|
-
if ( p === RGBA_ASTC_10x10_Format ) return (
|
|
25398
|
-
if ( p === RGBA_ASTC_12x10_Format ) return (
|
|
25399
|
-
if ( p === RGBA_ASTC_12x12_Format ) return (
|
|
25385
|
+
if ( p === RGBA_ASTC_4x4_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : extension.COMPRESSED_RGBA_ASTC_4x4_KHR;
|
|
25386
|
+
if ( p === RGBA_ASTC_5x4_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : extension.COMPRESSED_RGBA_ASTC_5x4_KHR;
|
|
25387
|
+
if ( p === RGBA_ASTC_5x5_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : extension.COMPRESSED_RGBA_ASTC_5x5_KHR;
|
|
25388
|
+
if ( p === RGBA_ASTC_6x5_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : extension.COMPRESSED_RGBA_ASTC_6x5_KHR;
|
|
25389
|
+
if ( p === RGBA_ASTC_6x6_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : extension.COMPRESSED_RGBA_ASTC_6x6_KHR;
|
|
25390
|
+
if ( p === RGBA_ASTC_8x5_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : extension.COMPRESSED_RGBA_ASTC_8x5_KHR;
|
|
25391
|
+
if ( p === RGBA_ASTC_8x6_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : extension.COMPRESSED_RGBA_ASTC_8x6_KHR;
|
|
25392
|
+
if ( p === RGBA_ASTC_8x8_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : extension.COMPRESSED_RGBA_ASTC_8x8_KHR;
|
|
25393
|
+
if ( p === RGBA_ASTC_10x5_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : extension.COMPRESSED_RGBA_ASTC_10x5_KHR;
|
|
25394
|
+
if ( p === RGBA_ASTC_10x6_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : extension.COMPRESSED_RGBA_ASTC_10x6_KHR;
|
|
25395
|
+
if ( p === RGBA_ASTC_10x8_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : extension.COMPRESSED_RGBA_ASTC_10x8_KHR;
|
|
25396
|
+
if ( p === RGBA_ASTC_10x10_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : extension.COMPRESSED_RGBA_ASTC_10x10_KHR;
|
|
25397
|
+
if ( p === RGBA_ASTC_12x10_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : extension.COMPRESSED_RGBA_ASTC_12x10_KHR;
|
|
25398
|
+
if ( p === RGBA_ASTC_12x12_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : extension.COMPRESSED_RGBA_ASTC_12x12_KHR;
|
|
25400
25399
|
|
|
25401
25400
|
} else {
|
|
25402
25401
|
|
|
@@ -25408,13 +25407,15 @@
|
|
|
25408
25407
|
|
|
25409
25408
|
// BPTC
|
|
25410
25409
|
|
|
25411
|
-
if ( p === RGBA_BPTC_Format ) {
|
|
25410
|
+
if ( p === RGBA_BPTC_Format || p === RGB_BPTC_SIGNED_Format || p === RGB_BPTC_UNSIGNED_Format ) {
|
|
25412
25411
|
|
|
25413
25412
|
extension = extensions.get( 'EXT_texture_compression_bptc' );
|
|
25414
25413
|
|
|
25415
25414
|
if ( extension !== null ) {
|
|
25416
25415
|
|
|
25417
|
-
if ( p === RGBA_BPTC_Format ) return (
|
|
25416
|
+
if ( p === RGBA_BPTC_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : extension.COMPRESSED_RGBA_BPTC_UNORM_EXT;
|
|
25417
|
+
if ( p === RGB_BPTC_SIGNED_Format ) return extension.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;
|
|
25418
|
+
if ( p === RGB_BPTC_UNSIGNED_Format ) return extension.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT;
|
|
25418
25419
|
|
|
25419
25420
|
} else {
|
|
25420
25421
|
|
|
@@ -26456,14 +26457,6 @@
|
|
|
26456
26457
|
camera.matrix.decompose( camera.position, camera.quaternion, camera.scale );
|
|
26457
26458
|
camera.updateMatrixWorld( true );
|
|
26458
26459
|
|
|
26459
|
-
const children = camera.children;
|
|
26460
|
-
|
|
26461
|
-
for ( let i = 0, l = children.length; i < l; i ++ ) {
|
|
26462
|
-
|
|
26463
|
-
children[ i ].updateMatrixWorld( true );
|
|
26464
|
-
|
|
26465
|
-
}
|
|
26466
|
-
|
|
26467
26460
|
camera.projectionMatrix.copy( cameraXR.projectionMatrix );
|
|
26468
26461
|
camera.projectionMatrixInverse.copy( cameraXR.projectionMatrixInverse );
|
|
26469
26462
|
|
|
@@ -27626,14 +27619,6 @@
|
|
|
27626
27619
|
|
|
27627
27620
|
}
|
|
27628
27621
|
|
|
27629
|
-
function createCanvasElement() {
|
|
27630
|
-
|
|
27631
|
-
const canvas = createElementNS( 'canvas' );
|
|
27632
|
-
canvas.style.display = 'block';
|
|
27633
|
-
return canvas;
|
|
27634
|
-
|
|
27635
|
-
}
|
|
27636
|
-
|
|
27637
27622
|
class WebGLRenderer {
|
|
27638
27623
|
|
|
27639
27624
|
constructor( parameters = {} ) {
|
|
@@ -29359,48 +29344,28 @@
|
|
|
29359
29344
|
|
|
29360
29345
|
if ( refreshProgram || _currentCamera !== camera ) {
|
|
29361
29346
|
|
|
29362
|
-
|
|
29347
|
+
// common camera uniforms
|
|
29363
29348
|
|
|
29364
|
-
|
|
29365
|
-
|
|
29366
|
-
p_uniforms.setValue( _gl, 'logDepthBufFC',
|
|
29367
|
-
2.0 / ( Math.log( camera.far + 1.0 ) / Math.LN2 ) );
|
|
29368
|
-
|
|
29369
|
-
}
|
|
29349
|
+
p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix );
|
|
29350
|
+
p_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse );
|
|
29370
29351
|
|
|
29371
|
-
|
|
29352
|
+
const uCamPos = p_uniforms.map.cameraPosition;
|
|
29372
29353
|
|
|
29373
|
-
|
|
29354
|
+
if ( uCamPos !== undefined ) {
|
|
29374
29355
|
|
|
29375
|
-
|
|
29376
|
-
// now, in case this material supports lights - or later, when
|
|
29377
|
-
// the next material that does gets activated:
|
|
29378
|
-
|
|
29379
|
-
refreshMaterial = true; // set to true on material change
|
|
29380
|
-
refreshLights = true; // remains set until update done
|
|
29356
|
+
uCamPos.setValue( _gl, _vector3.setFromMatrixPosition( camera.matrixWorld ) );
|
|
29381
29357
|
|
|
29382
29358
|
}
|
|
29383
29359
|
|
|
29384
|
-
|
|
29385
|
-
// (shader material also gets them for the sake of genericity)
|
|
29386
|
-
|
|
29387
|
-
if ( material.isShaderMaterial ||
|
|
29388
|
-
material.isMeshPhongMaterial ||
|
|
29389
|
-
material.isMeshToonMaterial ||
|
|
29390
|
-
material.isMeshStandardMaterial ||
|
|
29391
|
-
material.envMap ) {
|
|
29392
|
-
|
|
29393
|
-
const uCamPos = p_uniforms.map.cameraPosition;
|
|
29394
|
-
|
|
29395
|
-
if ( uCamPos !== undefined ) {
|
|
29396
|
-
|
|
29397
|
-
uCamPos.setValue( _gl,
|
|
29398
|
-
_vector3.setFromMatrixPosition( camera.matrixWorld ) );
|
|
29360
|
+
if ( capabilities.logarithmicDepthBuffer ) {
|
|
29399
29361
|
|
|
29400
|
-
|
|
29362
|
+
p_uniforms.setValue( _gl, 'logDepthBufFC',
|
|
29363
|
+
2.0 / ( Math.log( camera.far + 1.0 ) / Math.LN2 ) );
|
|
29401
29364
|
|
|
29402
29365
|
}
|
|
29403
29366
|
|
|
29367
|
+
// consider moving isOrthographic to UniformLib and WebGLMaterials, see https://github.com/mrdoob/three.js/pull/26467#issuecomment-1645185067
|
|
29368
|
+
|
|
29404
29369
|
if ( material.isMeshPhongMaterial ||
|
|
29405
29370
|
material.isMeshToonMaterial ||
|
|
29406
29371
|
material.isMeshLambertMaterial ||
|
|
@@ -29412,16 +29377,16 @@
|
|
|
29412
29377
|
|
|
29413
29378
|
}
|
|
29414
29379
|
|
|
29415
|
-
if (
|
|
29416
|
-
|
|
29417
|
-
|
|
29418
|
-
|
|
29419
|
-
|
|
29420
|
-
material
|
|
29421
|
-
material
|
|
29422
|
-
object.isSkinnedMesh ) {
|
|
29380
|
+
if ( _currentCamera !== camera ) {
|
|
29381
|
+
|
|
29382
|
+
_currentCamera = camera;
|
|
29383
|
+
|
|
29384
|
+
// lighting uniforms depend on the camera so enforce an update
|
|
29385
|
+
// now, in case this material supports lights - or later, when
|
|
29386
|
+
// the next material that does gets activated:
|
|
29423
29387
|
|
|
29424
|
-
|
|
29388
|
+
refreshMaterial = true; // set to true on material change
|
|
29389
|
+
refreshLights = true; // remains set until update done
|
|
29425
29390
|
|
|
29426
29391
|
}
|
|
29427
29392
|
|
|
@@ -30693,7 +30658,7 @@
|
|
|
30693
30658
|
|
|
30694
30659
|
super.copy( source, recursive );
|
|
30695
30660
|
|
|
30696
|
-
this.material = source.material;
|
|
30661
|
+
this.material = Array.isArray( source.material ) ? source.material.slice() : source.material;
|
|
30697
30662
|
this.geometry = source.geometry;
|
|
30698
30663
|
|
|
30699
30664
|
return this;
|
|
@@ -69546,7 +69511,7 @@
|
|
|
69546
69511
|
|
|
69547
69512
|
const twoPI = 2 * Math.PI;
|
|
69548
69513
|
|
|
69549
|
-
return function update() {
|
|
69514
|
+
return function update( deltaTime = null ) {
|
|
69550
69515
|
|
|
69551
69516
|
const position = scope.object.position;
|
|
69552
69517
|
|
|
@@ -69560,7 +69525,7 @@
|
|
|
69560
69525
|
|
|
69561
69526
|
if ( scope.autoRotate && state === STATE.NONE ) {
|
|
69562
69527
|
|
|
69563
|
-
rotateLeft( getAutoRotationAngle() );
|
|
69528
|
+
rotateLeft( getAutoRotationAngle( deltaTime ) );
|
|
69564
69529
|
|
|
69565
69530
|
}
|
|
69566
69531
|
|
|
@@ -69839,9 +69804,17 @@
|
|
|
69839
69804
|
const pointers = [];
|
|
69840
69805
|
const pointerPositions = {};
|
|
69841
69806
|
|
|
69842
|
-
function getAutoRotationAngle() {
|
|
69807
|
+
function getAutoRotationAngle( deltaTime ) {
|
|
69808
|
+
|
|
69809
|
+
if ( deltaTime !== null ) {
|
|
69843
69810
|
|
|
69844
|
-
|
|
69811
|
+
return ( 2 * Math.PI / 60 * scope.autoRotateSpeed ) * deltaTime;
|
|
69812
|
+
|
|
69813
|
+
} else {
|
|
69814
|
+
|
|
69815
|
+
return 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed;
|
|
69816
|
+
|
|
69817
|
+
}
|
|
69845
69818
|
|
|
69846
69819
|
}
|
|
69847
69820
|
|
|
@@ -69993,7 +69966,7 @@
|
|
|
69993
69966
|
mouse.x = ( x / w ) * 2 - 1;
|
|
69994
69967
|
mouse.y = - ( y / h ) * 2 + 1;
|
|
69995
69968
|
|
|
69996
|
-
dollyDirection.set( mouse.x, mouse.y, 1 ).unproject( object ).sub( object.position ).normalize();
|
|
69969
|
+
dollyDirection.set( mouse.x, mouse.y, 1 ).unproject( scope.object ).sub( scope.object.position ).normalize();
|
|
69997
69970
|
|
|
69998
69971
|
}
|
|
69999
69972
|
|
|
@@ -71559,7 +71532,7 @@
|
|
|
71559
71532
|
|
|
71560
71533
|
class RenderPass extends Pass {
|
|
71561
71534
|
|
|
71562
|
-
constructor( scene, camera, overrideMaterial, clearColor, clearAlpha ) {
|
|
71535
|
+
constructor( scene, camera, overrideMaterial = null, clearColor = null, clearAlpha = null ) {
|
|
71563
71536
|
|
|
71564
71537
|
super();
|
|
71565
71538
|
|
|
@@ -71569,7 +71542,7 @@
|
|
|
71569
71542
|
this.overrideMaterial = overrideMaterial;
|
|
71570
71543
|
|
|
71571
71544
|
this.clearColor = clearColor;
|
|
71572
|
-
this.clearAlpha =
|
|
71545
|
+
this.clearAlpha = clearAlpha;
|
|
71573
71546
|
|
|
71574
71547
|
this.clear = true;
|
|
71575
71548
|
this.clearDepth = false;
|
|
@@ -71585,7 +71558,7 @@
|
|
|
71585
71558
|
|
|
71586
71559
|
let oldClearAlpha, oldOverrideMaterial;
|
|
71587
71560
|
|
|
71588
|
-
if ( this.overrideMaterial !==
|
|
71561
|
+
if ( this.overrideMaterial !== null ) {
|
|
71589
71562
|
|
|
71590
71563
|
oldOverrideMaterial = this.scene.overrideMaterial;
|
|
71591
71564
|
|
|
@@ -71593,16 +71566,21 @@
|
|
|
71593
71566
|
|
|
71594
71567
|
}
|
|
71595
71568
|
|
|
71596
|
-
if ( this.clearColor ) {
|
|
71569
|
+
if ( this.clearColor !== null ) {
|
|
71597
71570
|
|
|
71598
71571
|
renderer.getClearColor( this._oldClearColor );
|
|
71599
|
-
|
|
71572
|
+
renderer.setClearColor( this.clearColor );
|
|
71600
71573
|
|
|
71601
|
-
|
|
71574
|
+
}
|
|
71575
|
+
|
|
71576
|
+
if ( this.clearAlpha !== null ) {
|
|
71577
|
+
|
|
71578
|
+
oldClearAlpha = renderer.getClearAlpha();
|
|
71579
|
+
renderer.setClearAlpha( this.clearAlpha );
|
|
71602
71580
|
|
|
71603
71581
|
}
|
|
71604
71582
|
|
|
71605
|
-
if ( this.clearDepth ) {
|
|
71583
|
+
if ( this.clearDepth == true ) {
|
|
71606
71584
|
|
|
71607
71585
|
renderer.clearDepth();
|
|
71608
71586
|
|
|
@@ -71610,17 +71588,30 @@
|
|
|
71610
71588
|
|
|
71611
71589
|
renderer.setRenderTarget( this.renderToScreen ? null : readBuffer );
|
|
71612
71590
|
|
|
71613
|
-
|
|
71614
|
-
|
|
71591
|
+
if ( this.clear === true ) {
|
|
71592
|
+
|
|
71593
|
+
// TODO: Avoid using autoClear properties, see https://github.com/mrdoob/three.js/pull/15571#issuecomment-465669600
|
|
71594
|
+
renderer.clear( renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil );
|
|
71595
|
+
|
|
71596
|
+
}
|
|
71597
|
+
|
|
71615
71598
|
renderer.render( this.scene, this.camera );
|
|
71616
71599
|
|
|
71617
|
-
|
|
71600
|
+
// restore
|
|
71601
|
+
|
|
71602
|
+
if ( this.clearColor !== null ) {
|
|
71603
|
+
|
|
71604
|
+
renderer.setClearColor( this._oldClearColor );
|
|
71605
|
+
|
|
71606
|
+
}
|
|
71607
|
+
|
|
71608
|
+
if ( this.clearAlpha !== null ) {
|
|
71618
71609
|
|
|
71619
|
-
renderer.
|
|
71610
|
+
renderer.setClearAlpha( oldClearAlpha );
|
|
71620
71611
|
|
|
71621
71612
|
}
|
|
71622
71613
|
|
|
71623
|
-
if ( this.overrideMaterial !==
|
|
71614
|
+
if ( this.overrideMaterial !== null ) {
|
|
71624
71615
|
|
|
71625
71616
|
this.scene.overrideMaterial = oldOverrideMaterial;
|
|
71626
71617
|
|
|
@@ -73074,10 +73065,10 @@
|
|
|
73074
73065
|
|
|
73075
73066
|
// Expose config from ThreeGlobe
|
|
73076
73067
|
var bindGlobe = linkKapsule('globe', threeGlobe);
|
|
73077
|
-
var linkedGlobeProps = Object.assign.apply(Object, _toConsumableArray$5(['globeImageUrl', 'bumpImageUrl', 'showGlobe', 'showGraticules', 'showAtmosphere', 'atmosphereColor', 'atmosphereAltitude', '
|
|
73068
|
+
var linkedGlobeProps = Object.assign.apply(Object, _toConsumableArray$5(['globeImageUrl', 'bumpImageUrl', 'showGlobe', 'showGraticules', 'showAtmosphere', 'atmosphereColor', 'atmosphereAltitude', 'onGlobeReady', 'pointsData', 'pointLat', 'pointLng', 'pointColor', 'pointAltitude', 'pointRadius', 'pointResolution', 'pointsMerge', 'pointsTransitionDuration', 'arcsData', 'arcStartLat', 'arcStartLng', 'arcEndLat', 'arcEndLng', 'arcColor', 'arcAltitude', 'arcAltitudeAutoScale', 'arcStroke', 'arcCurveResolution', 'arcCircularResolution', 'arcDashLength', 'arcDashGap', 'arcDashInitialGap', 'arcDashAnimateTime', 'arcsTransitionDuration', 'polygonsData', 'polygonGeoJsonGeometry', 'polygonCapColor', 'polygonCapMaterial', 'polygonSideColor', 'polygonSideMaterial', 'polygonStrokeColor', 'polygonAltitude', 'polygonCapCurvatureResolution', 'polygonsTransitionDuration', 'pathsData', 'pathPoints', 'pathPointLat', 'pathPointLng', 'pathPointAlt', 'pathResolution', 'pathColor', 'pathStroke', 'pathDashLength', 'pathDashGap', 'pathDashInitialGap', 'pathDashAnimateTime', 'pathTransitionDuration', 'hexBinPointsData', 'hexBinPointLat', 'hexBinPointLng', 'hexBinPointWeight', 'hexBinResolution', 'hexMargin', 'hexTopCurvatureResolution', 'hexTopColor', 'hexSideColor', 'hexAltitude', 'hexBinMerge', 'hexTransitionDuration', 'hexPolygonsData', 'hexPolygonGeoJsonGeometry', 'hexPolygonColor', 'hexPolygonAltitude', 'hexPolygonResolution', 'hexPolygonMargin', 'hexPolygonCurvatureResolution', 'hexPolygonsTransitionDuration', 'tilesData', 'tileLat', 'tileLng', 'tileAltitude', 'tileWidth', 'tileHeight', 'tileUseGlobeProjection', 'tileMaterial', 'tileCurvatureResolution', 'tilesTransitionDuration', 'ringsData', 'ringLat', 'ringLng', 'ringAltitude', 'ringColor', 'ringResolution', 'ringMaxRadius', 'ringPropagationSpeed', 'ringRepeatPeriod', 'labelsData', 'labelLat', 'labelLng', 'labelAltitude', 'labelRotation', 'labelText', 'labelSize', 'labelTypeFace', 'labelColor', 'labelResolution', 'labelIncludeDot', 'labelDotRadius', 'labelDotOrientation', 'labelsTransitionDuration', 'htmlElementsData', 'htmlLat', 'htmlLng', 'htmlAltitude', 'htmlElement', 'htmlTransitionDuration', 'objectsData', 'objectLat', 'objectLng', 'objectAltitude', 'objectRotation', 'objectFacesSurface', 'objectThreeObject', 'customLayerData', 'customThreeObject', 'customThreeObjectUpdate'].map(function (p) {
|
|
73078
73069
|
return _defineProperty$3({}, p, bindGlobe.linkProp(p));
|
|
73079
73070
|
})));
|
|
73080
|
-
var linkedGlobeMethods = Object.assign.apply(Object, _toConsumableArray$5(['getGlobeRadius', 'getCoords', 'toGeoCoords'].map(function (p) {
|
|
73071
|
+
var linkedGlobeMethods = Object.assign.apply(Object, _toConsumableArray$5(['globeMaterial', 'getGlobeRadius', 'getCoords', 'toGeoCoords'].map(function (p) {
|
|
73081
73072
|
return _defineProperty$3({}, p, bindGlobe.linkMethod(p));
|
|
73082
73073
|
})));
|
|
73083
73074
|
|
|
@@ -73256,7 +73247,7 @@
|
|
|
73256
73247
|
cancelAnimationFrame(state.animationFrameRequestId);
|
|
73257
73248
|
state.animationFrameRequestId = null;
|
|
73258
73249
|
}
|
|
73259
|
-
(_state$globe = state.globe) === null || _state$globe === void 0
|
|
73250
|
+
(_state$globe = state.globe) === null || _state$globe === void 0 || _state$globe.pauseAnimation();
|
|
73260
73251
|
return this;
|
|
73261
73252
|
},
|
|
73262
73253
|
resumeAnimation: function resumeAnimation(state) {
|
|
@@ -73264,7 +73255,7 @@
|
|
|
73264
73255
|
if (state.animationFrameRequestId === null) {
|
|
73265
73256
|
this._animationCycle();
|
|
73266
73257
|
}
|
|
73267
|
-
(_state$globe2 = state.globe) === null || _state$globe2 === void 0
|
|
73258
|
+
(_state$globe2 = state.globe) === null || _state$globe2 === void 0 || _state$globe2.resumeAnimation();
|
|
73268
73259
|
return this;
|
|
73269
73260
|
},
|
|
73270
73261
|
_animationCycle: function _animationCycle(state) {
|