react-globe.gl 2.24.2 → 2.24.4
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/react-globe.gl.d.ts +1 -1
- package/dist/react-globe.gl.js +539 -225
- package/dist/react-globe.gl.js.map +1 -1
- package/dist/react-globe.gl.min.js +5 -5
- package/package.json +9 -9
package/dist/react-globe.gl.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Version 2.24.
|
|
1
|
+
// Version 2.24.4 react-globe.gl - https://github.com/vasturiano/react-globe.gl
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react')) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['react'], factory) :
|
|
@@ -314,7 +314,7 @@
|
|
|
314
314
|
* Copyright 2010-2023 Three.js Authors
|
|
315
315
|
* SPDX-License-Identifier: MIT
|
|
316
316
|
*/
|
|
317
|
-
const REVISION = '
|
|
317
|
+
const REVISION = '156';
|
|
318
318
|
|
|
319
319
|
const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
|
|
320
320
|
const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
|
|
@@ -431,6 +431,8 @@
|
|
|
431
431
|
const RGBA_ASTC_12x10_Format = 37820;
|
|
432
432
|
const RGBA_ASTC_12x12_Format = 37821;
|
|
433
433
|
const RGBA_BPTC_Format = 36492;
|
|
434
|
+
const RGB_BPTC_SIGNED_Format = 36494;
|
|
435
|
+
const RGB_BPTC_UNSIGNED_Format = 36495;
|
|
434
436
|
const RED_RGTC1_Format = 36283;
|
|
435
437
|
const SIGNED_RED_RGTC1_Format = 36284;
|
|
436
438
|
const RED_GREEN_RGTC2_Format = 36285;
|
|
@@ -1186,8 +1188,8 @@
|
|
|
1186
1188
|
|
|
1187
1189
|
roundToZero() {
|
|
1188
1190
|
|
|
1189
|
-
this.x =
|
|
1190
|
-
this.y =
|
|
1191
|
+
this.x = Math.trunc( this.x );
|
|
1192
|
+
this.y = Math.trunc( this.y );
|
|
1191
1193
|
|
|
1192
1194
|
return this;
|
|
1193
1195
|
|
|
@@ -1777,6 +1779,14 @@
|
|
|
1777
1779
|
|
|
1778
1780
|
}
|
|
1779
1781
|
|
|
1782
|
+
function createCanvasElement() {
|
|
1783
|
+
|
|
1784
|
+
const canvas = createElementNS( 'canvas' );
|
|
1785
|
+
canvas.style.display = 'block';
|
|
1786
|
+
return canvas;
|
|
1787
|
+
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1780
1790
|
const _cache = {};
|
|
1781
1791
|
|
|
1782
1792
|
function warnOnce( message ) {
|
|
@@ -2168,7 +2178,7 @@
|
|
|
2168
2178
|
|
|
2169
2179
|
}
|
|
2170
2180
|
|
|
2171
|
-
let
|
|
2181
|
+
let _textureId = 0;
|
|
2172
2182
|
|
|
2173
2183
|
class Texture extends EventDispatcher {
|
|
2174
2184
|
|
|
@@ -2178,7 +2188,7 @@
|
|
|
2178
2188
|
|
|
2179
2189
|
this.isTexture = true;
|
|
2180
2190
|
|
|
2181
|
-
Object.defineProperty( this, 'id', { value:
|
|
2191
|
+
Object.defineProperty( this, 'id', { value: _textureId ++ } );
|
|
2182
2192
|
|
|
2183
2193
|
this.uuid = generateUUID();
|
|
2184
2194
|
|
|
@@ -2988,10 +2998,10 @@
|
|
|
2988
2998
|
|
|
2989
2999
|
roundToZero() {
|
|
2990
3000
|
|
|
2991
|
-
this.x =
|
|
2992
|
-
this.y =
|
|
2993
|
-
this.z =
|
|
2994
|
-
this.w =
|
|
3001
|
+
this.x = Math.trunc( this.x );
|
|
3002
|
+
this.y = Math.trunc( this.y );
|
|
3003
|
+
this.z = Math.trunc( this.z );
|
|
3004
|
+
this.w = Math.trunc( this.w );
|
|
2995
3005
|
|
|
2996
3006
|
return this;
|
|
2997
3007
|
|
|
@@ -3132,13 +3142,13 @@
|
|
|
3132
3142
|
* Texture parameters for an auto-generated target texture
|
|
3133
3143
|
* depthBuffer/stencilBuffer: Booleans to indicate if we should generate these buffers
|
|
3134
3144
|
*/
|
|
3135
|
-
class
|
|
3145
|
+
class RenderTarget extends EventDispatcher {
|
|
3136
3146
|
|
|
3137
3147
|
constructor( width = 1, height = 1, options = {} ) {
|
|
3138
3148
|
|
|
3139
3149
|
super();
|
|
3140
3150
|
|
|
3141
|
-
this.
|
|
3151
|
+
this.isRenderTarget = true;
|
|
3142
3152
|
|
|
3143
3153
|
this.width = width;
|
|
3144
3154
|
this.height = height;
|
|
@@ -3241,6 +3251,18 @@
|
|
|
3241
3251
|
|
|
3242
3252
|
}
|
|
3243
3253
|
|
|
3254
|
+
class WebGLRenderTarget extends RenderTarget {
|
|
3255
|
+
|
|
3256
|
+
constructor( width = 1, height = 1, options = {} ) {
|
|
3257
|
+
|
|
3258
|
+
super( width, height, options );
|
|
3259
|
+
|
|
3260
|
+
this.isWebGLRenderTarget = true;
|
|
3261
|
+
|
|
3262
|
+
}
|
|
3263
|
+
|
|
3264
|
+
}
|
|
3265
|
+
|
|
3244
3266
|
class DataArrayTexture extends Texture {
|
|
3245
3267
|
|
|
3246
3268
|
constructor( data = null, width = 1, height = 1, depth = 1 ) {
|
|
@@ -4372,9 +4394,9 @@
|
|
|
4372
4394
|
|
|
4373
4395
|
roundToZero() {
|
|
4374
4396
|
|
|
4375
|
-
this.x =
|
|
4376
|
-
this.y =
|
|
4377
|
-
this.z =
|
|
4397
|
+
this.x = Math.trunc( this.x );
|
|
4398
|
+
this.y = Math.trunc( this.y );
|
|
4399
|
+
this.z = Math.trunc( this.z );
|
|
4378
4400
|
|
|
4379
4401
|
return this;
|
|
4380
4402
|
|
|
@@ -7604,20 +7626,7 @@
|
|
|
7604
7626
|
|
|
7605
7627
|
clear() {
|
|
7606
7628
|
|
|
7607
|
-
|
|
7608
|
-
|
|
7609
|
-
const object = this.children[ i ];
|
|
7610
|
-
|
|
7611
|
-
object.parent = null;
|
|
7612
|
-
|
|
7613
|
-
object.dispatchEvent( _removedEvent );
|
|
7614
|
-
|
|
7615
|
-
}
|
|
7616
|
-
|
|
7617
|
-
this.children.length = 0;
|
|
7618
|
-
|
|
7619
|
-
return this;
|
|
7620
|
-
|
|
7629
|
+
return this.remove( ... this.children );
|
|
7621
7630
|
|
|
7622
7631
|
}
|
|
7623
7632
|
|
|
@@ -8157,7 +8166,7 @@
|
|
|
8157
8166
|
this.frustumCulled = source.frustumCulled;
|
|
8158
8167
|
this.renderOrder = source.renderOrder;
|
|
8159
8168
|
|
|
8160
|
-
this.animations = source.animations;
|
|
8169
|
+
this.animations = source.animations.slice();
|
|
8161
8170
|
|
|
8162
8171
|
this.userData = JSON.parse( JSON.stringify( source.userData ) );
|
|
8163
8172
|
|
|
@@ -8508,7 +8517,7 @@
|
|
|
8508
8517
|
|
|
8509
8518
|
}
|
|
8510
8519
|
|
|
8511
|
-
let
|
|
8520
|
+
let _materialId = 0;
|
|
8512
8521
|
|
|
8513
8522
|
class Material extends EventDispatcher {
|
|
8514
8523
|
|
|
@@ -8518,7 +8527,7 @@
|
|
|
8518
8527
|
|
|
8519
8528
|
this.isMaterial = true;
|
|
8520
8529
|
|
|
8521
|
-
Object.defineProperty( this, 'id', { value:
|
|
8530
|
+
Object.defineProperty( this, 'id', { value: _materialId ++ } );
|
|
8522
8531
|
|
|
8523
8532
|
this.uuid = generateUUID();
|
|
8524
8533
|
|
|
@@ -9880,6 +9889,26 @@
|
|
|
9880
9889
|
|
|
9881
9890
|
}
|
|
9882
9891
|
|
|
9892
|
+
getComponent( index, component ) {
|
|
9893
|
+
|
|
9894
|
+
let value = this.array[ index * this.itemSize + component ];
|
|
9895
|
+
|
|
9896
|
+
if ( this.normalized ) value = denormalize( value, this.array );
|
|
9897
|
+
|
|
9898
|
+
return value;
|
|
9899
|
+
|
|
9900
|
+
}
|
|
9901
|
+
|
|
9902
|
+
setComponent( index, component, value ) {
|
|
9903
|
+
|
|
9904
|
+
if ( this.normalized ) value = normalize$1( value, this.array );
|
|
9905
|
+
|
|
9906
|
+
this.array[ index * this.itemSize + component ] = value;
|
|
9907
|
+
|
|
9908
|
+
return this;
|
|
9909
|
+
|
|
9910
|
+
}
|
|
9911
|
+
|
|
9883
9912
|
getX( index ) {
|
|
9884
9913
|
|
|
9885
9914
|
let x = this.array[ index * this.itemSize ];
|
|
@@ -10084,7 +10113,7 @@
|
|
|
10084
10113
|
|
|
10085
10114
|
}
|
|
10086
10115
|
|
|
10087
|
-
let _id$
|
|
10116
|
+
let _id$2 = 0;
|
|
10088
10117
|
|
|
10089
10118
|
const _m1 = /*@__PURE__*/ new Matrix4();
|
|
10090
10119
|
const _obj = /*@__PURE__*/ new Object3D();
|
|
@@ -10101,7 +10130,7 @@
|
|
|
10101
10130
|
|
|
10102
10131
|
this.isBufferGeometry = true;
|
|
10103
10132
|
|
|
10104
|
-
Object.defineProperty( this, 'id', { value: _id$
|
|
10133
|
+
Object.defineProperty( this, 'id', { value: _id$2 ++ } );
|
|
10105
10134
|
|
|
10106
10135
|
this.uuid = generateUUID();
|
|
10107
10136
|
|
|
@@ -11206,7 +11235,7 @@
|
|
|
11206
11235
|
|
|
11207
11236
|
}
|
|
11208
11237
|
|
|
11209
|
-
this.material = source.material;
|
|
11238
|
+
this.material = Array.isArray( source.material ) ? source.material.slice() : source.material;
|
|
11210
11239
|
this.geometry = source.geometry;
|
|
11211
11240
|
|
|
11212
11241
|
return this;
|
|
@@ -12448,10 +12477,8 @@
|
|
|
12448
12477
|
|
|
12449
12478
|
const currentRenderTarget = renderer.getRenderTarget();
|
|
12450
12479
|
|
|
12451
|
-
const currentToneMapping = renderer.toneMapping;
|
|
12452
12480
|
const currentXrEnabled = renderer.xr.enabled;
|
|
12453
12481
|
|
|
12454
|
-
renderer.toneMapping = NoToneMapping;
|
|
12455
12482
|
renderer.xr.enabled = false;
|
|
12456
12483
|
|
|
12457
12484
|
const generateMipmaps = renderTarget.texture.generateMipmaps;
|
|
@@ -12480,7 +12507,6 @@
|
|
|
12480
12507
|
|
|
12481
12508
|
renderer.setRenderTarget( currentRenderTarget );
|
|
12482
12509
|
|
|
12483
|
-
renderer.toneMapping = currentToneMapping;
|
|
12484
12510
|
renderer.xr.enabled = currentXrEnabled;
|
|
12485
12511
|
|
|
12486
12512
|
renderTarget.texture.needsPMREMUpdate = true;
|
|
@@ -13403,7 +13429,7 @@
|
|
|
13403
13429
|
|
|
13404
13430
|
var bsdfs = "float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated";
|
|
13405
13431
|
|
|
13406
|
-
var iridescence_fragment = "#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\
|
|
13432
|
+
var iridescence_fragment = "#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif";
|
|
13407
13433
|
|
|
13408
13434
|
var bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos.xyz );\n\t\tvec3 vSigmaY = dFdy( surf_pos.xyz );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif";
|
|
13409
13435
|
|
|
@@ -13499,7 +13525,7 @@
|
|
|
13499
13525
|
|
|
13500
13526
|
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";
|
|
13501
13527
|
|
|
13502
|
-
var map_fragment = "#ifdef USE_MAP\n\
|
|
13528
|
+
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";
|
|
13503
13529
|
|
|
13504
13530
|
var map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif";
|
|
13505
13531
|
|
|
@@ -13593,7 +13619,7 @@
|
|
|
13593
13619
|
|
|
13594
13620
|
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}";
|
|
13595
13621
|
|
|
13596
|
-
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}";
|
|
13622
|
+
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}";
|
|
13597
13623
|
|
|
13598
13624
|
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}";
|
|
13599
13625
|
|
|
@@ -14413,24 +14439,15 @@
|
|
|
14413
14439
|
|
|
14414
14440
|
}
|
|
14415
14441
|
|
|
14416
|
-
const
|
|
14417
|
-
const environmentBlendMode = xr.getEnvironmentBlendMode();
|
|
14442
|
+
const environmentBlendMode = renderer.xr.getEnvironmentBlendMode();
|
|
14418
14443
|
|
|
14419
|
-
|
|
14444
|
+
if ( environmentBlendMode === 'additive' ) {
|
|
14420
14445
|
|
|
14421
|
-
|
|
14422
|
-
forceClear = true;
|
|
14423
|
-
break;
|
|
14446
|
+
state.buffers.color.setClear( 0, 0, 0, 1, premultipliedAlpha );
|
|
14424
14447
|
|
|
14425
|
-
|
|
14426
|
-
state.buffers.color.setClear( 0, 0, 0, 1, premultipliedAlpha );
|
|
14427
|
-
forceClear = true;
|
|
14428
|
-
break;
|
|
14448
|
+
} else if ( environmentBlendMode === 'alpha-blend' ) {
|
|
14429
14449
|
|
|
14430
|
-
|
|
14431
|
-
state.buffers.color.setClear( 0, 0, 0, 0, premultipliedAlpha );
|
|
14432
|
-
forceClear = true;
|
|
14433
|
-
break;
|
|
14450
|
+
state.buffers.color.setClear( 0, 0, 0, 0, premultipliedAlpha );
|
|
14434
14451
|
|
|
14435
14452
|
}
|
|
14436
14453
|
|
|
@@ -17031,7 +17048,7 @@
|
|
|
17031
17048
|
|
|
17032
17049
|
}
|
|
17033
17050
|
|
|
17034
|
-
} else {
|
|
17051
|
+
} else if ( geometryPosition !== undefined ) {
|
|
17035
17052
|
|
|
17036
17053
|
const array = geometryPosition.array;
|
|
17037
17054
|
version = geometryPosition.version;
|
|
@@ -17046,6 +17063,10 @@
|
|
|
17046
17063
|
|
|
17047
17064
|
}
|
|
17048
17065
|
|
|
17066
|
+
} else {
|
|
17067
|
+
|
|
17068
|
+
return;
|
|
17069
|
+
|
|
17049
17070
|
}
|
|
17050
17071
|
|
|
17051
17072
|
const attribute = new ( arrayNeedsUint32( indices ) ? Uint32BufferAttribute : Uint16BufferAttribute )( indices, 1 );
|
|
@@ -19541,6 +19562,8 @@
|
|
|
19541
19562
|
|
|
19542
19563
|
parameters.useLegacyLights ? '#define LEGACY_LIGHTS' : '',
|
|
19543
19564
|
|
|
19565
|
+
parameters.decodeVideoTexture ? '#define DECODE_VIDEO_TEXTURE' : '',
|
|
19566
|
+
|
|
19544
19567
|
parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
|
|
19545
19568
|
( parameters.logarithmicDepthBuffer && parameters.rendererExtensionFragDepth ) ? '#define USE_LOGDEPTHBUF_EXT' : '',
|
|
19546
19569
|
|
|
@@ -19775,7 +19798,7 @@
|
|
|
19775
19798
|
|
|
19776
19799
|
}
|
|
19777
19800
|
|
|
19778
|
-
let _id = 0;
|
|
19801
|
+
let _id$1 = 0;
|
|
19779
19802
|
|
|
19780
19803
|
class WebGLShaderCache {
|
|
19781
19804
|
|
|
@@ -19889,7 +19912,7 @@
|
|
|
19889
19912
|
|
|
19890
19913
|
constructor( code ) {
|
|
19891
19914
|
|
|
19892
|
-
this.id = _id ++;
|
|
19915
|
+
this.id = _id$1 ++;
|
|
19893
19916
|
|
|
19894
19917
|
this.code = code;
|
|
19895
19918
|
this.usedTimes = 0;
|
|
@@ -20053,6 +20076,18 @@
|
|
|
20053
20076
|
const HAS_ATTRIBUTE_UV2 = !! geometry.attributes.uv2;
|
|
20054
20077
|
const HAS_ATTRIBUTE_UV3 = !! geometry.attributes.uv3;
|
|
20055
20078
|
|
|
20079
|
+
let toneMapping = NoToneMapping;
|
|
20080
|
+
|
|
20081
|
+
if ( material.toneMapped ) {
|
|
20082
|
+
|
|
20083
|
+
if ( currentRenderTarget === null || currentRenderTarget.isXRRenderTarget === true ) {
|
|
20084
|
+
|
|
20085
|
+
toneMapping = renderer.toneMapping;
|
|
20086
|
+
|
|
20087
|
+
}
|
|
20088
|
+
|
|
20089
|
+
}
|
|
20090
|
+
|
|
20056
20091
|
const parameters = {
|
|
20057
20092
|
|
|
20058
20093
|
isWebGL2: IS_WEBGL2,
|
|
@@ -20213,8 +20248,10 @@
|
|
|
20213
20248
|
shadowMapEnabled: renderer.shadowMap.enabled && shadows.length > 0,
|
|
20214
20249
|
shadowMapType: renderer.shadowMap.type,
|
|
20215
20250
|
|
|
20216
|
-
toneMapping:
|
|
20217
|
-
useLegacyLights: renderer.
|
|
20251
|
+
toneMapping: toneMapping,
|
|
20252
|
+
useLegacyLights: renderer._useLegacyLights,
|
|
20253
|
+
|
|
20254
|
+
decodeVideoTexture: HAS_MAP && ( material.map.isVideoTexture === true ) && ( material.map.colorSpace === SRGBColorSpace ),
|
|
20218
20255
|
|
|
20219
20256
|
premultipliedAlpha: material.premultipliedAlpha,
|
|
20220
20257
|
|
|
@@ -20417,6 +20454,8 @@
|
|
|
20417
20454
|
_programLayers.enable( 17 );
|
|
20418
20455
|
if ( parameters.pointsUvs )
|
|
20419
20456
|
_programLayers.enable( 18 );
|
|
20457
|
+
if ( parameters.decodeVideoTexture )
|
|
20458
|
+
_programLayers.enable( 19 );
|
|
20420
20459
|
|
|
20421
20460
|
array.push( _programLayers.mask );
|
|
20422
20461
|
|
|
@@ -23386,6 +23425,17 @@
|
|
|
23386
23425
|
|
|
23387
23426
|
}
|
|
23388
23427
|
|
|
23428
|
+
if ( glFormat === _gl.RED_INTEGER ) {
|
|
23429
|
+
|
|
23430
|
+
if ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.R8UI;
|
|
23431
|
+
if ( glType === _gl.UNSIGNED_SHORT ) internalFormat = _gl.R16UI;
|
|
23432
|
+
if ( glType === _gl.UNSIGNED_INT ) internalFormat = _gl.R32UI;
|
|
23433
|
+
if ( glType === _gl.BYTE ) internalFormat = _gl.R8I;
|
|
23434
|
+
if ( glType === _gl.SHORT ) internalFormat = _gl.R16I;
|
|
23435
|
+
if ( glType === _gl.INT ) internalFormat = _gl.R32I;
|
|
23436
|
+
|
|
23437
|
+
}
|
|
23438
|
+
|
|
23389
23439
|
if ( glFormat === _gl.RG ) {
|
|
23390
23440
|
|
|
23391
23441
|
if ( glType === _gl.FLOAT ) internalFormat = _gl.RG32F;
|
|
@@ -23562,14 +23612,32 @@
|
|
|
23562
23612
|
|
|
23563
23613
|
for ( let i = 0; i < 6; i ++ ) {
|
|
23564
23614
|
|
|
23565
|
-
|
|
23615
|
+
if ( Array.isArray( renderTargetProperties.__webglFramebuffer[ i ] ) ) {
|
|
23616
|
+
|
|
23617
|
+
for ( let level = 0; level < renderTargetProperties.__webglFramebuffer[ i ].length; level ++ ) _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ i ][ level ] );
|
|
23618
|
+
|
|
23619
|
+
} else {
|
|
23620
|
+
|
|
23621
|
+
_gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ i ] );
|
|
23622
|
+
|
|
23623
|
+
}
|
|
23624
|
+
|
|
23566
23625
|
if ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer[ i ] );
|
|
23567
23626
|
|
|
23568
23627
|
}
|
|
23569
23628
|
|
|
23570
23629
|
} else {
|
|
23571
23630
|
|
|
23572
|
-
|
|
23631
|
+
if ( Array.isArray( renderTargetProperties.__webglFramebuffer ) ) {
|
|
23632
|
+
|
|
23633
|
+
for ( let level = 0; level < renderTargetProperties.__webglFramebuffer.length; level ++ ) _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ level ] );
|
|
23634
|
+
|
|
23635
|
+
} else {
|
|
23636
|
+
|
|
23637
|
+
_gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer );
|
|
23638
|
+
|
|
23639
|
+
}
|
|
23640
|
+
|
|
23573
23641
|
if ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer );
|
|
23574
23642
|
if ( renderTargetProperties.__webglMultisampledFramebuffer ) _gl.deleteFramebuffer( renderTargetProperties.__webglMultisampledFramebuffer );
|
|
23575
23643
|
|
|
@@ -23948,7 +24016,7 @@
|
|
|
23948
24016
|
glFormat = utils.convert( texture.format, texture.colorSpace );
|
|
23949
24017
|
|
|
23950
24018
|
let glType = utils.convert( texture.type ),
|
|
23951
|
-
glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace );
|
|
24019
|
+
glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace, texture.isVideoTexture );
|
|
23952
24020
|
|
|
23953
24021
|
setTextureParameters( textureType, texture, supportsMips );
|
|
23954
24022
|
|
|
@@ -24544,7 +24612,7 @@
|
|
|
24544
24612
|
// Render targets
|
|
24545
24613
|
|
|
24546
24614
|
// Setup storage for target texture and bind it to correct framebuffer
|
|
24547
|
-
function setupFrameBufferTexture( framebuffer, renderTarget, texture, attachment, textureTarget ) {
|
|
24615
|
+
function setupFrameBufferTexture( framebuffer, renderTarget, texture, attachment, textureTarget, level ) {
|
|
24548
24616
|
|
|
24549
24617
|
const glFormat = utils.convert( texture.format, texture.colorSpace );
|
|
24550
24618
|
const glType = utils.convert( texture.type );
|
|
@@ -24553,13 +24621,16 @@
|
|
|
24553
24621
|
|
|
24554
24622
|
if ( ! renderTargetProperties.__hasExternalTextures ) {
|
|
24555
24623
|
|
|
24624
|
+
const width = Math.max( 1, renderTarget.width >> level );
|
|
24625
|
+
const height = Math.max( 1, renderTarget.height >> level );
|
|
24626
|
+
|
|
24556
24627
|
if ( textureTarget === _gl.TEXTURE_3D || textureTarget === _gl.TEXTURE_2D_ARRAY ) {
|
|
24557
24628
|
|
|
24558
|
-
state.texImage3D( textureTarget,
|
|
24629
|
+
state.texImage3D( textureTarget, level, glInternalFormat, width, height, renderTarget.depth, 0, glFormat, glType, null );
|
|
24559
24630
|
|
|
24560
24631
|
} else {
|
|
24561
24632
|
|
|
24562
|
-
state.texImage2D( textureTarget,
|
|
24633
|
+
state.texImage2D( textureTarget, level, glInternalFormat, width, height, 0, glFormat, glType, null );
|
|
24563
24634
|
|
|
24564
24635
|
}
|
|
24565
24636
|
|
|
@@ -24573,7 +24644,7 @@
|
|
|
24573
24644
|
|
|
24574
24645
|
} else if ( textureTarget === _gl.TEXTURE_2D || ( textureTarget >= _gl.TEXTURE_CUBE_MAP_POSITIVE_X && textureTarget <= _gl.TEXTURE_CUBE_MAP_NEGATIVE_Z ) ) { // see #24753
|
|
24575
24646
|
|
|
24576
|
-
_gl.framebufferTexture2D( _gl.FRAMEBUFFER, attachment, textureTarget, properties.get( texture ).__webglTexture,
|
|
24647
|
+
_gl.framebufferTexture2D( _gl.FRAMEBUFFER, attachment, textureTarget, properties.get( texture ).__webglTexture, level );
|
|
24577
24648
|
|
|
24578
24649
|
}
|
|
24579
24650
|
|
|
@@ -24794,7 +24865,7 @@
|
|
|
24794
24865
|
|
|
24795
24866
|
if ( colorTexture !== undefined ) {
|
|
24796
24867
|
|
|
24797
|
-
setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, renderTarget.texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D );
|
|
24868
|
+
setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, renderTarget.texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D, 0 );
|
|
24798
24869
|
|
|
24799
24870
|
}
|
|
24800
24871
|
|
|
@@ -24841,13 +24912,41 @@
|
|
|
24841
24912
|
|
|
24842
24913
|
for ( let i = 0; i < 6; i ++ ) {
|
|
24843
24914
|
|
|
24844
|
-
|
|
24915
|
+
if ( isWebGL2 && texture.mipmaps && texture.mipmaps.length > 0 ) {
|
|
24916
|
+
|
|
24917
|
+
renderTargetProperties.__webglFramebuffer[ i ] = [];
|
|
24918
|
+
|
|
24919
|
+
for ( let level = 0; level < texture.mipmaps.length; level ++ ) {
|
|
24920
|
+
|
|
24921
|
+
renderTargetProperties.__webglFramebuffer[ i ][ level ] = _gl.createFramebuffer();
|
|
24922
|
+
|
|
24923
|
+
}
|
|
24924
|
+
|
|
24925
|
+
} else {
|
|
24926
|
+
|
|
24927
|
+
renderTargetProperties.__webglFramebuffer[ i ] = _gl.createFramebuffer();
|
|
24928
|
+
|
|
24929
|
+
}
|
|
24845
24930
|
|
|
24846
24931
|
}
|
|
24847
24932
|
|
|
24848
24933
|
} else {
|
|
24849
24934
|
|
|
24850
|
-
|
|
24935
|
+
if ( isWebGL2 && texture.mipmaps && texture.mipmaps.length > 0 ) {
|
|
24936
|
+
|
|
24937
|
+
renderTargetProperties.__webglFramebuffer = [];
|
|
24938
|
+
|
|
24939
|
+
for ( let level = 0; level < texture.mipmaps.length; level ++ ) {
|
|
24940
|
+
|
|
24941
|
+
renderTargetProperties.__webglFramebuffer[ level ] = _gl.createFramebuffer();
|
|
24942
|
+
|
|
24943
|
+
}
|
|
24944
|
+
|
|
24945
|
+
} else {
|
|
24946
|
+
|
|
24947
|
+
renderTargetProperties.__webglFramebuffer = _gl.createFramebuffer();
|
|
24948
|
+
|
|
24949
|
+
}
|
|
24851
24950
|
|
|
24852
24951
|
if ( isMultipleRenderTargets ) {
|
|
24853
24952
|
|
|
@@ -24927,7 +25026,19 @@
|
|
|
24927
25026
|
|
|
24928
25027
|
for ( let i = 0; i < 6; i ++ ) {
|
|
24929
25028
|
|
|
24930
|
-
|
|
25029
|
+
if ( isWebGL2 && texture.mipmaps && texture.mipmaps.length > 0 ) {
|
|
25030
|
+
|
|
25031
|
+
for ( let level = 0; level < texture.mipmaps.length; level ++ ) {
|
|
25032
|
+
|
|
25033
|
+
setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ][ level ], renderTarget, texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, level );
|
|
25034
|
+
|
|
25035
|
+
}
|
|
25036
|
+
|
|
25037
|
+
} else {
|
|
25038
|
+
|
|
25039
|
+
setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ], renderTarget, texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0 );
|
|
25040
|
+
|
|
25041
|
+
}
|
|
24931
25042
|
|
|
24932
25043
|
}
|
|
24933
25044
|
|
|
@@ -24950,7 +25061,7 @@
|
|
|
24950
25061
|
|
|
24951
25062
|
state.bindTexture( _gl.TEXTURE_2D, attachmentProperties.__webglTexture );
|
|
24952
25063
|
setTextureParameters( _gl.TEXTURE_2D, attachment, supportsMips );
|
|
24953
|
-
setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, attachment, _gl.COLOR_ATTACHMENT0 + i, _gl.TEXTURE_2D );
|
|
25064
|
+
setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, attachment, _gl.COLOR_ATTACHMENT0 + i, _gl.TEXTURE_2D, 0 );
|
|
24954
25065
|
|
|
24955
25066
|
if ( textureNeedsGenerateMipmaps( attachment, supportsMips ) ) {
|
|
24956
25067
|
|
|
@@ -24982,7 +25093,20 @@
|
|
|
24982
25093
|
|
|
24983
25094
|
state.bindTexture( glTextureType, textureProperties.__webglTexture );
|
|
24984
25095
|
setTextureParameters( glTextureType, texture, supportsMips );
|
|
24985
|
-
|
|
25096
|
+
|
|
25097
|
+
if ( isWebGL2 && texture.mipmaps && texture.mipmaps.length > 0 ) {
|
|
25098
|
+
|
|
25099
|
+
for ( let level = 0; level < texture.mipmaps.length; level ++ ) {
|
|
25100
|
+
|
|
25101
|
+
setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ level ], renderTarget, texture, _gl.COLOR_ATTACHMENT0, glTextureType, level );
|
|
25102
|
+
|
|
25103
|
+
}
|
|
25104
|
+
|
|
25105
|
+
} else {
|
|
25106
|
+
|
|
25107
|
+
setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, texture, _gl.COLOR_ATTACHMENT0, glTextureType, 0 );
|
|
25108
|
+
|
|
25109
|
+
}
|
|
24986
25110
|
|
|
24987
25111
|
if ( textureNeedsGenerateMipmaps( texture, supportsMips ) ) {
|
|
24988
25112
|
|
|
@@ -25171,13 +25295,13 @@
|
|
|
25171
25295
|
const format = texture.format;
|
|
25172
25296
|
const type = texture.type;
|
|
25173
25297
|
|
|
25174
|
-
if ( texture.isCompressedTexture === true || texture.format === _SRGBAFormat ) return image;
|
|
25298
|
+
if ( texture.isCompressedTexture === true || texture.isVideoTexture === true || texture.format === _SRGBAFormat ) return image;
|
|
25175
25299
|
|
|
25176
25300
|
if ( colorSpace !== LinearSRGBColorSpace && colorSpace !== NoColorSpace ) {
|
|
25177
25301
|
|
|
25178
25302
|
// sRGB
|
|
25179
25303
|
|
|
25180
|
-
if ( colorSpace === SRGBColorSpace ) {
|
|
25304
|
+
if ( colorSpace === SRGBColorSpace || colorSpace === DisplayP3ColorSpace ) {
|
|
25181
25305
|
|
|
25182
25306
|
if ( isWebGL2 === false ) {
|
|
25183
25307
|
|
|
@@ -25243,6 +25367,9 @@
|
|
|
25243
25367
|
|
|
25244
25368
|
}
|
|
25245
25369
|
|
|
25370
|
+
const LinearTransferFunction = 0;
|
|
25371
|
+
const SRGBTransferFunction = 1;
|
|
25372
|
+
|
|
25246
25373
|
function WebGLUtils( gl, extensions, capabilities ) {
|
|
25247
25374
|
|
|
25248
25375
|
const isWebGL2 = capabilities.isWebGL2;
|
|
@@ -25251,6 +25378,8 @@
|
|
|
25251
25378
|
|
|
25252
25379
|
let extension;
|
|
25253
25380
|
|
|
25381
|
+
const transferFunction = ( colorSpace === SRGBColorSpace || colorSpace === DisplayP3ColorSpace ) ? SRGBTransferFunction : LinearTransferFunction;
|
|
25382
|
+
|
|
25254
25383
|
if ( p === UnsignedByteType ) return gl.UNSIGNED_BYTE;
|
|
25255
25384
|
if ( p === UnsignedShort4444Type ) return gl.UNSIGNED_SHORT_4_4_4_4;
|
|
25256
25385
|
if ( p === UnsignedShort5551Type ) return gl.UNSIGNED_SHORT_5_5_5_1;
|
|
@@ -25317,7 +25446,7 @@
|
|
|
25317
25446
|
|
|
25318
25447
|
if ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format || p === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) {
|
|
25319
25448
|
|
|
25320
|
-
if (
|
|
25449
|
+
if ( transferFunction === SRGBTransferFunction ) {
|
|
25321
25450
|
|
|
25322
25451
|
extension = extensions.get( 'WEBGL_compressed_texture_s3tc_srgb' );
|
|
25323
25452
|
|
|
@@ -25402,8 +25531,8 @@
|
|
|
25402
25531
|
|
|
25403
25532
|
if ( extension !== null ) {
|
|
25404
25533
|
|
|
25405
|
-
if ( p === RGB_ETC2_Format ) return (
|
|
25406
|
-
if ( p === RGBA_ETC2_EAC_Format ) return (
|
|
25534
|
+
if ( p === RGB_ETC2_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ETC2 : extension.COMPRESSED_RGB8_ETC2;
|
|
25535
|
+
if ( p === RGBA_ETC2_EAC_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : extension.COMPRESSED_RGBA8_ETC2_EAC;
|
|
25407
25536
|
|
|
25408
25537
|
} else {
|
|
25409
25538
|
|
|
@@ -25425,20 +25554,20 @@
|
|
|
25425
25554
|
|
|
25426
25555
|
if ( extension !== null ) {
|
|
25427
25556
|
|
|
25428
|
-
if ( p === RGBA_ASTC_4x4_Format ) return (
|
|
25429
|
-
if ( p === RGBA_ASTC_5x4_Format ) return (
|
|
25430
|
-
if ( p === RGBA_ASTC_5x5_Format ) return (
|
|
25431
|
-
if ( p === RGBA_ASTC_6x5_Format ) return (
|
|
25432
|
-
if ( p === RGBA_ASTC_6x6_Format ) return (
|
|
25433
|
-
if ( p === RGBA_ASTC_8x5_Format ) return (
|
|
25434
|
-
if ( p === RGBA_ASTC_8x6_Format ) return (
|
|
25435
|
-
if ( p === RGBA_ASTC_8x8_Format ) return (
|
|
25436
|
-
if ( p === RGBA_ASTC_10x5_Format ) return (
|
|
25437
|
-
if ( p === RGBA_ASTC_10x6_Format ) return (
|
|
25438
|
-
if ( p === RGBA_ASTC_10x8_Format ) return (
|
|
25439
|
-
if ( p === RGBA_ASTC_10x10_Format ) return (
|
|
25440
|
-
if ( p === RGBA_ASTC_12x10_Format ) return (
|
|
25441
|
-
if ( p === RGBA_ASTC_12x12_Format ) return (
|
|
25557
|
+
if ( p === RGBA_ASTC_4x4_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : extension.COMPRESSED_RGBA_ASTC_4x4_KHR;
|
|
25558
|
+
if ( p === RGBA_ASTC_5x4_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : extension.COMPRESSED_RGBA_ASTC_5x4_KHR;
|
|
25559
|
+
if ( p === RGBA_ASTC_5x5_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : extension.COMPRESSED_RGBA_ASTC_5x5_KHR;
|
|
25560
|
+
if ( p === RGBA_ASTC_6x5_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : extension.COMPRESSED_RGBA_ASTC_6x5_KHR;
|
|
25561
|
+
if ( p === RGBA_ASTC_6x6_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : extension.COMPRESSED_RGBA_ASTC_6x6_KHR;
|
|
25562
|
+
if ( p === RGBA_ASTC_8x5_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : extension.COMPRESSED_RGBA_ASTC_8x5_KHR;
|
|
25563
|
+
if ( p === RGBA_ASTC_8x6_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : extension.COMPRESSED_RGBA_ASTC_8x6_KHR;
|
|
25564
|
+
if ( p === RGBA_ASTC_8x8_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : extension.COMPRESSED_RGBA_ASTC_8x8_KHR;
|
|
25565
|
+
if ( p === RGBA_ASTC_10x5_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : extension.COMPRESSED_RGBA_ASTC_10x5_KHR;
|
|
25566
|
+
if ( p === RGBA_ASTC_10x6_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : extension.COMPRESSED_RGBA_ASTC_10x6_KHR;
|
|
25567
|
+
if ( p === RGBA_ASTC_10x8_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : extension.COMPRESSED_RGBA_ASTC_10x8_KHR;
|
|
25568
|
+
if ( p === RGBA_ASTC_10x10_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : extension.COMPRESSED_RGBA_ASTC_10x10_KHR;
|
|
25569
|
+
if ( p === RGBA_ASTC_12x10_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : extension.COMPRESSED_RGBA_ASTC_12x10_KHR;
|
|
25570
|
+
if ( p === RGBA_ASTC_12x12_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : extension.COMPRESSED_RGBA_ASTC_12x12_KHR;
|
|
25442
25571
|
|
|
25443
25572
|
} else {
|
|
25444
25573
|
|
|
@@ -25450,13 +25579,15 @@
|
|
|
25450
25579
|
|
|
25451
25580
|
// BPTC
|
|
25452
25581
|
|
|
25453
|
-
if ( p === RGBA_BPTC_Format ) {
|
|
25582
|
+
if ( p === RGBA_BPTC_Format || p === RGB_BPTC_SIGNED_Format || p === RGB_BPTC_UNSIGNED_Format ) {
|
|
25454
25583
|
|
|
25455
25584
|
extension = extensions.get( 'EXT_texture_compression_bptc' );
|
|
25456
25585
|
|
|
25457
25586
|
if ( extension !== null ) {
|
|
25458
25587
|
|
|
25459
|
-
if ( p === RGBA_BPTC_Format ) return (
|
|
25588
|
+
if ( p === RGBA_BPTC_Format ) return ( transferFunction === SRGBTransferFunction ) ? extension.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : extension.COMPRESSED_RGBA_BPTC_UNORM_EXT;
|
|
25589
|
+
if ( p === RGB_BPTC_SIGNED_Format ) return extension.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;
|
|
25590
|
+
if ( p === RGB_BPTC_UNSIGNED_Format ) return extension.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT;
|
|
25460
25591
|
|
|
25461
25592
|
} else {
|
|
25462
25593
|
|
|
@@ -26498,14 +26629,6 @@
|
|
|
26498
26629
|
camera.matrix.decompose( camera.position, camera.quaternion, camera.scale );
|
|
26499
26630
|
camera.updateMatrixWorld( true );
|
|
26500
26631
|
|
|
26501
|
-
const children = camera.children;
|
|
26502
|
-
|
|
26503
|
-
for ( let i = 0, l = children.length; i < l; i ++ ) {
|
|
26504
|
-
|
|
26505
|
-
children[ i ].updateMatrixWorld( true );
|
|
26506
|
-
|
|
26507
|
-
}
|
|
26508
|
-
|
|
26509
26632
|
camera.projectionMatrix.copy( cameraXR.projectionMatrix );
|
|
26510
26633
|
camera.projectionMatrixInverse.copy( cameraXR.projectionMatrixInverse );
|
|
26511
26634
|
|
|
@@ -26921,7 +27044,7 @@
|
|
|
26921
27044
|
uniforms.lightMap.value = material.lightMap;
|
|
26922
27045
|
|
|
26923
27046
|
// artist-friendly light intensity scaling factor
|
|
26924
|
-
const scaleFactor = ( renderer.
|
|
27047
|
+
const scaleFactor = ( renderer._useLegacyLights === true ) ? Math.PI : 1;
|
|
26925
27048
|
|
|
26926
27049
|
uniforms.lightMapIntensity.value = material.lightMapIntensity * scaleFactor;
|
|
26927
27050
|
|
|
@@ -27668,14 +27791,6 @@
|
|
|
27668
27791
|
|
|
27669
27792
|
}
|
|
27670
27793
|
|
|
27671
|
-
function createCanvasElement() {
|
|
27672
|
-
|
|
27673
|
-
const canvas = createElementNS( 'canvas' );
|
|
27674
|
-
canvas.style.display = 'block';
|
|
27675
|
-
return canvas;
|
|
27676
|
-
|
|
27677
|
-
}
|
|
27678
|
-
|
|
27679
27794
|
class WebGLRenderer {
|
|
27680
27795
|
|
|
27681
27796
|
constructor( parameters = {} ) {
|
|
@@ -27760,7 +27875,7 @@
|
|
|
27760
27875
|
|
|
27761
27876
|
// physical lights
|
|
27762
27877
|
|
|
27763
|
-
this.
|
|
27878
|
+
this._useLegacyLights = false;
|
|
27764
27879
|
|
|
27765
27880
|
// tone mapping
|
|
27766
27881
|
|
|
@@ -28403,6 +28518,9 @@
|
|
|
28403
28518
|
if ( material.wireframe === true ) {
|
|
28404
28519
|
|
|
28405
28520
|
index = geometries.getWireframeAttribute( geometry );
|
|
28521
|
+
|
|
28522
|
+
if ( index === undefined ) return;
|
|
28523
|
+
|
|
28406
28524
|
rangeFactor = 2;
|
|
28407
28525
|
|
|
28408
28526
|
}
|
|
@@ -28567,7 +28685,7 @@
|
|
|
28567
28685
|
|
|
28568
28686
|
} );
|
|
28569
28687
|
|
|
28570
|
-
currentRenderState.setupLights( _this.
|
|
28688
|
+
currentRenderState.setupLights( _this._useLegacyLights );
|
|
28571
28689
|
|
|
28572
28690
|
scene.traverse( function ( object ) {
|
|
28573
28691
|
|
|
@@ -28720,7 +28838,7 @@
|
|
|
28720
28838
|
|
|
28721
28839
|
// render scene
|
|
28722
28840
|
|
|
28723
|
-
currentRenderState.setupLights( _this.
|
|
28841
|
+
currentRenderState.setupLights( _this._useLegacyLights );
|
|
28724
28842
|
|
|
28725
28843
|
if ( camera.isArrayCamera ) {
|
|
28726
28844
|
|
|
@@ -29209,6 +29327,7 @@
|
|
|
29209
29327
|
|
|
29210
29328
|
materialProperties.outputColorSpace = parameters.outputColorSpace;
|
|
29211
29329
|
materialProperties.instancing = parameters.instancing;
|
|
29330
|
+
materialProperties.instancingColor = parameters.instancingColor;
|
|
29212
29331
|
materialProperties.skinning = parameters.skinning;
|
|
29213
29332
|
materialProperties.morphTargets = parameters.morphTargets;
|
|
29214
29333
|
materialProperties.morphNormals = parameters.morphNormals;
|
|
@@ -29237,7 +29356,18 @@
|
|
|
29237
29356
|
const morphTargets = !! geometry.morphAttributes.position;
|
|
29238
29357
|
const morphNormals = !! geometry.morphAttributes.normal;
|
|
29239
29358
|
const morphColors = !! geometry.morphAttributes.color;
|
|
29240
|
-
|
|
29359
|
+
|
|
29360
|
+
let toneMapping = NoToneMapping;
|
|
29361
|
+
|
|
29362
|
+
if ( material.toneMapped ) {
|
|
29363
|
+
|
|
29364
|
+
if ( _currentRenderTarget === null || _currentRenderTarget.isXRRenderTarget === true ) {
|
|
29365
|
+
|
|
29366
|
+
toneMapping = _this.toneMapping;
|
|
29367
|
+
|
|
29368
|
+
}
|
|
29369
|
+
|
|
29370
|
+
}
|
|
29241
29371
|
|
|
29242
29372
|
const morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color;
|
|
29243
29373
|
const morphTargetsCount = ( morphAttribute !== undefined ) ? morphAttribute.length : 0;
|
|
@@ -29292,6 +29422,14 @@
|
|
|
29292
29422
|
|
|
29293
29423
|
needsProgramChange = true;
|
|
29294
29424
|
|
|
29425
|
+
} else if ( object.isInstancedMesh && materialProperties.instancingColor === true && object.instanceColor === null ) {
|
|
29426
|
+
|
|
29427
|
+
needsProgramChange = true;
|
|
29428
|
+
|
|
29429
|
+
} else if ( object.isInstancedMesh && materialProperties.instancingColor === false && object.instanceColor !== null ) {
|
|
29430
|
+
|
|
29431
|
+
needsProgramChange = true;
|
|
29432
|
+
|
|
29295
29433
|
} else if ( materialProperties.envMap !== envMap ) {
|
|
29296
29434
|
|
|
29297
29435
|
needsProgramChange = true;
|
|
@@ -29378,48 +29516,28 @@
|
|
|
29378
29516
|
|
|
29379
29517
|
if ( refreshProgram || _currentCamera !== camera ) {
|
|
29380
29518
|
|
|
29381
|
-
|
|
29382
|
-
|
|
29383
|
-
if ( capabilities.logarithmicDepthBuffer ) {
|
|
29384
|
-
|
|
29385
|
-
p_uniforms.setValue( _gl, 'logDepthBufFC',
|
|
29386
|
-
2.0 / ( Math.log( camera.far + 1.0 ) / Math.LN2 ) );
|
|
29387
|
-
|
|
29388
|
-
}
|
|
29519
|
+
// common camera uniforms
|
|
29389
29520
|
|
|
29390
|
-
|
|
29521
|
+
p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix );
|
|
29522
|
+
p_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse );
|
|
29391
29523
|
|
|
29392
|
-
|
|
29524
|
+
const uCamPos = p_uniforms.map.cameraPosition;
|
|
29393
29525
|
|
|
29394
|
-
|
|
29395
|
-
// now, in case this material supports lights - or later, when
|
|
29396
|
-
// the next material that does gets activated:
|
|
29526
|
+
if ( uCamPos !== undefined ) {
|
|
29397
29527
|
|
|
29398
|
-
|
|
29399
|
-
refreshLights = true; // remains set until update done
|
|
29528
|
+
uCamPos.setValue( _gl, _vector3.setFromMatrixPosition( camera.matrixWorld ) );
|
|
29400
29529
|
|
|
29401
29530
|
}
|
|
29402
29531
|
|
|
29403
|
-
|
|
29404
|
-
// (shader material also gets them for the sake of genericity)
|
|
29405
|
-
|
|
29406
|
-
if ( material.isShaderMaterial ||
|
|
29407
|
-
material.isMeshPhongMaterial ||
|
|
29408
|
-
material.isMeshToonMaterial ||
|
|
29409
|
-
material.isMeshStandardMaterial ||
|
|
29410
|
-
material.envMap ) {
|
|
29411
|
-
|
|
29412
|
-
const uCamPos = p_uniforms.map.cameraPosition;
|
|
29413
|
-
|
|
29414
|
-
if ( uCamPos !== undefined ) {
|
|
29415
|
-
|
|
29416
|
-
uCamPos.setValue( _gl,
|
|
29417
|
-
_vector3.setFromMatrixPosition( camera.matrixWorld ) );
|
|
29532
|
+
if ( capabilities.logarithmicDepthBuffer ) {
|
|
29418
29533
|
|
|
29419
|
-
|
|
29534
|
+
p_uniforms.setValue( _gl, 'logDepthBufFC',
|
|
29535
|
+
2.0 / ( Math.log( camera.far + 1.0 ) / Math.LN2 ) );
|
|
29420
29536
|
|
|
29421
29537
|
}
|
|
29422
29538
|
|
|
29539
|
+
// consider moving isOrthographic to UniformLib and WebGLMaterials, see https://github.com/mrdoob/three.js/pull/26467#issuecomment-1645185067
|
|
29540
|
+
|
|
29423
29541
|
if ( material.isMeshPhongMaterial ||
|
|
29424
29542
|
material.isMeshToonMaterial ||
|
|
29425
29543
|
material.isMeshLambertMaterial ||
|
|
@@ -29431,16 +29549,16 @@
|
|
|
29431
29549
|
|
|
29432
29550
|
}
|
|
29433
29551
|
|
|
29434
|
-
if (
|
|
29435
|
-
material.isMeshToonMaterial ||
|
|
29436
|
-
material.isMeshLambertMaterial ||
|
|
29437
|
-
material.isMeshBasicMaterial ||
|
|
29438
|
-
material.isMeshStandardMaterial ||
|
|
29439
|
-
material.isShaderMaterial ||
|
|
29440
|
-
material.isShadowMaterial ||
|
|
29441
|
-
object.isSkinnedMesh ) {
|
|
29552
|
+
if ( _currentCamera !== camera ) {
|
|
29442
29553
|
|
|
29443
|
-
|
|
29554
|
+
_currentCamera = camera;
|
|
29555
|
+
|
|
29556
|
+
// lighting uniforms depend on the camera so enforce an update
|
|
29557
|
+
// now, in case this material supports lights - or later, when
|
|
29558
|
+
// the next material that does gets activated:
|
|
29559
|
+
|
|
29560
|
+
refreshMaterial = true; // set to true on material change
|
|
29561
|
+
refreshLights = true; // remains set until update done
|
|
29444
29562
|
|
|
29445
29563
|
}
|
|
29446
29564
|
|
|
@@ -29707,7 +29825,16 @@
|
|
|
29707
29825
|
|
|
29708
29826
|
if ( renderTarget.isWebGLCubeRenderTarget ) {
|
|
29709
29827
|
|
|
29710
|
-
|
|
29828
|
+
if ( Array.isArray( __webglFramebuffer[ activeCubeFace ] ) ) {
|
|
29829
|
+
|
|
29830
|
+
framebuffer = __webglFramebuffer[ activeCubeFace ][ activeMipmapLevel ];
|
|
29831
|
+
|
|
29832
|
+
} else {
|
|
29833
|
+
|
|
29834
|
+
framebuffer = __webglFramebuffer[ activeCubeFace ];
|
|
29835
|
+
|
|
29836
|
+
}
|
|
29837
|
+
|
|
29711
29838
|
isCube = true;
|
|
29712
29839
|
|
|
29713
29840
|
} else if ( ( capabilities.isWebGL2 && renderTarget.samples > 0 ) && textures.useMultisampledRTT( renderTarget ) === false ) {
|
|
@@ -29716,7 +29843,15 @@
|
|
|
29716
29843
|
|
|
29717
29844
|
} else {
|
|
29718
29845
|
|
|
29719
|
-
|
|
29846
|
+
if ( Array.isArray( __webglFramebuffer ) ) {
|
|
29847
|
+
|
|
29848
|
+
framebuffer = __webglFramebuffer[ activeMipmapLevel ];
|
|
29849
|
+
|
|
29850
|
+
} else {
|
|
29851
|
+
|
|
29852
|
+
framebuffer = __webglFramebuffer;
|
|
29853
|
+
|
|
29854
|
+
}
|
|
29720
29855
|
|
|
29721
29856
|
}
|
|
29722
29857
|
|
|
@@ -30015,14 +30150,14 @@
|
|
|
30015
30150
|
|
|
30016
30151
|
get physicallyCorrectLights() { // @deprecated, r150
|
|
30017
30152
|
|
|
30018
|
-
console.warn( 'THREE.WebGLRenderer:
|
|
30153
|
+
console.warn( 'THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead.' );
|
|
30019
30154
|
return ! this.useLegacyLights;
|
|
30020
30155
|
|
|
30021
30156
|
}
|
|
30022
30157
|
|
|
30023
30158
|
set physicallyCorrectLights( value ) { // @deprecated, r150
|
|
30024
30159
|
|
|
30025
|
-
console.warn( 'THREE.WebGLRenderer:
|
|
30160
|
+
console.warn( 'THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead.' );
|
|
30026
30161
|
this.useLegacyLights = ! value;
|
|
30027
30162
|
|
|
30028
30163
|
}
|
|
@@ -30041,6 +30176,20 @@
|
|
|
30041
30176
|
|
|
30042
30177
|
}
|
|
30043
30178
|
|
|
30179
|
+
get useLegacyLights() { // @deprecated, r155
|
|
30180
|
+
|
|
30181
|
+
console.warn( 'THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733.' );
|
|
30182
|
+
return this._useLegacyLights;
|
|
30183
|
+
|
|
30184
|
+
}
|
|
30185
|
+
|
|
30186
|
+
set useLegacyLights( value ) { // @deprecated, r155
|
|
30187
|
+
|
|
30188
|
+
console.warn( 'THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733.' );
|
|
30189
|
+
this._useLegacyLights = value;
|
|
30190
|
+
|
|
30191
|
+
}
|
|
30192
|
+
|
|
30044
30193
|
}
|
|
30045
30194
|
|
|
30046
30195
|
class WebGL1Renderer extends WebGLRenderer {}
|
|
@@ -30681,7 +30830,7 @@
|
|
|
30681
30830
|
|
|
30682
30831
|
super.copy( source, recursive );
|
|
30683
30832
|
|
|
30684
|
-
this.material = source.material;
|
|
30833
|
+
this.material = Array.isArray( source.material ) ? source.material.slice() : source.material;
|
|
30685
30834
|
this.geometry = source.geometry;
|
|
30686
30835
|
|
|
30687
30836
|
return this;
|
|
@@ -43503,14 +43652,21 @@
|
|
|
43503
43652
|
}
|
|
43504
43653
|
|
|
43505
43654
|
|
|
43506
|
-
|
|
43507
|
-
|
|
43655
|
+
/**
|
|
43656
|
+
* Modifies the supplied geometry if it is non-indexed, otherwise creates a new,
|
|
43657
|
+
* non-indexed geometry. Returns the geometry with smooth normals everywhere except
|
|
43658
|
+
* faces that meet at an angle greater than the crease angle.
|
|
43659
|
+
*
|
|
43660
|
+
* @param {BufferGeometry} geometry
|
|
43661
|
+
* @param {number} [creaseAngle]
|
|
43662
|
+
* @return {BufferGeometry}
|
|
43663
|
+
*/
|
|
43508
43664
|
function toCreasedNormals( geometry, creaseAngle = Math.PI / 3 /* 60 degrees */ ) {
|
|
43509
43665
|
|
|
43510
43666
|
const creaseDot = Math.cos( creaseAngle );
|
|
43511
43667
|
const hashMultiplier = ( 1 + 1e-10 ) * 1e2;
|
|
43512
43668
|
|
|
43513
|
-
// reusable
|
|
43669
|
+
// reusable vectors
|
|
43514
43670
|
const verts = [ new Vector3(), new Vector3(), new Vector3() ];
|
|
43515
43671
|
const tempVec1 = new Vector3();
|
|
43516
43672
|
const tempVec2 = new Vector3();
|
|
@@ -43527,7 +43683,9 @@
|
|
|
43527
43683
|
|
|
43528
43684
|
}
|
|
43529
43685
|
|
|
43530
|
-
|
|
43686
|
+
// BufferGeometry.toNonIndexed() warns if the geometry is non-indexed
|
|
43687
|
+
// and returns the original geometry
|
|
43688
|
+
const resultGeometry = geometry.index ? geometry.toNonIndexed() : geometry;
|
|
43531
43689
|
const posAttr = resultGeometry.attributes.position;
|
|
43532
43690
|
const vertexMap = {};
|
|
43533
43691
|
|
|
@@ -65722,8 +65880,7 @@
|
|
|
65722
65880
|
// create globe
|
|
65723
65881
|
var globeGeometry = new THREE$e.SphereGeometry(GLOBE_RADIUS, 75, 75);
|
|
65724
65882
|
var defaultGlobeMaterial = new THREE$e.MeshPhongMaterial({
|
|
65725
|
-
color: 0x000000
|
|
65726
|
-
transparent: true
|
|
65883
|
+
color: 0x000000
|
|
65727
65884
|
});
|
|
65728
65885
|
var globeObj = new THREE$e.Mesh(globeGeometry, defaultGlobeMaterial);
|
|
65729
65886
|
globeObj.rotation.y = -Math.PI / 2; // face prime meridian along Z axis
|
|
@@ -66953,12 +67110,20 @@
|
|
|
66953
67110
|
margin: margin,
|
|
66954
67111
|
curvatureResolution: curvatureResolution
|
|
66955
67112
|
};
|
|
67113
|
+
var memD = {
|
|
67114
|
+
geoJson: geoJson,
|
|
67115
|
+
h3Res: h3Res
|
|
67116
|
+
};
|
|
66956
67117
|
var currentTargetD = obj.__currentTargetD || Object.assign({}, targetD, {
|
|
66957
67118
|
alt: -1e-3
|
|
66958
67119
|
});
|
|
67120
|
+
var currentMemD = obj.__currentMemD || memD;
|
|
66959
67121
|
if (Object.keys(targetD).some(function (k) {
|
|
66960
67122
|
return currentTargetD[k] !== targetD[k];
|
|
67123
|
+
}) || Object.keys(memD).some(function (k) {
|
|
67124
|
+
return currentMemD[k] !== memD[k];
|
|
66961
67125
|
})) {
|
|
67126
|
+
obj.__currentMemD = memD;
|
|
66962
67127
|
var h3Idxs = [];
|
|
66963
67128
|
if (geoJson.type === 'Polygon') {
|
|
66964
67129
|
polygonToCells(geoJson.coordinates, h3Res, true).forEach(function (idx) {
|
|
@@ -69357,6 +69522,9 @@
|
|
|
69357
69522
|
const _changeEvent$1 = { type: 'change' };
|
|
69358
69523
|
const _startEvent = { type: 'start' };
|
|
69359
69524
|
const _endEvent = { type: 'end' };
|
|
69525
|
+
const _ray = new Ray();
|
|
69526
|
+
const _plane = new Plane();
|
|
69527
|
+
const TILT_LIMIT = Math.cos( 70 * MathUtils.DEG2RAD );
|
|
69360
69528
|
|
|
69361
69529
|
class OrbitControls extends EventDispatcher {
|
|
69362
69530
|
|
|
@@ -69411,6 +69579,7 @@
|
|
|
69411
69579
|
this.panSpeed = 1.0;
|
|
69412
69580
|
this.screenSpacePanning = true; // if false, pan orthogonal to world-space direction camera.up
|
|
69413
69581
|
this.keyPanSpeed = 7.0; // pixels moved per arrow key push
|
|
69582
|
+
this.zoomToCursor = false;
|
|
69414
69583
|
|
|
69415
69584
|
// Set to true to automatically rotate around the target
|
|
69416
69585
|
// If auto-rotate is enabled, you must call controls.update() in your animation loop
|
|
@@ -69508,7 +69677,7 @@
|
|
|
69508
69677
|
|
|
69509
69678
|
const twoPI = 2 * Math.PI;
|
|
69510
69679
|
|
|
69511
|
-
return function update() {
|
|
69680
|
+
return function update( deltaTime = null ) {
|
|
69512
69681
|
|
|
69513
69682
|
const position = scope.object.position;
|
|
69514
69683
|
|
|
@@ -69522,7 +69691,7 @@
|
|
|
69522
69691
|
|
|
69523
69692
|
if ( scope.autoRotate && state === STATE.NONE ) {
|
|
69524
69693
|
|
|
69525
|
-
rotateLeft( getAutoRotationAngle() );
|
|
69694
|
+
rotateLeft( getAutoRotationAngle( deltaTime ) );
|
|
69526
69695
|
|
|
69527
69696
|
}
|
|
69528
69697
|
|
|
@@ -69569,11 +69738,6 @@
|
|
|
69569
69738
|
spherical.makeSafe();
|
|
69570
69739
|
|
|
69571
69740
|
|
|
69572
|
-
spherical.radius *= scale;
|
|
69573
|
-
|
|
69574
|
-
// restrict radius to be between desired limits
|
|
69575
|
-
spherical.radius = Math.max( scope.minDistance, Math.min( scope.maxDistance, spherical.radius ) );
|
|
69576
|
-
|
|
69577
69741
|
// move target to panned location
|
|
69578
69742
|
|
|
69579
69743
|
if ( scope.enableDamping === true ) {
|
|
@@ -69586,6 +69750,19 @@
|
|
|
69586
69750
|
|
|
69587
69751
|
}
|
|
69588
69752
|
|
|
69753
|
+
// adjust the camera position based on zoom only if we're not zooming to the cursor or if it's an ortho camera
|
|
69754
|
+
// we adjust zoom later in these cases
|
|
69755
|
+
if ( scope.zoomToCursor && performCursorZoom || scope.object.isOrthographicCamera ) {
|
|
69756
|
+
|
|
69757
|
+
spherical.radius = clampDistance( spherical.radius );
|
|
69758
|
+
|
|
69759
|
+
} else {
|
|
69760
|
+
|
|
69761
|
+
spherical.radius = clampDistance( spherical.radius * scale );
|
|
69762
|
+
|
|
69763
|
+
}
|
|
69764
|
+
|
|
69765
|
+
|
|
69589
69766
|
offset.setFromSpherical( spherical );
|
|
69590
69767
|
|
|
69591
69768
|
// rotate offset back to "camera-up-vector-is-up" space
|
|
@@ -69610,7 +69787,91 @@
|
|
|
69610
69787
|
|
|
69611
69788
|
}
|
|
69612
69789
|
|
|
69790
|
+
// adjust camera position
|
|
69791
|
+
let zoomChanged = false;
|
|
69792
|
+
if ( scope.zoomToCursor && performCursorZoom ) {
|
|
69793
|
+
|
|
69794
|
+
let newRadius = null;
|
|
69795
|
+
if ( scope.object.isPerspectiveCamera ) {
|
|
69796
|
+
|
|
69797
|
+
// move the camera down the pointer ray
|
|
69798
|
+
// this method avoids floating point error
|
|
69799
|
+
const prevRadius = offset.length();
|
|
69800
|
+
newRadius = clampDistance( prevRadius * scale );
|
|
69801
|
+
|
|
69802
|
+
const radiusDelta = prevRadius - newRadius;
|
|
69803
|
+
scope.object.position.addScaledVector( dollyDirection, radiusDelta );
|
|
69804
|
+
scope.object.updateMatrixWorld();
|
|
69805
|
+
|
|
69806
|
+
} else if ( scope.object.isOrthographicCamera ) {
|
|
69807
|
+
|
|
69808
|
+
// adjust the ortho camera position based on zoom changes
|
|
69809
|
+
const mouseBefore = new Vector3( mouse.x, mouse.y, 0 );
|
|
69810
|
+
mouseBefore.unproject( scope.object );
|
|
69811
|
+
|
|
69812
|
+
scope.object.zoom = Math.max( scope.minZoom, Math.min( scope.maxZoom, scope.object.zoom / scale ) );
|
|
69813
|
+
scope.object.updateProjectionMatrix();
|
|
69814
|
+
zoomChanged = true;
|
|
69815
|
+
|
|
69816
|
+
const mouseAfter = new Vector3( mouse.x, mouse.y, 0 );
|
|
69817
|
+
mouseAfter.unproject( scope.object );
|
|
69818
|
+
|
|
69819
|
+
scope.object.position.sub( mouseAfter ).add( mouseBefore );
|
|
69820
|
+
scope.object.updateMatrixWorld();
|
|
69821
|
+
|
|
69822
|
+
newRadius = offset.length();
|
|
69823
|
+
|
|
69824
|
+
} else {
|
|
69825
|
+
|
|
69826
|
+
console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled.' );
|
|
69827
|
+
scope.zoomToCursor = false;
|
|
69828
|
+
|
|
69829
|
+
}
|
|
69830
|
+
|
|
69831
|
+
// handle the placement of the target
|
|
69832
|
+
if ( newRadius !== null ) {
|
|
69833
|
+
|
|
69834
|
+
if ( this.screenSpacePanning ) {
|
|
69835
|
+
|
|
69836
|
+
// position the orbit target in front of the new camera position
|
|
69837
|
+
scope.target.set( 0, 0, - 1 )
|
|
69838
|
+
.transformDirection( scope.object.matrix )
|
|
69839
|
+
.multiplyScalar( newRadius )
|
|
69840
|
+
.add( scope.object.position );
|
|
69841
|
+
|
|
69842
|
+
} else {
|
|
69843
|
+
|
|
69844
|
+
// get the ray and translation plane to compute target
|
|
69845
|
+
_ray.origin.copy( scope.object.position );
|
|
69846
|
+
_ray.direction.set( 0, 0, - 1 ).transformDirection( scope.object.matrix );
|
|
69847
|
+
|
|
69848
|
+
// if the camera is 20 degrees above the horizon then don't adjust the focus target to avoid
|
|
69849
|
+
// extremely large values
|
|
69850
|
+
if ( Math.abs( scope.object.up.dot( _ray.direction ) ) < TILT_LIMIT ) {
|
|
69851
|
+
|
|
69852
|
+
object.lookAt( scope.target );
|
|
69853
|
+
|
|
69854
|
+
} else {
|
|
69855
|
+
|
|
69856
|
+
_plane.setFromNormalAndCoplanarPoint( scope.object.up, scope.target );
|
|
69857
|
+
_ray.intersectPlane( _plane, scope.target );
|
|
69858
|
+
|
|
69859
|
+
}
|
|
69860
|
+
|
|
69861
|
+
}
|
|
69862
|
+
|
|
69863
|
+
}
|
|
69864
|
+
|
|
69865
|
+
} else if ( scope.object.isOrthographicCamera ) {
|
|
69866
|
+
|
|
69867
|
+
scope.object.zoom = Math.max( scope.minZoom, Math.min( scope.maxZoom, scope.object.zoom / scale ) );
|
|
69868
|
+
scope.object.updateProjectionMatrix();
|
|
69869
|
+
zoomChanged = true;
|
|
69870
|
+
|
|
69871
|
+
}
|
|
69872
|
+
|
|
69613
69873
|
scale = 1;
|
|
69874
|
+
performCursorZoom = false;
|
|
69614
69875
|
|
|
69615
69876
|
// update condition is:
|
|
69616
69877
|
// min(camera displacement, camera rotation in radians)^2 > EPS
|
|
@@ -69689,7 +69950,6 @@
|
|
|
69689
69950
|
|
|
69690
69951
|
let scale = 1;
|
|
69691
69952
|
const panOffset = new Vector3();
|
|
69692
|
-
let zoomChanged = false;
|
|
69693
69953
|
|
|
69694
69954
|
const rotateStart = new Vector2();
|
|
69695
69955
|
const rotateEnd = new Vector2();
|
|
@@ -69703,12 +69963,24 @@
|
|
|
69703
69963
|
const dollyEnd = new Vector2();
|
|
69704
69964
|
const dollyDelta = new Vector2();
|
|
69705
69965
|
|
|
69966
|
+
const dollyDirection = new Vector3();
|
|
69967
|
+
const mouse = new Vector2();
|
|
69968
|
+
let performCursorZoom = false;
|
|
69969
|
+
|
|
69706
69970
|
const pointers = [];
|
|
69707
69971
|
const pointerPositions = {};
|
|
69708
69972
|
|
|
69709
|
-
function getAutoRotationAngle() {
|
|
69973
|
+
function getAutoRotationAngle( deltaTime ) {
|
|
69974
|
+
|
|
69975
|
+
if ( deltaTime !== null ) {
|
|
69976
|
+
|
|
69977
|
+
return ( 2 * Math.PI / 60 * scope.autoRotateSpeed ) * deltaTime;
|
|
69978
|
+
|
|
69979
|
+
} else {
|
|
69710
69980
|
|
|
69711
|
-
|
|
69981
|
+
return 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed;
|
|
69982
|
+
|
|
69983
|
+
}
|
|
69712
69984
|
|
|
69713
69985
|
}
|
|
69714
69986
|
|
|
@@ -69813,16 +70085,10 @@
|
|
|
69813
70085
|
|
|
69814
70086
|
function dollyOut( dollyScale ) {
|
|
69815
70087
|
|
|
69816
|
-
if ( scope.object.isPerspectiveCamera ) {
|
|
70088
|
+
if ( scope.object.isPerspectiveCamera || scope.object.isOrthographicCamera ) {
|
|
69817
70089
|
|
|
69818
70090
|
scale /= dollyScale;
|
|
69819
70091
|
|
|
69820
|
-
} else if ( scope.object.isOrthographicCamera ) {
|
|
69821
|
-
|
|
69822
|
-
scope.object.zoom = Math.max( scope.minZoom, Math.min( scope.maxZoom, scope.object.zoom * dollyScale ) );
|
|
69823
|
-
scope.object.updateProjectionMatrix();
|
|
69824
|
-
zoomChanged = true;
|
|
69825
|
-
|
|
69826
70092
|
} else {
|
|
69827
70093
|
|
|
69828
70094
|
console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );
|
|
@@ -69834,16 +70100,10 @@
|
|
|
69834
70100
|
|
|
69835
70101
|
function dollyIn( dollyScale ) {
|
|
69836
70102
|
|
|
69837
|
-
if ( scope.object.isPerspectiveCamera ) {
|
|
70103
|
+
if ( scope.object.isPerspectiveCamera || scope.object.isOrthographicCamera ) {
|
|
69838
70104
|
|
|
69839
70105
|
scale *= dollyScale;
|
|
69840
70106
|
|
|
69841
|
-
} else if ( scope.object.isOrthographicCamera ) {
|
|
69842
|
-
|
|
69843
|
-
scope.object.zoom = Math.max( scope.minZoom, Math.min( scope.maxZoom, scope.object.zoom / dollyScale ) );
|
|
69844
|
-
scope.object.updateProjectionMatrix();
|
|
69845
|
-
zoomChanged = true;
|
|
69846
|
-
|
|
69847
70107
|
} else {
|
|
69848
70108
|
|
|
69849
70109
|
console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );
|
|
@@ -69853,6 +70113,35 @@
|
|
|
69853
70113
|
|
|
69854
70114
|
}
|
|
69855
70115
|
|
|
70116
|
+
function updateMouseParameters( event ) {
|
|
70117
|
+
|
|
70118
|
+
if ( ! scope.zoomToCursor ) {
|
|
70119
|
+
|
|
70120
|
+
return;
|
|
70121
|
+
|
|
70122
|
+
}
|
|
70123
|
+
|
|
70124
|
+
performCursorZoom = true;
|
|
70125
|
+
|
|
70126
|
+
const rect = scope.domElement.getBoundingClientRect();
|
|
70127
|
+
const x = event.clientX - rect.left;
|
|
70128
|
+
const y = event.clientY - rect.top;
|
|
70129
|
+
const w = rect.width;
|
|
70130
|
+
const h = rect.height;
|
|
70131
|
+
|
|
70132
|
+
mouse.x = ( x / w ) * 2 - 1;
|
|
70133
|
+
mouse.y = - ( y / h ) * 2 + 1;
|
|
70134
|
+
|
|
70135
|
+
dollyDirection.set( mouse.x, mouse.y, 1 ).unproject( scope.object ).sub( scope.object.position ).normalize();
|
|
70136
|
+
|
|
70137
|
+
}
|
|
70138
|
+
|
|
70139
|
+
function clampDistance( dist ) {
|
|
70140
|
+
|
|
70141
|
+
return Math.max( scope.minDistance, Math.min( scope.maxDistance, dist ) );
|
|
70142
|
+
|
|
70143
|
+
}
|
|
70144
|
+
|
|
69856
70145
|
//
|
|
69857
70146
|
// event callbacks - update the object state
|
|
69858
70147
|
//
|
|
@@ -69865,6 +70154,7 @@
|
|
|
69865
70154
|
|
|
69866
70155
|
function handleMouseDownDolly( event ) {
|
|
69867
70156
|
|
|
70157
|
+
updateMouseParameters( event );
|
|
69868
70158
|
dollyStart.set( event.clientX, event.clientY );
|
|
69869
70159
|
|
|
69870
70160
|
}
|
|
@@ -69931,6 +70221,8 @@
|
|
|
69931
70221
|
|
|
69932
70222
|
function handleMouseWheel( event ) {
|
|
69933
70223
|
|
|
70224
|
+
updateMouseParameters( event );
|
|
70225
|
+
|
|
69934
70226
|
if ( event.deltaY < 0 ) {
|
|
69935
70227
|
|
|
69936
70228
|
dollyIn( getZoomScale() );
|
|
@@ -71148,11 +71440,14 @@
|
|
|
71148
71440
|
if ( this.clear ) renderer.clear();
|
|
71149
71441
|
renderer.render( this.scene, this.camera );
|
|
71150
71442
|
|
|
71151
|
-
// unlock color and depth buffer for subsequent rendering
|
|
71443
|
+
// unlock color and depth buffer and make them writable for subsequent rendering/clearing
|
|
71152
71444
|
|
|
71153
71445
|
state.buffers.color.setLocked( false );
|
|
71154
71446
|
state.buffers.depth.setLocked( false );
|
|
71155
71447
|
|
|
71448
|
+
state.buffers.color.setMask( true );
|
|
71449
|
+
state.buffers.depth.setMask( true );
|
|
71450
|
+
|
|
71156
71451
|
// only render where stencil is set to 1
|
|
71157
71452
|
|
|
71158
71453
|
state.buffers.stencil.setLocked( false );
|
|
@@ -71403,7 +71698,7 @@
|
|
|
71403
71698
|
|
|
71404
71699
|
class RenderPass extends Pass {
|
|
71405
71700
|
|
|
71406
|
-
constructor( scene, camera, overrideMaterial, clearColor, clearAlpha ) {
|
|
71701
|
+
constructor( scene, camera, overrideMaterial = null, clearColor = null, clearAlpha = null ) {
|
|
71407
71702
|
|
|
71408
71703
|
super();
|
|
71409
71704
|
|
|
@@ -71413,7 +71708,7 @@
|
|
|
71413
71708
|
this.overrideMaterial = overrideMaterial;
|
|
71414
71709
|
|
|
71415
71710
|
this.clearColor = clearColor;
|
|
71416
|
-
this.clearAlpha =
|
|
71711
|
+
this.clearAlpha = clearAlpha;
|
|
71417
71712
|
|
|
71418
71713
|
this.clear = true;
|
|
71419
71714
|
this.clearDepth = false;
|
|
@@ -71429,7 +71724,7 @@
|
|
|
71429
71724
|
|
|
71430
71725
|
let oldClearAlpha, oldOverrideMaterial;
|
|
71431
71726
|
|
|
71432
|
-
if ( this.overrideMaterial !==
|
|
71727
|
+
if ( this.overrideMaterial !== null ) {
|
|
71433
71728
|
|
|
71434
71729
|
oldOverrideMaterial = this.scene.overrideMaterial;
|
|
71435
71730
|
|
|
@@ -71437,16 +71732,21 @@
|
|
|
71437
71732
|
|
|
71438
71733
|
}
|
|
71439
71734
|
|
|
71440
|
-
if ( this.clearColor ) {
|
|
71735
|
+
if ( this.clearColor !== null ) {
|
|
71441
71736
|
|
|
71442
71737
|
renderer.getClearColor( this._oldClearColor );
|
|
71443
|
-
|
|
71738
|
+
renderer.setClearColor( this.clearColor );
|
|
71739
|
+
|
|
71740
|
+
}
|
|
71444
71741
|
|
|
71445
|
-
|
|
71742
|
+
if ( this.clearAlpha !== null ) {
|
|
71743
|
+
|
|
71744
|
+
oldClearAlpha = renderer.getClearAlpha();
|
|
71745
|
+
renderer.setClearAlpha( this.clearAlpha );
|
|
71446
71746
|
|
|
71447
71747
|
}
|
|
71448
71748
|
|
|
71449
|
-
if ( this.clearDepth ) {
|
|
71749
|
+
if ( this.clearDepth == true ) {
|
|
71450
71750
|
|
|
71451
71751
|
renderer.clearDepth();
|
|
71452
71752
|
|
|
@@ -71454,17 +71754,30 @@
|
|
|
71454
71754
|
|
|
71455
71755
|
renderer.setRenderTarget( this.renderToScreen ? null : readBuffer );
|
|
71456
71756
|
|
|
71457
|
-
|
|
71458
|
-
|
|
71757
|
+
if ( this.clear === true ) {
|
|
71758
|
+
|
|
71759
|
+
// TODO: Avoid using autoClear properties, see https://github.com/mrdoob/three.js/pull/15571#issuecomment-465669600
|
|
71760
|
+
renderer.clear( renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil );
|
|
71761
|
+
|
|
71762
|
+
}
|
|
71763
|
+
|
|
71459
71764
|
renderer.render( this.scene, this.camera );
|
|
71460
71765
|
|
|
71461
|
-
|
|
71766
|
+
// restore
|
|
71767
|
+
|
|
71768
|
+
if ( this.clearColor !== null ) {
|
|
71769
|
+
|
|
71770
|
+
renderer.setClearColor( this._oldClearColor );
|
|
71462
71771
|
|
|
71463
|
-
|
|
71772
|
+
}
|
|
71773
|
+
|
|
71774
|
+
if ( this.clearAlpha !== null ) {
|
|
71775
|
+
|
|
71776
|
+
renderer.setClearAlpha( oldClearAlpha );
|
|
71464
71777
|
|
|
71465
71778
|
}
|
|
71466
71779
|
|
|
71467
|
-
if ( this.overrideMaterial !==
|
|
71780
|
+
if ( this.overrideMaterial !== null ) {
|
|
71468
71781
|
|
|
71469
71782
|
this.scene.overrideMaterial = oldOverrideMaterial;
|
|
71470
71783
|
|
|
@@ -72901,26 +73214,26 @@
|
|
|
72901
73214
|
var css_248z = ".scene-container .clickable {\n cursor: pointer;\n}";
|
|
72902
73215
|
styleInject(css_248z);
|
|
72903
73216
|
|
|
72904
|
-
function ownKeys(
|
|
72905
|
-
var
|
|
73217
|
+
function ownKeys(e, r) {
|
|
73218
|
+
var t = Object.keys(e);
|
|
72906
73219
|
if (Object.getOwnPropertySymbols) {
|
|
72907
|
-
var
|
|
72908
|
-
|
|
72909
|
-
return Object.getOwnPropertyDescriptor(
|
|
72910
|
-
})),
|
|
73220
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
73221
|
+
r && (o = o.filter(function (r) {
|
|
73222
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
73223
|
+
})), t.push.apply(t, o);
|
|
72911
73224
|
}
|
|
72912
|
-
return
|
|
72913
|
-
}
|
|
72914
|
-
function _objectSpread2(
|
|
72915
|
-
for (var
|
|
72916
|
-
var
|
|
72917
|
-
|
|
72918
|
-
_defineProperty(
|
|
72919
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(
|
|
72920
|
-
Object.defineProperty(
|
|
73225
|
+
return t;
|
|
73226
|
+
}
|
|
73227
|
+
function _objectSpread2(e) {
|
|
73228
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
73229
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
73230
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
73231
|
+
_defineProperty(e, r, t[r]);
|
|
73232
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
73233
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
72921
73234
|
});
|
|
72922
73235
|
}
|
|
72923
|
-
return
|
|
73236
|
+
return e;
|
|
72924
73237
|
}
|
|
72925
73238
|
function _defineProperty(obj, key, value) {
|
|
72926
73239
|
key = _toPropertyKey(key);
|
|
@@ -73005,7 +73318,7 @@
|
|
|
73005
73318
|
|
|
73006
73319
|
function linkKapsule (kapsulePropName, kapsuleType) {
|
|
73007
73320
|
var dummyK = new kapsuleType(); // To extract defaults
|
|
73008
|
-
|
|
73321
|
+
dummyK._destructor && dummyK._destructor();
|
|
73009
73322
|
return {
|
|
73010
73323
|
linkProp: function linkProp(prop) {
|
|
73011
73324
|
// link property config
|
|
@@ -73046,10 +73359,10 @@
|
|
|
73046
73359
|
|
|
73047
73360
|
// Expose config from ThreeGlobe
|
|
73048
73361
|
var bindGlobe = linkKapsule('globe', threeGlobe);
|
|
73049
|
-
var linkedGlobeProps = Object.assign.apply(Object, _toConsumableArray(['globeImageUrl', 'bumpImageUrl', 'showGlobe', 'showGraticules', 'showAtmosphere', 'atmosphereColor', 'atmosphereAltitude', '
|
|
73362
|
+
var linkedGlobeProps = Object.assign.apply(Object, _toConsumableArray(['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) {
|
|
73050
73363
|
return _defineProperty({}, p, bindGlobe.linkProp(p));
|
|
73051
73364
|
})));
|
|
73052
|
-
var linkedGlobeMethods = Object.assign.apply(Object, _toConsumableArray(['getGlobeRadius', 'getCoords', 'toGeoCoords'].map(function (p) {
|
|
73365
|
+
var linkedGlobeMethods = Object.assign.apply(Object, _toConsumableArray(['globeMaterial', 'getGlobeRadius', 'getCoords', 'toGeoCoords'].map(function (p) {
|
|
73053
73366
|
return _defineProperty({}, p, bindGlobe.linkMethod(p));
|
|
73054
73367
|
})));
|
|
73055
73368
|
|
|
@@ -73228,7 +73541,7 @@
|
|
|
73228
73541
|
cancelAnimationFrame(state.animationFrameRequestId);
|
|
73229
73542
|
state.animationFrameRequestId = null;
|
|
73230
73543
|
}
|
|
73231
|
-
(_state$globe = state.globe) === null || _state$globe === void 0
|
|
73544
|
+
(_state$globe = state.globe) === null || _state$globe === void 0 || _state$globe.pauseAnimation();
|
|
73232
73545
|
return this;
|
|
73233
73546
|
},
|
|
73234
73547
|
resumeAnimation: function resumeAnimation(state) {
|
|
@@ -73236,7 +73549,7 @@
|
|
|
73236
73549
|
if (state.animationFrameRequestId === null) {
|
|
73237
73550
|
this._animationCycle();
|
|
73238
73551
|
}
|
|
73239
|
-
(_state$globe2 = state.globe) === null || _state$globe2 === void 0
|
|
73552
|
+
(_state$globe2 = state.globe) === null || _state$globe2 === void 0 || _state$globe2.resumeAnimation();
|
|
73240
73553
|
return this;
|
|
73241
73554
|
},
|
|
73242
73555
|
_animationCycle: function _animationCycle(state) {
|
|
@@ -73439,9 +73752,10 @@
|
|
|
73439
73752
|
return d;
|
|
73440
73753
|
}
|
|
73441
73754
|
};
|
|
73755
|
+
state.renderObjs.renderer().useLegacyLights = false; // force behavior of three < 155
|
|
73442
73756
|
state.renderObjs.objects([
|
|
73443
73757
|
// Populate scene
|
|
73444
|
-
new THREE.AmbientLight(0xcccccc), new THREE.DirectionalLight(0xffffff, 0.6), state.globe]).hoverOrderComparator(function (a, b) {
|
|
73758
|
+
new THREE.AmbientLight(0xcccccc, Math.PI), new THREE.DirectionalLight(0xffffff, 0.6 * Math.PI), state.globe]).hoverOrderComparator(function (a, b) {
|
|
73445
73759
|
var aObj = getGlobeObj(a);
|
|
73446
73760
|
var bObj = getGlobeObj(b);
|
|
73447
73761
|
|