3d-force-graph 1.70.13 → 1.70.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/3d-force-graph.js +479 -3017
- package/dist/3d-force-graph.js.map +1 -1
- package/dist/3d-force-graph.min.js +3 -3
- package/package.json +6 -6
package/dist/3d-force-graph.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Version 1.70.
|
|
1
|
+
// Version 1.70.14 3d-force-graph - https://github.com/vasturiano/3d-force-graph
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
* Copyright 2010-2022 Three.js Authors
|
|
115
115
|
* SPDX-License-Identifier: MIT
|
|
116
116
|
*/
|
|
117
|
-
const REVISION = '
|
|
117
|
+
const REVISION = '144';
|
|
118
118
|
const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
|
|
119
119
|
const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
|
|
120
120
|
const CullFaceNone = 0;
|
|
@@ -126,7 +126,6 @@
|
|
|
126
126
|
const FrontSide = 0;
|
|
127
127
|
const BackSide = 1;
|
|
128
128
|
const DoubleSide = 2;
|
|
129
|
-
const FlatShading = 1;
|
|
130
129
|
const NoBlending = 0;
|
|
131
130
|
const NormalBlending = 1;
|
|
132
131
|
const AdditiveBlending = 2;
|
|
@@ -194,7 +193,7 @@
|
|
|
194
193
|
const UnsignedShort5551Type = 1018;
|
|
195
194
|
const UnsignedInt248Type = 1020;
|
|
196
195
|
const AlphaFormat = 1021;
|
|
197
|
-
const RGBFormat = 1022;
|
|
196
|
+
const RGBFormat = 1022; // @deprecated since r137
|
|
198
197
|
const RGBAFormat = 1023;
|
|
199
198
|
const LuminanceFormat = 1024;
|
|
200
199
|
const LuminanceAlphaFormat = 1025;
|
|
@@ -389,6 +388,70 @@
|
|
|
389
388
|
|
|
390
389
|
}
|
|
391
390
|
|
|
391
|
+
function denormalize( value, array ) {
|
|
392
|
+
|
|
393
|
+
switch ( array.constructor ) {
|
|
394
|
+
|
|
395
|
+
case Float32Array:
|
|
396
|
+
|
|
397
|
+
return value;
|
|
398
|
+
|
|
399
|
+
case Uint16Array:
|
|
400
|
+
|
|
401
|
+
return value / 65535.0;
|
|
402
|
+
|
|
403
|
+
case Uint8Array:
|
|
404
|
+
|
|
405
|
+
return value / 255.0;
|
|
406
|
+
|
|
407
|
+
case Int16Array:
|
|
408
|
+
|
|
409
|
+
return Math.max( value / 32767.0, - 1.0 );
|
|
410
|
+
|
|
411
|
+
case Int8Array:
|
|
412
|
+
|
|
413
|
+
return Math.max( value / 127.0, - 1.0 );
|
|
414
|
+
|
|
415
|
+
default:
|
|
416
|
+
|
|
417
|
+
throw new Error( 'Invalid component type.' );
|
|
418
|
+
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
function normalize( value, array ) {
|
|
424
|
+
|
|
425
|
+
switch ( array.constructor ) {
|
|
426
|
+
|
|
427
|
+
case Float32Array:
|
|
428
|
+
|
|
429
|
+
return value;
|
|
430
|
+
|
|
431
|
+
case Uint16Array:
|
|
432
|
+
|
|
433
|
+
return Math.round( value * 65535.0 );
|
|
434
|
+
|
|
435
|
+
case Uint8Array:
|
|
436
|
+
|
|
437
|
+
return Math.round( value * 255.0 );
|
|
438
|
+
|
|
439
|
+
case Int16Array:
|
|
440
|
+
|
|
441
|
+
return Math.round( value * 32767.0 );
|
|
442
|
+
|
|
443
|
+
case Int8Array:
|
|
444
|
+
|
|
445
|
+
return Math.round( value * 127.0 );
|
|
446
|
+
|
|
447
|
+
default:
|
|
448
|
+
|
|
449
|
+
throw new Error( 'Invalid component type.' );
|
|
450
|
+
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
}
|
|
454
|
+
|
|
392
455
|
class Vector2 {
|
|
393
456
|
|
|
394
457
|
constructor( x = 0, y = 0 ) {
|
|
@@ -1190,7 +1253,7 @@
|
|
|
1190
1253
|
|
|
1191
1254
|
for ( let i = array.length - 1; i >= 0; -- i ) {
|
|
1192
1255
|
|
|
1193
|
-
if ( array[ i ]
|
|
1256
|
+
if ( array[ i ] >= 65535 ) return true; // account for PRIMITIVE_RESTART_FIXED_INDEX, #24565
|
|
1194
1257
|
|
|
1195
1258
|
}
|
|
1196
1259
|
|
|
@@ -1327,7 +1390,7 @@
|
|
|
1327
1390
|
|
|
1328
1391
|
}
|
|
1329
1392
|
|
|
1330
|
-
class Color
|
|
1393
|
+
class Color {
|
|
1331
1394
|
|
|
1332
1395
|
constructor( r, g, b ) {
|
|
1333
1396
|
|
|
@@ -1497,12 +1560,12 @@
|
|
|
1497
1560
|
case 'hsl':
|
|
1498
1561
|
case 'hsla':
|
|
1499
1562
|
|
|
1500
|
-
if ( color = /^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec( components ) ) {
|
|
1563
|
+
if ( color = /^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec( components ) ) {
|
|
1501
1564
|
|
|
1502
1565
|
// hsl(120,50%,50%) hsla(120,50%,50%,0.5)
|
|
1503
1566
|
const h = parseFloat( color[ 1 ] ) / 360;
|
|
1504
|
-
const s =
|
|
1505
|
-
const l =
|
|
1567
|
+
const s = parseFloat( color[ 2 ] ) / 100;
|
|
1568
|
+
const l = parseFloat( color[ 3 ] ) / 100;
|
|
1506
1569
|
|
|
1507
1570
|
handleAlpha( color[ 4 ] );
|
|
1508
1571
|
|
|
@@ -1855,16 +1918,6 @@
|
|
|
1855
1918
|
this.g = attribute.getY( index );
|
|
1856
1919
|
this.b = attribute.getZ( index );
|
|
1857
1920
|
|
|
1858
|
-
if ( attribute.normalized === true ) {
|
|
1859
|
-
|
|
1860
|
-
// assuming Uint8Array
|
|
1861
|
-
|
|
1862
|
-
this.r /= 255;
|
|
1863
|
-
this.g /= 255;
|
|
1864
|
-
this.b /= 255;
|
|
1865
|
-
|
|
1866
|
-
}
|
|
1867
|
-
|
|
1868
1921
|
return this;
|
|
1869
1922
|
|
|
1870
1923
|
}
|
|
@@ -1885,7 +1938,7 @@
|
|
|
1885
1938
|
|
|
1886
1939
|
}
|
|
1887
1940
|
|
|
1888
|
-
Color
|
|
1941
|
+
Color.NAMES = _colorKeywords;
|
|
1889
1942
|
|
|
1890
1943
|
let _canvas;
|
|
1891
1944
|
|
|
@@ -3421,12 +3474,6 @@
|
|
|
3421
3474
|
|
|
3422
3475
|
setFromEuler( euler, update ) {
|
|
3423
3476
|
|
|
3424
|
-
if ( ! ( euler && euler.isEuler ) ) {
|
|
3425
|
-
|
|
3426
|
-
throw new Error( 'THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.' );
|
|
3427
|
-
|
|
3428
|
-
}
|
|
3429
|
-
|
|
3430
3477
|
const x = euler._x, y = euler._y, z = euler._z, order = euler._order;
|
|
3431
3478
|
|
|
3432
3479
|
// http://www.mathworks.com/matlabcentral/fileexchange/
|
|
@@ -7186,6 +7233,8 @@
|
|
|
7186
7233
|
this.matrixAutoUpdate = Object3D.DefaultMatrixAutoUpdate;
|
|
7187
7234
|
this.matrixWorldNeedsUpdate = false;
|
|
7188
7235
|
|
|
7236
|
+
this.matrixWorldAutoUpdate = Object3D.DefaultMatrixWorldAutoUpdate; // checked by the renderer
|
|
7237
|
+
|
|
7189
7238
|
this.layers = new Layers();
|
|
7190
7239
|
this.visible = true;
|
|
7191
7240
|
|
|
@@ -7670,7 +7719,13 @@
|
|
|
7670
7719
|
|
|
7671
7720
|
for ( let i = 0, l = children.length; i < l; i ++ ) {
|
|
7672
7721
|
|
|
7673
|
-
children[ i ]
|
|
7722
|
+
const child = children[ i ];
|
|
7723
|
+
|
|
7724
|
+
if ( child.matrixWorldAutoUpdate === true || force === true ) {
|
|
7725
|
+
|
|
7726
|
+
child.updateMatrixWorld( force );
|
|
7727
|
+
|
|
7728
|
+
}
|
|
7674
7729
|
|
|
7675
7730
|
}
|
|
7676
7731
|
|
|
@@ -7680,7 +7735,7 @@
|
|
|
7680
7735
|
|
|
7681
7736
|
const parent = this.parent;
|
|
7682
7737
|
|
|
7683
|
-
if ( updateParents === true && parent !== null ) {
|
|
7738
|
+
if ( updateParents === true && parent !== null && parent.matrixWorldAutoUpdate === true ) {
|
|
7684
7739
|
|
|
7685
7740
|
parent.updateWorldMatrix( true, false );
|
|
7686
7741
|
|
|
@@ -7706,7 +7761,13 @@
|
|
|
7706
7761
|
|
|
7707
7762
|
for ( let i = 0, l = children.length; i < l; i ++ ) {
|
|
7708
7763
|
|
|
7709
|
-
children[ i ]
|
|
7764
|
+
const child = children[ i ];
|
|
7765
|
+
|
|
7766
|
+
if ( child.matrixWorldAutoUpdate === true ) {
|
|
7767
|
+
|
|
7768
|
+
child.updateWorldMatrix( false, true );
|
|
7769
|
+
|
|
7770
|
+
}
|
|
7710
7771
|
|
|
7711
7772
|
}
|
|
7712
7773
|
|
|
@@ -7979,6 +8040,8 @@
|
|
|
7979
8040
|
this.matrixAutoUpdate = source.matrixAutoUpdate;
|
|
7980
8041
|
this.matrixWorldNeedsUpdate = source.matrixWorldNeedsUpdate;
|
|
7981
8042
|
|
|
8043
|
+
this.matrixWorldAutoUpdate = source.matrixWorldAutoUpdate;
|
|
8044
|
+
|
|
7982
8045
|
this.layers.mask = source.layers.mask;
|
|
7983
8046
|
this.visible = source.visible;
|
|
7984
8047
|
|
|
@@ -8009,6 +8072,7 @@
|
|
|
8009
8072
|
|
|
8010
8073
|
Object3D.DefaultUp = /*@__PURE__*/ new Vector3( 0, 1, 0 );
|
|
8011
8074
|
Object3D.DefaultMatrixAutoUpdate = true;
|
|
8075
|
+
Object3D.DefaultMatrixWorldAutoUpdate = true;
|
|
8012
8076
|
|
|
8013
8077
|
const _v0$1 = /*@__PURE__*/ new Vector3();
|
|
8014
8078
|
const _v1$3 = /*@__PURE__*/ new Vector3();
|
|
@@ -8426,15 +8490,6 @@
|
|
|
8426
8490
|
|
|
8427
8491
|
}
|
|
8428
8492
|
|
|
8429
|
-
// for backward compatibility if shading is set in the constructor
|
|
8430
|
-
if ( key === 'shading' ) {
|
|
8431
|
-
|
|
8432
|
-
console.warn( 'THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.' );
|
|
8433
|
-
this.flatShading = ( newValue === FlatShading ) ? true : false;
|
|
8434
|
-
continue;
|
|
8435
|
-
|
|
8436
|
-
}
|
|
8437
|
-
|
|
8438
8493
|
const currentValue = this[ key ];
|
|
8439
8494
|
|
|
8440
8495
|
if ( currentValue === undefined ) {
|
|
@@ -8813,7 +8868,7 @@
|
|
|
8813
8868
|
|
|
8814
8869
|
this.type = 'MeshBasicMaterial';
|
|
8815
8870
|
|
|
8816
|
-
this.color = new Color
|
|
8871
|
+
this.color = new Color( 0xffffff ); // emissive
|
|
8817
8872
|
|
|
8818
8873
|
this.map = null;
|
|
8819
8874
|
|
|
@@ -8961,110 +9016,6 @@
|
|
|
8961
9016
|
|
|
8962
9017
|
}
|
|
8963
9018
|
|
|
8964
|
-
copyColorsArray( colors ) {
|
|
8965
|
-
|
|
8966
|
-
const array = this.array;
|
|
8967
|
-
let offset = 0;
|
|
8968
|
-
|
|
8969
|
-
for ( let i = 0, l = colors.length; i < l; i ++ ) {
|
|
8970
|
-
|
|
8971
|
-
let color = colors[ i ];
|
|
8972
|
-
|
|
8973
|
-
if ( color === undefined ) {
|
|
8974
|
-
|
|
8975
|
-
console.warn( 'THREE.BufferAttribute.copyColorsArray(): color is undefined', i );
|
|
8976
|
-
color = new Color$1();
|
|
8977
|
-
|
|
8978
|
-
}
|
|
8979
|
-
|
|
8980
|
-
array[ offset ++ ] = color.r;
|
|
8981
|
-
array[ offset ++ ] = color.g;
|
|
8982
|
-
array[ offset ++ ] = color.b;
|
|
8983
|
-
|
|
8984
|
-
}
|
|
8985
|
-
|
|
8986
|
-
return this;
|
|
8987
|
-
|
|
8988
|
-
}
|
|
8989
|
-
|
|
8990
|
-
copyVector2sArray( vectors ) {
|
|
8991
|
-
|
|
8992
|
-
const array = this.array;
|
|
8993
|
-
let offset = 0;
|
|
8994
|
-
|
|
8995
|
-
for ( let i = 0, l = vectors.length; i < l; i ++ ) {
|
|
8996
|
-
|
|
8997
|
-
let vector = vectors[ i ];
|
|
8998
|
-
|
|
8999
|
-
if ( vector === undefined ) {
|
|
9000
|
-
|
|
9001
|
-
console.warn( 'THREE.BufferAttribute.copyVector2sArray(): vector is undefined', i );
|
|
9002
|
-
vector = new Vector2();
|
|
9003
|
-
|
|
9004
|
-
}
|
|
9005
|
-
|
|
9006
|
-
array[ offset ++ ] = vector.x;
|
|
9007
|
-
array[ offset ++ ] = vector.y;
|
|
9008
|
-
|
|
9009
|
-
}
|
|
9010
|
-
|
|
9011
|
-
return this;
|
|
9012
|
-
|
|
9013
|
-
}
|
|
9014
|
-
|
|
9015
|
-
copyVector3sArray( vectors ) {
|
|
9016
|
-
|
|
9017
|
-
const array = this.array;
|
|
9018
|
-
let offset = 0;
|
|
9019
|
-
|
|
9020
|
-
for ( let i = 0, l = vectors.length; i < l; i ++ ) {
|
|
9021
|
-
|
|
9022
|
-
let vector = vectors[ i ];
|
|
9023
|
-
|
|
9024
|
-
if ( vector === undefined ) {
|
|
9025
|
-
|
|
9026
|
-
console.warn( 'THREE.BufferAttribute.copyVector3sArray(): vector is undefined', i );
|
|
9027
|
-
vector = new Vector3();
|
|
9028
|
-
|
|
9029
|
-
}
|
|
9030
|
-
|
|
9031
|
-
array[ offset ++ ] = vector.x;
|
|
9032
|
-
array[ offset ++ ] = vector.y;
|
|
9033
|
-
array[ offset ++ ] = vector.z;
|
|
9034
|
-
|
|
9035
|
-
}
|
|
9036
|
-
|
|
9037
|
-
return this;
|
|
9038
|
-
|
|
9039
|
-
}
|
|
9040
|
-
|
|
9041
|
-
copyVector4sArray( vectors ) {
|
|
9042
|
-
|
|
9043
|
-
const array = this.array;
|
|
9044
|
-
let offset = 0;
|
|
9045
|
-
|
|
9046
|
-
for ( let i = 0, l = vectors.length; i < l; i ++ ) {
|
|
9047
|
-
|
|
9048
|
-
let vector = vectors[ i ];
|
|
9049
|
-
|
|
9050
|
-
if ( vector === undefined ) {
|
|
9051
|
-
|
|
9052
|
-
console.warn( 'THREE.BufferAttribute.copyVector4sArray(): vector is undefined', i );
|
|
9053
|
-
vector = new Vector4();
|
|
9054
|
-
|
|
9055
|
-
}
|
|
9056
|
-
|
|
9057
|
-
array[ offset ++ ] = vector.x;
|
|
9058
|
-
array[ offset ++ ] = vector.y;
|
|
9059
|
-
array[ offset ++ ] = vector.z;
|
|
9060
|
-
array[ offset ++ ] = vector.w;
|
|
9061
|
-
|
|
9062
|
-
}
|
|
9063
|
-
|
|
9064
|
-
return this;
|
|
9065
|
-
|
|
9066
|
-
}
|
|
9067
|
-
|
|
9068
9019
|
applyMatrix3( m ) {
|
|
9069
9020
|
|
|
9070
9021
|
if ( this.itemSize === 2 ) {
|
|
@@ -9145,6 +9096,7 @@
|
|
|
9145
9096
|
|
|
9146
9097
|
set( value, offset = 0 ) {
|
|
9147
9098
|
|
|
9099
|
+
// Matching BufferAttribute constructor, do not normalize the array.
|
|
9148
9100
|
this.array.set( value, offset );
|
|
9149
9101
|
|
|
9150
9102
|
return this;
|
|
@@ -9153,12 +9105,18 @@
|
|
|
9153
9105
|
|
|
9154
9106
|
getX( index ) {
|
|
9155
9107
|
|
|
9156
|
-
|
|
9108
|
+
let x = this.array[ index * this.itemSize ];
|
|
9109
|
+
|
|
9110
|
+
if ( this.normalized ) x = denormalize( x, this.array );
|
|
9111
|
+
|
|
9112
|
+
return x;
|
|
9157
9113
|
|
|
9158
9114
|
}
|
|
9159
9115
|
|
|
9160
9116
|
setX( index, x ) {
|
|
9161
9117
|
|
|
9118
|
+
if ( this.normalized ) x = normalize( x, this.array );
|
|
9119
|
+
|
|
9162
9120
|
this.array[ index * this.itemSize ] = x;
|
|
9163
9121
|
|
|
9164
9122
|
return this;
|
|
@@ -9167,12 +9125,18 @@
|
|
|
9167
9125
|
|
|
9168
9126
|
getY( index ) {
|
|
9169
9127
|
|
|
9170
|
-
|
|
9128
|
+
let y = this.array[ index * this.itemSize + 1 ];
|
|
9129
|
+
|
|
9130
|
+
if ( this.normalized ) y = denormalize( y, this.array );
|
|
9131
|
+
|
|
9132
|
+
return y;
|
|
9171
9133
|
|
|
9172
9134
|
}
|
|
9173
9135
|
|
|
9174
9136
|
setY( index, y ) {
|
|
9175
9137
|
|
|
9138
|
+
if ( this.normalized ) y = normalize( y, this.array );
|
|
9139
|
+
|
|
9176
9140
|
this.array[ index * this.itemSize + 1 ] = y;
|
|
9177
9141
|
|
|
9178
9142
|
return this;
|
|
@@ -9181,12 +9145,18 @@
|
|
|
9181
9145
|
|
|
9182
9146
|
getZ( index ) {
|
|
9183
9147
|
|
|
9184
|
-
|
|
9148
|
+
let z = this.array[ index * this.itemSize + 2 ];
|
|
9149
|
+
|
|
9150
|
+
if ( this.normalized ) z = denormalize( z, this.array );
|
|
9151
|
+
|
|
9152
|
+
return z;
|
|
9185
9153
|
|
|
9186
9154
|
}
|
|
9187
9155
|
|
|
9188
9156
|
setZ( index, z ) {
|
|
9189
9157
|
|
|
9158
|
+
if ( this.normalized ) z = normalize( z, this.array );
|
|
9159
|
+
|
|
9190
9160
|
this.array[ index * this.itemSize + 2 ] = z;
|
|
9191
9161
|
|
|
9192
9162
|
return this;
|
|
@@ -9195,12 +9165,18 @@
|
|
|
9195
9165
|
|
|
9196
9166
|
getW( index ) {
|
|
9197
9167
|
|
|
9198
|
-
|
|
9168
|
+
let w = this.array[ index * this.itemSize + 3 ];
|
|
9169
|
+
|
|
9170
|
+
if ( this.normalized ) w = denormalize( w, this.array );
|
|
9171
|
+
|
|
9172
|
+
return w;
|
|
9199
9173
|
|
|
9200
9174
|
}
|
|
9201
9175
|
|
|
9202
9176
|
setW( index, w ) {
|
|
9203
9177
|
|
|
9178
|
+
if ( this.normalized ) w = normalize( w, this.array );
|
|
9179
|
+
|
|
9204
9180
|
this.array[ index * this.itemSize + 3 ] = w;
|
|
9205
9181
|
|
|
9206
9182
|
return this;
|
|
@@ -9211,6 +9187,13 @@
|
|
|
9211
9187
|
|
|
9212
9188
|
index *= this.itemSize;
|
|
9213
9189
|
|
|
9190
|
+
if ( this.normalized ) {
|
|
9191
|
+
|
|
9192
|
+
x = normalize( x, this.array );
|
|
9193
|
+
y = normalize( y, this.array );
|
|
9194
|
+
|
|
9195
|
+
}
|
|
9196
|
+
|
|
9214
9197
|
this.array[ index + 0 ] = x;
|
|
9215
9198
|
this.array[ index + 1 ] = y;
|
|
9216
9199
|
|
|
@@ -9222,6 +9205,14 @@
|
|
|
9222
9205
|
|
|
9223
9206
|
index *= this.itemSize;
|
|
9224
9207
|
|
|
9208
|
+
if ( this.normalized ) {
|
|
9209
|
+
|
|
9210
|
+
x = normalize( x, this.array );
|
|
9211
|
+
y = normalize( y, this.array );
|
|
9212
|
+
z = normalize( z, this.array );
|
|
9213
|
+
|
|
9214
|
+
}
|
|
9215
|
+
|
|
9225
9216
|
this.array[ index + 0 ] = x;
|
|
9226
9217
|
this.array[ index + 1 ] = y;
|
|
9227
9218
|
this.array[ index + 2 ] = z;
|
|
@@ -9234,6 +9225,15 @@
|
|
|
9234
9225
|
|
|
9235
9226
|
index *= this.itemSize;
|
|
9236
9227
|
|
|
9228
|
+
if ( this.normalized ) {
|
|
9229
|
+
|
|
9230
|
+
x = normalize( x, this.array );
|
|
9231
|
+
y = normalize( y, this.array );
|
|
9232
|
+
z = normalize( z, this.array );
|
|
9233
|
+
w = normalize( w, this.array );
|
|
9234
|
+
|
|
9235
|
+
}
|
|
9236
|
+
|
|
9237
9237
|
this.array[ index + 0 ] = x;
|
|
9238
9238
|
this.array[ index + 1 ] = y;
|
|
9239
9239
|
this.array[ index + 2 ] = z;
|
|
@@ -9274,6 +9274,32 @@
|
|
|
9274
9274
|
|
|
9275
9275
|
}
|
|
9276
9276
|
|
|
9277
|
+
// @deprecated
|
|
9278
|
+
|
|
9279
|
+
copyColorsArray() {
|
|
9280
|
+
|
|
9281
|
+
console.error( 'THREE.BufferAttribute: copyColorsArray() was removed in r144.' );
|
|
9282
|
+
|
|
9283
|
+
}
|
|
9284
|
+
|
|
9285
|
+
copyVector2sArray() {
|
|
9286
|
+
|
|
9287
|
+
console.error( 'THREE.BufferAttribute: copyVector2sArray() was removed in r144.' );
|
|
9288
|
+
|
|
9289
|
+
}
|
|
9290
|
+
|
|
9291
|
+
copyVector3sArray() {
|
|
9292
|
+
|
|
9293
|
+
console.error( 'THREE.BufferAttribute: copyVector3sArray() was removed in r144.' );
|
|
9294
|
+
|
|
9295
|
+
}
|
|
9296
|
+
|
|
9297
|
+
copyVector4sArray() {
|
|
9298
|
+
|
|
9299
|
+
console.error( 'THREE.BufferAttribute: copyVector4sArray() was removed in r144.' );
|
|
9300
|
+
|
|
9301
|
+
}
|
|
9302
|
+
|
|
9277
9303
|
}
|
|
9278
9304
|
|
|
9279
9305
|
class Uint16BufferAttribute extends BufferAttribute {
|
|
@@ -10023,49 +10049,11 @@
|
|
|
10023
10049
|
|
|
10024
10050
|
}
|
|
10025
10051
|
|
|
10026
|
-
|
|
10052
|
+
// @deprecated since r144
|
|
10027
10053
|
|
|
10028
|
-
|
|
10029
|
-
|
|
10030
|
-
console.error( 'THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.', geometry );
|
|
10031
|
-
return;
|
|
10032
|
-
|
|
10033
|
-
}
|
|
10034
|
-
|
|
10035
|
-
if ( offset === undefined ) {
|
|
10036
|
-
|
|
10037
|
-
offset = 0;
|
|
10038
|
-
|
|
10039
|
-
console.warn(
|
|
10040
|
-
'THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. '
|
|
10041
|
-
+ 'Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge.'
|
|
10042
|
-
);
|
|
10043
|
-
|
|
10044
|
-
}
|
|
10045
|
-
|
|
10046
|
-
const attributes = this.attributes;
|
|
10047
|
-
|
|
10048
|
-
for ( const key in attributes ) {
|
|
10049
|
-
|
|
10050
|
-
if ( geometry.attributes[ key ] === undefined ) continue;
|
|
10051
|
-
|
|
10052
|
-
const attribute1 = attributes[ key ];
|
|
10053
|
-
const attributeArray1 = attribute1.array;
|
|
10054
|
-
|
|
10055
|
-
const attribute2 = geometry.attributes[ key ];
|
|
10056
|
-
const attributeArray2 = attribute2.array;
|
|
10057
|
-
|
|
10058
|
-
const attributeOffset = attribute2.itemSize * offset;
|
|
10059
|
-
const length = Math.min( attributeArray2.length, attributeArray1.length - attributeOffset );
|
|
10060
|
-
|
|
10061
|
-
for ( let i = 0, j = attributeOffset; i < length; i ++, j ++ ) {
|
|
10062
|
-
|
|
10063
|
-
attributeArray1[ j ] = attributeArray2[ i ];
|
|
10064
|
-
|
|
10065
|
-
}
|
|
10066
|
-
|
|
10067
|
-
}
|
|
10054
|
+
merge() {
|
|
10068
10055
|
|
|
10056
|
+
console.error( 'THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeBufferGeometries() instead.' );
|
|
10069
10057
|
return this;
|
|
10070
10058
|
|
|
10071
10059
|
}
|
|
@@ -11105,12 +11093,6 @@
|
|
|
11105
11093
|
|
|
11106
11094
|
if ( parameters !== undefined ) {
|
|
11107
11095
|
|
|
11108
|
-
if ( parameters.attributes !== undefined ) {
|
|
11109
|
-
|
|
11110
|
-
console.error( 'THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.' );
|
|
11111
|
-
|
|
11112
|
-
}
|
|
11113
|
-
|
|
11114
11096
|
this.setValues( parameters );
|
|
11115
11097
|
|
|
11116
11098
|
}
|
|
@@ -11541,13 +11523,6 @@
|
|
|
11541
11523
|
|
|
11542
11524
|
this.type = 'CubeCamera';
|
|
11543
11525
|
|
|
11544
|
-
if ( renderTarget.isWebGLCubeRenderTarget !== true ) {
|
|
11545
|
-
|
|
11546
|
-
console.error( 'THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.' );
|
|
11547
|
-
return;
|
|
11548
|
-
|
|
11549
|
-
}
|
|
11550
|
-
|
|
11551
11526
|
this.renderTarget = renderTarget;
|
|
11552
11527
|
|
|
11553
11528
|
const cameraPX = new PerspectiveCamera( fov, aspect, near, far );
|
|
@@ -12528,7 +12503,7 @@
|
|
|
12528
12503
|
|
|
12529
12504
|
var common = "#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}";
|
|
12530
12505
|
|
|
12531
|
-
var cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define
|
|
12506
|
+
var cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif";
|
|
12532
12507
|
|
|
12533
12508
|
var defaultnormal_vertex = "vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif";
|
|
12534
12509
|
|
|
@@ -12548,9 +12523,9 @@
|
|
|
12548
12523
|
|
|
12549
12524
|
var envmap_common_pars_fragment = "#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif";
|
|
12550
12525
|
|
|
12551
|
-
var envmap_pars_fragment = "#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif";
|
|
12526
|
+
var envmap_pars_fragment = "#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif";
|
|
12552
12527
|
|
|
12553
|
-
var envmap_pars_vertex = "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif";
|
|
12528
|
+
var envmap_pars_vertex = "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif";
|
|
12554
12529
|
|
|
12555
12530
|
var envmap_vertex = "#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif";
|
|
12556
12531
|
|
|
@@ -12562,13 +12537,15 @@
|
|
|
12562
12537
|
|
|
12563
12538
|
var fog_pars_fragment = "#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif";
|
|
12564
12539
|
|
|
12565
|
-
var gradientmap_pars_fragment = "#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\
|
|
12540
|
+
var gradientmap_pars_fragment = "#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}";
|
|
12566
12541
|
|
|
12567
12542
|
var lightmap_fragment = "#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif";
|
|
12568
12543
|
|
|
12569
12544
|
var lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif";
|
|
12570
12545
|
|
|
12571
|
-
var
|
|
12546
|
+
var lights_lambert_fragment = "LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;";
|
|
12547
|
+
|
|
12548
|
+
var lights_lambert_pars_fragment = "varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert\n#define Material_LightProbeLOD( material )\t(0)";
|
|
12572
12549
|
|
|
12573
12550
|
var lights_pars_begin = "uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif";
|
|
12574
12551
|
|
|
@@ -12582,11 +12559,11 @@
|
|
|
12582
12559
|
|
|
12583
12560
|
var lights_phong_pars_fragment = "varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)";
|
|
12584
12561
|
|
|
12585
|
-
var lights_physical_fragment = "PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARCOLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( ior - 1.0 ) / ( ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n\t#endif\n#endif";
|
|
12562
|
+
var lights_physical_fragment = "PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARCOLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n\t#endif\n#endif";
|
|
12586
12563
|
|
|
12587
|
-
var lights_physical_pars_fragment = "struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\treflectedLight.directSpecular += irradiance * BRDF_GGX_Iridescence( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness );\n\t#else\n\t\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}";
|
|
12564
|
+
var lights_physical_pars_fragment = "struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\treflectedLight.directSpecular += irradiance * BRDF_GGX_Iridescence( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness );\n\t#else\n\t\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}";
|
|
12588
12565
|
|
|
12589
|
-
var lights_fragment_begin = "\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius,
|
|
12566
|
+
var lights_fragment_begin = "\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif";
|
|
12590
12567
|
|
|
12591
12568
|
var lights_fragment_maps = "#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif";
|
|
12592
12569
|
|
|
@@ -12640,7 +12617,7 @@
|
|
|
12640
12617
|
|
|
12641
12618
|
var iridescence_pars_fragment = "#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif";
|
|
12642
12619
|
|
|
12643
|
-
var output_fragment = "#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );";
|
|
12620
|
+
var output_fragment = "#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );";
|
|
12644
12621
|
|
|
12645
12622
|
var packing = "vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}";
|
|
12646
12623
|
|
|
@@ -12656,13 +12633,13 @@
|
|
|
12656
12633
|
|
|
12657
12634
|
var roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif";
|
|
12658
12635
|
|
|
12659
|
-
var shadowmap_pars_fragment = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\
|
|
12636
|
+
var shadowmap_pars_fragment = "#if NUM_SPOT_LIGHT_COORDS > 0\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif";
|
|
12660
12637
|
|
|
12661
|
-
var shadowmap_pars_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\
|
|
12638
|
+
var shadowmap_pars_vertex = "#if NUM_SPOT_LIGHT_COORDS > 0\n uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif";
|
|
12662
12639
|
|
|
12663
|
-
var shadowmap_vertex = "#
|
|
12640
|
+
var shadowmap_vertex = "#if defined( USE_SHADOWMAP ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_COORDS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif";
|
|
12664
12641
|
|
|
12665
|
-
var shadowmask_pars_fragment = "float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius,
|
|
12642
|
+
var shadowmask_pars_fragment = "float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}";
|
|
12666
12643
|
|
|
12667
12644
|
var skinbase_vertex = "#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif";
|
|
12668
12645
|
|
|
@@ -12680,7 +12657,7 @@
|
|
|
12680
12657
|
|
|
12681
12658
|
var tonemapping_pars_fragment = "#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }";
|
|
12682
12659
|
|
|
12683
|
-
var transmission_fragment = "#ifdef USE_TRANSMISSION\n\
|
|
12660
|
+
var transmission_fragment = "#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmission.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission );\n#endif";
|
|
12684
12661
|
|
|
12685
12662
|
var transmission_pars_fragment = "#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef texture2DLodEXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( attenuationDistance == 0.0 ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif";
|
|
12686
12663
|
|
|
@@ -12696,7 +12673,7 @@
|
|
|
12696
12673
|
|
|
12697
12674
|
var uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif";
|
|
12698
12675
|
|
|
12699
|
-
var worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif";
|
|
12676
|
+
var worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif";
|
|
12700
12677
|
|
|
12701
12678
|
const vertex$g = "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}";
|
|
12702
12679
|
|
|
@@ -12724,11 +12701,11 @@
|
|
|
12724
12701
|
|
|
12725
12702
|
const vertex$a = "#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}";
|
|
12726
12703
|
|
|
12727
|
-
const fragment$a = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <
|
|
12704
|
+
const fragment$a = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
|
|
12728
12705
|
|
|
12729
|
-
const vertex$9 = "#define LAMBERT\nvarying vec3
|
|
12706
|
+
const vertex$9 = "#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
|
|
12730
12707
|
|
|
12731
|
-
const fragment$9 = "
|
|
12708
|
+
const fragment$9 = "#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
|
|
12732
12709
|
|
|
12733
12710
|
const vertex$8 = "#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}";
|
|
12734
12711
|
|
|
@@ -12740,7 +12717,7 @@
|
|
|
12740
12717
|
|
|
12741
12718
|
const vertex$6 = "#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
|
|
12742
12719
|
|
|
12743
|
-
const fragment$6 = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <
|
|
12720
|
+
const fragment$6 = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
|
|
12744
12721
|
|
|
12745
12722
|
const vertex$5 = "#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}";
|
|
12746
12723
|
|
|
@@ -12804,7 +12781,8 @@
|
|
|
12804
12781
|
gradientmap_pars_fragment: gradientmap_pars_fragment,
|
|
12805
12782
|
lightmap_fragment: lightmap_fragment,
|
|
12806
12783
|
lightmap_pars_fragment: lightmap_pars_fragment,
|
|
12807
|
-
|
|
12784
|
+
lights_lambert_fragment: lights_lambert_fragment,
|
|
12785
|
+
lights_lambert_pars_fragment: lights_lambert_pars_fragment,
|
|
12808
12786
|
lights_pars_begin: lights_pars_begin,
|
|
12809
12787
|
lights_toon_fragment: lights_toon_fragment,
|
|
12810
12788
|
lights_toon_pars_fragment: lights_toon_pars_fragment,
|
|
@@ -12911,7 +12889,7 @@
|
|
|
12911
12889
|
|
|
12912
12890
|
common: {
|
|
12913
12891
|
|
|
12914
|
-
diffuse: { value: /*@__PURE__*/ new Color
|
|
12892
|
+
diffuse: { value: /*@__PURE__*/ new Color( 0xffffff ) },
|
|
12915
12893
|
opacity: { value: 1.0 },
|
|
12916
12894
|
|
|
12917
12895
|
map: { value: null },
|
|
@@ -13004,7 +12982,7 @@
|
|
|
13004
12982
|
fogDensity: { value: 0.00025 },
|
|
13005
12983
|
fogNear: { value: 1 },
|
|
13006
12984
|
fogFar: { value: 2000 },
|
|
13007
|
-
fogColor: { value: /*@__PURE__*/ new Color
|
|
12985
|
+
fogColor: { value: /*@__PURE__*/ new Color( 0xffffff ) }
|
|
13008
12986
|
|
|
13009
12987
|
},
|
|
13010
12988
|
|
|
@@ -13046,8 +13024,9 @@
|
|
|
13046
13024
|
shadowMapSize: {}
|
|
13047
13025
|
} },
|
|
13048
13026
|
|
|
13027
|
+
spotLightMap: { value: [] },
|
|
13049
13028
|
spotShadowMap: { value: [] },
|
|
13050
|
-
|
|
13029
|
+
spotLightMatrix: { value: [] },
|
|
13051
13030
|
|
|
13052
13031
|
pointLights: { value: [], properties: {
|
|
13053
13032
|
color: {},
|
|
@@ -13089,7 +13068,7 @@
|
|
|
13089
13068
|
|
|
13090
13069
|
points: {
|
|
13091
13070
|
|
|
13092
|
-
diffuse: { value: /*@__PURE__*/ new Color
|
|
13071
|
+
diffuse: { value: /*@__PURE__*/ new Color( 0xffffff ) },
|
|
13093
13072
|
opacity: { value: 1.0 },
|
|
13094
13073
|
size: { value: 1.0 },
|
|
13095
13074
|
scale: { value: 1.0 },
|
|
@@ -13102,7 +13081,7 @@
|
|
|
13102
13081
|
|
|
13103
13082
|
sprite: {
|
|
13104
13083
|
|
|
13105
|
-
diffuse: { value: /*@__PURE__*/ new Color
|
|
13084
|
+
diffuse: { value: /*@__PURE__*/ new Color( 0xffffff ) },
|
|
13106
13085
|
opacity: { value: 1.0 },
|
|
13107
13086
|
center: { value: /*@__PURE__*/ new Vector2( 0.5, 0.5 ) },
|
|
13108
13087
|
rotation: { value: 0.0 },
|
|
@@ -13142,10 +13121,13 @@
|
|
|
13142
13121
|
UniformsLib.aomap,
|
|
13143
13122
|
UniformsLib.lightmap,
|
|
13144
13123
|
UniformsLib.emissivemap,
|
|
13124
|
+
UniformsLib.bumpmap,
|
|
13125
|
+
UniformsLib.normalmap,
|
|
13126
|
+
UniformsLib.displacementmap,
|
|
13145
13127
|
UniformsLib.fog,
|
|
13146
13128
|
UniformsLib.lights,
|
|
13147
13129
|
{
|
|
13148
|
-
emissive: { value: /*@__PURE__*/ new Color
|
|
13130
|
+
emissive: { value: /*@__PURE__*/ new Color( 0x000000 ) }
|
|
13149
13131
|
}
|
|
13150
13132
|
] ),
|
|
13151
13133
|
|
|
@@ -13169,8 +13151,8 @@
|
|
|
13169
13151
|
UniformsLib.fog,
|
|
13170
13152
|
UniformsLib.lights,
|
|
13171
13153
|
{
|
|
13172
|
-
emissive: { value: /*@__PURE__*/ new Color
|
|
13173
|
-
specular: { value: /*@__PURE__*/ new Color
|
|
13154
|
+
emissive: { value: /*@__PURE__*/ new Color( 0x000000 ) },
|
|
13155
|
+
specular: { value: /*@__PURE__*/ new Color( 0x111111 ) },
|
|
13174
13156
|
shininess: { value: 30 }
|
|
13175
13157
|
}
|
|
13176
13158
|
] ),
|
|
@@ -13196,7 +13178,7 @@
|
|
|
13196
13178
|
UniformsLib.fog,
|
|
13197
13179
|
UniformsLib.lights,
|
|
13198
13180
|
{
|
|
13199
|
-
emissive: { value: /*@__PURE__*/ new Color
|
|
13181
|
+
emissive: { value: /*@__PURE__*/ new Color( 0x000000 ) },
|
|
13200
13182
|
roughness: { value: 1.0 },
|
|
13201
13183
|
metalness: { value: 0.0 },
|
|
13202
13184
|
envMapIntensity: { value: 1 } // temporary
|
|
@@ -13222,7 +13204,7 @@
|
|
|
13222
13204
|
UniformsLib.fog,
|
|
13223
13205
|
UniformsLib.lights,
|
|
13224
13206
|
{
|
|
13225
|
-
emissive: { value: /*@__PURE__*/ new Color
|
|
13207
|
+
emissive: { value: /*@__PURE__*/ new Color( 0x000000 ) }
|
|
13226
13208
|
}
|
|
13227
13209
|
] ),
|
|
13228
13210
|
|
|
@@ -13379,7 +13361,7 @@
|
|
|
13379
13361
|
UniformsLib.lights,
|
|
13380
13362
|
UniformsLib.fog,
|
|
13381
13363
|
{
|
|
13382
|
-
color: { value: /*@__PURE__*/ new Color
|
|
13364
|
+
color: { value: /*@__PURE__*/ new Color( 0x00000 ) },
|
|
13383
13365
|
opacity: { value: 1.0 }
|
|
13384
13366
|
},
|
|
13385
13367
|
] ),
|
|
@@ -13409,7 +13391,7 @@
|
|
|
13409
13391
|
iridescenceThicknessMaximum: { value: 400 },
|
|
13410
13392
|
iridescenceThicknessMap: { value: null },
|
|
13411
13393
|
sheen: { value: 0 },
|
|
13412
|
-
sheenColor: { value: /*@__PURE__*/ new Color
|
|
13394
|
+
sheenColor: { value: /*@__PURE__*/ new Color( 0x000000 ) },
|
|
13413
13395
|
sheenColorMap: { value: null },
|
|
13414
13396
|
sheenRoughness: { value: 1 },
|
|
13415
13397
|
sheenRoughnessMap: { value: null },
|
|
@@ -13420,10 +13402,10 @@
|
|
|
13420
13402
|
thickness: { value: 0 },
|
|
13421
13403
|
thicknessMap: { value: null },
|
|
13422
13404
|
attenuationDistance: { value: 0 },
|
|
13423
|
-
attenuationColor: { value: /*@__PURE__*/ new Color
|
|
13405
|
+
attenuationColor: { value: /*@__PURE__*/ new Color( 0x000000 ) },
|
|
13424
13406
|
specularIntensity: { value: 1 },
|
|
13425
13407
|
specularIntensityMap: { value: null },
|
|
13426
|
-
specularColor: { value: /*@__PURE__*/ new Color
|
|
13408
|
+
specularColor: { value: /*@__PURE__*/ new Color( 1, 1, 1 ) },
|
|
13427
13409
|
specularColorMap: { value: null },
|
|
13428
13410
|
}
|
|
13429
13411
|
] ),
|
|
@@ -13435,7 +13417,7 @@
|
|
|
13435
13417
|
|
|
13436
13418
|
function WebGLBackground( renderer, cubemaps, state, objects, alpha, premultipliedAlpha ) {
|
|
13437
13419
|
|
|
13438
|
-
const clearColor = new Color
|
|
13420
|
+
const clearColor = new Color( 0x000000 );
|
|
13439
13421
|
let clearAlpha = alpha === true ? 0 : 1;
|
|
13440
13422
|
|
|
13441
13423
|
let planeMesh;
|
|
@@ -13512,7 +13494,7 @@
|
|
|
13512
13494
|
|
|
13513
13495
|
};
|
|
13514
13496
|
|
|
13515
|
-
//
|
|
13497
|
+
// add "envMap" material property so the renderer can evaluate it like for built-in materials
|
|
13516
13498
|
Object.defineProperty( boxMesh.material, 'envMap', {
|
|
13517
13499
|
|
|
13518
13500
|
get: function () {
|
|
@@ -13567,7 +13549,7 @@
|
|
|
13567
13549
|
|
|
13568
13550
|
planeMesh.geometry.deleteAttribute( 'normal' );
|
|
13569
13551
|
|
|
13570
|
-
//
|
|
13552
|
+
// add "map" material property so the renderer can evaluate it like for built-in materials
|
|
13571
13553
|
Object.defineProperty( planeMesh.material, 'map', {
|
|
13572
13554
|
|
|
13573
13555
|
get: function () {
|
|
@@ -14852,7 +14834,7 @@
|
|
|
14852
14834
|
const MAX_SAMPLES = 20;
|
|
14853
14835
|
|
|
14854
14836
|
const _flatCamera = /*@__PURE__*/ new OrthographicCamera();
|
|
14855
|
-
const _clearColor = /*@__PURE__*/ new Color
|
|
14837
|
+
const _clearColor = /*@__PURE__*/ new Color();
|
|
14856
14838
|
let _oldTarget = null;
|
|
14857
14839
|
|
|
14858
14840
|
// Golden Ratio
|
|
@@ -16274,22 +16256,6 @@
|
|
|
16274
16256
|
|
|
16275
16257
|
}
|
|
16276
16258
|
|
|
16277
|
-
function denormalize( morph, attribute ) {
|
|
16278
|
-
|
|
16279
|
-
let denominator = 1;
|
|
16280
|
-
const array = attribute.isInterleavedBufferAttribute ? attribute.data.array : attribute.array;
|
|
16281
|
-
|
|
16282
|
-
if ( array instanceof Int8Array ) denominator = 127;
|
|
16283
|
-
else if ( array instanceof Uint8Array ) denominator = 255;
|
|
16284
|
-
else if ( array instanceof Uint16Array ) denominator = 65535;
|
|
16285
|
-
else if ( array instanceof Int16Array ) denominator = 32767;
|
|
16286
|
-
else if ( array instanceof Int32Array ) denominator = 2147483647;
|
|
16287
|
-
else console.error( 'THREE.WebGLMorphtargets: Unsupported morph attribute data type: ', array );
|
|
16288
|
-
|
|
16289
|
-
morph.divideScalar( denominator );
|
|
16290
|
-
|
|
16291
|
-
}
|
|
16292
|
-
|
|
16293
16259
|
function WebGLMorphtargets( gl, capabilities, textures ) {
|
|
16294
16260
|
|
|
16295
16261
|
const influencesList = {};
|
|
@@ -16373,8 +16339,6 @@
|
|
|
16373
16339
|
|
|
16374
16340
|
morph.fromBufferAttribute( morphTarget, j );
|
|
16375
16341
|
|
|
16376
|
-
if ( morphTarget.normalized === true ) denormalize( morph, morphTarget );
|
|
16377
|
-
|
|
16378
16342
|
buffer[ offset + stride + 0 ] = morph.x;
|
|
16379
16343
|
buffer[ offset + stride + 1 ] = morph.y;
|
|
16380
16344
|
buffer[ offset + stride + 2 ] = morph.z;
|
|
@@ -16386,8 +16350,6 @@
|
|
|
16386
16350
|
|
|
16387
16351
|
morph.fromBufferAttribute( morphNormal, j );
|
|
16388
16352
|
|
|
16389
|
-
if ( morphNormal.normalized === true ) denormalize( morph, morphNormal );
|
|
16390
|
-
|
|
16391
16353
|
buffer[ offset + stride + 4 ] = morph.x;
|
|
16392
16354
|
buffer[ offset + stride + 5 ] = morph.y;
|
|
16393
16355
|
buffer[ offset + stride + 6 ] = morph.z;
|
|
@@ -16399,8 +16361,6 @@
|
|
|
16399
16361
|
|
|
16400
16362
|
morph.fromBufferAttribute( morphColor, j );
|
|
16401
16363
|
|
|
16402
|
-
if ( morphColor.normalized === true ) denormalize( morph, morphColor );
|
|
16403
|
-
|
|
16404
16364
|
buffer[ offset + stride + 8 ] = morph.x;
|
|
16405
16365
|
buffer[ offset + stride + 9 ] = morph.y;
|
|
16406
16366
|
buffer[ offset + stride + 10 ] = morph.z;
|
|
@@ -17843,13 +17803,18 @@
|
|
|
17843
17803
|
|
|
17844
17804
|
function replaceLightNums( string, parameters ) {
|
|
17845
17805
|
|
|
17806
|
+
const numSpotLightCoords = parameters.numSpotLightShadows + parameters.numSpotLightMaps - parameters.numSpotLightShadowsWithMaps;
|
|
17807
|
+
|
|
17846
17808
|
return string
|
|
17847
17809
|
.replace( /NUM_DIR_LIGHTS/g, parameters.numDirLights )
|
|
17848
17810
|
.replace( /NUM_SPOT_LIGHTS/g, parameters.numSpotLights )
|
|
17811
|
+
.replace( /NUM_SPOT_LIGHT_MAPS/g, parameters.numSpotLightMaps )
|
|
17812
|
+
.replace( /NUM_SPOT_LIGHT_COORDS/g, numSpotLightCoords )
|
|
17849
17813
|
.replace( /NUM_RECT_AREA_LIGHTS/g, parameters.numRectAreaLights )
|
|
17850
17814
|
.replace( /NUM_POINT_LIGHTS/g, parameters.numPointLights )
|
|
17851
17815
|
.replace( /NUM_HEMI_LIGHTS/g, parameters.numHemiLights )
|
|
17852
17816
|
.replace( /NUM_DIR_LIGHT_SHADOWS/g, parameters.numDirLightShadows )
|
|
17817
|
+
.replace( /NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g, parameters.numSpotLightShadowsWithMaps )
|
|
17853
17818
|
.replace( /NUM_SPOT_LIGHT_SHADOWS/g, parameters.numSpotLightShadows )
|
|
17854
17819
|
.replace( /NUM_POINT_LIGHT_SHADOWS/g, parameters.numPointLightShadows );
|
|
17855
17820
|
|
|
@@ -17889,21 +17854,11 @@
|
|
|
17889
17854
|
|
|
17890
17855
|
// Unroll Loops
|
|
17891
17856
|
|
|
17892
|
-
const deprecatedUnrollLoopPattern = /#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
|
|
17893
17857
|
const unrollLoopPattern = /#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;
|
|
17894
17858
|
|
|
17895
17859
|
function unrollLoops( string ) {
|
|
17896
17860
|
|
|
17897
|
-
return string
|
|
17898
|
-
.replace( unrollLoopPattern, loopReplacer )
|
|
17899
|
-
.replace( deprecatedUnrollLoopPattern, deprecatedLoopReplacer );
|
|
17900
|
-
|
|
17901
|
-
}
|
|
17902
|
-
|
|
17903
|
-
function deprecatedLoopReplacer( match, start, end, snippet ) {
|
|
17904
|
-
|
|
17905
|
-
console.warn( 'WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead.' );
|
|
17906
|
-
return loopReplacer( match, start, end, snippet );
|
|
17861
|
+
return string.replace( unrollLoopPattern, loopReplacer );
|
|
17907
17862
|
|
|
17908
17863
|
}
|
|
17909
17864
|
|
|
@@ -18649,29 +18604,32 @@
|
|
|
18649
18604
|
_getShaderCacheForMaterial( material ) {
|
|
18650
18605
|
|
|
18651
18606
|
const cache = this.materialCache;
|
|
18607
|
+
let set = cache.get( material );
|
|
18652
18608
|
|
|
18653
|
-
if (
|
|
18609
|
+
if ( set === undefined ) {
|
|
18654
18610
|
|
|
18655
|
-
|
|
18611
|
+
set = new Set();
|
|
18612
|
+
cache.set( material, set );
|
|
18656
18613
|
|
|
18657
18614
|
}
|
|
18658
18615
|
|
|
18659
|
-
return
|
|
18616
|
+
return set;
|
|
18660
18617
|
|
|
18661
18618
|
}
|
|
18662
18619
|
|
|
18663
18620
|
_getShaderStage( code ) {
|
|
18664
18621
|
|
|
18665
18622
|
const cache = this.shaderCache;
|
|
18623
|
+
let stage = cache.get( code );
|
|
18666
18624
|
|
|
18667
|
-
if (
|
|
18625
|
+
if ( stage === undefined ) {
|
|
18668
18626
|
|
|
18669
|
-
|
|
18627
|
+
stage = new WebGLShaderStage( code );
|
|
18670
18628
|
cache.set( code, stage );
|
|
18671
18629
|
|
|
18672
18630
|
}
|
|
18673
18631
|
|
|
18674
|
-
return
|
|
18632
|
+
return stage;
|
|
18675
18633
|
|
|
18676
18634
|
}
|
|
18677
18635
|
|
|
@@ -18884,12 +18842,14 @@
|
|
|
18884
18842
|
numDirLights: lights.directional.length,
|
|
18885
18843
|
numPointLights: lights.point.length,
|
|
18886
18844
|
numSpotLights: lights.spot.length,
|
|
18845
|
+
numSpotLightMaps: lights.spotLightMap.length,
|
|
18887
18846
|
numRectAreaLights: lights.rectArea.length,
|
|
18888
18847
|
numHemiLights: lights.hemi.length,
|
|
18889
18848
|
|
|
18890
18849
|
numDirLightShadows: lights.directionalShadowMap.length,
|
|
18891
18850
|
numPointLightShadows: lights.pointShadowMap.length,
|
|
18892
18851
|
numSpotLightShadows: lights.spotShadowMap.length,
|
|
18852
|
+
numSpotLightShadowsWithMaps: lights.numSpotLightShadowsWithMaps,
|
|
18893
18853
|
|
|
18894
18854
|
numClippingPlanes: clipping.numPlanes,
|
|
18895
18855
|
numClipIntersection: clipping.numIntersection,
|
|
@@ -18984,11 +18944,13 @@
|
|
|
18984
18944
|
array.push( parameters.numDirLights );
|
|
18985
18945
|
array.push( parameters.numPointLights );
|
|
18986
18946
|
array.push( parameters.numSpotLights );
|
|
18947
|
+
array.push( parameters.numSpotLightMaps );
|
|
18987
18948
|
array.push( parameters.numHemiLights );
|
|
18988
18949
|
array.push( parameters.numRectAreaLights );
|
|
18989
18950
|
array.push( parameters.numDirLightShadows );
|
|
18990
18951
|
array.push( parameters.numPointLightShadows );
|
|
18991
18952
|
array.push( parameters.numSpotLightShadows );
|
|
18953
|
+
array.push( parameters.numSpotLightShadowsWithMaps );
|
|
18992
18954
|
array.push( parameters.shadowMapType );
|
|
18993
18955
|
array.push( parameters.toneMapping );
|
|
18994
18956
|
array.push( parameters.numClippingPlanes );
|
|
@@ -19067,60 +19029,60 @@
|
|
|
19067
19029
|
_programLayers.enable( 31 );
|
|
19068
19030
|
if ( parameters.uvsVertexOnly )
|
|
19069
19031
|
_programLayers.enable( 32 );
|
|
19070
|
-
if ( parameters.fog )
|
|
19071
|
-
_programLayers.enable( 33 );
|
|
19072
19032
|
|
|
19073
19033
|
array.push( _programLayers.mask );
|
|
19074
19034
|
_programLayers.disableAll();
|
|
19075
19035
|
|
|
19076
|
-
if ( parameters.
|
|
19036
|
+
if ( parameters.fog )
|
|
19077
19037
|
_programLayers.enable( 0 );
|
|
19078
|
-
if ( parameters.
|
|
19038
|
+
if ( parameters.useFog )
|
|
19079
19039
|
_programLayers.enable( 1 );
|
|
19080
|
-
if ( parameters.
|
|
19040
|
+
if ( parameters.flatShading )
|
|
19081
19041
|
_programLayers.enable( 2 );
|
|
19082
|
-
if ( parameters.
|
|
19042
|
+
if ( parameters.logarithmicDepthBuffer )
|
|
19083
19043
|
_programLayers.enable( 3 );
|
|
19084
|
-
if ( parameters.
|
|
19044
|
+
if ( parameters.skinning )
|
|
19085
19045
|
_programLayers.enable( 4 );
|
|
19086
|
-
if ( parameters.
|
|
19046
|
+
if ( parameters.morphTargets )
|
|
19087
19047
|
_programLayers.enable( 5 );
|
|
19088
|
-
if ( parameters.
|
|
19048
|
+
if ( parameters.morphNormals )
|
|
19089
19049
|
_programLayers.enable( 6 );
|
|
19090
|
-
if ( parameters.
|
|
19050
|
+
if ( parameters.morphColors )
|
|
19091
19051
|
_programLayers.enable( 7 );
|
|
19092
|
-
if ( parameters.
|
|
19052
|
+
if ( parameters.premultipliedAlpha )
|
|
19093
19053
|
_programLayers.enable( 8 );
|
|
19094
|
-
if ( parameters.
|
|
19054
|
+
if ( parameters.shadowMapEnabled )
|
|
19095
19055
|
_programLayers.enable( 9 );
|
|
19096
|
-
if ( parameters.
|
|
19056
|
+
if ( parameters.physicallyCorrectLights )
|
|
19097
19057
|
_programLayers.enable( 10 );
|
|
19098
|
-
if ( parameters.
|
|
19058
|
+
if ( parameters.doubleSided )
|
|
19099
19059
|
_programLayers.enable( 11 );
|
|
19100
|
-
if ( parameters.
|
|
19060
|
+
if ( parameters.flipSided )
|
|
19101
19061
|
_programLayers.enable( 12 );
|
|
19102
|
-
if ( parameters.
|
|
19062
|
+
if ( parameters.useDepthPacking )
|
|
19103
19063
|
_programLayers.enable( 13 );
|
|
19104
|
-
if ( parameters.
|
|
19064
|
+
if ( parameters.dithering )
|
|
19105
19065
|
_programLayers.enable( 14 );
|
|
19106
|
-
if ( parameters.
|
|
19066
|
+
if ( parameters.specularIntensityMap )
|
|
19107
19067
|
_programLayers.enable( 15 );
|
|
19108
|
-
if ( parameters.
|
|
19068
|
+
if ( parameters.specularColorMap )
|
|
19109
19069
|
_programLayers.enable( 16 );
|
|
19110
|
-
if ( parameters.
|
|
19070
|
+
if ( parameters.transmission )
|
|
19111
19071
|
_programLayers.enable( 17 );
|
|
19112
|
-
if ( parameters.
|
|
19072
|
+
if ( parameters.transmissionMap )
|
|
19113
19073
|
_programLayers.enable( 18 );
|
|
19114
|
-
if ( parameters.
|
|
19074
|
+
if ( parameters.thicknessMap )
|
|
19115
19075
|
_programLayers.enable( 19 );
|
|
19116
|
-
if ( parameters.
|
|
19076
|
+
if ( parameters.sheen )
|
|
19117
19077
|
_programLayers.enable( 20 );
|
|
19118
|
-
if ( parameters.
|
|
19078
|
+
if ( parameters.sheenColorMap )
|
|
19119
19079
|
_programLayers.enable( 21 );
|
|
19120
|
-
if ( parameters.
|
|
19080
|
+
if ( parameters.sheenRoughnessMap )
|
|
19121
19081
|
_programLayers.enable( 22 );
|
|
19122
|
-
if ( parameters.
|
|
19082
|
+
if ( parameters.decodeVideoTexture )
|
|
19123
19083
|
_programLayers.enable( 23 );
|
|
19084
|
+
if ( parameters.opaque )
|
|
19085
|
+
_programLayers.enable( 24 );
|
|
19124
19086
|
|
|
19125
19087
|
array.push( _programLayers.mask );
|
|
19126
19088
|
|
|
@@ -19461,23 +19423,24 @@
|
|
|
19461
19423
|
|
|
19462
19424
|
function get( scene, renderCallDepth ) {
|
|
19463
19425
|
|
|
19426
|
+
const listArray = lists.get( scene );
|
|
19464
19427
|
let list;
|
|
19465
19428
|
|
|
19466
|
-
if (
|
|
19429
|
+
if ( listArray === undefined ) {
|
|
19467
19430
|
|
|
19468
19431
|
list = new WebGLRenderList();
|
|
19469
19432
|
lists.set( scene, [ list ] );
|
|
19470
19433
|
|
|
19471
19434
|
} else {
|
|
19472
19435
|
|
|
19473
|
-
if ( renderCallDepth >=
|
|
19436
|
+
if ( renderCallDepth >= listArray.length ) {
|
|
19474
19437
|
|
|
19475
19438
|
list = new WebGLRenderList();
|
|
19476
|
-
|
|
19439
|
+
listArray.push( list );
|
|
19477
19440
|
|
|
19478
19441
|
} else {
|
|
19479
19442
|
|
|
19480
|
-
list =
|
|
19443
|
+
list = listArray[ renderCallDepth ];
|
|
19481
19444
|
|
|
19482
19445
|
}
|
|
19483
19446
|
|
|
@@ -19521,7 +19484,7 @@
|
|
|
19521
19484
|
case 'DirectionalLight':
|
|
19522
19485
|
uniforms = {
|
|
19523
19486
|
direction: new Vector3(),
|
|
19524
|
-
color: new Color
|
|
19487
|
+
color: new Color()
|
|
19525
19488
|
};
|
|
19526
19489
|
break;
|
|
19527
19490
|
|
|
@@ -19529,7 +19492,7 @@
|
|
|
19529
19492
|
uniforms = {
|
|
19530
19493
|
position: new Vector3(),
|
|
19531
19494
|
direction: new Vector3(),
|
|
19532
|
-
color: new Color
|
|
19495
|
+
color: new Color(),
|
|
19533
19496
|
distance: 0,
|
|
19534
19497
|
coneCos: 0,
|
|
19535
19498
|
penumbraCos: 0,
|
|
@@ -19540,7 +19503,7 @@
|
|
|
19540
19503
|
case 'PointLight':
|
|
19541
19504
|
uniforms = {
|
|
19542
19505
|
position: new Vector3(),
|
|
19543
|
-
color: new Color
|
|
19506
|
+
color: new Color(),
|
|
19544
19507
|
distance: 0,
|
|
19545
19508
|
decay: 0
|
|
19546
19509
|
};
|
|
@@ -19549,14 +19512,14 @@
|
|
|
19549
19512
|
case 'HemisphereLight':
|
|
19550
19513
|
uniforms = {
|
|
19551
19514
|
direction: new Vector3(),
|
|
19552
|
-
skyColor: new Color
|
|
19553
|
-
groundColor: new Color
|
|
19515
|
+
skyColor: new Color(),
|
|
19516
|
+
groundColor: new Color()
|
|
19554
19517
|
};
|
|
19555
19518
|
break;
|
|
19556
19519
|
|
|
19557
19520
|
case 'RectAreaLight':
|
|
19558
19521
|
uniforms = {
|
|
19559
|
-
color: new Color
|
|
19522
|
+
color: new Color(),
|
|
19560
19523
|
position: new Vector3(),
|
|
19561
19524
|
halfWidth: new Vector3(),
|
|
19562
19525
|
halfHeight: new Vector3()
|
|
@@ -19640,9 +19603,9 @@
|
|
|
19640
19603
|
|
|
19641
19604
|
let nextVersion = 0;
|
|
19642
19605
|
|
|
19643
|
-
function
|
|
19606
|
+
function shadowCastingAndTexturingLightsFirst( lightA, lightB ) {
|
|
19644
19607
|
|
|
19645
|
-
return ( lightB.castShadow ?
|
|
19608
|
+
return ( lightB.castShadow ? 2 : 0 ) - ( lightA.castShadow ? 2 : 0 ) + ( lightB.map ? 1 : 0 ) - ( lightA.map ? 1 : 0 );
|
|
19646
19609
|
|
|
19647
19610
|
}
|
|
19648
19611
|
|
|
@@ -19665,7 +19628,8 @@
|
|
|
19665
19628
|
|
|
19666
19629
|
numDirectionalShadows: - 1,
|
|
19667
19630
|
numPointShadows: - 1,
|
|
19668
|
-
numSpotShadows: - 1
|
|
19631
|
+
numSpotShadows: - 1,
|
|
19632
|
+
numSpotMaps: - 1
|
|
19669
19633
|
},
|
|
19670
19634
|
|
|
19671
19635
|
ambient: [ 0, 0, 0 ],
|
|
@@ -19675,9 +19639,10 @@
|
|
|
19675
19639
|
directionalShadowMap: [],
|
|
19676
19640
|
directionalShadowMatrix: [],
|
|
19677
19641
|
spot: [],
|
|
19642
|
+
spotLightMap: [],
|
|
19678
19643
|
spotShadow: [],
|
|
19679
19644
|
spotShadowMap: [],
|
|
19680
|
-
|
|
19645
|
+
spotLightMatrix: [],
|
|
19681
19646
|
rectArea: [],
|
|
19682
19647
|
rectAreaLTC1: null,
|
|
19683
19648
|
rectAreaLTC2: null,
|
|
@@ -19685,7 +19650,8 @@
|
|
|
19685
19650
|
pointShadow: [],
|
|
19686
19651
|
pointShadowMap: [],
|
|
19687
19652
|
pointShadowMatrix: [],
|
|
19688
|
-
hemi: []
|
|
19653
|
+
hemi: [],
|
|
19654
|
+
numSpotLightShadowsWithMaps: 0
|
|
19689
19655
|
|
|
19690
19656
|
};
|
|
19691
19657
|
|
|
@@ -19710,8 +19676,11 @@
|
|
|
19710
19676
|
let numDirectionalShadows = 0;
|
|
19711
19677
|
let numPointShadows = 0;
|
|
19712
19678
|
let numSpotShadows = 0;
|
|
19679
|
+
let numSpotMaps = 0;
|
|
19680
|
+
let numSpotShadowsWithMaps = 0;
|
|
19713
19681
|
|
|
19714
|
-
|
|
19682
|
+
// ordering : [shadow casting + map texturing, map texturing, shadow casting, none ]
|
|
19683
|
+
lights.sort( shadowCastingAndTexturingLightsFirst );
|
|
19715
19684
|
|
|
19716
19685
|
// artist-friendly light intensity scaling factor
|
|
19717
19686
|
const scaleFactor = ( physicallyCorrectLights !== true ) ? Math.PI : 1;
|
|
@@ -19782,9 +19751,26 @@
|
|
|
19782
19751
|
uniforms.penumbraCos = Math.cos( light.angle * ( 1 - light.penumbra ) );
|
|
19783
19752
|
uniforms.decay = light.decay;
|
|
19784
19753
|
|
|
19785
|
-
|
|
19754
|
+
state.spot[ spotLength ] = uniforms;
|
|
19786
19755
|
|
|
19787
|
-
|
|
19756
|
+
const shadow = light.shadow;
|
|
19757
|
+
|
|
19758
|
+
if ( light.map ) {
|
|
19759
|
+
|
|
19760
|
+
state.spotLightMap[ numSpotMaps ] = light.map;
|
|
19761
|
+
numSpotMaps ++;
|
|
19762
|
+
|
|
19763
|
+
// make sure the lightMatrix is up to date
|
|
19764
|
+
// TODO : do it if required only
|
|
19765
|
+
shadow.updateMatrices( light );
|
|
19766
|
+
|
|
19767
|
+
if ( light.castShadow ) numSpotShadowsWithMaps ++;
|
|
19768
|
+
|
|
19769
|
+
}
|
|
19770
|
+
|
|
19771
|
+
state.spotLightMatrix[ spotLength ] = shadow.matrix;
|
|
19772
|
+
|
|
19773
|
+
if ( light.castShadow ) {
|
|
19788
19774
|
|
|
19789
19775
|
const shadowUniforms = shadowCache.get( light );
|
|
19790
19776
|
|
|
@@ -19795,14 +19781,11 @@
|
|
|
19795
19781
|
|
|
19796
19782
|
state.spotShadow[ spotLength ] = shadowUniforms;
|
|
19797
19783
|
state.spotShadowMap[ spotLength ] = shadowMap;
|
|
19798
|
-
state.spotShadowMatrix[ spotLength ] = light.shadow.matrix;
|
|
19799
19784
|
|
|
19800
19785
|
numSpotShadows ++;
|
|
19801
19786
|
|
|
19802
19787
|
}
|
|
19803
19788
|
|
|
19804
|
-
state.spot[ spotLength ] = uniforms;
|
|
19805
|
-
|
|
19806
19789
|
spotLength ++;
|
|
19807
19790
|
|
|
19808
19791
|
} else if ( light.isRectAreaLight ) {
|
|
@@ -19916,7 +19899,8 @@
|
|
|
19916
19899
|
hash.hemiLength !== hemiLength ||
|
|
19917
19900
|
hash.numDirectionalShadows !== numDirectionalShadows ||
|
|
19918
19901
|
hash.numPointShadows !== numPointShadows ||
|
|
19919
|
-
hash.numSpotShadows !== numSpotShadows
|
|
19902
|
+
hash.numSpotShadows !== numSpotShadows ||
|
|
19903
|
+
hash.numSpotMaps !== numSpotMaps ) {
|
|
19920
19904
|
|
|
19921
19905
|
state.directional.length = directionalLength;
|
|
19922
19906
|
state.spot.length = spotLength;
|
|
@@ -19932,7 +19916,9 @@
|
|
|
19932
19916
|
state.spotShadowMap.length = numSpotShadows;
|
|
19933
19917
|
state.directionalShadowMatrix.length = numDirectionalShadows;
|
|
19934
19918
|
state.pointShadowMatrix.length = numPointShadows;
|
|
19935
|
-
state.
|
|
19919
|
+
state.spotLightMatrix.length = numSpotShadows + numSpotMaps - numSpotShadowsWithMaps;
|
|
19920
|
+
state.spotLightMap.length = numSpotMaps;
|
|
19921
|
+
state.numSpotLightShadowsWithMaps = numSpotShadowsWithMaps;
|
|
19936
19922
|
|
|
19937
19923
|
hash.directionalLength = directionalLength;
|
|
19938
19924
|
hash.pointLength = pointLength;
|
|
@@ -19943,6 +19929,7 @@
|
|
|
19943
19929
|
hash.numDirectionalShadows = numDirectionalShadows;
|
|
19944
19930
|
hash.numPointShadows = numPointShadows;
|
|
19945
19931
|
hash.numSpotShadows = numSpotShadows;
|
|
19932
|
+
hash.numSpotMaps = numSpotMaps;
|
|
19946
19933
|
|
|
19947
19934
|
state.version = nextVersion ++;
|
|
19948
19935
|
|
|
@@ -20105,23 +20092,24 @@
|
|
|
20105
20092
|
|
|
20106
20093
|
function get( scene, renderCallDepth = 0 ) {
|
|
20107
20094
|
|
|
20095
|
+
const renderStateArray = renderStates.get( scene );
|
|
20108
20096
|
let renderState;
|
|
20109
20097
|
|
|
20110
|
-
if (
|
|
20098
|
+
if ( renderStateArray === undefined ) {
|
|
20111
20099
|
|
|
20112
20100
|
renderState = new WebGLRenderState( extensions, capabilities );
|
|
20113
20101
|
renderStates.set( scene, [ renderState ] );
|
|
20114
20102
|
|
|
20115
20103
|
} else {
|
|
20116
20104
|
|
|
20117
|
-
if ( renderCallDepth >=
|
|
20105
|
+
if ( renderCallDepth >= renderStateArray.length ) {
|
|
20118
20106
|
|
|
20119
20107
|
renderState = new WebGLRenderState( extensions, capabilities );
|
|
20120
|
-
|
|
20108
|
+
renderStateArray.push( renderState );
|
|
20121
20109
|
|
|
20122
20110
|
} else {
|
|
20123
20111
|
|
|
20124
|
-
renderState =
|
|
20112
|
+
renderState = renderStateArray[ renderCallDepth ];
|
|
20125
20113
|
|
|
20126
20114
|
}
|
|
20127
20115
|
|
|
@@ -23837,6 +23825,8 @@
|
|
|
23837
23825
|
if ( p === DepthStencilFormat ) return 34041;
|
|
23838
23826
|
if ( p === RedFormat ) return 6403;
|
|
23839
23827
|
|
|
23828
|
+
// @deprecated since r137
|
|
23829
|
+
|
|
23840
23830
|
if ( p === RGBFormat ) {
|
|
23841
23831
|
|
|
23842
23832
|
console.warn( 'THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228' );
|
|
@@ -24683,7 +24673,8 @@
|
|
|
24683
24673
|
{
|
|
24684
24674
|
format: RGBAFormat,
|
|
24685
24675
|
type: UnsignedByteType,
|
|
24686
|
-
encoding: renderer.outputEncoding
|
|
24676
|
+
encoding: renderer.outputEncoding,
|
|
24677
|
+
stencilBuffer: attributes.stencil
|
|
24687
24678
|
}
|
|
24688
24679
|
);
|
|
24689
24680
|
|
|
@@ -24927,11 +24918,8 @@
|
|
|
24927
24918
|
|
|
24928
24919
|
// update user camera and its children
|
|
24929
24920
|
|
|
24930
|
-
camera.position.copy( cameraVR.position );
|
|
24931
|
-
camera.quaternion.copy( cameraVR.quaternion );
|
|
24932
|
-
camera.scale.copy( cameraVR.scale );
|
|
24933
24921
|
camera.matrix.copy( cameraVR.matrix );
|
|
24934
|
-
camera.
|
|
24922
|
+
camera.matrix.decompose( camera.position, camera.quaternion, camera.scale );
|
|
24935
24923
|
|
|
24936
24924
|
const children = camera.children;
|
|
24937
24925
|
|
|
@@ -26972,6 +26960,28 @@
|
|
|
26972
26960
|
|
|
26973
26961
|
this.compile = function ( scene, camera ) {
|
|
26974
26962
|
|
|
26963
|
+
function prepare( material, scene, object ) {
|
|
26964
|
+
|
|
26965
|
+
if ( material.transparent === true && material.side === DoubleSide ) {
|
|
26966
|
+
|
|
26967
|
+
material.side = BackSide;
|
|
26968
|
+
material.needsUpdate = true;
|
|
26969
|
+
getProgram( material, scene, object );
|
|
26970
|
+
|
|
26971
|
+
material.side = FrontSide;
|
|
26972
|
+
material.needsUpdate = true;
|
|
26973
|
+
getProgram( material, scene, object );
|
|
26974
|
+
|
|
26975
|
+
material.side = DoubleSide;
|
|
26976
|
+
|
|
26977
|
+
} else {
|
|
26978
|
+
|
|
26979
|
+
getProgram( material, scene, object );
|
|
26980
|
+
|
|
26981
|
+
}
|
|
26982
|
+
|
|
26983
|
+
}
|
|
26984
|
+
|
|
26975
26985
|
currentRenderState = renderStates.get( scene );
|
|
26976
26986
|
currentRenderState.init();
|
|
26977
26987
|
|
|
@@ -27007,13 +27017,13 @@
|
|
|
27007
27017
|
|
|
27008
27018
|
const material2 = material[ i ];
|
|
27009
27019
|
|
|
27010
|
-
|
|
27020
|
+
prepare( material2, scene, object );
|
|
27011
27021
|
|
|
27012
27022
|
}
|
|
27013
27023
|
|
|
27014
27024
|
} else {
|
|
27015
27025
|
|
|
27016
|
-
|
|
27026
|
+
prepare( material, scene, object );
|
|
27017
27027
|
|
|
27018
27028
|
}
|
|
27019
27029
|
|
|
@@ -27080,11 +27090,11 @@
|
|
|
27080
27090
|
|
|
27081
27091
|
// update scene graph
|
|
27082
27092
|
|
|
27083
|
-
if ( scene.
|
|
27093
|
+
if ( scene.matrixWorldAutoUpdate === true ) scene.updateMatrixWorld();
|
|
27084
27094
|
|
|
27085
27095
|
// update camera matrices and frustum
|
|
27086
27096
|
|
|
27087
|
-
if ( camera.parent === null ) camera.updateMatrixWorld();
|
|
27097
|
+
if ( camera.parent === null && camera.matrixWorldAutoUpdate === true ) camera.updateMatrixWorld();
|
|
27088
27098
|
|
|
27089
27099
|
if ( xr.enabled === true && xr.isPresenting === true ) {
|
|
27090
27100
|
|
|
@@ -27553,7 +27563,8 @@
|
|
|
27553
27563
|
uniforms.directionalShadowMap.value = lights.state.directionalShadowMap;
|
|
27554
27564
|
uniforms.directionalShadowMatrix.value = lights.state.directionalShadowMatrix;
|
|
27555
27565
|
uniforms.spotShadowMap.value = lights.state.spotShadowMap;
|
|
27556
|
-
uniforms.
|
|
27566
|
+
uniforms.spotLightMatrix.value = lights.state.spotLightMatrix;
|
|
27567
|
+
uniforms.spotLightMap.value = lights.state.spotLightMap;
|
|
27557
27568
|
uniforms.pointShadowMap.value = lights.state.pointShadowMap;
|
|
27558
27569
|
uniforms.pointShadowMatrix.value = lights.state.pointShadowMatrix;
|
|
27559
27570
|
// TODO (abelnation): add area lights shadow info to uniforms
|
|
@@ -27851,7 +27862,6 @@
|
|
|
27851
27862
|
|
|
27852
27863
|
}
|
|
27853
27864
|
|
|
27854
|
-
|
|
27855
27865
|
if ( refreshMaterial || materialProperties.receiveShadow !== object.receiveShadow ) {
|
|
27856
27866
|
|
|
27857
27867
|
materialProperties.receiveShadow = object.receiveShadow;
|
|
@@ -27859,6 +27869,16 @@
|
|
|
27859
27869
|
|
|
27860
27870
|
}
|
|
27861
27871
|
|
|
27872
|
+
// https://github.com/mrdoob/three.js/pull/24467#issuecomment-1209031512
|
|
27873
|
+
|
|
27874
|
+
if ( material.isMeshGouraudMaterial && material.envMap !== null ) {
|
|
27875
|
+
|
|
27876
|
+
m_uniforms.envMap.value = envMap;
|
|
27877
|
+
|
|
27878
|
+
m_uniforms.flipEnvMap.value = ( envMap.isCubeTexture && envMap.isRenderTargetTexture === false ) ? - 1 : 1;
|
|
27879
|
+
|
|
27880
|
+
}
|
|
27881
|
+
|
|
27862
27882
|
if ( refreshMaterial ) {
|
|
27863
27883
|
|
|
27864
27884
|
p_uniforms.setValue( _gl, 'toneMappingExposure', _this.toneMappingExposure );
|
|
@@ -28390,8 +28410,6 @@
|
|
|
28390
28410
|
|
|
28391
28411
|
this.overrideMaterial = null;
|
|
28392
28412
|
|
|
28393
|
-
this.autoUpdate = true; // checked by the renderer
|
|
28394
|
-
|
|
28395
28413
|
if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
|
|
28396
28414
|
|
|
28397
28415
|
__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'observe', { detail: this } ) );
|
|
@@ -28410,7 +28428,6 @@
|
|
|
28410
28428
|
|
|
28411
28429
|
if ( source.overrideMaterial !== null ) this.overrideMaterial = source.overrideMaterial.clone();
|
|
28412
28430
|
|
|
28413
|
-
this.autoUpdate = source.autoUpdate;
|
|
28414
28431
|
this.matrixAutoUpdate = source.matrixAutoUpdate;
|
|
28415
28432
|
|
|
28416
28433
|
return this;
|
|
@@ -28427,6 +28444,22 @@
|
|
|
28427
28444
|
|
|
28428
28445
|
}
|
|
28429
28446
|
|
|
28447
|
+
// @deprecated
|
|
28448
|
+
|
|
28449
|
+
get autoUpdate() {
|
|
28450
|
+
|
|
28451
|
+
console.warn( 'THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144.' );
|
|
28452
|
+
return this.matrixWorldAutoUpdate;
|
|
28453
|
+
|
|
28454
|
+
}
|
|
28455
|
+
|
|
28456
|
+
set autoUpdate( value ) {
|
|
28457
|
+
|
|
28458
|
+
console.warn( 'THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144.' );
|
|
28459
|
+
this.matrixWorldAutoUpdate = value;
|
|
28460
|
+
|
|
28461
|
+
}
|
|
28462
|
+
|
|
28430
28463
|
}
|
|
28431
28464
|
|
|
28432
28465
|
class LineBasicMaterial extends Material {
|
|
@@ -28439,7 +28472,7 @@
|
|
|
28439
28472
|
|
|
28440
28473
|
this.type = 'LineBasicMaterial';
|
|
28441
28474
|
|
|
28442
|
-
this.color = new Color
|
|
28475
|
+
this.color = new Color( 0xffffff );
|
|
28443
28476
|
|
|
28444
28477
|
this.linewidth = 1;
|
|
28445
28478
|
this.linecap = 'round';
|
|
@@ -30749,7 +30782,7 @@
|
|
|
30749
30782
|
|
|
30750
30783
|
this.type = 'MeshLambertMaterial';
|
|
30751
30784
|
|
|
30752
|
-
this.color = new Color
|
|
30785
|
+
this.color = new Color( 0xffffff ); // diffuse
|
|
30753
30786
|
|
|
30754
30787
|
this.map = null;
|
|
30755
30788
|
|
|
@@ -30759,10 +30792,21 @@
|
|
|
30759
30792
|
this.aoMap = null;
|
|
30760
30793
|
this.aoMapIntensity = 1.0;
|
|
30761
30794
|
|
|
30762
|
-
this.emissive = new Color
|
|
30795
|
+
this.emissive = new Color( 0x000000 );
|
|
30763
30796
|
this.emissiveIntensity = 1.0;
|
|
30764
30797
|
this.emissiveMap = null;
|
|
30765
30798
|
|
|
30799
|
+
this.bumpMap = null;
|
|
30800
|
+
this.bumpScale = 1;
|
|
30801
|
+
|
|
30802
|
+
this.normalMap = null;
|
|
30803
|
+
this.normalMapType = TangentSpaceNormalMap;
|
|
30804
|
+
this.normalScale = new Vector2( 1, 1 );
|
|
30805
|
+
|
|
30806
|
+
this.displacementMap = null;
|
|
30807
|
+
this.displacementScale = 1;
|
|
30808
|
+
this.displacementBias = 0;
|
|
30809
|
+
|
|
30766
30810
|
this.specularMap = null;
|
|
30767
30811
|
|
|
30768
30812
|
this.alphaMap = null;
|
|
@@ -30777,6 +30821,8 @@
|
|
|
30777
30821
|
this.wireframeLinecap = 'round';
|
|
30778
30822
|
this.wireframeLinejoin = 'round';
|
|
30779
30823
|
|
|
30824
|
+
this.flatShading = false;
|
|
30825
|
+
|
|
30780
30826
|
this.fog = true;
|
|
30781
30827
|
|
|
30782
30828
|
this.setValues( parameters );
|
|
@@ -30801,6 +30847,17 @@
|
|
|
30801
30847
|
this.emissiveMap = source.emissiveMap;
|
|
30802
30848
|
this.emissiveIntensity = source.emissiveIntensity;
|
|
30803
30849
|
|
|
30850
|
+
this.bumpMap = source.bumpMap;
|
|
30851
|
+
this.bumpScale = source.bumpScale;
|
|
30852
|
+
|
|
30853
|
+
this.normalMap = source.normalMap;
|
|
30854
|
+
this.normalMapType = source.normalMapType;
|
|
30855
|
+
this.normalScale.copy( source.normalScale );
|
|
30856
|
+
|
|
30857
|
+
this.displacementMap = source.displacementMap;
|
|
30858
|
+
this.displacementScale = source.displacementScale;
|
|
30859
|
+
this.displacementBias = source.displacementBias;
|
|
30860
|
+
|
|
30804
30861
|
this.specularMap = source.specularMap;
|
|
30805
30862
|
|
|
30806
30863
|
this.alphaMap = source.alphaMap;
|
|
@@ -30815,6 +30872,8 @@
|
|
|
30815
30872
|
this.wireframeLinecap = source.wireframeLinecap;
|
|
30816
30873
|
this.wireframeLinejoin = source.wireframeLinejoin;
|
|
30817
30874
|
|
|
30875
|
+
this.flatShading = source.flatShading;
|
|
30876
|
+
|
|
30818
30877
|
this.fog = source.fog;
|
|
30819
30878
|
|
|
30820
30879
|
return this;
|
|
@@ -31201,7 +31260,7 @@
|
|
|
31201
31260
|
|
|
31202
31261
|
this.type = 'Light';
|
|
31203
31262
|
|
|
31204
|
-
this.color = new Color
|
|
31263
|
+
this.color = new Color( color );
|
|
31205
31264
|
this.intensity = intensity;
|
|
31206
31265
|
|
|
31207
31266
|
}
|
|
@@ -33221,7 +33280,7 @@
|
|
|
33221
33280
|
treeProto.y = tree_y;
|
|
33222
33281
|
treeProto.z = tree_z;
|
|
33223
33282
|
|
|
33224
|
-
function constant
|
|
33283
|
+
function constant(x) {
|
|
33225
33284
|
return function() {
|
|
33226
33285
|
return x;
|
|
33227
33286
|
};
|
|
@@ -33245,7 +33304,7 @@
|
|
|
33245
33304
|
var id = index$3,
|
|
33246
33305
|
strength = defaultStrength,
|
|
33247
33306
|
strengths,
|
|
33248
|
-
distance = constant
|
|
33307
|
+
distance = constant(30),
|
|
33249
33308
|
distances,
|
|
33250
33309
|
nodes,
|
|
33251
33310
|
nDim,
|
|
@@ -33343,11 +33402,11 @@
|
|
|
33343
33402
|
};
|
|
33344
33403
|
|
|
33345
33404
|
force.strength = function(_) {
|
|
33346
|
-
return arguments.length ? (strength = typeof _ === "function" ? _ : constant
|
|
33405
|
+
return arguments.length ? (strength = typeof _ === "function" ? _ : constant(+_), initializeStrength(), force) : strength;
|
|
33347
33406
|
};
|
|
33348
33407
|
|
|
33349
33408
|
force.distance = function(_) {
|
|
33350
|
-
return arguments.length ? (distance = typeof _ === "function" ? _ : constant
|
|
33409
|
+
return arguments.length ? (distance = typeof _ === "function" ? _ : constant(+_), initializeDistance(), force) : distance;
|
|
33351
33410
|
};
|
|
33352
33411
|
|
|
33353
33412
|
return force;
|
|
@@ -33759,7 +33818,7 @@
|
|
|
33759
33818
|
node,
|
|
33760
33819
|
random,
|
|
33761
33820
|
alpha,
|
|
33762
|
-
strength = constant
|
|
33821
|
+
strength = constant(-30),
|
|
33763
33822
|
strengths,
|
|
33764
33823
|
distanceMin2 = 1,
|
|
33765
33824
|
distanceMax2 = Infinity,
|
|
@@ -33868,7 +33927,7 @@
|
|
|
33868
33927
|
};
|
|
33869
33928
|
|
|
33870
33929
|
force.strength = function(_) {
|
|
33871
|
-
return arguments.length ? (strength = typeof _ === "function" ? _ : constant
|
|
33930
|
+
return arguments.length ? (strength = typeof _ === "function" ? _ : constant(+_), initialize(), force) : strength;
|
|
33872
33931
|
};
|
|
33873
33932
|
|
|
33874
33933
|
force.distanceMin = function(_) {
|
|
@@ -33889,11 +33948,11 @@
|
|
|
33889
33948
|
function forceRadial(radius, x, y, z) {
|
|
33890
33949
|
var nodes,
|
|
33891
33950
|
nDim,
|
|
33892
|
-
strength = constant
|
|
33951
|
+
strength = constant(0.1),
|
|
33893
33952
|
strengths,
|
|
33894
33953
|
radiuses;
|
|
33895
33954
|
|
|
33896
|
-
if (typeof radius !== "function") radius = constant
|
|
33955
|
+
if (typeof radius !== "function") radius = constant(+radius);
|
|
33897
33956
|
if (x == null) x = 0;
|
|
33898
33957
|
if (y == null) y = 0;
|
|
33899
33958
|
if (z == null) z = 0;
|
|
@@ -33930,11 +33989,11 @@
|
|
|
33930
33989
|
};
|
|
33931
33990
|
|
|
33932
33991
|
force.strength = function(_) {
|
|
33933
|
-
return arguments.length ? (strength = typeof _ === "function" ? _ : constant
|
|
33992
|
+
return arguments.length ? (strength = typeof _ === "function" ? _ : constant(+_), initialize(), force) : strength;
|
|
33934
33993
|
};
|
|
33935
33994
|
|
|
33936
33995
|
force.radius = function(_) {
|
|
33937
|
-
return arguments.length ? (radius = typeof _ === "function" ? _ : constant
|
|
33996
|
+
return arguments.length ? (radius = typeof _ === "function" ? _ : constant(+_), initialize(), force) : radius;
|
|
33938
33997
|
};
|
|
33939
33998
|
|
|
33940
33999
|
force.x = function(_) {
|
|
@@ -36715,78 +36774,7 @@ function InsertStackElement(node, body) {
|
|
|
36715
36774
|
};
|
|
36716
36775
|
}); // constant
|
|
36717
36776
|
|
|
36718
|
-
|
|
36719
|
-
return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
|
|
36720
|
-
}
|
|
36721
|
-
|
|
36722
|
-
function descending(a, b) {
|
|
36723
|
-
return a == null || b == null ? NaN
|
|
36724
|
-
: b < a ? -1
|
|
36725
|
-
: b > a ? 1
|
|
36726
|
-
: b >= a ? 0
|
|
36727
|
-
: NaN;
|
|
36728
|
-
}
|
|
36729
|
-
|
|
36730
|
-
function bisector(f) {
|
|
36731
|
-
let compare1, compare2, delta;
|
|
36732
|
-
|
|
36733
|
-
// If an accessor is specified, promote it to a comparator. In this case we
|
|
36734
|
-
// can test whether the search value is (self-) comparable. We can’t do this
|
|
36735
|
-
// for a comparator (except for specific, known comparators) because we can’t
|
|
36736
|
-
// tell if the comparator is symmetric, and an asymmetric comparator can’t be
|
|
36737
|
-
// used to test whether a single value is comparable.
|
|
36738
|
-
if (f.length !== 2) {
|
|
36739
|
-
compare1 = ascending;
|
|
36740
|
-
compare2 = (d, x) => ascending(f(d), x);
|
|
36741
|
-
delta = (d, x) => f(d) - x;
|
|
36742
|
-
} else {
|
|
36743
|
-
compare1 = f === ascending || f === descending ? f : zero;
|
|
36744
|
-
compare2 = f;
|
|
36745
|
-
delta = f;
|
|
36746
|
-
}
|
|
36747
|
-
|
|
36748
|
-
function left(a, x, lo = 0, hi = a.length) {
|
|
36749
|
-
if (lo < hi) {
|
|
36750
|
-
if (compare1(x, x) !== 0) return hi;
|
|
36751
|
-
do {
|
|
36752
|
-
const mid = (lo + hi) >>> 1;
|
|
36753
|
-
if (compare2(a[mid], x) < 0) lo = mid + 1;
|
|
36754
|
-
else hi = mid;
|
|
36755
|
-
} while (lo < hi);
|
|
36756
|
-
}
|
|
36757
|
-
return lo;
|
|
36758
|
-
}
|
|
36759
|
-
|
|
36760
|
-
function right(a, x, lo = 0, hi = a.length) {
|
|
36761
|
-
if (lo < hi) {
|
|
36762
|
-
if (compare1(x, x) !== 0) return hi;
|
|
36763
|
-
do {
|
|
36764
|
-
const mid = (lo + hi) >>> 1;
|
|
36765
|
-
if (compare2(a[mid], x) <= 0) lo = mid + 1;
|
|
36766
|
-
else hi = mid;
|
|
36767
|
-
} while (lo < hi);
|
|
36768
|
-
}
|
|
36769
|
-
return lo;
|
|
36770
|
-
}
|
|
36771
|
-
|
|
36772
|
-
function center(a, x, lo = 0, hi = a.length) {
|
|
36773
|
-
const i = left(a, x, lo, hi - 1);
|
|
36774
|
-
return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;
|
|
36775
|
-
}
|
|
36776
|
-
|
|
36777
|
-
return {left, center, right};
|
|
36778
|
-
}
|
|
36779
|
-
|
|
36780
|
-
function zero() {
|
|
36781
|
-
return 0;
|
|
36782
|
-
}
|
|
36783
|
-
|
|
36784
|
-
function number(x) {
|
|
36785
|
-
return x === null ? NaN : +x;
|
|
36786
|
-
}
|
|
36787
|
-
|
|
36788
|
-
bisector(ascending);
|
|
36789
|
-
bisector(number).center;
|
|
36777
|
+
var accessorFn = index$1;
|
|
36790
36778
|
|
|
36791
36779
|
class InternMap extends Map {
|
|
36792
36780
|
constructor(entries, key = keyof) {
|
|
@@ -36932,7 +36920,7 @@ function InsertStackElement(node, body) {
|
|
|
36932
36920
|
}
|
|
36933
36921
|
|
|
36934
36922
|
function _iterableToArrayLimit$3(arr, i) {
|
|
36935
|
-
var _i = arr
|
|
36923
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
36936
36924
|
|
|
36937
36925
|
if (_i == null) return;
|
|
36938
36926
|
var _arr = [];
|
|
@@ -37115,14 +37103,9 @@ function InsertStackElement(node, body) {
|
|
|
37115
37103
|
|
|
37116
37104
|
if (Object.getOwnPropertySymbols) {
|
|
37117
37105
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
37118
|
-
|
|
37119
|
-
|
|
37120
|
-
|
|
37121
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
37122
|
-
});
|
|
37123
|
-
}
|
|
37124
|
-
|
|
37125
|
-
keys.push.apply(keys, symbols);
|
|
37106
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
37107
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
37108
|
+
})), keys.push.apply(keys, symbols);
|
|
37126
37109
|
}
|
|
37127
37110
|
|
|
37128
37111
|
return keys;
|
|
@@ -37130,19 +37113,12 @@ function InsertStackElement(node, body) {
|
|
|
37130
37113
|
|
|
37131
37114
|
function _objectSpread2$1(target) {
|
|
37132
37115
|
for (var i = 1; i < arguments.length; i++) {
|
|
37133
|
-
var source = arguments[i]
|
|
37134
|
-
|
|
37135
|
-
|
|
37136
|
-
|
|
37137
|
-
|
|
37138
|
-
|
|
37139
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
37140
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
37141
|
-
} else {
|
|
37142
|
-
ownKeys$1(Object(source)).forEach(function (key) {
|
|
37143
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
37144
|
-
});
|
|
37145
|
-
}
|
|
37116
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
37117
|
+
i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) {
|
|
37118
|
+
_defineProperty$2(target, key, source[key]);
|
|
37119
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) {
|
|
37120
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
37121
|
+
});
|
|
37146
37122
|
}
|
|
37147
37123
|
|
|
37148
37124
|
return target;
|
|
@@ -37220,7 +37196,7 @@ function InsertStackElement(node, body) {
|
|
|
37220
37196
|
}
|
|
37221
37197
|
|
|
37222
37198
|
function _iterableToArrayLimit$2(arr, i) {
|
|
37223
|
-
var _i = arr
|
|
37199
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
37224
37200
|
|
|
37225
37201
|
if (_i == null) return;
|
|
37226
37202
|
var _arr = [];
|
|
@@ -37274,6 +37250,8 @@ function InsertStackElement(node, body) {
|
|
|
37274
37250
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
37275
37251
|
}
|
|
37276
37252
|
|
|
37253
|
+
var _excluded$1 = ["createObj", "updateObj", "exitObj", "objBindAttr", "dataBindAttr"];
|
|
37254
|
+
|
|
37277
37255
|
function diffArrays(prev, next, idAccessor) {
|
|
37278
37256
|
var result = {
|
|
37279
37257
|
enter: [],
|
|
@@ -37368,7 +37346,7 @@ function InsertStackElement(node, body) {
|
|
|
37368
37346
|
objBindAttr = _ref7$objBindAttr === void 0 ? '__obj' : _ref7$objBindAttr,
|
|
37369
37347
|
_ref7$dataBindAttr = _ref7.dataBindAttr,
|
|
37370
37348
|
dataBindAttr = _ref7$dataBindAttr === void 0 ? '__data' : _ref7$dataBindAttr,
|
|
37371
|
-
dataDiffOptions = _objectWithoutProperties$1(_ref7,
|
|
37349
|
+
dataDiffOptions = _objectWithoutProperties$1(_ref7, _excluded$1);
|
|
37372
37350
|
|
|
37373
37351
|
var _dataBindDiff = dataBindDiff(data, existingObjs, _objectSpread2$1({
|
|
37374
37352
|
objBindAttr: objBindAttr,
|
|
@@ -37471,2517 +37449,14 @@ function InsertStackElement(node, body) {
|
|
|
37471
37449
|
return scale;
|
|
37472
37450
|
}
|
|
37473
37451
|
|
|
37474
|
-
function define(constructor, factory, prototype) {
|
|
37475
|
-
constructor.prototype = factory.prototype = prototype;
|
|
37476
|
-
prototype.constructor = constructor;
|
|
37477
|
-
}
|
|
37478
|
-
|
|
37479
|
-
function extend(parent, definition) {
|
|
37480
|
-
var prototype = Object.create(parent.prototype);
|
|
37481
|
-
for (var key in definition) prototype[key] = definition[key];
|
|
37482
|
-
return prototype;
|
|
37483
|
-
}
|
|
37484
|
-
|
|
37485
|
-
function Color() {}
|
|
37486
|
-
|
|
37487
|
-
var darker = 0.7;
|
|
37488
|
-
var brighter = 1 / darker;
|
|
37489
|
-
|
|
37490
|
-
var reI = "\\s*([+-]?\\d+)\\s*",
|
|
37491
|
-
reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",
|
|
37492
|
-
reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",
|
|
37493
|
-
reHex = /^#([0-9a-f]{3,8})$/,
|
|
37494
|
-
reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`),
|
|
37495
|
-
reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`),
|
|
37496
|
-
reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`),
|
|
37497
|
-
reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`),
|
|
37498
|
-
reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`),
|
|
37499
|
-
reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`);
|
|
37500
|
-
|
|
37501
|
-
var named = {
|
|
37502
|
-
aliceblue: 0xf0f8ff,
|
|
37503
|
-
antiquewhite: 0xfaebd7,
|
|
37504
|
-
aqua: 0x00ffff,
|
|
37505
|
-
aquamarine: 0x7fffd4,
|
|
37506
|
-
azure: 0xf0ffff,
|
|
37507
|
-
beige: 0xf5f5dc,
|
|
37508
|
-
bisque: 0xffe4c4,
|
|
37509
|
-
black: 0x000000,
|
|
37510
|
-
blanchedalmond: 0xffebcd,
|
|
37511
|
-
blue: 0x0000ff,
|
|
37512
|
-
blueviolet: 0x8a2be2,
|
|
37513
|
-
brown: 0xa52a2a,
|
|
37514
|
-
burlywood: 0xdeb887,
|
|
37515
|
-
cadetblue: 0x5f9ea0,
|
|
37516
|
-
chartreuse: 0x7fff00,
|
|
37517
|
-
chocolate: 0xd2691e,
|
|
37518
|
-
coral: 0xff7f50,
|
|
37519
|
-
cornflowerblue: 0x6495ed,
|
|
37520
|
-
cornsilk: 0xfff8dc,
|
|
37521
|
-
crimson: 0xdc143c,
|
|
37522
|
-
cyan: 0x00ffff,
|
|
37523
|
-
darkblue: 0x00008b,
|
|
37524
|
-
darkcyan: 0x008b8b,
|
|
37525
|
-
darkgoldenrod: 0xb8860b,
|
|
37526
|
-
darkgray: 0xa9a9a9,
|
|
37527
|
-
darkgreen: 0x006400,
|
|
37528
|
-
darkgrey: 0xa9a9a9,
|
|
37529
|
-
darkkhaki: 0xbdb76b,
|
|
37530
|
-
darkmagenta: 0x8b008b,
|
|
37531
|
-
darkolivegreen: 0x556b2f,
|
|
37532
|
-
darkorange: 0xff8c00,
|
|
37533
|
-
darkorchid: 0x9932cc,
|
|
37534
|
-
darkred: 0x8b0000,
|
|
37535
|
-
darksalmon: 0xe9967a,
|
|
37536
|
-
darkseagreen: 0x8fbc8f,
|
|
37537
|
-
darkslateblue: 0x483d8b,
|
|
37538
|
-
darkslategray: 0x2f4f4f,
|
|
37539
|
-
darkslategrey: 0x2f4f4f,
|
|
37540
|
-
darkturquoise: 0x00ced1,
|
|
37541
|
-
darkviolet: 0x9400d3,
|
|
37542
|
-
deeppink: 0xff1493,
|
|
37543
|
-
deepskyblue: 0x00bfff,
|
|
37544
|
-
dimgray: 0x696969,
|
|
37545
|
-
dimgrey: 0x696969,
|
|
37546
|
-
dodgerblue: 0x1e90ff,
|
|
37547
|
-
firebrick: 0xb22222,
|
|
37548
|
-
floralwhite: 0xfffaf0,
|
|
37549
|
-
forestgreen: 0x228b22,
|
|
37550
|
-
fuchsia: 0xff00ff,
|
|
37551
|
-
gainsboro: 0xdcdcdc,
|
|
37552
|
-
ghostwhite: 0xf8f8ff,
|
|
37553
|
-
gold: 0xffd700,
|
|
37554
|
-
goldenrod: 0xdaa520,
|
|
37555
|
-
gray: 0x808080,
|
|
37556
|
-
green: 0x008000,
|
|
37557
|
-
greenyellow: 0xadff2f,
|
|
37558
|
-
grey: 0x808080,
|
|
37559
|
-
honeydew: 0xf0fff0,
|
|
37560
|
-
hotpink: 0xff69b4,
|
|
37561
|
-
indianred: 0xcd5c5c,
|
|
37562
|
-
indigo: 0x4b0082,
|
|
37563
|
-
ivory: 0xfffff0,
|
|
37564
|
-
khaki: 0xf0e68c,
|
|
37565
|
-
lavender: 0xe6e6fa,
|
|
37566
|
-
lavenderblush: 0xfff0f5,
|
|
37567
|
-
lawngreen: 0x7cfc00,
|
|
37568
|
-
lemonchiffon: 0xfffacd,
|
|
37569
|
-
lightblue: 0xadd8e6,
|
|
37570
|
-
lightcoral: 0xf08080,
|
|
37571
|
-
lightcyan: 0xe0ffff,
|
|
37572
|
-
lightgoldenrodyellow: 0xfafad2,
|
|
37573
|
-
lightgray: 0xd3d3d3,
|
|
37574
|
-
lightgreen: 0x90ee90,
|
|
37575
|
-
lightgrey: 0xd3d3d3,
|
|
37576
|
-
lightpink: 0xffb6c1,
|
|
37577
|
-
lightsalmon: 0xffa07a,
|
|
37578
|
-
lightseagreen: 0x20b2aa,
|
|
37579
|
-
lightskyblue: 0x87cefa,
|
|
37580
|
-
lightslategray: 0x778899,
|
|
37581
|
-
lightslategrey: 0x778899,
|
|
37582
|
-
lightsteelblue: 0xb0c4de,
|
|
37583
|
-
lightyellow: 0xffffe0,
|
|
37584
|
-
lime: 0x00ff00,
|
|
37585
|
-
limegreen: 0x32cd32,
|
|
37586
|
-
linen: 0xfaf0e6,
|
|
37587
|
-
magenta: 0xff00ff,
|
|
37588
|
-
maroon: 0x800000,
|
|
37589
|
-
mediumaquamarine: 0x66cdaa,
|
|
37590
|
-
mediumblue: 0x0000cd,
|
|
37591
|
-
mediumorchid: 0xba55d3,
|
|
37592
|
-
mediumpurple: 0x9370db,
|
|
37593
|
-
mediumseagreen: 0x3cb371,
|
|
37594
|
-
mediumslateblue: 0x7b68ee,
|
|
37595
|
-
mediumspringgreen: 0x00fa9a,
|
|
37596
|
-
mediumturquoise: 0x48d1cc,
|
|
37597
|
-
mediumvioletred: 0xc71585,
|
|
37598
|
-
midnightblue: 0x191970,
|
|
37599
|
-
mintcream: 0xf5fffa,
|
|
37600
|
-
mistyrose: 0xffe4e1,
|
|
37601
|
-
moccasin: 0xffe4b5,
|
|
37602
|
-
navajowhite: 0xffdead,
|
|
37603
|
-
navy: 0x000080,
|
|
37604
|
-
oldlace: 0xfdf5e6,
|
|
37605
|
-
olive: 0x808000,
|
|
37606
|
-
olivedrab: 0x6b8e23,
|
|
37607
|
-
orange: 0xffa500,
|
|
37608
|
-
orangered: 0xff4500,
|
|
37609
|
-
orchid: 0xda70d6,
|
|
37610
|
-
palegoldenrod: 0xeee8aa,
|
|
37611
|
-
palegreen: 0x98fb98,
|
|
37612
|
-
paleturquoise: 0xafeeee,
|
|
37613
|
-
palevioletred: 0xdb7093,
|
|
37614
|
-
papayawhip: 0xffefd5,
|
|
37615
|
-
peachpuff: 0xffdab9,
|
|
37616
|
-
peru: 0xcd853f,
|
|
37617
|
-
pink: 0xffc0cb,
|
|
37618
|
-
plum: 0xdda0dd,
|
|
37619
|
-
powderblue: 0xb0e0e6,
|
|
37620
|
-
purple: 0x800080,
|
|
37621
|
-
rebeccapurple: 0x663399,
|
|
37622
|
-
red: 0xff0000,
|
|
37623
|
-
rosybrown: 0xbc8f8f,
|
|
37624
|
-
royalblue: 0x4169e1,
|
|
37625
|
-
saddlebrown: 0x8b4513,
|
|
37626
|
-
salmon: 0xfa8072,
|
|
37627
|
-
sandybrown: 0xf4a460,
|
|
37628
|
-
seagreen: 0x2e8b57,
|
|
37629
|
-
seashell: 0xfff5ee,
|
|
37630
|
-
sienna: 0xa0522d,
|
|
37631
|
-
silver: 0xc0c0c0,
|
|
37632
|
-
skyblue: 0x87ceeb,
|
|
37633
|
-
slateblue: 0x6a5acd,
|
|
37634
|
-
slategray: 0x708090,
|
|
37635
|
-
slategrey: 0x708090,
|
|
37636
|
-
snow: 0xfffafa,
|
|
37637
|
-
springgreen: 0x00ff7f,
|
|
37638
|
-
steelblue: 0x4682b4,
|
|
37639
|
-
tan: 0xd2b48c,
|
|
37640
|
-
teal: 0x008080,
|
|
37641
|
-
thistle: 0xd8bfd8,
|
|
37642
|
-
tomato: 0xff6347,
|
|
37643
|
-
turquoise: 0x40e0d0,
|
|
37644
|
-
violet: 0xee82ee,
|
|
37645
|
-
wheat: 0xf5deb3,
|
|
37646
|
-
white: 0xffffff,
|
|
37647
|
-
whitesmoke: 0xf5f5f5,
|
|
37648
|
-
yellow: 0xffff00,
|
|
37649
|
-
yellowgreen: 0x9acd32
|
|
37650
|
-
};
|
|
37651
|
-
|
|
37652
|
-
define(Color, color, {
|
|
37653
|
-
copy(channels) {
|
|
37654
|
-
return Object.assign(new this.constructor, this, channels);
|
|
37655
|
-
},
|
|
37656
|
-
displayable() {
|
|
37657
|
-
return this.rgb().displayable();
|
|
37658
|
-
},
|
|
37659
|
-
hex: color_formatHex, // Deprecated! Use color.formatHex.
|
|
37660
|
-
formatHex: color_formatHex,
|
|
37661
|
-
formatHex8: color_formatHex8,
|
|
37662
|
-
formatHsl: color_formatHsl,
|
|
37663
|
-
formatRgb: color_formatRgb,
|
|
37664
|
-
toString: color_formatRgb
|
|
37665
|
-
});
|
|
37666
|
-
|
|
37667
|
-
function color_formatHex() {
|
|
37668
|
-
return this.rgb().formatHex();
|
|
37669
|
-
}
|
|
37670
|
-
|
|
37671
|
-
function color_formatHex8() {
|
|
37672
|
-
return this.rgb().formatHex8();
|
|
37673
|
-
}
|
|
37674
|
-
|
|
37675
|
-
function color_formatHsl() {
|
|
37676
|
-
return hslConvert(this).formatHsl();
|
|
37677
|
-
}
|
|
37678
|
-
|
|
37679
|
-
function color_formatRgb() {
|
|
37680
|
-
return this.rgb().formatRgb();
|
|
37681
|
-
}
|
|
37682
|
-
|
|
37683
|
-
function color(format) {
|
|
37684
|
-
var m, l;
|
|
37685
|
-
format = (format + "").trim().toLowerCase();
|
|
37686
|
-
return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000
|
|
37687
|
-
: l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00
|
|
37688
|
-
: l === 8 ? rgba$1(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000
|
|
37689
|
-
: l === 4 ? rgba$1((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000
|
|
37690
|
-
: null) // invalid hex
|
|
37691
|
-
: (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)
|
|
37692
|
-
: (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)
|
|
37693
|
-
: (m = reRgbaInteger.exec(format)) ? rgba$1(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)
|
|
37694
|
-
: (m = reRgbaPercent.exec(format)) ? rgba$1(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)
|
|
37695
|
-
: (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)
|
|
37696
|
-
: (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)
|
|
37697
|
-
: named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins
|
|
37698
|
-
: format === "transparent" ? new Rgb(NaN, NaN, NaN, 0)
|
|
37699
|
-
: null;
|
|
37700
|
-
}
|
|
37701
|
-
|
|
37702
|
-
function rgbn(n) {
|
|
37703
|
-
return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);
|
|
37704
|
-
}
|
|
37705
|
-
|
|
37706
|
-
function rgba$1(r, g, b, a) {
|
|
37707
|
-
if (a <= 0) r = g = b = NaN;
|
|
37708
|
-
return new Rgb(r, g, b, a);
|
|
37709
|
-
}
|
|
37710
|
-
|
|
37711
|
-
function rgbConvert(o) {
|
|
37712
|
-
if (!(o instanceof Color)) o = color(o);
|
|
37713
|
-
if (!o) return new Rgb;
|
|
37714
|
-
o = o.rgb();
|
|
37715
|
-
return new Rgb(o.r, o.g, o.b, o.opacity);
|
|
37716
|
-
}
|
|
37717
|
-
|
|
37718
|
-
function rgb$1(r, g, b, opacity) {
|
|
37719
|
-
return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
|
|
37720
|
-
}
|
|
37721
|
-
|
|
37722
|
-
function Rgb(r, g, b, opacity) {
|
|
37723
|
-
this.r = +r;
|
|
37724
|
-
this.g = +g;
|
|
37725
|
-
this.b = +b;
|
|
37726
|
-
this.opacity = +opacity;
|
|
37727
|
-
}
|
|
37728
|
-
|
|
37729
|
-
define(Rgb, rgb$1, extend(Color, {
|
|
37730
|
-
brighter(k) {
|
|
37731
|
-
k = k == null ? brighter : Math.pow(brighter, k);
|
|
37732
|
-
return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
|
|
37733
|
-
},
|
|
37734
|
-
darker(k) {
|
|
37735
|
-
k = k == null ? darker : Math.pow(darker, k);
|
|
37736
|
-
return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
|
|
37737
|
-
},
|
|
37738
|
-
rgb() {
|
|
37739
|
-
return this;
|
|
37740
|
-
},
|
|
37741
|
-
clamp() {
|
|
37742
|
-
return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));
|
|
37743
|
-
},
|
|
37744
|
-
displayable() {
|
|
37745
|
-
return (-0.5 <= this.r && this.r < 255.5)
|
|
37746
|
-
&& (-0.5 <= this.g && this.g < 255.5)
|
|
37747
|
-
&& (-0.5 <= this.b && this.b < 255.5)
|
|
37748
|
-
&& (0 <= this.opacity && this.opacity <= 1);
|
|
37749
|
-
},
|
|
37750
|
-
hex: rgb_formatHex, // Deprecated! Use color.formatHex.
|
|
37751
|
-
formatHex: rgb_formatHex,
|
|
37752
|
-
formatHex8: rgb_formatHex8,
|
|
37753
|
-
formatRgb: rgb_formatRgb,
|
|
37754
|
-
toString: rgb_formatRgb
|
|
37755
|
-
}));
|
|
37756
|
-
|
|
37757
|
-
function rgb_formatHex() {
|
|
37758
|
-
return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;
|
|
37759
|
-
}
|
|
37760
|
-
|
|
37761
|
-
function rgb_formatHex8() {
|
|
37762
|
-
return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
|
|
37763
|
-
}
|
|
37764
|
-
|
|
37765
|
-
function rgb_formatRgb() {
|
|
37766
|
-
const a = clampa(this.opacity);
|
|
37767
|
-
return `${a === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? ")" : `, ${a})`}`;
|
|
37768
|
-
}
|
|
37769
|
-
|
|
37770
|
-
function clampa(opacity) {
|
|
37771
|
-
return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));
|
|
37772
|
-
}
|
|
37773
|
-
|
|
37774
|
-
function clampi(value) {
|
|
37775
|
-
return Math.max(0, Math.min(255, Math.round(value) || 0));
|
|
37776
|
-
}
|
|
37777
|
-
|
|
37778
|
-
function hex(value) {
|
|
37779
|
-
value = clampi(value);
|
|
37780
|
-
return (value < 16 ? "0" : "") + value.toString(16);
|
|
37781
|
-
}
|
|
37782
|
-
|
|
37783
|
-
function hsla(h, s, l, a) {
|
|
37784
|
-
if (a <= 0) h = s = l = NaN;
|
|
37785
|
-
else if (l <= 0 || l >= 1) h = s = NaN;
|
|
37786
|
-
else if (s <= 0) h = NaN;
|
|
37787
|
-
return new Hsl(h, s, l, a);
|
|
37788
|
-
}
|
|
37789
|
-
|
|
37790
|
-
function hslConvert(o) {
|
|
37791
|
-
if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
|
|
37792
|
-
if (!(o instanceof Color)) o = color(o);
|
|
37793
|
-
if (!o) return new Hsl;
|
|
37794
|
-
if (o instanceof Hsl) return o;
|
|
37795
|
-
o = o.rgb();
|
|
37796
|
-
var r = o.r / 255,
|
|
37797
|
-
g = o.g / 255,
|
|
37798
|
-
b = o.b / 255,
|
|
37799
|
-
min = Math.min(r, g, b),
|
|
37800
|
-
max = Math.max(r, g, b),
|
|
37801
|
-
h = NaN,
|
|
37802
|
-
s = max - min,
|
|
37803
|
-
l = (max + min) / 2;
|
|
37804
|
-
if (s) {
|
|
37805
|
-
if (r === max) h = (g - b) / s + (g < b) * 6;
|
|
37806
|
-
else if (g === max) h = (b - r) / s + 2;
|
|
37807
|
-
else h = (r - g) / s + 4;
|
|
37808
|
-
s /= l < 0.5 ? max + min : 2 - max - min;
|
|
37809
|
-
h *= 60;
|
|
37810
|
-
} else {
|
|
37811
|
-
s = l > 0 && l < 1 ? 0 : h;
|
|
37812
|
-
}
|
|
37813
|
-
return new Hsl(h, s, l, o.opacity);
|
|
37814
|
-
}
|
|
37815
|
-
|
|
37816
|
-
function hsl(h, s, l, opacity) {
|
|
37817
|
-
return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);
|
|
37818
|
-
}
|
|
37819
|
-
|
|
37820
|
-
function Hsl(h, s, l, opacity) {
|
|
37821
|
-
this.h = +h;
|
|
37822
|
-
this.s = +s;
|
|
37823
|
-
this.l = +l;
|
|
37824
|
-
this.opacity = +opacity;
|
|
37825
|
-
}
|
|
37826
|
-
|
|
37827
|
-
define(Hsl, hsl, extend(Color, {
|
|
37828
|
-
brighter(k) {
|
|
37829
|
-
k = k == null ? brighter : Math.pow(brighter, k);
|
|
37830
|
-
return new Hsl(this.h, this.s, this.l * k, this.opacity);
|
|
37831
|
-
},
|
|
37832
|
-
darker(k) {
|
|
37833
|
-
k = k == null ? darker : Math.pow(darker, k);
|
|
37834
|
-
return new Hsl(this.h, this.s, this.l * k, this.opacity);
|
|
37835
|
-
},
|
|
37836
|
-
rgb() {
|
|
37837
|
-
var h = this.h % 360 + (this.h < 0) * 360,
|
|
37838
|
-
s = isNaN(h) || isNaN(this.s) ? 0 : this.s,
|
|
37839
|
-
l = this.l,
|
|
37840
|
-
m2 = l + (l < 0.5 ? l : 1 - l) * s,
|
|
37841
|
-
m1 = 2 * l - m2;
|
|
37842
|
-
return new Rgb(
|
|
37843
|
-
hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
|
|
37844
|
-
hsl2rgb(h, m1, m2),
|
|
37845
|
-
hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),
|
|
37846
|
-
this.opacity
|
|
37847
|
-
);
|
|
37848
|
-
},
|
|
37849
|
-
clamp() {
|
|
37850
|
-
return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));
|
|
37851
|
-
},
|
|
37852
|
-
displayable() {
|
|
37853
|
-
return (0 <= this.s && this.s <= 1 || isNaN(this.s))
|
|
37854
|
-
&& (0 <= this.l && this.l <= 1)
|
|
37855
|
-
&& (0 <= this.opacity && this.opacity <= 1);
|
|
37856
|
-
},
|
|
37857
|
-
formatHsl() {
|
|
37858
|
-
const a = clampa(this.opacity);
|
|
37859
|
-
return `${a === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? ")" : `, ${a})`}`;
|
|
37860
|
-
}
|
|
37861
|
-
}));
|
|
37862
|
-
|
|
37863
|
-
function clamph(value) {
|
|
37864
|
-
value = (value || 0) % 360;
|
|
37865
|
-
return value < 0 ? value + 360 : value;
|
|
37866
|
-
}
|
|
37867
|
-
|
|
37868
|
-
function clampt(value) {
|
|
37869
|
-
return Math.max(0, Math.min(1, value || 0));
|
|
37870
|
-
}
|
|
37871
|
-
|
|
37872
|
-
/* From FvD 13.37, CSS Color Module Level 3 */
|
|
37873
|
-
function hsl2rgb(h, m1, m2) {
|
|
37874
|
-
return (h < 60 ? m1 + (m2 - m1) * h / 60
|
|
37875
|
-
: h < 180 ? m2
|
|
37876
|
-
: h < 240 ? m1 + (m2 - m1) * (240 - h) / 60
|
|
37877
|
-
: m1) * 255;
|
|
37878
|
-
}
|
|
37879
|
-
|
|
37880
|
-
const radians = Math.PI / 180;
|
|
37881
|
-
const degrees = 180 / Math.PI;
|
|
37882
|
-
|
|
37883
|
-
// https://observablehq.com/@mbostock/lab-and-rgb
|
|
37884
|
-
const K = 18,
|
|
37885
|
-
Xn = 0.96422,
|
|
37886
|
-
Yn = 1,
|
|
37887
|
-
Zn = 0.82521,
|
|
37888
|
-
t0$1 = 4 / 29,
|
|
37889
|
-
t1$1 = 6 / 29,
|
|
37890
|
-
t2 = 3 * t1$1 * t1$1,
|
|
37891
|
-
t3 = t1$1 * t1$1 * t1$1;
|
|
37892
|
-
|
|
37893
|
-
function labConvert(o) {
|
|
37894
|
-
if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);
|
|
37895
|
-
if (o instanceof Hcl) return hcl2lab(o);
|
|
37896
|
-
if (!(o instanceof Rgb)) o = rgbConvert(o);
|
|
37897
|
-
var r = rgb2lrgb(o.r),
|
|
37898
|
-
g = rgb2lrgb(o.g),
|
|
37899
|
-
b = rgb2lrgb(o.b),
|
|
37900
|
-
y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z;
|
|
37901
|
-
if (r === g && g === b) x = z = y; else {
|
|
37902
|
-
x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);
|
|
37903
|
-
z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);
|
|
37904
|
-
}
|
|
37905
|
-
return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);
|
|
37906
|
-
}
|
|
37907
|
-
|
|
37908
|
-
function lab(l, a, b, opacity) {
|
|
37909
|
-
return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);
|
|
37910
|
-
}
|
|
37911
|
-
|
|
37912
|
-
function Lab(l, a, b, opacity) {
|
|
37913
|
-
this.l = +l;
|
|
37914
|
-
this.a = +a;
|
|
37915
|
-
this.b = +b;
|
|
37916
|
-
this.opacity = +opacity;
|
|
37917
|
-
}
|
|
37918
|
-
|
|
37919
|
-
define(Lab, lab, extend(Color, {
|
|
37920
|
-
brighter(k) {
|
|
37921
|
-
return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);
|
|
37922
|
-
},
|
|
37923
|
-
darker(k) {
|
|
37924
|
-
return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);
|
|
37925
|
-
},
|
|
37926
|
-
rgb() {
|
|
37927
|
-
var y = (this.l + 16) / 116,
|
|
37928
|
-
x = isNaN(this.a) ? y : y + this.a / 500,
|
|
37929
|
-
z = isNaN(this.b) ? y : y - this.b / 200;
|
|
37930
|
-
x = Xn * lab2xyz(x);
|
|
37931
|
-
y = Yn * lab2xyz(y);
|
|
37932
|
-
z = Zn * lab2xyz(z);
|
|
37933
|
-
return new Rgb(
|
|
37934
|
-
lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z),
|
|
37935
|
-
lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z),
|
|
37936
|
-
lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z),
|
|
37937
|
-
this.opacity
|
|
37938
|
-
);
|
|
37939
|
-
}
|
|
37940
|
-
}));
|
|
37941
|
-
|
|
37942
|
-
function xyz2lab(t) {
|
|
37943
|
-
return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0$1;
|
|
37944
|
-
}
|
|
37945
|
-
|
|
37946
|
-
function lab2xyz(t) {
|
|
37947
|
-
return t > t1$1 ? t * t * t : t2 * (t - t0$1);
|
|
37948
|
-
}
|
|
37949
|
-
|
|
37950
|
-
function lrgb2rgb(x) {
|
|
37951
|
-
return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);
|
|
37952
|
-
}
|
|
37953
|
-
|
|
37954
|
-
function rgb2lrgb(x) {
|
|
37955
|
-
return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);
|
|
37956
|
-
}
|
|
37957
|
-
|
|
37958
|
-
function hclConvert(o) {
|
|
37959
|
-
if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);
|
|
37960
|
-
if (!(o instanceof Lab)) o = labConvert(o);
|
|
37961
|
-
if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);
|
|
37962
|
-
var h = Math.atan2(o.b, o.a) * degrees;
|
|
37963
|
-
return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);
|
|
37964
|
-
}
|
|
37965
|
-
|
|
37966
|
-
function hcl(h, c, l, opacity) {
|
|
37967
|
-
return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);
|
|
37968
|
-
}
|
|
37969
|
-
|
|
37970
|
-
function Hcl(h, c, l, opacity) {
|
|
37971
|
-
this.h = +h;
|
|
37972
|
-
this.c = +c;
|
|
37973
|
-
this.l = +l;
|
|
37974
|
-
this.opacity = +opacity;
|
|
37975
|
-
}
|
|
37976
|
-
|
|
37977
|
-
function hcl2lab(o) {
|
|
37978
|
-
if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity);
|
|
37979
|
-
var h = o.h * radians;
|
|
37980
|
-
return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);
|
|
37981
|
-
}
|
|
37982
|
-
|
|
37983
|
-
define(Hcl, hcl, extend(Color, {
|
|
37984
|
-
brighter(k) {
|
|
37985
|
-
return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);
|
|
37986
|
-
},
|
|
37987
|
-
darker(k) {
|
|
37988
|
-
return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);
|
|
37989
|
-
},
|
|
37990
|
-
rgb() {
|
|
37991
|
-
return hcl2lab(this).rgb();
|
|
37992
|
-
}
|
|
37993
|
-
}));
|
|
37994
|
-
|
|
37995
|
-
var A = -0.14861,
|
|
37996
|
-
B = +1.78277,
|
|
37997
|
-
C = -0.29227,
|
|
37998
|
-
D = -0.90649,
|
|
37999
|
-
E = +1.97294,
|
|
38000
|
-
ED = E * D,
|
|
38001
|
-
EB = E * B,
|
|
38002
|
-
BC_DA = B * C - D * A;
|
|
38003
|
-
|
|
38004
|
-
function cubehelixConvert(o) {
|
|
38005
|
-
if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);
|
|
38006
|
-
if (!(o instanceof Rgb)) o = rgbConvert(o);
|
|
38007
|
-
var r = o.r / 255,
|
|
38008
|
-
g = o.g / 255,
|
|
38009
|
-
b = o.b / 255,
|
|
38010
|
-
l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),
|
|
38011
|
-
bl = b - l,
|
|
38012
|
-
k = (E * (g - l) - C * bl) / D,
|
|
38013
|
-
s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1
|
|
38014
|
-
h = s ? Math.atan2(k, bl) * degrees - 120 : NaN;
|
|
38015
|
-
return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);
|
|
38016
|
-
}
|
|
38017
|
-
|
|
38018
|
-
function cubehelix$1(h, s, l, opacity) {
|
|
38019
|
-
return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);
|
|
38020
|
-
}
|
|
38021
|
-
|
|
38022
|
-
function Cubehelix(h, s, l, opacity) {
|
|
38023
|
-
this.h = +h;
|
|
38024
|
-
this.s = +s;
|
|
38025
|
-
this.l = +l;
|
|
38026
|
-
this.opacity = +opacity;
|
|
38027
|
-
}
|
|
38028
|
-
|
|
38029
|
-
define(Cubehelix, cubehelix$1, extend(Color, {
|
|
38030
|
-
brighter(k) {
|
|
38031
|
-
k = k == null ? brighter : Math.pow(brighter, k);
|
|
38032
|
-
return new Cubehelix(this.h, this.s, this.l * k, this.opacity);
|
|
38033
|
-
},
|
|
38034
|
-
darker(k) {
|
|
38035
|
-
k = k == null ? darker : Math.pow(darker, k);
|
|
38036
|
-
return new Cubehelix(this.h, this.s, this.l * k, this.opacity);
|
|
38037
|
-
},
|
|
38038
|
-
rgb() {
|
|
38039
|
-
var h = isNaN(this.h) ? 0 : (this.h + 120) * radians,
|
|
38040
|
-
l = +this.l,
|
|
38041
|
-
a = isNaN(this.s) ? 0 : this.s * l * (1 - l),
|
|
38042
|
-
cosh = Math.cos(h),
|
|
38043
|
-
sinh = Math.sin(h);
|
|
38044
|
-
return new Rgb(
|
|
38045
|
-
255 * (l + a * (A * cosh + B * sinh)),
|
|
38046
|
-
255 * (l + a * (C * cosh + D * sinh)),
|
|
38047
|
-
255 * (l + a * (E * cosh)),
|
|
38048
|
-
this.opacity
|
|
38049
|
-
);
|
|
38050
|
-
}
|
|
38051
|
-
}));
|
|
38052
|
-
|
|
38053
|
-
function basis(t1, v0, v1, v2, v3) {
|
|
38054
|
-
var t2 = t1 * t1, t3 = t2 * t1;
|
|
38055
|
-
return ((1 - 3 * t1 + 3 * t2 - t3) * v0
|
|
38056
|
-
+ (4 - 6 * t2 + 3 * t3) * v1
|
|
38057
|
-
+ (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2
|
|
38058
|
-
+ t3 * v3) / 6;
|
|
38059
|
-
}
|
|
38060
|
-
|
|
38061
|
-
function basis$1(values) {
|
|
38062
|
-
var n = values.length - 1;
|
|
38063
|
-
return function(t) {
|
|
38064
|
-
var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),
|
|
38065
|
-
v1 = values[i],
|
|
38066
|
-
v2 = values[i + 1],
|
|
38067
|
-
v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,
|
|
38068
|
-
v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;
|
|
38069
|
-
return basis((t - i / n) * n, v0, v1, v2, v3);
|
|
38070
|
-
};
|
|
38071
|
-
}
|
|
38072
|
-
|
|
38073
|
-
var constant = x => () => x;
|
|
38074
|
-
|
|
38075
|
-
function linear(a, d) {
|
|
38076
|
-
return function(t) {
|
|
38077
|
-
return a + t * d;
|
|
38078
|
-
};
|
|
38079
|
-
}
|
|
38080
|
-
|
|
38081
|
-
function exponential(a, b, y) {
|
|
38082
|
-
return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {
|
|
38083
|
-
return Math.pow(a + t * b, y);
|
|
38084
|
-
};
|
|
38085
|
-
}
|
|
38086
|
-
|
|
38087
|
-
function hue(a, b) {
|
|
38088
|
-
var d = b - a;
|
|
38089
|
-
return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);
|
|
38090
|
-
}
|
|
38091
|
-
|
|
38092
|
-
function gamma(y) {
|
|
38093
|
-
return (y = +y) === 1 ? nogamma : function(a, b) {
|
|
38094
|
-
return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);
|
|
38095
|
-
};
|
|
38096
|
-
}
|
|
38097
|
-
|
|
38098
|
-
function nogamma(a, b) {
|
|
38099
|
-
var d = b - a;
|
|
38100
|
-
return d ? linear(a, d) : constant(isNaN(a) ? b : a);
|
|
38101
|
-
}
|
|
38102
|
-
|
|
38103
|
-
((function rgbGamma(y) {
|
|
38104
|
-
var color = gamma(y);
|
|
38105
|
-
|
|
38106
|
-
function rgb(start, end) {
|
|
38107
|
-
var r = color((start = rgb$1(start)).r, (end = rgb$1(end)).r),
|
|
38108
|
-
g = color(start.g, end.g),
|
|
38109
|
-
b = color(start.b, end.b),
|
|
38110
|
-
opacity = nogamma(start.opacity, end.opacity);
|
|
38111
|
-
return function(t) {
|
|
38112
|
-
start.r = r(t);
|
|
38113
|
-
start.g = g(t);
|
|
38114
|
-
start.b = b(t);
|
|
38115
|
-
start.opacity = opacity(t);
|
|
38116
|
-
return start + "";
|
|
38117
|
-
};
|
|
38118
|
-
}
|
|
38119
|
-
|
|
38120
|
-
rgb.gamma = rgbGamma;
|
|
38121
|
-
|
|
38122
|
-
return rgb;
|
|
38123
|
-
}))(1);
|
|
38124
|
-
|
|
38125
|
-
function rgbSpline(spline) {
|
|
38126
|
-
return function(colors) {
|
|
38127
|
-
var n = colors.length,
|
|
38128
|
-
r = new Array(n),
|
|
38129
|
-
g = new Array(n),
|
|
38130
|
-
b = new Array(n),
|
|
38131
|
-
i, color;
|
|
38132
|
-
for (i = 0; i < n; ++i) {
|
|
38133
|
-
color = rgb$1(colors[i]);
|
|
38134
|
-
r[i] = color.r || 0;
|
|
38135
|
-
g[i] = color.g || 0;
|
|
38136
|
-
b[i] = color.b || 0;
|
|
38137
|
-
}
|
|
38138
|
-
r = spline(r);
|
|
38139
|
-
g = spline(g);
|
|
38140
|
-
b = spline(b);
|
|
38141
|
-
color.opacity = 1;
|
|
38142
|
-
return function(t) {
|
|
38143
|
-
color.r = r(t);
|
|
38144
|
-
color.g = g(t);
|
|
38145
|
-
color.b = b(t);
|
|
38146
|
-
return color + "";
|
|
38147
|
-
};
|
|
38148
|
-
};
|
|
38149
|
-
}
|
|
38150
|
-
|
|
38151
|
-
var rgbBasis = rgbSpline(basis$1);
|
|
38152
|
-
|
|
38153
|
-
var epsilon2 = 1e-12;
|
|
38154
|
-
|
|
38155
|
-
function cosh(x) {
|
|
38156
|
-
return ((x = Math.exp(x)) + 1 / x) / 2;
|
|
38157
|
-
}
|
|
38158
|
-
|
|
38159
|
-
function sinh(x) {
|
|
38160
|
-
return ((x = Math.exp(x)) - 1 / x) / 2;
|
|
38161
|
-
}
|
|
38162
|
-
|
|
38163
|
-
function tanh(x) {
|
|
38164
|
-
return ((x = Math.exp(2 * x)) - 1) / (x + 1);
|
|
38165
|
-
}
|
|
38166
|
-
|
|
38167
|
-
((function zoomRho(rho, rho2, rho4) {
|
|
38168
|
-
|
|
38169
|
-
// p0 = [ux0, uy0, w0]
|
|
38170
|
-
// p1 = [ux1, uy1, w1]
|
|
38171
|
-
function zoom(p0, p1) {
|
|
38172
|
-
var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],
|
|
38173
|
-
ux1 = p1[0], uy1 = p1[1], w1 = p1[2],
|
|
38174
|
-
dx = ux1 - ux0,
|
|
38175
|
-
dy = uy1 - uy0,
|
|
38176
|
-
d2 = dx * dx + dy * dy,
|
|
38177
|
-
i,
|
|
38178
|
-
S;
|
|
38179
|
-
|
|
38180
|
-
// Special case for u0 ≅ u1.
|
|
38181
|
-
if (d2 < epsilon2) {
|
|
38182
|
-
S = Math.log(w1 / w0) / rho;
|
|
38183
|
-
i = function(t) {
|
|
38184
|
-
return [
|
|
38185
|
-
ux0 + t * dx,
|
|
38186
|
-
uy0 + t * dy,
|
|
38187
|
-
w0 * Math.exp(rho * t * S)
|
|
38188
|
-
];
|
|
38189
|
-
};
|
|
38190
|
-
}
|
|
38191
|
-
|
|
38192
|
-
// General case.
|
|
38193
|
-
else {
|
|
38194
|
-
var d1 = Math.sqrt(d2),
|
|
38195
|
-
b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),
|
|
38196
|
-
b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),
|
|
38197
|
-
r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),
|
|
38198
|
-
r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
|
|
38199
|
-
S = (r1 - r0) / rho;
|
|
38200
|
-
i = function(t) {
|
|
38201
|
-
var s = t * S,
|
|
38202
|
-
coshr0 = cosh(r0),
|
|
38203
|
-
u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));
|
|
38204
|
-
return [
|
|
38205
|
-
ux0 + u * dx,
|
|
38206
|
-
uy0 + u * dy,
|
|
38207
|
-
w0 * coshr0 / cosh(rho * s + r0)
|
|
38208
|
-
];
|
|
38209
|
-
};
|
|
38210
|
-
}
|
|
38211
|
-
|
|
38212
|
-
i.duration = S * 1000 * rho / Math.SQRT2;
|
|
38213
|
-
|
|
38214
|
-
return i;
|
|
38215
|
-
}
|
|
38216
|
-
|
|
38217
|
-
zoom.rho = function(_) {
|
|
38218
|
-
var _1 = Math.max(1e-3, +_), _2 = _1 * _1, _4 = _2 * _2;
|
|
38219
|
-
return zoomRho(_1, _2, _4);
|
|
38220
|
-
};
|
|
38221
|
-
|
|
38222
|
-
return zoom;
|
|
38223
|
-
}))(Math.SQRT2, 2, 4);
|
|
38224
|
-
|
|
38225
|
-
function cubehelix(hue) {
|
|
38226
|
-
return (function cubehelixGamma(y) {
|
|
38227
|
-
y = +y;
|
|
38228
|
-
|
|
38229
|
-
function cubehelix(start, end) {
|
|
38230
|
-
var h = hue((start = cubehelix$1(start)).h, (end = cubehelix$1(end)).h),
|
|
38231
|
-
s = nogamma(start.s, end.s),
|
|
38232
|
-
l = nogamma(start.l, end.l),
|
|
38233
|
-
opacity = nogamma(start.opacity, end.opacity);
|
|
38234
|
-
return function(t) {
|
|
38235
|
-
start.h = h(t);
|
|
38236
|
-
start.s = s(t);
|
|
38237
|
-
start.l = l(Math.pow(t, y));
|
|
38238
|
-
start.opacity = opacity(t);
|
|
38239
|
-
return start + "";
|
|
38240
|
-
};
|
|
38241
|
-
}
|
|
38242
|
-
|
|
38243
|
-
cubehelix.gamma = cubehelixGamma;
|
|
38244
|
-
|
|
38245
|
-
return cubehelix;
|
|
38246
|
-
})(1);
|
|
38247
|
-
}
|
|
38248
|
-
|
|
38249
|
-
cubehelix(hue);
|
|
38250
|
-
var cubehelixLong = cubehelix(nogamma);
|
|
38251
|
-
|
|
38252
|
-
function formatDecimal(x) {
|
|
38253
|
-
return Math.abs(x = Math.round(x)) >= 1e21
|
|
38254
|
-
? x.toLocaleString("en").replace(/,/g, "")
|
|
38255
|
-
: x.toString(10);
|
|
38256
|
-
}
|
|
38257
|
-
|
|
38258
|
-
// Computes the decimal coefficient and exponent of the specified number x with
|
|
38259
|
-
// significant digits p, where x is positive and p is in [1, 21] or undefined.
|
|
38260
|
-
// For example, formatDecimalParts(1.23) returns ["123", 0].
|
|
38261
|
-
function formatDecimalParts(x, p) {
|
|
38262
|
-
if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null; // NaN, ±Infinity
|
|
38263
|
-
var i, coefficient = x.slice(0, i);
|
|
38264
|
-
|
|
38265
|
-
// The string returned by toExponential either has the form \d\.\d+e[-+]\d+
|
|
38266
|
-
// (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3).
|
|
38267
|
-
return [
|
|
38268
|
-
coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,
|
|
38269
|
-
+x.slice(i + 1)
|
|
38270
|
-
];
|
|
38271
|
-
}
|
|
38272
|
-
|
|
38273
|
-
function exponent(x) {
|
|
38274
|
-
return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;
|
|
38275
|
-
}
|
|
38276
|
-
|
|
38277
|
-
function formatGroup(grouping, thousands) {
|
|
38278
|
-
return function(value, width) {
|
|
38279
|
-
var i = value.length,
|
|
38280
|
-
t = [],
|
|
38281
|
-
j = 0,
|
|
38282
|
-
g = grouping[0],
|
|
38283
|
-
length = 0;
|
|
38284
|
-
|
|
38285
|
-
while (i > 0 && g > 0) {
|
|
38286
|
-
if (length + g + 1 > width) g = Math.max(1, width - length);
|
|
38287
|
-
t.push(value.substring(i -= g, i + g));
|
|
38288
|
-
if ((length += g + 1) > width) break;
|
|
38289
|
-
g = grouping[j = (j + 1) % grouping.length];
|
|
38290
|
-
}
|
|
38291
|
-
|
|
38292
|
-
return t.reverse().join(thousands);
|
|
38293
|
-
};
|
|
38294
|
-
}
|
|
38295
|
-
|
|
38296
|
-
function formatNumerals(numerals) {
|
|
38297
|
-
return function(value) {
|
|
38298
|
-
return value.replace(/[0-9]/g, function(i) {
|
|
38299
|
-
return numerals[+i];
|
|
38300
|
-
});
|
|
38301
|
-
};
|
|
38302
|
-
}
|
|
38303
|
-
|
|
38304
|
-
// [[fill]align][sign][symbol][0][width][,][.precision][~][type]
|
|
38305
|
-
var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
|
|
38306
|
-
|
|
38307
|
-
function formatSpecifier(specifier) {
|
|
38308
|
-
if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier);
|
|
38309
|
-
var match;
|
|
38310
|
-
return new FormatSpecifier({
|
|
38311
|
-
fill: match[1],
|
|
38312
|
-
align: match[2],
|
|
38313
|
-
sign: match[3],
|
|
38314
|
-
symbol: match[4],
|
|
38315
|
-
zero: match[5],
|
|
38316
|
-
width: match[6],
|
|
38317
|
-
comma: match[7],
|
|
38318
|
-
precision: match[8] && match[8].slice(1),
|
|
38319
|
-
trim: match[9],
|
|
38320
|
-
type: match[10]
|
|
38321
|
-
});
|
|
38322
|
-
}
|
|
38323
|
-
|
|
38324
|
-
formatSpecifier.prototype = FormatSpecifier.prototype; // instanceof
|
|
38325
|
-
|
|
38326
|
-
function FormatSpecifier(specifier) {
|
|
38327
|
-
this.fill = specifier.fill === undefined ? " " : specifier.fill + "";
|
|
38328
|
-
this.align = specifier.align === undefined ? ">" : specifier.align + "";
|
|
38329
|
-
this.sign = specifier.sign === undefined ? "-" : specifier.sign + "";
|
|
38330
|
-
this.symbol = specifier.symbol === undefined ? "" : specifier.symbol + "";
|
|
38331
|
-
this.zero = !!specifier.zero;
|
|
38332
|
-
this.width = specifier.width === undefined ? undefined : +specifier.width;
|
|
38333
|
-
this.comma = !!specifier.comma;
|
|
38334
|
-
this.precision = specifier.precision === undefined ? undefined : +specifier.precision;
|
|
38335
|
-
this.trim = !!specifier.trim;
|
|
38336
|
-
this.type = specifier.type === undefined ? "" : specifier.type + "";
|
|
38337
|
-
}
|
|
38338
|
-
|
|
38339
|
-
FormatSpecifier.prototype.toString = function() {
|
|
38340
|
-
return this.fill
|
|
38341
|
-
+ this.align
|
|
38342
|
-
+ this.sign
|
|
38343
|
-
+ this.symbol
|
|
38344
|
-
+ (this.zero ? "0" : "")
|
|
38345
|
-
+ (this.width === undefined ? "" : Math.max(1, this.width | 0))
|
|
38346
|
-
+ (this.comma ? "," : "")
|
|
38347
|
-
+ (this.precision === undefined ? "" : "." + Math.max(0, this.precision | 0))
|
|
38348
|
-
+ (this.trim ? "~" : "")
|
|
38349
|
-
+ this.type;
|
|
38350
|
-
};
|
|
38351
|
-
|
|
38352
|
-
// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.
|
|
38353
|
-
function formatTrim(s) {
|
|
38354
|
-
out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {
|
|
38355
|
-
switch (s[i]) {
|
|
38356
|
-
case ".": i0 = i1 = i; break;
|
|
38357
|
-
case "0": if (i0 === 0) i0 = i; i1 = i; break;
|
|
38358
|
-
default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break;
|
|
38359
|
-
}
|
|
38360
|
-
}
|
|
38361
|
-
return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;
|
|
38362
|
-
}
|
|
38363
|
-
|
|
38364
|
-
var prefixExponent;
|
|
38365
|
-
|
|
38366
|
-
function formatPrefixAuto(x, p) {
|
|
38367
|
-
var d = formatDecimalParts(x, p);
|
|
38368
|
-
if (!d) return x + "";
|
|
38369
|
-
var coefficient = d[0],
|
|
38370
|
-
exponent = d[1],
|
|
38371
|
-
i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,
|
|
38372
|
-
n = coefficient.length;
|
|
38373
|
-
return i === n ? coefficient
|
|
38374
|
-
: i > n ? coefficient + new Array(i - n + 1).join("0")
|
|
38375
|
-
: i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i)
|
|
38376
|
-
: "0." + new Array(1 - i).join("0") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!
|
|
38377
|
-
}
|
|
38378
|
-
|
|
38379
|
-
function formatRounded(x, p) {
|
|
38380
|
-
var d = formatDecimalParts(x, p);
|
|
38381
|
-
if (!d) return x + "";
|
|
38382
|
-
var coefficient = d[0],
|
|
38383
|
-
exponent = d[1];
|
|
38384
|
-
return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient
|
|
38385
|
-
: coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1)
|
|
38386
|
-
: coefficient + new Array(exponent - coefficient.length + 2).join("0");
|
|
38387
|
-
}
|
|
38388
|
-
|
|
38389
|
-
var formatTypes = {
|
|
38390
|
-
"%": (x, p) => (x * 100).toFixed(p),
|
|
38391
|
-
"b": (x) => Math.round(x).toString(2),
|
|
38392
|
-
"c": (x) => x + "",
|
|
38393
|
-
"d": formatDecimal,
|
|
38394
|
-
"e": (x, p) => x.toExponential(p),
|
|
38395
|
-
"f": (x, p) => x.toFixed(p),
|
|
38396
|
-
"g": (x, p) => x.toPrecision(p),
|
|
38397
|
-
"o": (x) => Math.round(x).toString(8),
|
|
38398
|
-
"p": (x, p) => formatRounded(x * 100, p),
|
|
38399
|
-
"r": formatRounded,
|
|
38400
|
-
"s": formatPrefixAuto,
|
|
38401
|
-
"X": (x) => Math.round(x).toString(16).toUpperCase(),
|
|
38402
|
-
"x": (x) => Math.round(x).toString(16)
|
|
38403
|
-
};
|
|
38404
|
-
|
|
38405
|
-
function identity(x) {
|
|
38406
|
-
return x;
|
|
38407
|
-
}
|
|
38408
|
-
|
|
38409
|
-
var map = Array.prototype.map,
|
|
38410
|
-
prefixes = ["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];
|
|
38411
|
-
|
|
38412
|
-
function formatLocale$1(locale) {
|
|
38413
|
-
var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + ""),
|
|
38414
|
-
currencyPrefix = locale.currency === undefined ? "" : locale.currency[0] + "",
|
|
38415
|
-
currencySuffix = locale.currency === undefined ? "" : locale.currency[1] + "",
|
|
38416
|
-
decimal = locale.decimal === undefined ? "." : locale.decimal + "",
|
|
38417
|
-
numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),
|
|
38418
|
-
percent = locale.percent === undefined ? "%" : locale.percent + "",
|
|
38419
|
-
minus = locale.minus === undefined ? "−" : locale.minus + "",
|
|
38420
|
-
nan = locale.nan === undefined ? "NaN" : locale.nan + "";
|
|
38421
|
-
|
|
38422
|
-
function newFormat(specifier) {
|
|
38423
|
-
specifier = formatSpecifier(specifier);
|
|
38424
|
-
|
|
38425
|
-
var fill = specifier.fill,
|
|
38426
|
-
align = specifier.align,
|
|
38427
|
-
sign = specifier.sign,
|
|
38428
|
-
symbol = specifier.symbol,
|
|
38429
|
-
zero = specifier.zero,
|
|
38430
|
-
width = specifier.width,
|
|
38431
|
-
comma = specifier.comma,
|
|
38432
|
-
precision = specifier.precision,
|
|
38433
|
-
trim = specifier.trim,
|
|
38434
|
-
type = specifier.type;
|
|
38435
|
-
|
|
38436
|
-
// The "n" type is an alias for ",g".
|
|
38437
|
-
if (type === "n") comma = true, type = "g";
|
|
38438
|
-
|
|
38439
|
-
// The "" type, and any invalid type, is an alias for ".12~g".
|
|
38440
|
-
else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = "g";
|
|
38441
|
-
|
|
38442
|
-
// If zero fill is specified, padding goes after sign and before digits.
|
|
38443
|
-
if (zero || (fill === "0" && align === "=")) zero = true, fill = "0", align = "=";
|
|
38444
|
-
|
|
38445
|
-
// Compute the prefix and suffix.
|
|
38446
|
-
// For SI-prefix, the suffix is lazily computed.
|
|
38447
|
-
var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "",
|
|
38448
|
-
suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : "";
|
|
38449
|
-
|
|
38450
|
-
// What format function should we use?
|
|
38451
|
-
// Is this an integer type?
|
|
38452
|
-
// Can this type generate exponential notation?
|
|
38453
|
-
var formatType = formatTypes[type],
|
|
38454
|
-
maybeSuffix = /[defgprs%]/.test(type);
|
|
38455
|
-
|
|
38456
|
-
// Set the default precision if not specified,
|
|
38457
|
-
// or clamp the specified precision to the supported range.
|
|
38458
|
-
// For significant precision, it must be in [1, 21].
|
|
38459
|
-
// For fixed precision, it must be in [0, 20].
|
|
38460
|
-
precision = precision === undefined ? 6
|
|
38461
|
-
: /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))
|
|
38462
|
-
: Math.max(0, Math.min(20, precision));
|
|
38463
|
-
|
|
38464
|
-
function format(value) {
|
|
38465
|
-
var valuePrefix = prefix,
|
|
38466
|
-
valueSuffix = suffix,
|
|
38467
|
-
i, n, c;
|
|
38468
|
-
|
|
38469
|
-
if (type === "c") {
|
|
38470
|
-
valueSuffix = formatType(value) + valueSuffix;
|
|
38471
|
-
value = "";
|
|
38472
|
-
} else {
|
|
38473
|
-
value = +value;
|
|
38474
|
-
|
|
38475
|
-
// Determine the sign. -0 is not less than 0, but 1 / -0 is!
|
|
38476
|
-
var valueNegative = value < 0 || 1 / value < 0;
|
|
38477
|
-
|
|
38478
|
-
// Perform the initial formatting.
|
|
38479
|
-
value = isNaN(value) ? nan : formatType(Math.abs(value), precision);
|
|
38480
|
-
|
|
38481
|
-
// Trim insignificant zeros.
|
|
38482
|
-
if (trim) value = formatTrim(value);
|
|
38483
|
-
|
|
38484
|
-
// If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.
|
|
38485
|
-
if (valueNegative && +value === 0 && sign !== "+") valueNegative = false;
|
|
38486
|
-
|
|
38487
|
-
// Compute the prefix and suffix.
|
|
38488
|
-
valuePrefix = (valueNegative ? (sign === "(" ? sign : minus) : sign === "-" || sign === "(" ? "" : sign) + valuePrefix;
|
|
38489
|
-
valueSuffix = (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : "");
|
|
38490
|
-
|
|
38491
|
-
// Break the formatted value into the integer “value” part that can be
|
|
38492
|
-
// grouped, and fractional or exponential “suffix” part that is not.
|
|
38493
|
-
if (maybeSuffix) {
|
|
38494
|
-
i = -1, n = value.length;
|
|
38495
|
-
while (++i < n) {
|
|
38496
|
-
if (c = value.charCodeAt(i), 48 > c || c > 57) {
|
|
38497
|
-
valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;
|
|
38498
|
-
value = value.slice(0, i);
|
|
38499
|
-
break;
|
|
38500
|
-
}
|
|
38501
|
-
}
|
|
38502
|
-
}
|
|
38503
|
-
}
|
|
38504
|
-
|
|
38505
|
-
// If the fill character is not "0", grouping is applied before padding.
|
|
38506
|
-
if (comma && !zero) value = group(value, Infinity);
|
|
38507
|
-
|
|
38508
|
-
// Compute the padding.
|
|
38509
|
-
var length = valuePrefix.length + value.length + valueSuffix.length,
|
|
38510
|
-
padding = length < width ? new Array(width - length + 1).join(fill) : "";
|
|
38511
|
-
|
|
38512
|
-
// If the fill character is "0", grouping is applied after padding.
|
|
38513
|
-
if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = "";
|
|
38514
|
-
|
|
38515
|
-
// Reconstruct the final output based on the desired alignment.
|
|
38516
|
-
switch (align) {
|
|
38517
|
-
case "<": value = valuePrefix + value + valueSuffix + padding; break;
|
|
38518
|
-
case "=": value = valuePrefix + padding + value + valueSuffix; break;
|
|
38519
|
-
case "^": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;
|
|
38520
|
-
default: value = padding + valuePrefix + value + valueSuffix; break;
|
|
38521
|
-
}
|
|
38522
|
-
|
|
38523
|
-
return numerals(value);
|
|
38524
|
-
}
|
|
38525
|
-
|
|
38526
|
-
format.toString = function() {
|
|
38527
|
-
return specifier + "";
|
|
38528
|
-
};
|
|
38529
|
-
|
|
38530
|
-
return format;
|
|
38531
|
-
}
|
|
38532
|
-
|
|
38533
|
-
function formatPrefix(specifier, value) {
|
|
38534
|
-
var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)),
|
|
38535
|
-
e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,
|
|
38536
|
-
k = Math.pow(10, -e),
|
|
38537
|
-
prefix = prefixes[8 + e / 3];
|
|
38538
|
-
return function(value) {
|
|
38539
|
-
return f(k * value) + prefix;
|
|
38540
|
-
};
|
|
38541
|
-
}
|
|
38542
|
-
|
|
38543
|
-
return {
|
|
38544
|
-
format: newFormat,
|
|
38545
|
-
formatPrefix: formatPrefix
|
|
38546
|
-
};
|
|
38547
|
-
}
|
|
38548
|
-
|
|
38549
|
-
var locale$1;
|
|
38550
|
-
|
|
38551
|
-
defaultLocale$1({
|
|
38552
|
-
thousands: ",",
|
|
38553
|
-
grouping: [3],
|
|
38554
|
-
currency: ["$", ""]
|
|
38555
|
-
});
|
|
38556
|
-
|
|
38557
|
-
function defaultLocale$1(definition) {
|
|
38558
|
-
locale$1 = formatLocale$1(definition);
|
|
38559
|
-
locale$1.format;
|
|
38560
|
-
locale$1.formatPrefix;
|
|
38561
|
-
return locale$1;
|
|
38562
|
-
}
|
|
38563
|
-
|
|
38564
|
-
var t0 = new Date,
|
|
38565
|
-
t1 = new Date;
|
|
38566
|
-
|
|
38567
|
-
function newInterval(floori, offseti, count, field) {
|
|
38568
|
-
|
|
38569
|
-
function interval(date) {
|
|
38570
|
-
return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;
|
|
38571
|
-
}
|
|
38572
|
-
|
|
38573
|
-
interval.floor = function(date) {
|
|
38574
|
-
return floori(date = new Date(+date)), date;
|
|
38575
|
-
};
|
|
38576
|
-
|
|
38577
|
-
interval.ceil = function(date) {
|
|
38578
|
-
return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;
|
|
38579
|
-
};
|
|
38580
|
-
|
|
38581
|
-
interval.round = function(date) {
|
|
38582
|
-
var d0 = interval(date),
|
|
38583
|
-
d1 = interval.ceil(date);
|
|
38584
|
-
return date - d0 < d1 - date ? d0 : d1;
|
|
38585
|
-
};
|
|
38586
|
-
|
|
38587
|
-
interval.offset = function(date, step) {
|
|
38588
|
-
return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;
|
|
38589
|
-
};
|
|
38590
|
-
|
|
38591
|
-
interval.range = function(start, stop, step) {
|
|
38592
|
-
var range = [], previous;
|
|
38593
|
-
start = interval.ceil(start);
|
|
38594
|
-
step = step == null ? 1 : Math.floor(step);
|
|
38595
|
-
if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date
|
|
38596
|
-
do range.push(previous = new Date(+start)), offseti(start, step), floori(start);
|
|
38597
|
-
while (previous < start && start < stop);
|
|
38598
|
-
return range;
|
|
38599
|
-
};
|
|
38600
|
-
|
|
38601
|
-
interval.filter = function(test) {
|
|
38602
|
-
return newInterval(function(date) {
|
|
38603
|
-
if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);
|
|
38604
|
-
}, function(date, step) {
|
|
38605
|
-
if (date >= date) {
|
|
38606
|
-
if (step < 0) while (++step <= 0) {
|
|
38607
|
-
while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty
|
|
38608
|
-
} else while (--step >= 0) {
|
|
38609
|
-
while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty
|
|
38610
|
-
}
|
|
38611
|
-
}
|
|
38612
|
-
});
|
|
38613
|
-
};
|
|
38614
|
-
|
|
38615
|
-
if (count) {
|
|
38616
|
-
interval.count = function(start, end) {
|
|
38617
|
-
t0.setTime(+start), t1.setTime(+end);
|
|
38618
|
-
floori(t0), floori(t1);
|
|
38619
|
-
return Math.floor(count(t0, t1));
|
|
38620
|
-
};
|
|
38621
|
-
|
|
38622
|
-
interval.every = function(step) {
|
|
38623
|
-
step = Math.floor(step);
|
|
38624
|
-
return !isFinite(step) || !(step > 0) ? null
|
|
38625
|
-
: !(step > 1) ? interval
|
|
38626
|
-
: interval.filter(field
|
|
38627
|
-
? function(d) { return field(d) % step === 0; }
|
|
38628
|
-
: function(d) { return interval.count(0, d) % step === 0; });
|
|
38629
|
-
};
|
|
38630
|
-
}
|
|
38631
|
-
|
|
38632
|
-
return interval;
|
|
38633
|
-
}
|
|
38634
|
-
|
|
38635
|
-
var millisecond = newInterval(function() {
|
|
38636
|
-
// noop
|
|
38637
|
-
}, function(date, step) {
|
|
38638
|
-
date.setTime(+date + step);
|
|
38639
|
-
}, function(start, end) {
|
|
38640
|
-
return end - start;
|
|
38641
|
-
});
|
|
38642
|
-
|
|
38643
|
-
// An optimized implementation for this simple case.
|
|
38644
|
-
millisecond.every = function(k) {
|
|
38645
|
-
k = Math.floor(k);
|
|
38646
|
-
if (!isFinite(k) || !(k > 0)) return null;
|
|
38647
|
-
if (!(k > 1)) return millisecond;
|
|
38648
|
-
return newInterval(function(date) {
|
|
38649
|
-
date.setTime(Math.floor(date / k) * k);
|
|
38650
|
-
}, function(date, step) {
|
|
38651
|
-
date.setTime(+date + step * k);
|
|
38652
|
-
}, function(start, end) {
|
|
38653
|
-
return (end - start) / k;
|
|
38654
|
-
});
|
|
38655
|
-
};
|
|
38656
|
-
millisecond.range;
|
|
38657
|
-
|
|
38658
|
-
const durationSecond = 1000;
|
|
38659
|
-
const durationMinute = durationSecond * 60;
|
|
38660
|
-
const durationHour = durationMinute * 60;
|
|
38661
|
-
const durationDay = durationHour * 24;
|
|
38662
|
-
const durationWeek = durationDay * 7;
|
|
38663
|
-
|
|
38664
|
-
var second = newInterval(function(date) {
|
|
38665
|
-
date.setTime(date - date.getMilliseconds());
|
|
38666
|
-
}, function(date, step) {
|
|
38667
|
-
date.setTime(+date + step * durationSecond);
|
|
38668
|
-
}, function(start, end) {
|
|
38669
|
-
return (end - start) / durationSecond;
|
|
38670
|
-
}, function(date) {
|
|
38671
|
-
return date.getUTCSeconds();
|
|
38672
|
-
});
|
|
38673
|
-
second.range;
|
|
38674
|
-
|
|
38675
|
-
var minute = newInterval(function(date) {
|
|
38676
|
-
date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);
|
|
38677
|
-
}, function(date, step) {
|
|
38678
|
-
date.setTime(+date + step * durationMinute);
|
|
38679
|
-
}, function(start, end) {
|
|
38680
|
-
return (end - start) / durationMinute;
|
|
38681
|
-
}, function(date) {
|
|
38682
|
-
return date.getMinutes();
|
|
38683
|
-
});
|
|
38684
|
-
minute.range;
|
|
38685
|
-
|
|
38686
|
-
var hour = newInterval(function(date) {
|
|
38687
|
-
date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);
|
|
38688
|
-
}, function(date, step) {
|
|
38689
|
-
date.setTime(+date + step * durationHour);
|
|
38690
|
-
}, function(start, end) {
|
|
38691
|
-
return (end - start) / durationHour;
|
|
38692
|
-
}, function(date) {
|
|
38693
|
-
return date.getHours();
|
|
38694
|
-
});
|
|
38695
|
-
hour.range;
|
|
38696
|
-
|
|
38697
|
-
var day = newInterval(
|
|
38698
|
-
date => date.setHours(0, 0, 0, 0),
|
|
38699
|
-
(date, step) => date.setDate(date.getDate() + step),
|
|
38700
|
-
(start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,
|
|
38701
|
-
date => date.getDate() - 1
|
|
38702
|
-
);
|
|
38703
|
-
day.range;
|
|
38704
|
-
|
|
38705
|
-
function weekday(i) {
|
|
38706
|
-
return newInterval(function(date) {
|
|
38707
|
-
date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);
|
|
38708
|
-
date.setHours(0, 0, 0, 0);
|
|
38709
|
-
}, function(date, step) {
|
|
38710
|
-
date.setDate(date.getDate() + step * 7);
|
|
38711
|
-
}, function(start, end) {
|
|
38712
|
-
return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;
|
|
38713
|
-
});
|
|
38714
|
-
}
|
|
38715
|
-
|
|
38716
|
-
var sunday = weekday(0);
|
|
38717
|
-
var monday = weekday(1);
|
|
38718
|
-
var tuesday = weekday(2);
|
|
38719
|
-
var wednesday = weekday(3);
|
|
38720
|
-
var thursday = weekday(4);
|
|
38721
|
-
var friday = weekday(5);
|
|
38722
|
-
var saturday = weekday(6);
|
|
38723
|
-
|
|
38724
|
-
sunday.range;
|
|
38725
|
-
monday.range;
|
|
38726
|
-
tuesday.range;
|
|
38727
|
-
wednesday.range;
|
|
38728
|
-
thursday.range;
|
|
38729
|
-
friday.range;
|
|
38730
|
-
saturday.range;
|
|
38731
|
-
|
|
38732
|
-
var month = newInterval(function(date) {
|
|
38733
|
-
date.setDate(1);
|
|
38734
|
-
date.setHours(0, 0, 0, 0);
|
|
38735
|
-
}, function(date, step) {
|
|
38736
|
-
date.setMonth(date.getMonth() + step);
|
|
38737
|
-
}, function(start, end) {
|
|
38738
|
-
return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;
|
|
38739
|
-
}, function(date) {
|
|
38740
|
-
return date.getMonth();
|
|
38741
|
-
});
|
|
38742
|
-
month.range;
|
|
38743
|
-
|
|
38744
|
-
var year = newInterval(function(date) {
|
|
38745
|
-
date.setMonth(0, 1);
|
|
38746
|
-
date.setHours(0, 0, 0, 0);
|
|
38747
|
-
}, function(date, step) {
|
|
38748
|
-
date.setFullYear(date.getFullYear() + step);
|
|
38749
|
-
}, function(start, end) {
|
|
38750
|
-
return end.getFullYear() - start.getFullYear();
|
|
38751
|
-
}, function(date) {
|
|
38752
|
-
return date.getFullYear();
|
|
38753
|
-
});
|
|
38754
|
-
|
|
38755
|
-
// An optimized implementation for this simple case.
|
|
38756
|
-
year.every = function(k) {
|
|
38757
|
-
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date) {
|
|
38758
|
-
date.setFullYear(Math.floor(date.getFullYear() / k) * k);
|
|
38759
|
-
date.setMonth(0, 1);
|
|
38760
|
-
date.setHours(0, 0, 0, 0);
|
|
38761
|
-
}, function(date, step) {
|
|
38762
|
-
date.setFullYear(date.getFullYear() + step * k);
|
|
38763
|
-
});
|
|
38764
|
-
};
|
|
38765
|
-
year.range;
|
|
38766
|
-
|
|
38767
|
-
var utcMinute = newInterval(function(date) {
|
|
38768
|
-
date.setUTCSeconds(0, 0);
|
|
38769
|
-
}, function(date, step) {
|
|
38770
|
-
date.setTime(+date + step * durationMinute);
|
|
38771
|
-
}, function(start, end) {
|
|
38772
|
-
return (end - start) / durationMinute;
|
|
38773
|
-
}, function(date) {
|
|
38774
|
-
return date.getUTCMinutes();
|
|
38775
|
-
});
|
|
38776
|
-
utcMinute.range;
|
|
38777
|
-
|
|
38778
|
-
var utcHour = newInterval(function(date) {
|
|
38779
|
-
date.setUTCMinutes(0, 0, 0);
|
|
38780
|
-
}, function(date, step) {
|
|
38781
|
-
date.setTime(+date + step * durationHour);
|
|
38782
|
-
}, function(start, end) {
|
|
38783
|
-
return (end - start) / durationHour;
|
|
38784
|
-
}, function(date) {
|
|
38785
|
-
return date.getUTCHours();
|
|
38786
|
-
});
|
|
38787
|
-
utcHour.range;
|
|
38788
|
-
|
|
38789
|
-
var utcDay = newInterval(function(date) {
|
|
38790
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
38791
|
-
}, function(date, step) {
|
|
38792
|
-
date.setUTCDate(date.getUTCDate() + step);
|
|
38793
|
-
}, function(start, end) {
|
|
38794
|
-
return (end - start) / durationDay;
|
|
38795
|
-
}, function(date) {
|
|
38796
|
-
return date.getUTCDate() - 1;
|
|
38797
|
-
});
|
|
38798
|
-
utcDay.range;
|
|
38799
|
-
|
|
38800
|
-
function utcWeekday(i) {
|
|
38801
|
-
return newInterval(function(date) {
|
|
38802
|
-
date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);
|
|
38803
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
38804
|
-
}, function(date, step) {
|
|
38805
|
-
date.setUTCDate(date.getUTCDate() + step * 7);
|
|
38806
|
-
}, function(start, end) {
|
|
38807
|
-
return (end - start) / durationWeek;
|
|
38808
|
-
});
|
|
38809
|
-
}
|
|
38810
|
-
|
|
38811
|
-
var utcSunday = utcWeekday(0);
|
|
38812
|
-
var utcMonday = utcWeekday(1);
|
|
38813
|
-
var utcTuesday = utcWeekday(2);
|
|
38814
|
-
var utcWednesday = utcWeekday(3);
|
|
38815
|
-
var utcThursday = utcWeekday(4);
|
|
38816
|
-
var utcFriday = utcWeekday(5);
|
|
38817
|
-
var utcSaturday = utcWeekday(6);
|
|
38818
|
-
|
|
38819
|
-
utcSunday.range;
|
|
38820
|
-
utcMonday.range;
|
|
38821
|
-
utcTuesday.range;
|
|
38822
|
-
utcWednesday.range;
|
|
38823
|
-
utcThursday.range;
|
|
38824
|
-
utcFriday.range;
|
|
38825
|
-
utcSaturday.range;
|
|
38826
|
-
|
|
38827
|
-
var utcMonth = newInterval(function(date) {
|
|
38828
|
-
date.setUTCDate(1);
|
|
38829
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
38830
|
-
}, function(date, step) {
|
|
38831
|
-
date.setUTCMonth(date.getUTCMonth() + step);
|
|
38832
|
-
}, function(start, end) {
|
|
38833
|
-
return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;
|
|
38834
|
-
}, function(date) {
|
|
38835
|
-
return date.getUTCMonth();
|
|
38836
|
-
});
|
|
38837
|
-
utcMonth.range;
|
|
38838
|
-
|
|
38839
|
-
var utcYear = newInterval(function(date) {
|
|
38840
|
-
date.setUTCMonth(0, 1);
|
|
38841
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
38842
|
-
}, function(date, step) {
|
|
38843
|
-
date.setUTCFullYear(date.getUTCFullYear() + step);
|
|
38844
|
-
}, function(start, end) {
|
|
38845
|
-
return end.getUTCFullYear() - start.getUTCFullYear();
|
|
38846
|
-
}, function(date) {
|
|
38847
|
-
return date.getUTCFullYear();
|
|
38848
|
-
});
|
|
38849
|
-
|
|
38850
|
-
// An optimized implementation for this simple case.
|
|
38851
|
-
utcYear.every = function(k) {
|
|
38852
|
-
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date) {
|
|
38853
|
-
date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);
|
|
38854
|
-
date.setUTCMonth(0, 1);
|
|
38855
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
38856
|
-
}, function(date, step) {
|
|
38857
|
-
date.setUTCFullYear(date.getUTCFullYear() + step * k);
|
|
38858
|
-
});
|
|
38859
|
-
};
|
|
38860
|
-
utcYear.range;
|
|
38861
|
-
|
|
38862
|
-
function localDate(d) {
|
|
38863
|
-
if (0 <= d.y && d.y < 100) {
|
|
38864
|
-
var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);
|
|
38865
|
-
date.setFullYear(d.y);
|
|
38866
|
-
return date;
|
|
38867
|
-
}
|
|
38868
|
-
return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);
|
|
38869
|
-
}
|
|
38870
|
-
|
|
38871
|
-
function utcDate(d) {
|
|
38872
|
-
if (0 <= d.y && d.y < 100) {
|
|
38873
|
-
var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));
|
|
38874
|
-
date.setUTCFullYear(d.y);
|
|
38875
|
-
return date;
|
|
38876
|
-
}
|
|
38877
|
-
return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));
|
|
38878
|
-
}
|
|
38879
|
-
|
|
38880
|
-
function newDate(y, m, d) {
|
|
38881
|
-
return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};
|
|
38882
|
-
}
|
|
38883
|
-
|
|
38884
|
-
function formatLocale(locale) {
|
|
38885
|
-
var locale_dateTime = locale.dateTime,
|
|
38886
|
-
locale_date = locale.date,
|
|
38887
|
-
locale_time = locale.time,
|
|
38888
|
-
locale_periods = locale.periods,
|
|
38889
|
-
locale_weekdays = locale.days,
|
|
38890
|
-
locale_shortWeekdays = locale.shortDays,
|
|
38891
|
-
locale_months = locale.months,
|
|
38892
|
-
locale_shortMonths = locale.shortMonths;
|
|
38893
|
-
|
|
38894
|
-
var periodRe = formatRe(locale_periods),
|
|
38895
|
-
periodLookup = formatLookup(locale_periods),
|
|
38896
|
-
weekdayRe = formatRe(locale_weekdays),
|
|
38897
|
-
weekdayLookup = formatLookup(locale_weekdays),
|
|
38898
|
-
shortWeekdayRe = formatRe(locale_shortWeekdays),
|
|
38899
|
-
shortWeekdayLookup = formatLookup(locale_shortWeekdays),
|
|
38900
|
-
monthRe = formatRe(locale_months),
|
|
38901
|
-
monthLookup = formatLookup(locale_months),
|
|
38902
|
-
shortMonthRe = formatRe(locale_shortMonths),
|
|
38903
|
-
shortMonthLookup = formatLookup(locale_shortMonths);
|
|
38904
|
-
|
|
38905
|
-
var formats = {
|
|
38906
|
-
"a": formatShortWeekday,
|
|
38907
|
-
"A": formatWeekday,
|
|
38908
|
-
"b": formatShortMonth,
|
|
38909
|
-
"B": formatMonth,
|
|
38910
|
-
"c": null,
|
|
38911
|
-
"d": formatDayOfMonth,
|
|
38912
|
-
"e": formatDayOfMonth,
|
|
38913
|
-
"f": formatMicroseconds,
|
|
38914
|
-
"g": formatYearISO,
|
|
38915
|
-
"G": formatFullYearISO,
|
|
38916
|
-
"H": formatHour24,
|
|
38917
|
-
"I": formatHour12,
|
|
38918
|
-
"j": formatDayOfYear,
|
|
38919
|
-
"L": formatMilliseconds,
|
|
38920
|
-
"m": formatMonthNumber,
|
|
38921
|
-
"M": formatMinutes,
|
|
38922
|
-
"p": formatPeriod,
|
|
38923
|
-
"q": formatQuarter,
|
|
38924
|
-
"Q": formatUnixTimestamp,
|
|
38925
|
-
"s": formatUnixTimestampSeconds,
|
|
38926
|
-
"S": formatSeconds,
|
|
38927
|
-
"u": formatWeekdayNumberMonday,
|
|
38928
|
-
"U": formatWeekNumberSunday,
|
|
38929
|
-
"V": formatWeekNumberISO,
|
|
38930
|
-
"w": formatWeekdayNumberSunday,
|
|
38931
|
-
"W": formatWeekNumberMonday,
|
|
38932
|
-
"x": null,
|
|
38933
|
-
"X": null,
|
|
38934
|
-
"y": formatYear,
|
|
38935
|
-
"Y": formatFullYear,
|
|
38936
|
-
"Z": formatZone,
|
|
38937
|
-
"%": formatLiteralPercent
|
|
38938
|
-
};
|
|
38939
|
-
|
|
38940
|
-
var utcFormats = {
|
|
38941
|
-
"a": formatUTCShortWeekday,
|
|
38942
|
-
"A": formatUTCWeekday,
|
|
38943
|
-
"b": formatUTCShortMonth,
|
|
38944
|
-
"B": formatUTCMonth,
|
|
38945
|
-
"c": null,
|
|
38946
|
-
"d": formatUTCDayOfMonth,
|
|
38947
|
-
"e": formatUTCDayOfMonth,
|
|
38948
|
-
"f": formatUTCMicroseconds,
|
|
38949
|
-
"g": formatUTCYearISO,
|
|
38950
|
-
"G": formatUTCFullYearISO,
|
|
38951
|
-
"H": formatUTCHour24,
|
|
38952
|
-
"I": formatUTCHour12,
|
|
38953
|
-
"j": formatUTCDayOfYear,
|
|
38954
|
-
"L": formatUTCMilliseconds,
|
|
38955
|
-
"m": formatUTCMonthNumber,
|
|
38956
|
-
"M": formatUTCMinutes,
|
|
38957
|
-
"p": formatUTCPeriod,
|
|
38958
|
-
"q": formatUTCQuarter,
|
|
38959
|
-
"Q": formatUnixTimestamp,
|
|
38960
|
-
"s": formatUnixTimestampSeconds,
|
|
38961
|
-
"S": formatUTCSeconds,
|
|
38962
|
-
"u": formatUTCWeekdayNumberMonday,
|
|
38963
|
-
"U": formatUTCWeekNumberSunday,
|
|
38964
|
-
"V": formatUTCWeekNumberISO,
|
|
38965
|
-
"w": formatUTCWeekdayNumberSunday,
|
|
38966
|
-
"W": formatUTCWeekNumberMonday,
|
|
38967
|
-
"x": null,
|
|
38968
|
-
"X": null,
|
|
38969
|
-
"y": formatUTCYear,
|
|
38970
|
-
"Y": formatUTCFullYear,
|
|
38971
|
-
"Z": formatUTCZone,
|
|
38972
|
-
"%": formatLiteralPercent
|
|
38973
|
-
};
|
|
38974
|
-
|
|
38975
|
-
var parses = {
|
|
38976
|
-
"a": parseShortWeekday,
|
|
38977
|
-
"A": parseWeekday,
|
|
38978
|
-
"b": parseShortMonth,
|
|
38979
|
-
"B": parseMonth,
|
|
38980
|
-
"c": parseLocaleDateTime,
|
|
38981
|
-
"d": parseDayOfMonth,
|
|
38982
|
-
"e": parseDayOfMonth,
|
|
38983
|
-
"f": parseMicroseconds,
|
|
38984
|
-
"g": parseYear,
|
|
38985
|
-
"G": parseFullYear,
|
|
38986
|
-
"H": parseHour24,
|
|
38987
|
-
"I": parseHour24,
|
|
38988
|
-
"j": parseDayOfYear,
|
|
38989
|
-
"L": parseMilliseconds,
|
|
38990
|
-
"m": parseMonthNumber,
|
|
38991
|
-
"M": parseMinutes,
|
|
38992
|
-
"p": parsePeriod,
|
|
38993
|
-
"q": parseQuarter,
|
|
38994
|
-
"Q": parseUnixTimestamp,
|
|
38995
|
-
"s": parseUnixTimestampSeconds,
|
|
38996
|
-
"S": parseSeconds,
|
|
38997
|
-
"u": parseWeekdayNumberMonday,
|
|
38998
|
-
"U": parseWeekNumberSunday,
|
|
38999
|
-
"V": parseWeekNumberISO,
|
|
39000
|
-
"w": parseWeekdayNumberSunday,
|
|
39001
|
-
"W": parseWeekNumberMonday,
|
|
39002
|
-
"x": parseLocaleDate,
|
|
39003
|
-
"X": parseLocaleTime,
|
|
39004
|
-
"y": parseYear,
|
|
39005
|
-
"Y": parseFullYear,
|
|
39006
|
-
"Z": parseZone,
|
|
39007
|
-
"%": parseLiteralPercent
|
|
39008
|
-
};
|
|
39009
|
-
|
|
39010
|
-
// These recursive directive definitions must be deferred.
|
|
39011
|
-
formats.x = newFormat(locale_date, formats);
|
|
39012
|
-
formats.X = newFormat(locale_time, formats);
|
|
39013
|
-
formats.c = newFormat(locale_dateTime, formats);
|
|
39014
|
-
utcFormats.x = newFormat(locale_date, utcFormats);
|
|
39015
|
-
utcFormats.X = newFormat(locale_time, utcFormats);
|
|
39016
|
-
utcFormats.c = newFormat(locale_dateTime, utcFormats);
|
|
39017
|
-
|
|
39018
|
-
function newFormat(specifier, formats) {
|
|
39019
|
-
return function(date) {
|
|
39020
|
-
var string = [],
|
|
39021
|
-
i = -1,
|
|
39022
|
-
j = 0,
|
|
39023
|
-
n = specifier.length,
|
|
39024
|
-
c,
|
|
39025
|
-
pad,
|
|
39026
|
-
format;
|
|
39027
|
-
|
|
39028
|
-
if (!(date instanceof Date)) date = new Date(+date);
|
|
39029
|
-
|
|
39030
|
-
while (++i < n) {
|
|
39031
|
-
if (specifier.charCodeAt(i) === 37) {
|
|
39032
|
-
string.push(specifier.slice(j, i));
|
|
39033
|
-
if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);
|
|
39034
|
-
else pad = c === "e" ? " " : "0";
|
|
39035
|
-
if (format = formats[c]) c = format(date, pad);
|
|
39036
|
-
string.push(c);
|
|
39037
|
-
j = i + 1;
|
|
39038
|
-
}
|
|
39039
|
-
}
|
|
39040
|
-
|
|
39041
|
-
string.push(specifier.slice(j, i));
|
|
39042
|
-
return string.join("");
|
|
39043
|
-
};
|
|
39044
|
-
}
|
|
39045
|
-
|
|
39046
|
-
function newParse(specifier, Z) {
|
|
39047
|
-
return function(string) {
|
|
39048
|
-
var d = newDate(1900, undefined, 1),
|
|
39049
|
-
i = parseSpecifier(d, specifier, string += "", 0),
|
|
39050
|
-
week, day$1;
|
|
39051
|
-
if (i != string.length) return null;
|
|
39052
|
-
|
|
39053
|
-
// If a UNIX timestamp is specified, return it.
|
|
39054
|
-
if ("Q" in d) return new Date(d.Q);
|
|
39055
|
-
if ("s" in d) return new Date(d.s * 1000 + ("L" in d ? d.L : 0));
|
|
39056
|
-
|
|
39057
|
-
// If this is utcParse, never use the local timezone.
|
|
39058
|
-
if (Z && !("Z" in d)) d.Z = 0;
|
|
39059
|
-
|
|
39060
|
-
// The am-pm flag is 0 for AM, and 1 for PM.
|
|
39061
|
-
if ("p" in d) d.H = d.H % 12 + d.p * 12;
|
|
39062
|
-
|
|
39063
|
-
// If the month was not specified, inherit from the quarter.
|
|
39064
|
-
if (d.m === undefined) d.m = "q" in d ? d.q : 0;
|
|
39065
|
-
|
|
39066
|
-
// Convert day-of-week and week-of-year to day-of-year.
|
|
39067
|
-
if ("V" in d) {
|
|
39068
|
-
if (d.V < 1 || d.V > 53) return null;
|
|
39069
|
-
if (!("w" in d)) d.w = 1;
|
|
39070
|
-
if ("Z" in d) {
|
|
39071
|
-
week = utcDate(newDate(d.y, 0, 1)), day$1 = week.getUTCDay();
|
|
39072
|
-
week = day$1 > 4 || day$1 === 0 ? utcMonday.ceil(week) : utcMonday(week);
|
|
39073
|
-
week = utcDay.offset(week, (d.V - 1) * 7);
|
|
39074
|
-
d.y = week.getUTCFullYear();
|
|
39075
|
-
d.m = week.getUTCMonth();
|
|
39076
|
-
d.d = week.getUTCDate() + (d.w + 6) % 7;
|
|
39077
|
-
} else {
|
|
39078
|
-
week = localDate(newDate(d.y, 0, 1)), day$1 = week.getDay();
|
|
39079
|
-
week = day$1 > 4 || day$1 === 0 ? monday.ceil(week) : monday(week);
|
|
39080
|
-
week = day.offset(week, (d.V - 1) * 7);
|
|
39081
|
-
d.y = week.getFullYear();
|
|
39082
|
-
d.m = week.getMonth();
|
|
39083
|
-
d.d = week.getDate() + (d.w + 6) % 7;
|
|
39084
|
-
}
|
|
39085
|
-
} else if ("W" in d || "U" in d) {
|
|
39086
|
-
if (!("w" in d)) d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0;
|
|
39087
|
-
day$1 = "Z" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();
|
|
39088
|
-
d.m = 0;
|
|
39089
|
-
d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day$1 + 5) % 7 : d.w + d.U * 7 - (day$1 + 6) % 7;
|
|
39090
|
-
}
|
|
39091
|
-
|
|
39092
|
-
// If a time zone is specified, all fields are interpreted as UTC and then
|
|
39093
|
-
// offset according to the specified time zone.
|
|
39094
|
-
if ("Z" in d) {
|
|
39095
|
-
d.H += d.Z / 100 | 0;
|
|
39096
|
-
d.M += d.Z % 100;
|
|
39097
|
-
return utcDate(d);
|
|
39098
|
-
}
|
|
39099
|
-
|
|
39100
|
-
// Otherwise, all fields are in local time.
|
|
39101
|
-
return localDate(d);
|
|
39102
|
-
};
|
|
39103
|
-
}
|
|
39104
|
-
|
|
39105
|
-
function parseSpecifier(d, specifier, string, j) {
|
|
39106
|
-
var i = 0,
|
|
39107
|
-
n = specifier.length,
|
|
39108
|
-
m = string.length,
|
|
39109
|
-
c,
|
|
39110
|
-
parse;
|
|
39111
|
-
|
|
39112
|
-
while (i < n) {
|
|
39113
|
-
if (j >= m) return -1;
|
|
39114
|
-
c = specifier.charCodeAt(i++);
|
|
39115
|
-
if (c === 37) {
|
|
39116
|
-
c = specifier.charAt(i++);
|
|
39117
|
-
parse = parses[c in pads ? specifier.charAt(i++) : c];
|
|
39118
|
-
if (!parse || ((j = parse(d, string, j)) < 0)) return -1;
|
|
39119
|
-
} else if (c != string.charCodeAt(j++)) {
|
|
39120
|
-
return -1;
|
|
39121
|
-
}
|
|
39122
|
-
}
|
|
39123
|
-
|
|
39124
|
-
return j;
|
|
39125
|
-
}
|
|
39126
|
-
|
|
39127
|
-
function parsePeriod(d, string, i) {
|
|
39128
|
-
var n = periodRe.exec(string.slice(i));
|
|
39129
|
-
return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
39130
|
-
}
|
|
39131
|
-
|
|
39132
|
-
function parseShortWeekday(d, string, i) {
|
|
39133
|
-
var n = shortWeekdayRe.exec(string.slice(i));
|
|
39134
|
-
return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
39135
|
-
}
|
|
39136
|
-
|
|
39137
|
-
function parseWeekday(d, string, i) {
|
|
39138
|
-
var n = weekdayRe.exec(string.slice(i));
|
|
39139
|
-
return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
39140
|
-
}
|
|
39141
|
-
|
|
39142
|
-
function parseShortMonth(d, string, i) {
|
|
39143
|
-
var n = shortMonthRe.exec(string.slice(i));
|
|
39144
|
-
return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
39145
|
-
}
|
|
39146
|
-
|
|
39147
|
-
function parseMonth(d, string, i) {
|
|
39148
|
-
var n = monthRe.exec(string.slice(i));
|
|
39149
|
-
return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
39150
|
-
}
|
|
39151
|
-
|
|
39152
|
-
function parseLocaleDateTime(d, string, i) {
|
|
39153
|
-
return parseSpecifier(d, locale_dateTime, string, i);
|
|
39154
|
-
}
|
|
39155
|
-
|
|
39156
|
-
function parseLocaleDate(d, string, i) {
|
|
39157
|
-
return parseSpecifier(d, locale_date, string, i);
|
|
39158
|
-
}
|
|
39159
|
-
|
|
39160
|
-
function parseLocaleTime(d, string, i) {
|
|
39161
|
-
return parseSpecifier(d, locale_time, string, i);
|
|
39162
|
-
}
|
|
39163
|
-
|
|
39164
|
-
function formatShortWeekday(d) {
|
|
39165
|
-
return locale_shortWeekdays[d.getDay()];
|
|
39166
|
-
}
|
|
39167
|
-
|
|
39168
|
-
function formatWeekday(d) {
|
|
39169
|
-
return locale_weekdays[d.getDay()];
|
|
39170
|
-
}
|
|
39171
|
-
|
|
39172
|
-
function formatShortMonth(d) {
|
|
39173
|
-
return locale_shortMonths[d.getMonth()];
|
|
39174
|
-
}
|
|
39175
|
-
|
|
39176
|
-
function formatMonth(d) {
|
|
39177
|
-
return locale_months[d.getMonth()];
|
|
39178
|
-
}
|
|
39179
|
-
|
|
39180
|
-
function formatPeriod(d) {
|
|
39181
|
-
return locale_periods[+(d.getHours() >= 12)];
|
|
39182
|
-
}
|
|
39183
|
-
|
|
39184
|
-
function formatQuarter(d) {
|
|
39185
|
-
return 1 + ~~(d.getMonth() / 3);
|
|
39186
|
-
}
|
|
39187
|
-
|
|
39188
|
-
function formatUTCShortWeekday(d) {
|
|
39189
|
-
return locale_shortWeekdays[d.getUTCDay()];
|
|
39190
|
-
}
|
|
39191
|
-
|
|
39192
|
-
function formatUTCWeekday(d) {
|
|
39193
|
-
return locale_weekdays[d.getUTCDay()];
|
|
39194
|
-
}
|
|
39195
|
-
|
|
39196
|
-
function formatUTCShortMonth(d) {
|
|
39197
|
-
return locale_shortMonths[d.getUTCMonth()];
|
|
39198
|
-
}
|
|
39199
|
-
|
|
39200
|
-
function formatUTCMonth(d) {
|
|
39201
|
-
return locale_months[d.getUTCMonth()];
|
|
39202
|
-
}
|
|
39203
|
-
|
|
39204
|
-
function formatUTCPeriod(d) {
|
|
39205
|
-
return locale_periods[+(d.getUTCHours() >= 12)];
|
|
39206
|
-
}
|
|
39207
|
-
|
|
39208
|
-
function formatUTCQuarter(d) {
|
|
39209
|
-
return 1 + ~~(d.getUTCMonth() / 3);
|
|
39210
|
-
}
|
|
39211
|
-
|
|
39212
|
-
return {
|
|
39213
|
-
format: function(specifier) {
|
|
39214
|
-
var f = newFormat(specifier += "", formats);
|
|
39215
|
-
f.toString = function() { return specifier; };
|
|
39216
|
-
return f;
|
|
39217
|
-
},
|
|
39218
|
-
parse: function(specifier) {
|
|
39219
|
-
var p = newParse(specifier += "", false);
|
|
39220
|
-
p.toString = function() { return specifier; };
|
|
39221
|
-
return p;
|
|
39222
|
-
},
|
|
39223
|
-
utcFormat: function(specifier) {
|
|
39224
|
-
var f = newFormat(specifier += "", utcFormats);
|
|
39225
|
-
f.toString = function() { return specifier; };
|
|
39226
|
-
return f;
|
|
39227
|
-
},
|
|
39228
|
-
utcParse: function(specifier) {
|
|
39229
|
-
var p = newParse(specifier += "", true);
|
|
39230
|
-
p.toString = function() { return specifier; };
|
|
39231
|
-
return p;
|
|
39232
|
-
}
|
|
39233
|
-
};
|
|
39234
|
-
}
|
|
39235
|
-
|
|
39236
|
-
var pads = {"-": "", "_": " ", "0": "0"},
|
|
39237
|
-
numberRe = /^\s*\d+/, // note: ignores next directive
|
|
39238
|
-
percentRe = /^%/,
|
|
39239
|
-
requoteRe = /[\\^$*+?|[\]().{}]/g;
|
|
39240
|
-
|
|
39241
|
-
function pad(value, fill, width) {
|
|
39242
|
-
var sign = value < 0 ? "-" : "",
|
|
39243
|
-
string = (sign ? -value : value) + "",
|
|
39244
|
-
length = string.length;
|
|
39245
|
-
return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);
|
|
39246
|
-
}
|
|
39247
|
-
|
|
39248
|
-
function requote(s) {
|
|
39249
|
-
return s.replace(requoteRe, "\\$&");
|
|
39250
|
-
}
|
|
39251
|
-
|
|
39252
|
-
function formatRe(names) {
|
|
39253
|
-
return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i");
|
|
39254
|
-
}
|
|
39255
|
-
|
|
39256
|
-
function formatLookup(names) {
|
|
39257
|
-
return new Map(names.map((name, i) => [name.toLowerCase(), i]));
|
|
39258
|
-
}
|
|
39259
|
-
|
|
39260
|
-
function parseWeekdayNumberSunday(d, string, i) {
|
|
39261
|
-
var n = numberRe.exec(string.slice(i, i + 1));
|
|
39262
|
-
return n ? (d.w = +n[0], i + n[0].length) : -1;
|
|
39263
|
-
}
|
|
39264
|
-
|
|
39265
|
-
function parseWeekdayNumberMonday(d, string, i) {
|
|
39266
|
-
var n = numberRe.exec(string.slice(i, i + 1));
|
|
39267
|
-
return n ? (d.u = +n[0], i + n[0].length) : -1;
|
|
39268
|
-
}
|
|
39269
|
-
|
|
39270
|
-
function parseWeekNumberSunday(d, string, i) {
|
|
39271
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
39272
|
-
return n ? (d.U = +n[0], i + n[0].length) : -1;
|
|
39273
|
-
}
|
|
39274
|
-
|
|
39275
|
-
function parseWeekNumberISO(d, string, i) {
|
|
39276
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
39277
|
-
return n ? (d.V = +n[0], i + n[0].length) : -1;
|
|
39278
|
-
}
|
|
39279
|
-
|
|
39280
|
-
function parseWeekNumberMonday(d, string, i) {
|
|
39281
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
39282
|
-
return n ? (d.W = +n[0], i + n[0].length) : -1;
|
|
39283
|
-
}
|
|
39284
|
-
|
|
39285
|
-
function parseFullYear(d, string, i) {
|
|
39286
|
-
var n = numberRe.exec(string.slice(i, i + 4));
|
|
39287
|
-
return n ? (d.y = +n[0], i + n[0].length) : -1;
|
|
39288
|
-
}
|
|
39289
|
-
|
|
39290
|
-
function parseYear(d, string, i) {
|
|
39291
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
39292
|
-
return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;
|
|
39293
|
-
}
|
|
39294
|
-
|
|
39295
|
-
function parseZone(d, string, i) {
|
|
39296
|
-
var n = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string.slice(i, i + 6));
|
|
39297
|
-
return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i + n[0].length) : -1;
|
|
39298
|
-
}
|
|
39299
|
-
|
|
39300
|
-
function parseQuarter(d, string, i) {
|
|
39301
|
-
var n = numberRe.exec(string.slice(i, i + 1));
|
|
39302
|
-
return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;
|
|
39303
|
-
}
|
|
39304
|
-
|
|
39305
|
-
function parseMonthNumber(d, string, i) {
|
|
39306
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
39307
|
-
return n ? (d.m = n[0] - 1, i + n[0].length) : -1;
|
|
39308
|
-
}
|
|
39309
|
-
|
|
39310
|
-
function parseDayOfMonth(d, string, i) {
|
|
39311
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
39312
|
-
return n ? (d.d = +n[0], i + n[0].length) : -1;
|
|
39313
|
-
}
|
|
39314
|
-
|
|
39315
|
-
function parseDayOfYear(d, string, i) {
|
|
39316
|
-
var n = numberRe.exec(string.slice(i, i + 3));
|
|
39317
|
-
return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;
|
|
39318
|
-
}
|
|
39319
|
-
|
|
39320
|
-
function parseHour24(d, string, i) {
|
|
39321
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
39322
|
-
return n ? (d.H = +n[0], i + n[0].length) : -1;
|
|
39323
|
-
}
|
|
39324
|
-
|
|
39325
|
-
function parseMinutes(d, string, i) {
|
|
39326
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
39327
|
-
return n ? (d.M = +n[0], i + n[0].length) : -1;
|
|
39328
|
-
}
|
|
39329
|
-
|
|
39330
|
-
function parseSeconds(d, string, i) {
|
|
39331
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
39332
|
-
return n ? (d.S = +n[0], i + n[0].length) : -1;
|
|
39333
|
-
}
|
|
39334
|
-
|
|
39335
|
-
function parseMilliseconds(d, string, i) {
|
|
39336
|
-
var n = numberRe.exec(string.slice(i, i + 3));
|
|
39337
|
-
return n ? (d.L = +n[0], i + n[0].length) : -1;
|
|
39338
|
-
}
|
|
39339
|
-
|
|
39340
|
-
function parseMicroseconds(d, string, i) {
|
|
39341
|
-
var n = numberRe.exec(string.slice(i, i + 6));
|
|
39342
|
-
return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;
|
|
39343
|
-
}
|
|
39344
|
-
|
|
39345
|
-
function parseLiteralPercent(d, string, i) {
|
|
39346
|
-
var n = percentRe.exec(string.slice(i, i + 1));
|
|
39347
|
-
return n ? i + n[0].length : -1;
|
|
39348
|
-
}
|
|
39349
|
-
|
|
39350
|
-
function parseUnixTimestamp(d, string, i) {
|
|
39351
|
-
var n = numberRe.exec(string.slice(i));
|
|
39352
|
-
return n ? (d.Q = +n[0], i + n[0].length) : -1;
|
|
39353
|
-
}
|
|
39354
|
-
|
|
39355
|
-
function parseUnixTimestampSeconds(d, string, i) {
|
|
39356
|
-
var n = numberRe.exec(string.slice(i));
|
|
39357
|
-
return n ? (d.s = +n[0], i + n[0].length) : -1;
|
|
39358
|
-
}
|
|
39359
|
-
|
|
39360
|
-
function formatDayOfMonth(d, p) {
|
|
39361
|
-
return pad(d.getDate(), p, 2);
|
|
39362
|
-
}
|
|
39363
|
-
|
|
39364
|
-
function formatHour24(d, p) {
|
|
39365
|
-
return pad(d.getHours(), p, 2);
|
|
39366
|
-
}
|
|
39367
|
-
|
|
39368
|
-
function formatHour12(d, p) {
|
|
39369
|
-
return pad(d.getHours() % 12 || 12, p, 2);
|
|
39370
|
-
}
|
|
39371
|
-
|
|
39372
|
-
function formatDayOfYear(d, p) {
|
|
39373
|
-
return pad(1 + day.count(year(d), d), p, 3);
|
|
39374
|
-
}
|
|
39375
|
-
|
|
39376
|
-
function formatMilliseconds(d, p) {
|
|
39377
|
-
return pad(d.getMilliseconds(), p, 3);
|
|
39378
|
-
}
|
|
39379
|
-
|
|
39380
|
-
function formatMicroseconds(d, p) {
|
|
39381
|
-
return formatMilliseconds(d, p) + "000";
|
|
39382
|
-
}
|
|
39383
|
-
|
|
39384
|
-
function formatMonthNumber(d, p) {
|
|
39385
|
-
return pad(d.getMonth() + 1, p, 2);
|
|
39386
|
-
}
|
|
39387
|
-
|
|
39388
|
-
function formatMinutes(d, p) {
|
|
39389
|
-
return pad(d.getMinutes(), p, 2);
|
|
39390
|
-
}
|
|
39391
|
-
|
|
39392
|
-
function formatSeconds(d, p) {
|
|
39393
|
-
return pad(d.getSeconds(), p, 2);
|
|
39394
|
-
}
|
|
39395
|
-
|
|
39396
|
-
function formatWeekdayNumberMonday(d) {
|
|
39397
|
-
var day = d.getDay();
|
|
39398
|
-
return day === 0 ? 7 : day;
|
|
39399
|
-
}
|
|
39400
|
-
|
|
39401
|
-
function formatWeekNumberSunday(d, p) {
|
|
39402
|
-
return pad(sunday.count(year(d) - 1, d), p, 2);
|
|
39403
|
-
}
|
|
39404
|
-
|
|
39405
|
-
function dISO(d) {
|
|
39406
|
-
var day = d.getDay();
|
|
39407
|
-
return (day >= 4 || day === 0) ? thursday(d) : thursday.ceil(d);
|
|
39408
|
-
}
|
|
39409
|
-
|
|
39410
|
-
function formatWeekNumberISO(d, p) {
|
|
39411
|
-
d = dISO(d);
|
|
39412
|
-
return pad(thursday.count(year(d), d) + (year(d).getDay() === 4), p, 2);
|
|
39413
|
-
}
|
|
39414
|
-
|
|
39415
|
-
function formatWeekdayNumberSunday(d) {
|
|
39416
|
-
return d.getDay();
|
|
39417
|
-
}
|
|
39418
|
-
|
|
39419
|
-
function formatWeekNumberMonday(d, p) {
|
|
39420
|
-
return pad(monday.count(year(d) - 1, d), p, 2);
|
|
39421
|
-
}
|
|
39422
|
-
|
|
39423
|
-
function formatYear(d, p) {
|
|
39424
|
-
return pad(d.getFullYear() % 100, p, 2);
|
|
39425
|
-
}
|
|
39426
|
-
|
|
39427
|
-
function formatYearISO(d, p) {
|
|
39428
|
-
d = dISO(d);
|
|
39429
|
-
return pad(d.getFullYear() % 100, p, 2);
|
|
39430
|
-
}
|
|
39431
|
-
|
|
39432
|
-
function formatFullYear(d, p) {
|
|
39433
|
-
return pad(d.getFullYear() % 10000, p, 4);
|
|
39434
|
-
}
|
|
39435
|
-
|
|
39436
|
-
function formatFullYearISO(d, p) {
|
|
39437
|
-
var day = d.getDay();
|
|
39438
|
-
d = (day >= 4 || day === 0) ? thursday(d) : thursday.ceil(d);
|
|
39439
|
-
return pad(d.getFullYear() % 10000, p, 4);
|
|
39440
|
-
}
|
|
39441
|
-
|
|
39442
|
-
function formatZone(d) {
|
|
39443
|
-
var z = d.getTimezoneOffset();
|
|
39444
|
-
return (z > 0 ? "-" : (z *= -1, "+"))
|
|
39445
|
-
+ pad(z / 60 | 0, "0", 2)
|
|
39446
|
-
+ pad(z % 60, "0", 2);
|
|
39447
|
-
}
|
|
39448
|
-
|
|
39449
|
-
function formatUTCDayOfMonth(d, p) {
|
|
39450
|
-
return pad(d.getUTCDate(), p, 2);
|
|
39451
|
-
}
|
|
39452
|
-
|
|
39453
|
-
function formatUTCHour24(d, p) {
|
|
39454
|
-
return pad(d.getUTCHours(), p, 2);
|
|
39455
|
-
}
|
|
39456
|
-
|
|
39457
|
-
function formatUTCHour12(d, p) {
|
|
39458
|
-
return pad(d.getUTCHours() % 12 || 12, p, 2);
|
|
39459
|
-
}
|
|
39460
|
-
|
|
39461
|
-
function formatUTCDayOfYear(d, p) {
|
|
39462
|
-
return pad(1 + utcDay.count(utcYear(d), d), p, 3);
|
|
39463
|
-
}
|
|
39464
|
-
|
|
39465
|
-
function formatUTCMilliseconds(d, p) {
|
|
39466
|
-
return pad(d.getUTCMilliseconds(), p, 3);
|
|
39467
|
-
}
|
|
39468
|
-
|
|
39469
|
-
function formatUTCMicroseconds(d, p) {
|
|
39470
|
-
return formatUTCMilliseconds(d, p) + "000";
|
|
39471
|
-
}
|
|
39472
|
-
|
|
39473
|
-
function formatUTCMonthNumber(d, p) {
|
|
39474
|
-
return pad(d.getUTCMonth() + 1, p, 2);
|
|
39475
|
-
}
|
|
39476
|
-
|
|
39477
|
-
function formatUTCMinutes(d, p) {
|
|
39478
|
-
return pad(d.getUTCMinutes(), p, 2);
|
|
39479
|
-
}
|
|
39480
|
-
|
|
39481
|
-
function formatUTCSeconds(d, p) {
|
|
39482
|
-
return pad(d.getUTCSeconds(), p, 2);
|
|
39483
|
-
}
|
|
39484
|
-
|
|
39485
|
-
function formatUTCWeekdayNumberMonday(d) {
|
|
39486
|
-
var dow = d.getUTCDay();
|
|
39487
|
-
return dow === 0 ? 7 : dow;
|
|
39488
|
-
}
|
|
39489
|
-
|
|
39490
|
-
function formatUTCWeekNumberSunday(d, p) {
|
|
39491
|
-
return pad(utcSunday.count(utcYear(d) - 1, d), p, 2);
|
|
39492
|
-
}
|
|
39493
|
-
|
|
39494
|
-
function UTCdISO(d) {
|
|
39495
|
-
var day = d.getUTCDay();
|
|
39496
|
-
return (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);
|
|
39497
|
-
}
|
|
39498
|
-
|
|
39499
|
-
function formatUTCWeekNumberISO(d, p) {
|
|
39500
|
-
d = UTCdISO(d);
|
|
39501
|
-
return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);
|
|
39502
|
-
}
|
|
39503
|
-
|
|
39504
|
-
function formatUTCWeekdayNumberSunday(d) {
|
|
39505
|
-
return d.getUTCDay();
|
|
39506
|
-
}
|
|
39507
|
-
|
|
39508
|
-
function formatUTCWeekNumberMonday(d, p) {
|
|
39509
|
-
return pad(utcMonday.count(utcYear(d) - 1, d), p, 2);
|
|
39510
|
-
}
|
|
39511
|
-
|
|
39512
|
-
function formatUTCYear(d, p) {
|
|
39513
|
-
return pad(d.getUTCFullYear() % 100, p, 2);
|
|
39514
|
-
}
|
|
39515
|
-
|
|
39516
|
-
function formatUTCYearISO(d, p) {
|
|
39517
|
-
d = UTCdISO(d);
|
|
39518
|
-
return pad(d.getUTCFullYear() % 100, p, 2);
|
|
39519
|
-
}
|
|
39520
|
-
|
|
39521
|
-
function formatUTCFullYear(d, p) {
|
|
39522
|
-
return pad(d.getUTCFullYear() % 10000, p, 4);
|
|
39523
|
-
}
|
|
39524
|
-
|
|
39525
|
-
function formatUTCFullYearISO(d, p) {
|
|
39526
|
-
var day = d.getUTCDay();
|
|
39527
|
-
d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);
|
|
39528
|
-
return pad(d.getUTCFullYear() % 10000, p, 4);
|
|
39529
|
-
}
|
|
39530
|
-
|
|
39531
|
-
function formatUTCZone() {
|
|
39532
|
-
return "+0000";
|
|
39533
|
-
}
|
|
39534
|
-
|
|
39535
|
-
function formatLiteralPercent() {
|
|
39536
|
-
return "%";
|
|
39537
|
-
}
|
|
39538
|
-
|
|
39539
|
-
function formatUnixTimestamp(d) {
|
|
39540
|
-
return +d;
|
|
39541
|
-
}
|
|
39542
|
-
|
|
39543
|
-
function formatUnixTimestampSeconds(d) {
|
|
39544
|
-
return Math.floor(+d / 1000);
|
|
39545
|
-
}
|
|
39546
|
-
|
|
39547
|
-
var locale;
|
|
39548
|
-
var utcFormat;
|
|
39549
|
-
var utcParse;
|
|
39550
|
-
|
|
39551
|
-
defaultLocale({
|
|
39552
|
-
dateTime: "%x, %X",
|
|
39553
|
-
date: "%-m/%-d/%Y",
|
|
39554
|
-
time: "%-I:%M:%S %p",
|
|
39555
|
-
periods: ["AM", "PM"],
|
|
39556
|
-
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
|
|
39557
|
-
shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
39558
|
-
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
|
|
39559
|
-
shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
|
|
39560
|
-
});
|
|
39561
|
-
|
|
39562
|
-
function defaultLocale(definition) {
|
|
39563
|
-
locale = formatLocale(definition);
|
|
39564
|
-
locale.format;
|
|
39565
|
-
locale.parse;
|
|
39566
|
-
utcFormat = locale.utcFormat;
|
|
39567
|
-
utcParse = locale.utcParse;
|
|
39568
|
-
return locale;
|
|
39569
|
-
}
|
|
39570
|
-
|
|
39571
|
-
var isoSpecifier = "%Y-%m-%dT%H:%M:%S.%LZ";
|
|
39572
|
-
|
|
39573
|
-
function formatIsoNative(date) {
|
|
39574
|
-
return date.toISOString();
|
|
39575
|
-
}
|
|
39576
|
-
|
|
39577
|
-
Date.prototype.toISOString
|
|
39578
|
-
? formatIsoNative
|
|
39579
|
-
: utcFormat(isoSpecifier);
|
|
39580
|
-
|
|
39581
|
-
function parseIsoNative(string) {
|
|
39582
|
-
var date = new Date(string);
|
|
39583
|
-
return isNaN(date) ? null : date;
|
|
39584
|
-
}
|
|
39585
|
-
|
|
39586
|
-
+new Date("2000-01-01T00:00:00.000Z")
|
|
39587
|
-
? parseIsoNative
|
|
39588
|
-
: utcParse(isoSpecifier);
|
|
39589
|
-
|
|
39590
37452
|
function colors(specifier) {
|
|
39591
37453
|
var n = specifier.length / 6 | 0, colors = new Array(n), i = 0;
|
|
39592
37454
|
while (i < n) colors[i] = "#" + specifier.slice(i * 6, ++i * 6);
|
|
39593
37455
|
return colors;
|
|
39594
37456
|
}
|
|
39595
37457
|
|
|
39596
|
-
colors("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");
|
|
39597
|
-
|
|
39598
|
-
colors("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666");
|
|
39599
|
-
|
|
39600
|
-
colors("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666");
|
|
39601
|
-
|
|
39602
37458
|
var schemePaired = colors("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");
|
|
39603
37459
|
|
|
39604
|
-
colors("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2");
|
|
39605
|
-
|
|
39606
|
-
colors("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc");
|
|
39607
|
-
|
|
39608
|
-
colors("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999");
|
|
39609
|
-
|
|
39610
|
-
colors("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3");
|
|
39611
|
-
|
|
39612
|
-
colors("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");
|
|
39613
|
-
|
|
39614
|
-
colors("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");
|
|
39615
|
-
|
|
39616
|
-
var ramp$1 = scheme => rgbBasis(scheme[scheme.length - 1]);
|
|
39617
|
-
|
|
39618
|
-
var scheme$q = new Array(3).concat(
|
|
39619
|
-
"d8b365f5f5f55ab4ac",
|
|
39620
|
-
"a6611adfc27d80cdc1018571",
|
|
39621
|
-
"a6611adfc27df5f5f580cdc1018571",
|
|
39622
|
-
"8c510ad8b365f6e8c3c7eae55ab4ac01665e",
|
|
39623
|
-
"8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e",
|
|
39624
|
-
"8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e",
|
|
39625
|
-
"8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e",
|
|
39626
|
-
"5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30",
|
|
39627
|
-
"5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30"
|
|
39628
|
-
).map(colors);
|
|
39629
|
-
|
|
39630
|
-
ramp$1(scheme$q);
|
|
39631
|
-
|
|
39632
|
-
var scheme$p = new Array(3).concat(
|
|
39633
|
-
"af8dc3f7f7f77fbf7b",
|
|
39634
|
-
"7b3294c2a5cfa6dba0008837",
|
|
39635
|
-
"7b3294c2a5cff7f7f7a6dba0008837",
|
|
39636
|
-
"762a83af8dc3e7d4e8d9f0d37fbf7b1b7837",
|
|
39637
|
-
"762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837",
|
|
39638
|
-
"762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837",
|
|
39639
|
-
"762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837",
|
|
39640
|
-
"40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b",
|
|
39641
|
-
"40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b"
|
|
39642
|
-
).map(colors);
|
|
39643
|
-
|
|
39644
|
-
ramp$1(scheme$p);
|
|
39645
|
-
|
|
39646
|
-
var scheme$o = new Array(3).concat(
|
|
39647
|
-
"e9a3c9f7f7f7a1d76a",
|
|
39648
|
-
"d01c8bf1b6dab8e1864dac26",
|
|
39649
|
-
"d01c8bf1b6daf7f7f7b8e1864dac26",
|
|
39650
|
-
"c51b7de9a3c9fde0efe6f5d0a1d76a4d9221",
|
|
39651
|
-
"c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221",
|
|
39652
|
-
"c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221",
|
|
39653
|
-
"c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221",
|
|
39654
|
-
"8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419",
|
|
39655
|
-
"8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419"
|
|
39656
|
-
).map(colors);
|
|
39657
|
-
|
|
39658
|
-
ramp$1(scheme$o);
|
|
39659
|
-
|
|
39660
|
-
var scheme$n = new Array(3).concat(
|
|
39661
|
-
"998ec3f7f7f7f1a340",
|
|
39662
|
-
"5e3c99b2abd2fdb863e66101",
|
|
39663
|
-
"5e3c99b2abd2f7f7f7fdb863e66101",
|
|
39664
|
-
"542788998ec3d8daebfee0b6f1a340b35806",
|
|
39665
|
-
"542788998ec3d8daebf7f7f7fee0b6f1a340b35806",
|
|
39666
|
-
"5427888073acb2abd2d8daebfee0b6fdb863e08214b35806",
|
|
39667
|
-
"5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806",
|
|
39668
|
-
"2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08",
|
|
39669
|
-
"2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08"
|
|
39670
|
-
).map(colors);
|
|
39671
|
-
|
|
39672
|
-
ramp$1(scheme$n);
|
|
39673
|
-
|
|
39674
|
-
var scheme$m = new Array(3).concat(
|
|
39675
|
-
"ef8a62f7f7f767a9cf",
|
|
39676
|
-
"ca0020f4a58292c5de0571b0",
|
|
39677
|
-
"ca0020f4a582f7f7f792c5de0571b0",
|
|
39678
|
-
"b2182bef8a62fddbc7d1e5f067a9cf2166ac",
|
|
39679
|
-
"b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac",
|
|
39680
|
-
"b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac",
|
|
39681
|
-
"b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac",
|
|
39682
|
-
"67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061",
|
|
39683
|
-
"67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061"
|
|
39684
|
-
).map(colors);
|
|
39685
|
-
|
|
39686
|
-
ramp$1(scheme$m);
|
|
39687
|
-
|
|
39688
|
-
var scheme$l = new Array(3).concat(
|
|
39689
|
-
"ef8a62ffffff999999",
|
|
39690
|
-
"ca0020f4a582bababa404040",
|
|
39691
|
-
"ca0020f4a582ffffffbababa404040",
|
|
39692
|
-
"b2182bef8a62fddbc7e0e0e09999994d4d4d",
|
|
39693
|
-
"b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d",
|
|
39694
|
-
"b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d",
|
|
39695
|
-
"b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d",
|
|
39696
|
-
"67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a",
|
|
39697
|
-
"67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a"
|
|
39698
|
-
).map(colors);
|
|
39699
|
-
|
|
39700
|
-
ramp$1(scheme$l);
|
|
39701
|
-
|
|
39702
|
-
var scheme$k = new Array(3).concat(
|
|
39703
|
-
"fc8d59ffffbf91bfdb",
|
|
39704
|
-
"d7191cfdae61abd9e92c7bb6",
|
|
39705
|
-
"d7191cfdae61ffffbfabd9e92c7bb6",
|
|
39706
|
-
"d73027fc8d59fee090e0f3f891bfdb4575b4",
|
|
39707
|
-
"d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4",
|
|
39708
|
-
"d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4",
|
|
39709
|
-
"d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4",
|
|
39710
|
-
"a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695",
|
|
39711
|
-
"a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695"
|
|
39712
|
-
).map(colors);
|
|
39713
|
-
|
|
39714
|
-
ramp$1(scheme$k);
|
|
39715
|
-
|
|
39716
|
-
var scheme$j = new Array(3).concat(
|
|
39717
|
-
"fc8d59ffffbf91cf60",
|
|
39718
|
-
"d7191cfdae61a6d96a1a9641",
|
|
39719
|
-
"d7191cfdae61ffffbfa6d96a1a9641",
|
|
39720
|
-
"d73027fc8d59fee08bd9ef8b91cf601a9850",
|
|
39721
|
-
"d73027fc8d59fee08bffffbfd9ef8b91cf601a9850",
|
|
39722
|
-
"d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850",
|
|
39723
|
-
"d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850",
|
|
39724
|
-
"a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837",
|
|
39725
|
-
"a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837"
|
|
39726
|
-
).map(colors);
|
|
39727
|
-
|
|
39728
|
-
ramp$1(scheme$j);
|
|
39729
|
-
|
|
39730
|
-
var scheme$i = new Array(3).concat(
|
|
39731
|
-
"fc8d59ffffbf99d594",
|
|
39732
|
-
"d7191cfdae61abdda42b83ba",
|
|
39733
|
-
"d7191cfdae61ffffbfabdda42b83ba",
|
|
39734
|
-
"d53e4ffc8d59fee08be6f59899d5943288bd",
|
|
39735
|
-
"d53e4ffc8d59fee08bffffbfe6f59899d5943288bd",
|
|
39736
|
-
"d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd",
|
|
39737
|
-
"d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd",
|
|
39738
|
-
"9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2",
|
|
39739
|
-
"9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2"
|
|
39740
|
-
).map(colors);
|
|
39741
|
-
|
|
39742
|
-
ramp$1(scheme$i);
|
|
39743
|
-
|
|
39744
|
-
var scheme$h = new Array(3).concat(
|
|
39745
|
-
"e5f5f999d8c92ca25f",
|
|
39746
|
-
"edf8fbb2e2e266c2a4238b45",
|
|
39747
|
-
"edf8fbb2e2e266c2a42ca25f006d2c",
|
|
39748
|
-
"edf8fbccece699d8c966c2a42ca25f006d2c",
|
|
39749
|
-
"edf8fbccece699d8c966c2a441ae76238b45005824",
|
|
39750
|
-
"f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824",
|
|
39751
|
-
"f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b"
|
|
39752
|
-
).map(colors);
|
|
39753
|
-
|
|
39754
|
-
ramp$1(scheme$h);
|
|
39755
|
-
|
|
39756
|
-
var scheme$g = new Array(3).concat(
|
|
39757
|
-
"e0ecf49ebcda8856a7",
|
|
39758
|
-
"edf8fbb3cde38c96c688419d",
|
|
39759
|
-
"edf8fbb3cde38c96c68856a7810f7c",
|
|
39760
|
-
"edf8fbbfd3e69ebcda8c96c68856a7810f7c",
|
|
39761
|
-
"edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b",
|
|
39762
|
-
"f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b",
|
|
39763
|
-
"f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b"
|
|
39764
|
-
).map(colors);
|
|
39765
|
-
|
|
39766
|
-
ramp$1(scheme$g);
|
|
39767
|
-
|
|
39768
|
-
var scheme$f = new Array(3).concat(
|
|
39769
|
-
"e0f3dba8ddb543a2ca",
|
|
39770
|
-
"f0f9e8bae4bc7bccc42b8cbe",
|
|
39771
|
-
"f0f9e8bae4bc7bccc443a2ca0868ac",
|
|
39772
|
-
"f0f9e8ccebc5a8ddb57bccc443a2ca0868ac",
|
|
39773
|
-
"f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e",
|
|
39774
|
-
"f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e",
|
|
39775
|
-
"f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081"
|
|
39776
|
-
).map(colors);
|
|
39777
|
-
|
|
39778
|
-
ramp$1(scheme$f);
|
|
39779
|
-
|
|
39780
|
-
var scheme$e = new Array(3).concat(
|
|
39781
|
-
"fee8c8fdbb84e34a33",
|
|
39782
|
-
"fef0d9fdcc8afc8d59d7301f",
|
|
39783
|
-
"fef0d9fdcc8afc8d59e34a33b30000",
|
|
39784
|
-
"fef0d9fdd49efdbb84fc8d59e34a33b30000",
|
|
39785
|
-
"fef0d9fdd49efdbb84fc8d59ef6548d7301f990000",
|
|
39786
|
-
"fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000",
|
|
39787
|
-
"fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000"
|
|
39788
|
-
).map(colors);
|
|
39789
|
-
|
|
39790
|
-
ramp$1(scheme$e);
|
|
39791
|
-
|
|
39792
|
-
var scheme$d = new Array(3).concat(
|
|
39793
|
-
"ece2f0a6bddb1c9099",
|
|
39794
|
-
"f6eff7bdc9e167a9cf02818a",
|
|
39795
|
-
"f6eff7bdc9e167a9cf1c9099016c59",
|
|
39796
|
-
"f6eff7d0d1e6a6bddb67a9cf1c9099016c59",
|
|
39797
|
-
"f6eff7d0d1e6a6bddb67a9cf3690c002818a016450",
|
|
39798
|
-
"fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450",
|
|
39799
|
-
"fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636"
|
|
39800
|
-
).map(colors);
|
|
39801
|
-
|
|
39802
|
-
ramp$1(scheme$d);
|
|
39803
|
-
|
|
39804
|
-
var scheme$c = new Array(3).concat(
|
|
39805
|
-
"ece7f2a6bddb2b8cbe",
|
|
39806
|
-
"f1eef6bdc9e174a9cf0570b0",
|
|
39807
|
-
"f1eef6bdc9e174a9cf2b8cbe045a8d",
|
|
39808
|
-
"f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d",
|
|
39809
|
-
"f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b",
|
|
39810
|
-
"fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b",
|
|
39811
|
-
"fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858"
|
|
39812
|
-
).map(colors);
|
|
39813
|
-
|
|
39814
|
-
ramp$1(scheme$c);
|
|
39815
|
-
|
|
39816
|
-
var scheme$b = new Array(3).concat(
|
|
39817
|
-
"e7e1efc994c7dd1c77",
|
|
39818
|
-
"f1eef6d7b5d8df65b0ce1256",
|
|
39819
|
-
"f1eef6d7b5d8df65b0dd1c77980043",
|
|
39820
|
-
"f1eef6d4b9dac994c7df65b0dd1c77980043",
|
|
39821
|
-
"f1eef6d4b9dac994c7df65b0e7298ace125691003f",
|
|
39822
|
-
"f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f",
|
|
39823
|
-
"f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f"
|
|
39824
|
-
).map(colors);
|
|
39825
|
-
|
|
39826
|
-
ramp$1(scheme$b);
|
|
39827
|
-
|
|
39828
|
-
var scheme$a = new Array(3).concat(
|
|
39829
|
-
"fde0ddfa9fb5c51b8a",
|
|
39830
|
-
"feebe2fbb4b9f768a1ae017e",
|
|
39831
|
-
"feebe2fbb4b9f768a1c51b8a7a0177",
|
|
39832
|
-
"feebe2fcc5c0fa9fb5f768a1c51b8a7a0177",
|
|
39833
|
-
"feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177",
|
|
39834
|
-
"fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177",
|
|
39835
|
-
"fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a"
|
|
39836
|
-
).map(colors);
|
|
39837
|
-
|
|
39838
|
-
ramp$1(scheme$a);
|
|
39839
|
-
|
|
39840
|
-
var scheme$9 = new Array(3).concat(
|
|
39841
|
-
"edf8b17fcdbb2c7fb8",
|
|
39842
|
-
"ffffcca1dab441b6c4225ea8",
|
|
39843
|
-
"ffffcca1dab441b6c42c7fb8253494",
|
|
39844
|
-
"ffffccc7e9b47fcdbb41b6c42c7fb8253494",
|
|
39845
|
-
"ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84",
|
|
39846
|
-
"ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84",
|
|
39847
|
-
"ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58"
|
|
39848
|
-
).map(colors);
|
|
39849
|
-
|
|
39850
|
-
ramp$1(scheme$9);
|
|
39851
|
-
|
|
39852
|
-
var scheme$8 = new Array(3).concat(
|
|
39853
|
-
"f7fcb9addd8e31a354",
|
|
39854
|
-
"ffffccc2e69978c679238443",
|
|
39855
|
-
"ffffccc2e69978c67931a354006837",
|
|
39856
|
-
"ffffccd9f0a3addd8e78c67931a354006837",
|
|
39857
|
-
"ffffccd9f0a3addd8e78c67941ab5d238443005a32",
|
|
39858
|
-
"ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32",
|
|
39859
|
-
"ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529"
|
|
39860
|
-
).map(colors);
|
|
39861
|
-
|
|
39862
|
-
ramp$1(scheme$8);
|
|
39863
|
-
|
|
39864
|
-
var scheme$7 = new Array(3).concat(
|
|
39865
|
-
"fff7bcfec44fd95f0e",
|
|
39866
|
-
"ffffd4fed98efe9929cc4c02",
|
|
39867
|
-
"ffffd4fed98efe9929d95f0e993404",
|
|
39868
|
-
"ffffd4fee391fec44ffe9929d95f0e993404",
|
|
39869
|
-
"ffffd4fee391fec44ffe9929ec7014cc4c028c2d04",
|
|
39870
|
-
"ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04",
|
|
39871
|
-
"ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506"
|
|
39872
|
-
).map(colors);
|
|
39873
|
-
|
|
39874
|
-
ramp$1(scheme$7);
|
|
39875
|
-
|
|
39876
|
-
var scheme$6 = new Array(3).concat(
|
|
39877
|
-
"ffeda0feb24cf03b20",
|
|
39878
|
-
"ffffb2fecc5cfd8d3ce31a1c",
|
|
39879
|
-
"ffffb2fecc5cfd8d3cf03b20bd0026",
|
|
39880
|
-
"ffffb2fed976feb24cfd8d3cf03b20bd0026",
|
|
39881
|
-
"ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026",
|
|
39882
|
-
"ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026",
|
|
39883
|
-
"ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026"
|
|
39884
|
-
).map(colors);
|
|
39885
|
-
|
|
39886
|
-
ramp$1(scheme$6);
|
|
39887
|
-
|
|
39888
|
-
var scheme$5 = new Array(3).concat(
|
|
39889
|
-
"deebf79ecae13182bd",
|
|
39890
|
-
"eff3ffbdd7e76baed62171b5",
|
|
39891
|
-
"eff3ffbdd7e76baed63182bd08519c",
|
|
39892
|
-
"eff3ffc6dbef9ecae16baed63182bd08519c",
|
|
39893
|
-
"eff3ffc6dbef9ecae16baed64292c62171b5084594",
|
|
39894
|
-
"f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594",
|
|
39895
|
-
"f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b"
|
|
39896
|
-
).map(colors);
|
|
39897
|
-
|
|
39898
|
-
ramp$1(scheme$5);
|
|
39899
|
-
|
|
39900
|
-
var scheme$4 = new Array(3).concat(
|
|
39901
|
-
"e5f5e0a1d99b31a354",
|
|
39902
|
-
"edf8e9bae4b374c476238b45",
|
|
39903
|
-
"edf8e9bae4b374c47631a354006d2c",
|
|
39904
|
-
"edf8e9c7e9c0a1d99b74c47631a354006d2c",
|
|
39905
|
-
"edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32",
|
|
39906
|
-
"f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32",
|
|
39907
|
-
"f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b"
|
|
39908
|
-
).map(colors);
|
|
39909
|
-
|
|
39910
|
-
ramp$1(scheme$4);
|
|
39911
|
-
|
|
39912
|
-
var scheme$3 = new Array(3).concat(
|
|
39913
|
-
"f0f0f0bdbdbd636363",
|
|
39914
|
-
"f7f7f7cccccc969696525252",
|
|
39915
|
-
"f7f7f7cccccc969696636363252525",
|
|
39916
|
-
"f7f7f7d9d9d9bdbdbd969696636363252525",
|
|
39917
|
-
"f7f7f7d9d9d9bdbdbd969696737373525252252525",
|
|
39918
|
-
"fffffff0f0f0d9d9d9bdbdbd969696737373525252252525",
|
|
39919
|
-
"fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000"
|
|
39920
|
-
).map(colors);
|
|
39921
|
-
|
|
39922
|
-
ramp$1(scheme$3);
|
|
39923
|
-
|
|
39924
|
-
var scheme$2 = new Array(3).concat(
|
|
39925
|
-
"efedf5bcbddc756bb1",
|
|
39926
|
-
"f2f0f7cbc9e29e9ac86a51a3",
|
|
39927
|
-
"f2f0f7cbc9e29e9ac8756bb154278f",
|
|
39928
|
-
"f2f0f7dadaebbcbddc9e9ac8756bb154278f",
|
|
39929
|
-
"f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486",
|
|
39930
|
-
"fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486",
|
|
39931
|
-
"fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d"
|
|
39932
|
-
).map(colors);
|
|
39933
|
-
|
|
39934
|
-
ramp$1(scheme$2);
|
|
39935
|
-
|
|
39936
|
-
var scheme$1 = new Array(3).concat(
|
|
39937
|
-
"fee0d2fc9272de2d26",
|
|
39938
|
-
"fee5d9fcae91fb6a4acb181d",
|
|
39939
|
-
"fee5d9fcae91fb6a4ade2d26a50f15",
|
|
39940
|
-
"fee5d9fcbba1fc9272fb6a4ade2d26a50f15",
|
|
39941
|
-
"fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d",
|
|
39942
|
-
"fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d",
|
|
39943
|
-
"fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d"
|
|
39944
|
-
).map(colors);
|
|
39945
|
-
|
|
39946
|
-
ramp$1(scheme$1);
|
|
39947
|
-
|
|
39948
|
-
var scheme = new Array(3).concat(
|
|
39949
|
-
"fee6cefdae6be6550d",
|
|
39950
|
-
"feeddefdbe85fd8d3cd94701",
|
|
39951
|
-
"feeddefdbe85fd8d3ce6550da63603",
|
|
39952
|
-
"feeddefdd0a2fdae6bfd8d3ce6550da63603",
|
|
39953
|
-
"feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04",
|
|
39954
|
-
"fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04",
|
|
39955
|
-
"fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704"
|
|
39956
|
-
).map(colors);
|
|
39957
|
-
|
|
39958
|
-
ramp$1(scheme);
|
|
39959
|
-
|
|
39960
|
-
cubehelixLong(cubehelix$1(300, 0.5, 0.0), cubehelix$1(-240, 0.5, 1.0));
|
|
39961
|
-
|
|
39962
|
-
cubehelixLong(cubehelix$1(-100, 0.75, 0.35), cubehelix$1(80, 1.50, 0.8));
|
|
39963
|
-
|
|
39964
|
-
cubehelixLong(cubehelix$1(260, 0.75, 0.35), cubehelix$1(80, 1.50, 0.8));
|
|
39965
|
-
|
|
39966
|
-
cubehelix$1();
|
|
39967
|
-
|
|
39968
|
-
rgb$1();
|
|
39969
|
-
|
|
39970
|
-
function ramp(range) {
|
|
39971
|
-
var n = range.length;
|
|
39972
|
-
return function(t) {
|
|
39973
|
-
return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];
|
|
39974
|
-
};
|
|
39975
|
-
}
|
|
39976
|
-
|
|
39977
|
-
ramp(colors("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));
|
|
39978
|
-
|
|
39979
|
-
ramp(colors("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf"));
|
|
39980
|
-
|
|
39981
|
-
ramp(colors("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4"));
|
|
39982
|
-
|
|
39983
|
-
ramp(colors("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));
|
|
39984
|
-
|
|
39985
37460
|
var tinycolor = {exports: {}};
|
|
39986
37461
|
|
|
39987
37462
|
(function (module) {
|
|
@@ -41644,15 +39119,15 @@ function InsertStackElement(node, body) {
|
|
|
41644
39119
|
Group: Group$1,
|
|
41645
39120
|
Mesh: Mesh,
|
|
41646
39121
|
MeshLambertMaterial: MeshLambertMaterial,
|
|
41647
|
-
Color: Color
|
|
39122
|
+
Color: Color,
|
|
41648
39123
|
BufferGeometry: BufferGeometry,
|
|
41649
39124
|
BufferAttribute: BufferAttribute,
|
|
41650
39125
|
Matrix4: Matrix4,
|
|
41651
39126
|
Vector3: Vector3,
|
|
41652
|
-
|
|
41653
|
-
|
|
41654
|
-
|
|
41655
|
-
|
|
39127
|
+
SphereGeometry: SphereGeometry,
|
|
39128
|
+
CylinderGeometry: CylinderGeometry,
|
|
39129
|
+
TubeGeometry: TubeGeometry,
|
|
39130
|
+
ConeGeometry: ConeGeometry,
|
|
41656
39131
|
Line: Line,
|
|
41657
39132
|
LineBasicMaterial: LineBasicMaterial,
|
|
41658
39133
|
QuadraticBezierCurve3: QuadraticBezierCurve3,
|
|
@@ -41981,10 +39456,10 @@ function InsertStackElement(node, body) {
|
|
|
41981
39456
|
obj.position.z = pos.z || 0;
|
|
41982
39457
|
}); // Update links position
|
|
41983
39458
|
|
|
41984
|
-
var linkWidthAccessor =
|
|
41985
|
-
var linkCurvatureAccessor =
|
|
41986
|
-
var linkCurveRotationAccessor =
|
|
41987
|
-
var linkThreeObjectExtendAccessor =
|
|
39459
|
+
var linkWidthAccessor = accessorFn(state.linkWidth);
|
|
39460
|
+
var linkCurvatureAccessor = accessorFn(state.linkCurvature);
|
|
39461
|
+
var linkCurveRotationAccessor = accessorFn(state.linkCurveRotation);
|
|
39462
|
+
var linkThreeObjectExtendAccessor = accessorFn(state.linkThreeObjectExtend);
|
|
41988
39463
|
state.graphData.links.forEach(function (link) {
|
|
41989
39464
|
var lineObj = link.__lineObj;
|
|
41990
39465
|
if (!lineObj) return;
|
|
@@ -42050,7 +39525,7 @@ function InsertStackElement(node, body) {
|
|
|
42050
39525
|
if (!line.geometry.type.match(/^Cylinder(Buffer)?Geometry$/)) {
|
|
42051
39526
|
var linkWidth = Math.ceil(linkWidthAccessor(link) * 10) / 10;
|
|
42052
39527
|
var r = linkWidth / 2;
|
|
42053
|
-
var geometry = new three$1$1.
|
|
39528
|
+
var geometry = new three$1$1.CylinderGeometry(r, r, 1, state.linkResolution, 1, false);
|
|
42054
39529
|
geometry[applyMatrix4Fn](new three$1$1.Matrix4().makeTranslation(0, 1 / 2, 0));
|
|
42055
39530
|
geometry[applyMatrix4Fn](new three$1$1.Matrix4().makeRotationX(Math.PI / 2));
|
|
42056
39531
|
line.geometry.dispose();
|
|
@@ -42080,7 +39555,7 @@ function InsertStackElement(node, body) {
|
|
|
42080
39555
|
|
|
42081
39556
|
var _r = _linkWidth / 2;
|
|
42082
39557
|
|
|
42083
|
-
var _geometry = new three$1$1.
|
|
39558
|
+
var _geometry = new three$1$1.TubeGeometry(curve, curveResolution, _r, state.linkResolution, false);
|
|
42084
39559
|
|
|
42085
39560
|
line.geometry.dispose();
|
|
42086
39561
|
line.geometry = _geometry;
|
|
@@ -42131,9 +39606,9 @@ function InsertStackElement(node, body) {
|
|
|
42131
39606
|
|
|
42132
39607
|
function updateArrows() {
|
|
42133
39608
|
// update link arrow position
|
|
42134
|
-
var arrowRelPosAccessor =
|
|
42135
|
-
var arrowLengthAccessor =
|
|
42136
|
-
var nodeValAccessor =
|
|
39609
|
+
var arrowRelPosAccessor = accessorFn(state.linkDirectionalArrowRelPos);
|
|
39610
|
+
var arrowLengthAccessor = accessorFn(state.linkDirectionalArrowLength);
|
|
39611
|
+
var nodeValAccessor = accessorFn(state.nodeVal);
|
|
42137
39612
|
state.graphData.links.forEach(function (link) {
|
|
42138
39613
|
var arrowObj = link.__arrowObj;
|
|
42139
39614
|
if (!arrowObj) return;
|
|
@@ -42185,7 +39660,7 @@ function InsertStackElement(node, body) {
|
|
|
42185
39660
|
|
|
42186
39661
|
function updatePhotons() {
|
|
42187
39662
|
// update link particle positions
|
|
42188
|
-
var particleSpeedAccessor =
|
|
39663
|
+
var particleSpeedAccessor = accessorFn(state.linkDirectionalParticleSpeed);
|
|
42189
39664
|
state.graphData.links.forEach(function (link) {
|
|
42190
39665
|
var cyclePhotons = link.__photonsObj && link.__photonsObj.children;
|
|
42191
39666
|
var singleHopPhotons = link.__singleHopPhotonsObj && link.__singleHopPhotonsObj.children;
|
|
@@ -42250,12 +39725,12 @@ function InsertStackElement(node, body) {
|
|
|
42250
39725
|
state.graphScene.add(obj);
|
|
42251
39726
|
}
|
|
42252
39727
|
|
|
42253
|
-
var particleWidthAccessor =
|
|
39728
|
+
var particleWidthAccessor = accessorFn(state.linkDirectionalParticleWidth);
|
|
42254
39729
|
var photonR = Math.ceil(particleWidthAccessor(link) * 10) / 10 / 2;
|
|
42255
39730
|
var numSegments = state.linkDirectionalParticleResolution;
|
|
42256
|
-
var particleGeometry = new three$1$1.
|
|
42257
|
-
var linkColorAccessor =
|
|
42258
|
-
var particleColorAccessor =
|
|
39731
|
+
var particleGeometry = new three$1$1.SphereGeometry(photonR, numSegments, numSegments);
|
|
39732
|
+
var linkColorAccessor = accessorFn(state.linkColor);
|
|
39733
|
+
var particleColorAccessor = accessorFn(state.linkDirectionalParticleColor);
|
|
42259
39734
|
var photonColor = particleColorAccessor(link) || linkColorAccessor(link) || '#f0f0f0';
|
|
42260
39735
|
var materialColor = new three$1$1.Color(colorStr2Hex(photonColor));
|
|
42261
39736
|
var opacity = state.linkOpacity * 3;
|
|
@@ -42326,21 +39801,21 @@ function InsertStackElement(node, body) {
|
|
|
42326
39801
|
|
|
42327
39802
|
if (state.nodeAutoColorBy !== null && hasAnyPropChanged(['nodeAutoColorBy', 'graphData', 'nodeColor'])) {
|
|
42328
39803
|
// Auto add color to uncolored nodes
|
|
42329
|
-
autoColorObjects(state.graphData.nodes,
|
|
39804
|
+
autoColorObjects(state.graphData.nodes, accessorFn(state.nodeAutoColorBy), state.nodeColor);
|
|
42330
39805
|
}
|
|
42331
39806
|
|
|
42332
39807
|
if (state.linkAutoColorBy !== null && hasAnyPropChanged(['linkAutoColorBy', 'graphData', 'linkColor'])) {
|
|
42333
39808
|
// Auto add color to uncolored links
|
|
42334
|
-
autoColorObjects(state.graphData.links,
|
|
39809
|
+
autoColorObjects(state.graphData.links, accessorFn(state.linkAutoColorBy), state.linkColor);
|
|
42335
39810
|
} // Digest nodes WebGL objects
|
|
42336
39811
|
|
|
42337
39812
|
|
|
42338
39813
|
if (state._flushObjects || hasAnyPropChanged(['graphData', 'nodeThreeObject', 'nodeThreeObjectExtend', 'nodeVal', 'nodeColor', 'nodeVisibility', 'nodeRelSize', 'nodeResolution', 'nodeOpacity'])) {
|
|
42339
|
-
var customObjectAccessor =
|
|
42340
|
-
var customObjectExtendAccessor =
|
|
42341
|
-
var valAccessor =
|
|
42342
|
-
var colorAccessor =
|
|
42343
|
-
var visibilityAccessor =
|
|
39814
|
+
var customObjectAccessor = accessorFn(state.nodeThreeObject);
|
|
39815
|
+
var customObjectExtendAccessor = accessorFn(state.nodeThreeObjectExtend);
|
|
39816
|
+
var valAccessor = accessorFn(state.nodeVal);
|
|
39817
|
+
var colorAccessor = accessorFn(state.nodeColor);
|
|
39818
|
+
var visibilityAccessor = accessorFn(state.nodeVisibility);
|
|
42344
39819
|
var sphereGeometries = {}; // indexed by node value
|
|
42345
39820
|
|
|
42346
39821
|
var sphereMaterials = {}; // indexed by color
|
|
@@ -42387,7 +39862,7 @@ function InsertStackElement(node, body) {
|
|
|
42387
39862
|
|
|
42388
39863
|
if (!obj.geometry.type.match(/^Sphere(Buffer)?Geometry$/) || obj.geometry.parameters.radius !== radius || obj.geometry.parameters.widthSegments !== numSegments) {
|
|
42389
39864
|
if (!sphereGeometries.hasOwnProperty(val)) {
|
|
42390
|
-
sphereGeometries[val] = new three$1$1.
|
|
39865
|
+
sphereGeometries[val] = new three$1$1.SphereGeometry(radius, numSegments, numSegments);
|
|
42391
39866
|
}
|
|
42392
39867
|
|
|
42393
39868
|
obj.geometry.dispose();
|
|
@@ -42417,17 +39892,17 @@ function InsertStackElement(node, body) {
|
|
|
42417
39892
|
|
|
42418
39893
|
|
|
42419
39894
|
if (state._flushObjects || hasAnyPropChanged(['graphData', 'linkThreeObject', 'linkThreeObjectExtend', 'linkMaterial', 'linkColor', 'linkWidth', 'linkVisibility', 'linkResolution', 'linkOpacity', 'linkDirectionalArrowLength', 'linkDirectionalArrowColor', 'linkDirectionalArrowResolution', 'linkDirectionalParticles', 'linkDirectionalParticleWidth', 'linkDirectionalParticleColor', 'linkDirectionalParticleResolution'])) {
|
|
42420
|
-
var _customObjectAccessor =
|
|
39895
|
+
var _customObjectAccessor = accessorFn(state.linkThreeObject);
|
|
42421
39896
|
|
|
42422
|
-
var _customObjectExtendAccessor =
|
|
39897
|
+
var _customObjectExtendAccessor = accessorFn(state.linkThreeObjectExtend);
|
|
42423
39898
|
|
|
42424
|
-
var customMaterialAccessor =
|
|
39899
|
+
var customMaterialAccessor = accessorFn(state.linkMaterial);
|
|
42425
39900
|
|
|
42426
|
-
var _visibilityAccessor =
|
|
39901
|
+
var _visibilityAccessor = accessorFn(state.linkVisibility);
|
|
42427
39902
|
|
|
42428
|
-
var _colorAccessor =
|
|
39903
|
+
var _colorAccessor = accessorFn(state.linkColor);
|
|
42429
39904
|
|
|
42430
|
-
var widthAccessor =
|
|
39905
|
+
var widthAccessor = accessorFn(state.linkWidth);
|
|
42431
39906
|
var cylinderGeometries = {}; // indexed by link width
|
|
42432
39907
|
|
|
42433
39908
|
var lambertLineMaterials = {}; // for cylinder objects, indexed by link color
|
|
@@ -42507,7 +39982,7 @@ function InsertStackElement(node, body) {
|
|
|
42507
39982
|
|
|
42508
39983
|
if (!obj.geometry.type.match(/^Cylinder(Buffer)?Geometry$/) || obj.geometry.parameters.radiusTop !== r || obj.geometry.parameters.radialSegments !== numSegments) {
|
|
42509
39984
|
if (!cylinderGeometries.hasOwnProperty(linkWidth)) {
|
|
42510
|
-
var geometry = new three$1$1.
|
|
39985
|
+
var geometry = new three$1$1.CylinderGeometry(r, r, 1, numSegments, 1, false);
|
|
42511
39986
|
geometry[applyMatrix4Fn](new three$1$1.Matrix4().makeTranslation(0, 1 / 2, 0));
|
|
42512
39987
|
geometry[applyMatrix4Fn](new three$1$1.Matrix4().makeRotationX(Math.PI / 2));
|
|
42513
39988
|
cylinderGeometries[linkWidth] = geometry;
|
|
@@ -42551,8 +40026,8 @@ function InsertStackElement(node, body) {
|
|
|
42551
40026
|
}); // Arrows digest cycle
|
|
42552
40027
|
|
|
42553
40028
|
if (state.linkDirectionalArrowLength || changedProps.hasOwnProperty('linkDirectionalArrowLength')) {
|
|
42554
|
-
var arrowLengthAccessor =
|
|
42555
|
-
var arrowColorAccessor =
|
|
40029
|
+
var arrowLengthAccessor = accessorFn(state.linkDirectionalArrowLength);
|
|
40030
|
+
var arrowColorAccessor = accessorFn(state.linkDirectionalArrowColor);
|
|
42556
40031
|
threeDigest(visibleLinks.filter(arrowLengthAccessor), state.graphScene, {
|
|
42557
40032
|
objBindAttr: '__arrowObj',
|
|
42558
40033
|
objFilter: function objFilter(obj) {
|
|
@@ -42571,7 +40046,7 @@ function InsertStackElement(node, body) {
|
|
|
42571
40046
|
var numSegments = state.linkDirectionalArrowResolution;
|
|
42572
40047
|
|
|
42573
40048
|
if (!obj.geometry.type.match(/^Cone(Buffer)?Geometry$/) || obj.geometry.parameters.height !== arrowLength || obj.geometry.parameters.radialSegments !== numSegments) {
|
|
42574
|
-
var coneGeometry = new three$1$1.
|
|
40049
|
+
var coneGeometry = new three$1$1.ConeGeometry(arrowLength * 0.25, arrowLength, numSegments); // Correct orientation
|
|
42575
40050
|
|
|
42576
40051
|
coneGeometry.translate(0, arrowLength / 2, 0);
|
|
42577
40052
|
coneGeometry.rotateX(Math.PI / 2);
|
|
@@ -42587,9 +40062,9 @@ function InsertStackElement(node, body) {
|
|
|
42587
40062
|
|
|
42588
40063
|
|
|
42589
40064
|
if (state.linkDirectionalParticles || changedProps.hasOwnProperty('linkDirectionalParticles')) {
|
|
42590
|
-
var particlesAccessor =
|
|
42591
|
-
var particleWidthAccessor =
|
|
42592
|
-
var particleColorAccessor =
|
|
40065
|
+
var particlesAccessor = accessorFn(state.linkDirectionalParticles);
|
|
40066
|
+
var particleWidthAccessor = accessorFn(state.linkDirectionalParticleWidth);
|
|
40067
|
+
var particleColorAccessor = accessorFn(state.linkDirectionalParticleColor);
|
|
42593
40068
|
var particleMaterials = {}; // indexed by link color
|
|
42594
40069
|
|
|
42595
40070
|
var particleGeometries = {}; // indexed by particle width
|
|
@@ -42616,7 +40091,7 @@ function InsertStackElement(node, body) {
|
|
|
42616
40091
|
particleGeometry = curPhoton.geometry;
|
|
42617
40092
|
} else {
|
|
42618
40093
|
if (!particleGeometries.hasOwnProperty(photonR)) {
|
|
42619
|
-
particleGeometries[photonR] = new three$1$1.
|
|
40094
|
+
particleGeometries[photonR] = new three$1$1.SphereGeometry(photonR, numSegments, numSegments);
|
|
42620
40095
|
}
|
|
42621
40096
|
|
|
42622
40097
|
particleGeometry = particleGeometries[photonR];
|
|
@@ -42813,9 +40288,6 @@ function InsertStackElement(node, body) {
|
|
|
42813
40288
|
|
|
42814
40289
|
super();
|
|
42815
40290
|
|
|
42816
|
-
if ( domElement === undefined ) console.warn( 'THREE.TrackballControls: The second parameter "domElement" is now mandatory.' );
|
|
42817
|
-
if ( domElement === document ) console.error( 'THREE.TrackballControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.' );
|
|
42818
|
-
|
|
42819
40291
|
const scope = this;
|
|
42820
40292
|
const STATE = { NONE: - 1, ROTATE: 0, ZOOM: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_ZOOM_PAN: 4 };
|
|
42821
40293
|
|
|
@@ -43616,9 +41088,6 @@ function InsertStackElement(node, body) {
|
|
|
43616
41088
|
|
|
43617
41089
|
super();
|
|
43618
41090
|
|
|
43619
|
-
if ( domElement === undefined ) console.warn( 'THREE.OrbitControls: The second parameter "domElement" is now mandatory.' );
|
|
43620
|
-
if ( domElement === document ) console.error( 'THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.' );
|
|
43621
|
-
|
|
43622
41091
|
this.object = object;
|
|
43623
41092
|
this.domElement = domElement;
|
|
43624
41093
|
this.domElement.style.touchAction = 'none'; // disable touch scroll
|
|
@@ -44819,13 +42288,6 @@ function InsertStackElement(node, body) {
|
|
|
44819
42288
|
|
|
44820
42289
|
super();
|
|
44821
42290
|
|
|
44822
|
-
if ( domElement === undefined ) {
|
|
44823
|
-
|
|
44824
|
-
console.warn( 'THREE.FlyControls: The second parameter "domElement" is now mandatory.' );
|
|
44825
|
-
domElement = document;
|
|
44826
|
-
|
|
44827
|
-
}
|
|
44828
|
-
|
|
44829
42291
|
this.object = object;
|
|
44830
42292
|
this.domElement = domElement;
|
|
44831
42293
|
|
|
@@ -45618,7 +43080,7 @@ function InsertStackElement(node, body) {
|
|
|
45618
43080
|
this.clear = true;
|
|
45619
43081
|
this.clearDepth = false;
|
|
45620
43082
|
this.needsSwap = false;
|
|
45621
|
-
this._oldClearColor = new Color
|
|
43083
|
+
this._oldClearColor = new Color();
|
|
45622
43084
|
|
|
45623
43085
|
}
|
|
45624
43086
|
|
|
@@ -47375,7 +44837,7 @@ function InsertStackElement(node, body) {
|
|
|
47375
44837
|
Vector2: Vector2,
|
|
47376
44838
|
Vector3: Vector3,
|
|
47377
44839
|
Box3: Box3,
|
|
47378
|
-
Color: Color
|
|
44840
|
+
Color: Color,
|
|
47379
44841
|
Mesh: Mesh,
|
|
47380
44842
|
SphereGeometry: SphereGeometry,
|
|
47381
44843
|
MeshBasicMaterial: MeshBasicMaterial,
|
|
@@ -47492,7 +44954,7 @@ function InsertStackElement(node, body) {
|
|
|
47492
44954
|
|
|
47493
44955
|
if (topObject !== state.hoverObj) {
|
|
47494
44956
|
state.onHover(topObject, state.hoverObj);
|
|
47495
|
-
state.toolTipElem.innerHTML = topObject ?
|
|
44957
|
+
state.toolTipElem.innerHTML = topObject ? accessorFn(state.tooltipContent)(topObject) || '' : '';
|
|
47496
44958
|
state.hoverObj = topObject;
|
|
47497
44959
|
}
|
|
47498
44960
|
}
|
|
@@ -47852,7 +45314,7 @@ function InsertStackElement(node, body) {
|
|
|
47852
45314
|
}
|
|
47853
45315
|
|
|
47854
45316
|
if (changedProps.hasOwnProperty('skyRadius') && state.skyRadius) {
|
|
47855
|
-
state.controls.hasOwnProperty('maxDistance') && changedProps.skyRadius && (state.controls.maxDistance = state.skyRadius);
|
|
45317
|
+
state.controls.hasOwnProperty('maxDistance') && changedProps.skyRadius && (state.controls.maxDistance = Math.min(state.controls.maxDistance, state.skyRadius));
|
|
47856
45318
|
state.camera.far = state.skyRadius * 2.5;
|
|
47857
45319
|
state.camera.updateProjectionMatrix();
|
|
47858
45320
|
state.skysphere.geometry = new three$1.SphereGeometry(state.skyRadius);
|
|
@@ -48292,7 +45754,7 @@ function InsertStackElement(node, body) {
|
|
|
48292
45754
|
return isNode(bObj) - isNode(aObj);
|
|
48293
45755
|
}).tooltipContent(function (obj) {
|
|
48294
45756
|
var graphObj = getGraphObj(obj);
|
|
48295
|
-
return graphObj ?
|
|
45757
|
+
return graphObj ? accessorFn(state["".concat(graphObj.__graphObjType, "Label")])(graphObj.__data) || '' : '';
|
|
48296
45758
|
}).hoverDuringDrag(false).onHover(function (obj) {
|
|
48297
45759
|
// Update tooltip and trigger onHover events
|
|
48298
45760
|
var hoverObj = getGraphObj(obj);
|