globe.gl 2.42.0 → 2.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/globe.gl.js +1516 -1102
- package/dist/globe.gl.js.map +1 -1
- package/dist/globe.gl.min.js +4 -4
- package/dist/globe.gl.mjs +1 -1
- package/package.json +5 -5
package/dist/globe.gl.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Version 2.
|
|
1
|
+
// Version 2.43.0 globe.gl - https://github.com/vasturiano/globe.gl
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
* Copyright 2010-2025 Three.js Authors
|
|
129
129
|
* SPDX-License-Identifier: MIT
|
|
130
130
|
*/
|
|
131
|
-
const REVISION = '
|
|
131
|
+
const REVISION = '178';
|
|
132
132
|
|
|
133
133
|
/**
|
|
134
134
|
* Represents mouse buttons and interaction types in context of controls.
|
|
@@ -3749,7 +3749,7 @@
|
|
|
3749
3749
|
|
|
3750
3750
|
let r = vFrom.dot( vTo ) + 1;
|
|
3751
3751
|
|
|
3752
|
-
if ( r <
|
|
3752
|
+
if ( r < 1e-8 ) { // the epsilon value has been discussed in #31286
|
|
3753
3753
|
|
|
3754
3754
|
// vFrom and vTo point in opposite directions
|
|
3755
3755
|
|
|
@@ -12964,7 +12964,7 @@
|
|
|
12964
12964
|
const _childaddedEvent = { type: 'childadded', child: null };
|
|
12965
12965
|
|
|
12966
12966
|
/**
|
|
12967
|
-
* Fires when a
|
|
12967
|
+
* Fires when a child object has been removed.
|
|
12968
12968
|
*
|
|
12969
12969
|
* @event Object3D#childremoved
|
|
12970
12970
|
* @type {Object}
|
|
@@ -17525,7 +17525,7 @@
|
|
|
17525
17525
|
/**
|
|
17526
17526
|
* Applies to integer data only. Indicates how the underlying data in the buffer maps to
|
|
17527
17527
|
* the values in the GLSL code. For instance, if `array` is an instance of `UInt16Array`,
|
|
17528
|
-
* and `normalized` is `true`, the values `0
|
|
17528
|
+
* and `normalized` is `true`, the values `0 - +65535` in the array data will be mapped to
|
|
17529
17529
|
* `0.0f - +1.0f` in the GLSL attribute. If `normalized` is `false`, the values will be converted
|
|
17530
17530
|
* to floats unmodified, i.e. `65535` becomes `65535.0f`.
|
|
17531
17531
|
*
|
|
@@ -18163,8 +18163,8 @@
|
|
|
18163
18163
|
* Convenient class that can be used when creating a `Float16` buffer attribute with
|
|
18164
18164
|
* a plain `Array` instance.
|
|
18165
18165
|
*
|
|
18166
|
-
* This class automatically converts to and from FP16 since `Float16Array`
|
|
18167
|
-
*
|
|
18166
|
+
* This class automatically converts to and from FP16 via `Uint16Array` since `Float16Array`
|
|
18167
|
+
* browser support is still problematic.
|
|
18168
18168
|
*
|
|
18169
18169
|
* @augments BufferAttribute
|
|
18170
18170
|
*/
|
|
@@ -24058,6 +24058,7 @@
|
|
|
24058
24058
|
}
|
|
24059
24059
|
|
|
24060
24060
|
const _sphere$3 = /*@__PURE__*/ new Sphere();
|
|
24061
|
+
const _defaultSpriteCenter = /*@__PURE__*/ new Vector2( 0.5, 0.5 );
|
|
24061
24062
|
const _vector$6 = /*@__PURE__*/ new Vector3();
|
|
24062
24063
|
|
|
24063
24064
|
/**
|
|
@@ -24215,7 +24216,10 @@
|
|
|
24215
24216
|
intersectsSprite( sprite ) {
|
|
24216
24217
|
|
|
24217
24218
|
_sphere$3.center.set( 0, 0, 0 );
|
|
24218
|
-
|
|
24219
|
+
|
|
24220
|
+
const offset = _defaultSpriteCenter.distanceTo( sprite.center );
|
|
24221
|
+
|
|
24222
|
+
_sphere$3.radius = 0.7071067811865476 + offset;
|
|
24219
24223
|
_sphere$3.applyMatrix4( sprite.matrixWorld );
|
|
24220
24224
|
|
|
24221
24225
|
return this.intersectsSphere( _sphere$3 );
|
|
@@ -28671,11 +28675,11 @@
|
|
|
28671
28675
|
* Adds an arc as an instance of {@link EllipseCurve} to the path, positioned relative
|
|
28672
28676
|
* to the current point.
|
|
28673
28677
|
*
|
|
28674
|
-
* @param {number} aX - The x coordinate of the center of the arc offsetted from the previous curve.
|
|
28675
|
-
* @param {number} aY - The y coordinate of the center of the arc offsetted from the previous curve.
|
|
28676
|
-
* @param {number} aRadius - The radius of the arc.
|
|
28677
|
-
* @param {number} aStartAngle - The start angle in radians.
|
|
28678
|
-
* @param {number} aEndAngle - The end angle in radians.
|
|
28678
|
+
* @param {number} [aX=0] - The x coordinate of the center of the arc offsetted from the previous curve.
|
|
28679
|
+
* @param {number} [aY=0] - The y coordinate of the center of the arc offsetted from the previous curve.
|
|
28680
|
+
* @param {number} [aRadius=1] - The radius of the arc.
|
|
28681
|
+
* @param {number} [aStartAngle=0] - The start angle in radians.
|
|
28682
|
+
* @param {number} [aEndAngle=Math.PI*2] - The end angle in radians.
|
|
28679
28683
|
* @param {boolean} [aClockwise=false] - Whether to sweep the arc clockwise or not.
|
|
28680
28684
|
* @return {Path} A reference to this path.
|
|
28681
28685
|
*/
|
|
@@ -28694,11 +28698,11 @@
|
|
|
28694
28698
|
/**
|
|
28695
28699
|
* Adds an absolutely positioned arc as an instance of {@link EllipseCurve} to the path.
|
|
28696
28700
|
*
|
|
28697
|
-
* @param {number} aX - The x coordinate of the center of the arc.
|
|
28698
|
-
* @param {number} aY - The y coordinate of the center of the arc.
|
|
28699
|
-
* @param {number} aRadius - The radius of the arc.
|
|
28700
|
-
* @param {number} aStartAngle - The start angle in radians.
|
|
28701
|
-
* @param {number} aEndAngle - The end angle in radians.
|
|
28701
|
+
* @param {number} [aX=0] - The x coordinate of the center of the arc.
|
|
28702
|
+
* @param {number} [aY=0] - The y coordinate of the center of the arc.
|
|
28703
|
+
* @param {number} [aRadius=1] - The radius of the arc.
|
|
28704
|
+
* @param {number} [aStartAngle=0] - The start angle in radians.
|
|
28705
|
+
* @param {number} [aEndAngle=Math.PI*2] - The end angle in radians.
|
|
28702
28706
|
* @param {boolean} [aClockwise=false] - Whether to sweep the arc clockwise or not.
|
|
28703
28707
|
* @return {Path} A reference to this path.
|
|
28704
28708
|
*/
|
|
@@ -28714,12 +28718,12 @@
|
|
|
28714
28718
|
* Adds an ellipse as an instance of {@link EllipseCurve} to the path, positioned relative
|
|
28715
28719
|
* to the current point
|
|
28716
28720
|
*
|
|
28717
|
-
* @param {number} aX - The x coordinate of the center of the ellipse offsetted from the previous curve.
|
|
28718
|
-
* @param {number} aY - The y coordinate of the center of the ellipse offsetted from the previous curve.
|
|
28719
|
-
* @param {number} xRadius - The radius of the ellipse in the x axis.
|
|
28720
|
-
* @param {number} yRadius - The radius of the ellipse in the y axis.
|
|
28721
|
-
* @param {number} aStartAngle - The start angle in radians.
|
|
28722
|
-
* @param {number} aEndAngle - The end angle in radians.
|
|
28721
|
+
* @param {number} [aX=0] - The x coordinate of the center of the ellipse offsetted from the previous curve.
|
|
28722
|
+
* @param {number} [aY=0] - The y coordinate of the center of the ellipse offsetted from the previous curve.
|
|
28723
|
+
* @param {number} [xRadius=1] - The radius of the ellipse in the x axis.
|
|
28724
|
+
* @param {number} [yRadius=1] - The radius of the ellipse in the y axis.
|
|
28725
|
+
* @param {number} [aStartAngle=0] - The start angle in radians.
|
|
28726
|
+
* @param {number} [aEndAngle=Math.PI*2] - The end angle in radians.
|
|
28723
28727
|
* @param {boolean} [aClockwise=false] - Whether to sweep the ellipse clockwise or not.
|
|
28724
28728
|
* @param {number} [aRotation=0] - The rotation angle of the ellipse in radians, counterclockwise from the positive X axis.
|
|
28725
28729
|
* @return {Path} A reference to this path.
|
|
@@ -28738,12 +28742,12 @@
|
|
|
28738
28742
|
/**
|
|
28739
28743
|
* Adds an absolutely positioned ellipse as an instance of {@link EllipseCurve} to the path.
|
|
28740
28744
|
*
|
|
28741
|
-
* @param {number} aX - The x coordinate of the absolute center of the ellipse.
|
|
28742
|
-
* @param {number} aY - The y coordinate of the absolute center of the ellipse.
|
|
28743
|
-
* @param {number} xRadius - The radius of the ellipse in the x axis.
|
|
28744
|
-
* @param {number} yRadius - The radius of the ellipse in the y axis.
|
|
28745
|
-
* @param {number} aStartAngle - The start angle in radians.
|
|
28746
|
-
* @param {number} aEndAngle - The end angle in radians.
|
|
28745
|
+
* @param {number} [aX=0] - The x coordinate of the absolute center of the ellipse.
|
|
28746
|
+
* @param {number} [aY=0] - The y coordinate of the absolute center of the ellipse.
|
|
28747
|
+
* @param {number} [xRadius=1] - The radius of the ellipse in the x axis.
|
|
28748
|
+
* @param {number} [yRadius=1] - The radius of the ellipse in the y axis.
|
|
28749
|
+
* @param {number} [aStartAngle=0] - The start angle in radians.
|
|
28750
|
+
* @param {number} [aEndAngle=Math.PI*2] - The end angle in radians.
|
|
28747
28751
|
* @param {boolean} [aClockwise=false] - Whether to sweep the ellipse clockwise or not.
|
|
28748
28752
|
* @param {number} [aRotation=0] - The rotation angle of the ellipse in radians, counterclockwise from the positive X axis.
|
|
28749
28753
|
* @return {Path} A reference to this path.
|
|
@@ -34760,6 +34764,8 @@
|
|
|
34760
34764
|
*/
|
|
34761
34765
|
Loader.DEFAULT_MATERIAL_NAME = '__DEFAULT';
|
|
34762
34766
|
|
|
34767
|
+
const _loading = new WeakMap();
|
|
34768
|
+
|
|
34763
34769
|
/**
|
|
34764
34770
|
* A loader for loading images. The class loads images with the HTML `Image` API.
|
|
34765
34771
|
*
|
|
@@ -34806,19 +34812,36 @@
|
|
|
34806
34812
|
|
|
34807
34813
|
const scope = this;
|
|
34808
34814
|
|
|
34809
|
-
const cached = Cache.get( url );
|
|
34815
|
+
const cached = Cache.get( `image:${url}` );
|
|
34810
34816
|
|
|
34811
34817
|
if ( cached !== undefined ) {
|
|
34812
34818
|
|
|
34813
|
-
|
|
34819
|
+
if ( cached.complete === true ) {
|
|
34820
|
+
|
|
34821
|
+
scope.manager.itemStart( url );
|
|
34814
34822
|
|
|
34815
|
-
|
|
34823
|
+
setTimeout( function () {
|
|
34816
34824
|
|
|
34817
|
-
|
|
34825
|
+
if ( onLoad ) onLoad( cached );
|
|
34826
|
+
|
|
34827
|
+
scope.manager.itemEnd( url );
|
|
34828
|
+
|
|
34829
|
+
}, 0 );
|
|
34830
|
+
|
|
34831
|
+
} else {
|
|
34818
34832
|
|
|
34819
|
-
|
|
34833
|
+
let arr = _loading.get( cached );
|
|
34820
34834
|
|
|
34821
|
-
|
|
34835
|
+
if ( arr === undefined ) {
|
|
34836
|
+
|
|
34837
|
+
arr = [];
|
|
34838
|
+
_loading.set( cached, arr );
|
|
34839
|
+
|
|
34840
|
+
}
|
|
34841
|
+
|
|
34842
|
+
arr.push( { onLoad, onError } );
|
|
34843
|
+
|
|
34844
|
+
}
|
|
34822
34845
|
|
|
34823
34846
|
return cached;
|
|
34824
34847
|
|
|
@@ -34830,10 +34853,21 @@
|
|
|
34830
34853
|
|
|
34831
34854
|
removeEventListeners();
|
|
34832
34855
|
|
|
34833
|
-
Cache.add( url, this );
|
|
34834
|
-
|
|
34835
34856
|
if ( onLoad ) onLoad( this );
|
|
34836
34857
|
|
|
34858
|
+
//
|
|
34859
|
+
|
|
34860
|
+
const callbacks = _loading.get( this ) || [];
|
|
34861
|
+
|
|
34862
|
+
for ( let i = 0; i < callbacks.length; i ++ ) {
|
|
34863
|
+
|
|
34864
|
+
const callback = callbacks[ i ];
|
|
34865
|
+
if ( callback.onLoad ) callback.onLoad( this );
|
|
34866
|
+
|
|
34867
|
+
}
|
|
34868
|
+
|
|
34869
|
+
_loading.delete( this );
|
|
34870
|
+
|
|
34837
34871
|
scope.manager.itemEnd( url );
|
|
34838
34872
|
|
|
34839
34873
|
}
|
|
@@ -34844,6 +34878,22 @@
|
|
|
34844
34878
|
|
|
34845
34879
|
if ( onError ) onError( event );
|
|
34846
34880
|
|
|
34881
|
+
Cache.remove( `image:${url}` );
|
|
34882
|
+
|
|
34883
|
+
//
|
|
34884
|
+
|
|
34885
|
+
const callbacks = _loading.get( this ) || [];
|
|
34886
|
+
|
|
34887
|
+
for ( let i = 0; i < callbacks.length; i ++ ) {
|
|
34888
|
+
|
|
34889
|
+
const callback = callbacks[ i ];
|
|
34890
|
+
if ( callback.onError ) callback.onError( event );
|
|
34891
|
+
|
|
34892
|
+
}
|
|
34893
|
+
|
|
34894
|
+
_loading.delete( this );
|
|
34895
|
+
|
|
34896
|
+
|
|
34847
34897
|
scope.manager.itemError( url );
|
|
34848
34898
|
scope.manager.itemEnd( url );
|
|
34849
34899
|
|
|
@@ -34865,6 +34915,7 @@
|
|
|
34865
34915
|
|
|
34866
34916
|
}
|
|
34867
34917
|
|
|
34918
|
+
Cache.add( `image:${url}`, image );
|
|
34868
34919
|
scope.manager.itemStart( url );
|
|
34869
34920
|
|
|
34870
34921
|
image.src = url;
|
|
@@ -36986,7 +37037,7 @@
|
|
|
36986
37037
|
*/
|
|
36987
37038
|
start() {
|
|
36988
37039
|
|
|
36989
|
-
this.startTime = now
|
|
37040
|
+
this.startTime = performance.now();
|
|
36990
37041
|
|
|
36991
37042
|
this.oldTime = this.startTime;
|
|
36992
37043
|
this.elapsedTime = 0;
|
|
@@ -37035,7 +37086,7 @@
|
|
|
37035
37086
|
|
|
37036
37087
|
if ( this.running ) {
|
|
37037
37088
|
|
|
37038
|
-
const newTime = now
|
|
37089
|
+
const newTime = performance.now();
|
|
37039
37090
|
|
|
37040
37091
|
diff = ( newTime - this.oldTime ) / 1000;
|
|
37041
37092
|
this.oldTime = newTime;
|
|
@@ -37050,12 +37101,6 @@
|
|
|
37050
37101
|
|
|
37051
37102
|
}
|
|
37052
37103
|
|
|
37053
|
-
function now$2() {
|
|
37054
|
-
|
|
37055
|
-
return performance.now();
|
|
37056
|
-
|
|
37057
|
-
}
|
|
37058
|
-
|
|
37059
37104
|
/**
|
|
37060
37105
|
* An instanced version of an interleaved buffer.
|
|
37061
37106
|
*
|
|
@@ -38571,6 +38616,10 @@
|
|
|
38571
38616
|
|
|
38572
38617
|
type = gl.FLOAT;
|
|
38573
38618
|
|
|
38619
|
+
} else if ( typeof Float16Array !== 'undefined' && array instanceof Float16Array ) {
|
|
38620
|
+
|
|
38621
|
+
type = gl.HALF_FLOAT;
|
|
38622
|
+
|
|
38574
38623
|
} else if ( array instanceof Uint16Array ) {
|
|
38575
38624
|
|
|
38576
38625
|
if ( attribute.isFloat16BufferAttribute ) {
|
|
@@ -45548,7 +45597,7 @@
|
|
|
45548
45597
|
useFog: material.fog === true,
|
|
45549
45598
|
fogExp2: ( !! fog && fog.isFogExp2 ),
|
|
45550
45599
|
|
|
45551
|
-
flatShading: material.flatShading === true,
|
|
45600
|
+
flatShading: ( material.flatShading === true && material.wireframe === false ),
|
|
45552
45601
|
|
|
45553
45602
|
sizeAttenuation: material.sizeAttenuation === true,
|
|
45554
45603
|
logarithmicDepthBuffer: logarithmicDepthBuffer,
|
|
@@ -45761,6 +45810,8 @@
|
|
|
45761
45810
|
_programLayers.enable( 20 );
|
|
45762
45811
|
if ( parameters.batchingColor )
|
|
45763
45812
|
_programLayers.enable( 21 );
|
|
45813
|
+
if ( parameters.gradientMap )
|
|
45814
|
+
_programLayers.enable( 22 );
|
|
45764
45815
|
|
|
45765
45816
|
array.push( _programLayers.mask );
|
|
45766
45817
|
_programLayers.disableAll();
|
|
@@ -47942,7 +47993,7 @@
|
|
|
47942
47993
|
break;
|
|
47943
47994
|
|
|
47944
47995
|
case MultiplyBlending:
|
|
47945
|
-
gl.blendFuncSeparate( gl.
|
|
47996
|
+
gl.blendFuncSeparate( gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA, gl.ZERO, gl.ONE );
|
|
47946
47997
|
break;
|
|
47947
47998
|
|
|
47948
47999
|
default:
|
|
@@ -47960,15 +48011,15 @@
|
|
|
47960
48011
|
break;
|
|
47961
48012
|
|
|
47962
48013
|
case AdditiveBlending:
|
|
47963
|
-
gl.
|
|
48014
|
+
gl.blendFuncSeparate( gl.SRC_ALPHA, gl.ONE, gl.ONE, gl.ONE );
|
|
47964
48015
|
break;
|
|
47965
48016
|
|
|
47966
48017
|
case SubtractiveBlending:
|
|
47967
|
-
|
|
48018
|
+
console.error( 'THREE.WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true' );
|
|
47968
48019
|
break;
|
|
47969
48020
|
|
|
47970
48021
|
case MultiplyBlending:
|
|
47971
|
-
|
|
48022
|
+
console.error( 'THREE.WebGLState: MultiplyBlending requires material.premultipliedAlpha = true' );
|
|
47972
48023
|
break;
|
|
47973
48024
|
|
|
47974
48025
|
default:
|
|
@@ -55103,6 +55154,9 @@ void main() {
|
|
|
55103
55154
|
//
|
|
55104
55155
|
|
|
55105
55156
|
const currentRenderTarget = _this.getRenderTarget();
|
|
55157
|
+
const currentActiveCubeFace = _this.getActiveCubeFace();
|
|
55158
|
+
const currentActiveMipmapLevel = _this.getActiveMipmapLevel();
|
|
55159
|
+
|
|
55106
55160
|
_this.setRenderTarget( transmissionRenderTarget );
|
|
55107
55161
|
|
|
55108
55162
|
_this.getClearColor( _currentClearColor );
|
|
@@ -55172,7 +55226,7 @@ void main() {
|
|
|
55172
55226
|
|
|
55173
55227
|
}
|
|
55174
55228
|
|
|
55175
|
-
_this.setRenderTarget( currentRenderTarget );
|
|
55229
|
+
_this.setRenderTarget( currentRenderTarget, currentActiveCubeFace, currentActiveMipmapLevel );
|
|
55176
55230
|
|
|
55177
55231
|
_this.setClearColor( _currentClearColor, _currentClearAlpha );
|
|
55178
55232
|
|
|
@@ -56102,7 +56156,7 @@ void main() {
|
|
|
56102
56156
|
|
|
56103
56157
|
if ( ( x >= 0 && x <= ( renderTarget.width - width ) ) && ( y >= 0 && y <= ( renderTarget.height - height ) ) ) {
|
|
56104
56158
|
|
|
56105
|
-
// when using MRT, select the
|
|
56159
|
+
// when using MRT, select the correct color buffer for the subsequent read command
|
|
56106
56160
|
|
|
56107
56161
|
if ( renderTarget.textures.length > 1 ) _gl.readBuffer( _gl.COLOR_ATTACHMENT0 + textureIndex );
|
|
56108
56162
|
|
|
@@ -63417,10 +63471,10 @@ void main() {
|
|
|
63417
63471
|
|
|
63418
63472
|
// if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox
|
|
63419
63473
|
if (data.length > 80 * dim) {
|
|
63420
|
-
minX =
|
|
63421
|
-
minY =
|
|
63422
|
-
let maxX =
|
|
63423
|
-
let maxY =
|
|
63474
|
+
minX = data[0];
|
|
63475
|
+
minY = data[1];
|
|
63476
|
+
let maxX = minX;
|
|
63477
|
+
let maxY = minY;
|
|
63424
63478
|
|
|
63425
63479
|
for (let i = dim; i < outerLen; i += dim) {
|
|
63426
63480
|
const x = data[i];
|
|
@@ -63696,7 +63750,7 @@ void main() {
|
|
|
63696
63750
|
return result;
|
|
63697
63751
|
}
|
|
63698
63752
|
|
|
63699
|
-
// find a bridge between vertices that connects hole with an outer ring and
|
|
63753
|
+
// find a bridge between vertices that connects hole with an outer ring and link it
|
|
63700
63754
|
function eliminateHole(hole, outerNode) {
|
|
63701
63755
|
const bridge = findHoleBridge(hole, outerNode);
|
|
63702
63756
|
if (!bridge) {
|
|
@@ -63887,7 +63941,7 @@ void main() {
|
|
|
63887
63941
|
|
|
63888
63942
|
// check if a diagonal between two polygon nodes is valid (lies in polygon interior)
|
|
63889
63943
|
function isValidDiagonal(a, b) {
|
|
63890
|
-
return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && //
|
|
63944
|
+
return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // doesn't intersect other edges
|
|
63891
63945
|
(locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible
|
|
63892
63946
|
(area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors
|
|
63893
63947
|
equals$1(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case
|
|
@@ -67381,7 +67435,7 @@ void main() {
|
|
|
67381
67435
|
const ccwerrboundB = (2 + 12 * epsilon$1) * epsilon$1;
|
|
67382
67436
|
const ccwerrboundC = (9 + 64 * epsilon$1) * epsilon$1 * epsilon$1;
|
|
67383
67437
|
|
|
67384
|
-
const B$
|
|
67438
|
+
const B$2 = vec(4);
|
|
67385
67439
|
const C1 = vec(8);
|
|
67386
67440
|
const C2 = vec(12);
|
|
67387
67441
|
const D$1 = vec(16);
|
|
@@ -67414,19 +67468,19 @@ void main() {
|
|
|
67414
67468
|
t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
|
|
67415
67469
|
_i = s0 - t0;
|
|
67416
67470
|
bvirt = s0 - _i;
|
|
67417
|
-
B$
|
|
67471
|
+
B$2[0] = s0 - (_i + bvirt) + (bvirt - t0);
|
|
67418
67472
|
_j = s1 + _i;
|
|
67419
67473
|
bvirt = _j - s1;
|
|
67420
67474
|
_0 = s1 - (_j - bvirt) + (_i - bvirt);
|
|
67421
67475
|
_i = _0 - t1;
|
|
67422
67476
|
bvirt = _0 - _i;
|
|
67423
|
-
B$
|
|
67477
|
+
B$2[1] = _0 - (_i + bvirt) + (bvirt - t1);
|
|
67424
67478
|
u3 = _j + _i;
|
|
67425
67479
|
bvirt = u3 - _j;
|
|
67426
|
-
B$
|
|
67427
|
-
B$
|
|
67480
|
+
B$2[2] = _j - (u3 - bvirt) + (_i - bvirt);
|
|
67481
|
+
B$2[3] = u3;
|
|
67428
67482
|
|
|
67429
|
-
let det = estimate(4, B$
|
|
67483
|
+
let det = estimate(4, B$2);
|
|
67430
67484
|
let errbound = ccwerrboundB * detsum;
|
|
67431
67485
|
if (det >= errbound || -det >= errbound) {
|
|
67432
67486
|
return det;
|
|
@@ -67478,7 +67532,7 @@ void main() {
|
|
|
67478
67532
|
bvirt = u3 - _j;
|
|
67479
67533
|
u$1[2] = _j - (u3 - bvirt) + (_i - bvirt);
|
|
67480
67534
|
u$1[3] = u3;
|
|
67481
|
-
const C1len = sum(4, B$
|
|
67535
|
+
const C1len = sum(4, B$2, 4, u$1, C1);
|
|
67482
67536
|
|
|
67483
67537
|
s1 = acx * bcytail;
|
|
67484
67538
|
c = splitter * acx;
|
|
@@ -85940,7 +85994,7 @@ void main() {
|
|
|
85940
85994
|
|
|
85941
85995
|
console.warn( 'THREE.Node: Recursion detected.', this );
|
|
85942
85996
|
|
|
85943
|
-
result = '';
|
|
85997
|
+
result = '/* Recursion detected. */';
|
|
85944
85998
|
|
|
85945
85999
|
}
|
|
85946
86000
|
|
|
@@ -87315,7 +87369,7 @@ void main() {
|
|
|
87315
87369
|
|
|
87316
87370
|
} else if ( type === 'shader' ) {
|
|
87317
87371
|
|
|
87318
|
-
return Fn$1( obj );
|
|
87372
|
+
return obj.isFn ? obj : Fn$1( obj );
|
|
87319
87373
|
|
|
87320
87374
|
}
|
|
87321
87375
|
|
|
@@ -87465,16 +87519,22 @@ void main() {
|
|
|
87465
87519
|
const { shaderNode, inputNodes } = this;
|
|
87466
87520
|
|
|
87467
87521
|
const properties = builder.getNodeProperties( shaderNode );
|
|
87468
|
-
const onceNS = shaderNode.namespace && shaderNode.namespace === builder.namespace ? builder.getNamespace( 'once' ) : 'once';
|
|
87469
87522
|
|
|
87470
|
-
|
|
87523
|
+
const subBuild = builder.getClosestSubBuild( shaderNode.subBuilds ) || '';
|
|
87524
|
+
const subBuildProperty = subBuild || 'default';
|
|
87471
87525
|
|
|
87472
|
-
|
|
87526
|
+
if ( properties[ subBuildProperty ] ) {
|
|
87527
|
+
|
|
87528
|
+
return properties[ subBuildProperty ];
|
|
87473
87529
|
|
|
87474
87530
|
}
|
|
87475
87531
|
|
|
87476
87532
|
//
|
|
87477
87533
|
|
|
87534
|
+
const previousSubBuildFn = builder.subBuildFn;
|
|
87535
|
+
|
|
87536
|
+
builder.subBuildFn = subBuild;
|
|
87537
|
+
|
|
87478
87538
|
let result = null;
|
|
87479
87539
|
|
|
87480
87540
|
if ( shaderNode.layout ) {
|
|
@@ -87512,9 +87572,11 @@ void main() {
|
|
|
87512
87572
|
|
|
87513
87573
|
}
|
|
87514
87574
|
|
|
87575
|
+
builder.subBuildFn = previousSubBuildFn;
|
|
87576
|
+
|
|
87515
87577
|
if ( shaderNode.once ) {
|
|
87516
87578
|
|
|
87517
|
-
properties[
|
|
87579
|
+
properties[ subBuildProperty ] = result;
|
|
87518
87580
|
|
|
87519
87581
|
}
|
|
87520
87582
|
|
|
@@ -87535,11 +87597,12 @@ void main() {
|
|
|
87535
87597
|
getOutputNode( builder ) {
|
|
87536
87598
|
|
|
87537
87599
|
const properties = builder.getNodeProperties( this );
|
|
87538
|
-
const
|
|
87600
|
+
const subBuildOutput = builder.getSubBuildOutput( this );
|
|
87539
87601
|
|
|
87540
|
-
properties[
|
|
87602
|
+
properties[ subBuildOutput ] = properties[ subBuildOutput ] || this.setupOutput( builder );
|
|
87603
|
+
properties[ subBuildOutput ].subBuild = builder.getClosestSubBuild( this );
|
|
87541
87604
|
|
|
87542
|
-
return properties[
|
|
87605
|
+
return properties[ subBuildOutput ];
|
|
87543
87606
|
|
|
87544
87607
|
}
|
|
87545
87608
|
|
|
@@ -87550,23 +87613,45 @@ void main() {
|
|
|
87550
87613
|
const buildStage = builder.getBuildStage();
|
|
87551
87614
|
const properties = builder.getNodeProperties( this );
|
|
87552
87615
|
|
|
87553
|
-
const
|
|
87616
|
+
const subBuildOutput = builder.getSubBuildOutput( this );
|
|
87554
87617
|
const outputNode = this.getOutputNode( builder );
|
|
87555
87618
|
|
|
87556
87619
|
if ( buildStage === 'setup' ) {
|
|
87557
87620
|
|
|
87558
|
-
const
|
|
87621
|
+
const subBuildInitialized = builder.getSubBuildProperty( 'initialized', this );
|
|
87559
87622
|
|
|
87560
|
-
if ( properties[
|
|
87623
|
+
if ( properties[ subBuildInitialized ] !== true ) {
|
|
87561
87624
|
|
|
87562
|
-
properties[
|
|
87625
|
+
properties[ subBuildInitialized ] = true;
|
|
87563
87626
|
|
|
87564
|
-
properties[
|
|
87565
|
-
properties[
|
|
87627
|
+
properties[ subBuildOutput ] = this.getOutputNode( builder );
|
|
87628
|
+
properties[ subBuildOutput ].build( builder );
|
|
87629
|
+
|
|
87630
|
+
// If the shaderNode has subBuilds, add them to the chaining nodes
|
|
87631
|
+
// so they can be built later in the build process.
|
|
87632
|
+
|
|
87633
|
+
if ( this.shaderNode.subBuilds ) {
|
|
87634
|
+
|
|
87635
|
+
for ( const node of builder.chaining ) {
|
|
87636
|
+
|
|
87637
|
+
const nodeData = builder.getDataFromNode( node, 'any' );
|
|
87638
|
+
nodeData.subBuilds = nodeData.subBuilds || new Set();
|
|
87639
|
+
|
|
87640
|
+
for ( const subBuild of this.shaderNode.subBuilds ) {
|
|
87641
|
+
|
|
87642
|
+
nodeData.subBuilds.add( subBuild );
|
|
87643
|
+
|
|
87644
|
+
}
|
|
87645
|
+
|
|
87646
|
+
//builder.getDataFromNode( node ).subBuilds = nodeData.subBuilds;
|
|
87647
|
+
|
|
87648
|
+
}
|
|
87649
|
+
|
|
87650
|
+
}
|
|
87566
87651
|
|
|
87567
87652
|
}
|
|
87568
87653
|
|
|
87569
|
-
result = properties[
|
|
87654
|
+
result = properties[ subBuildOutput ];
|
|
87570
87655
|
|
|
87571
87656
|
} else if ( buildStage === 'analyze' ) {
|
|
87572
87657
|
|
|
@@ -87596,7 +87681,6 @@ void main() {
|
|
|
87596
87681
|
this.global = true;
|
|
87597
87682
|
|
|
87598
87683
|
this.once = false;
|
|
87599
|
-
this.namespace = null;
|
|
87600
87684
|
|
|
87601
87685
|
}
|
|
87602
87686
|
|
|
@@ -87664,20 +87748,6 @@ void main() {
|
|
|
87664
87748
|
|
|
87665
87749
|
};
|
|
87666
87750
|
|
|
87667
|
-
const safeGetNodeType = ( node ) => {
|
|
87668
|
-
|
|
87669
|
-
try {
|
|
87670
|
-
|
|
87671
|
-
return node.getNodeType();
|
|
87672
|
-
|
|
87673
|
-
} catch ( _ ) {
|
|
87674
|
-
|
|
87675
|
-
return undefined;
|
|
87676
|
-
|
|
87677
|
-
}
|
|
87678
|
-
|
|
87679
|
-
};
|
|
87680
|
-
|
|
87681
87751
|
const ConvertType = function ( type, cacheMap = null ) {
|
|
87682
87752
|
|
|
87683
87753
|
return ( ...params ) => {
|
|
@@ -87697,7 +87767,7 @@ void main() {
|
|
|
87697
87767
|
if ( params.length === 1 ) {
|
|
87698
87768
|
|
|
87699
87769
|
const node = getConstNode( params[ 0 ], type );
|
|
87700
|
-
if (
|
|
87770
|
+
if ( node.nodeType === type ) return nodeObject( node );
|
|
87701
87771
|
return nodeObject( new ConvertNode( node, type ) );
|
|
87702
87772
|
|
|
87703
87773
|
}
|
|
@@ -87792,6 +87862,8 @@ void main() {
|
|
|
87792
87862
|
fn.shaderNode = shaderNode;
|
|
87793
87863
|
fn.id = shaderNode.id;
|
|
87794
87864
|
|
|
87865
|
+
fn.isFn = true;
|
|
87866
|
+
|
|
87795
87867
|
fn.getNodeType = ( ...params ) => shaderNode.getNodeType( ...params );
|
|
87796
87868
|
fn.getCacheKey = ( ...params ) => shaderNode.getCacheKey( ...params );
|
|
87797
87869
|
|
|
@@ -87803,10 +87875,10 @@ void main() {
|
|
|
87803
87875
|
|
|
87804
87876
|
};
|
|
87805
87877
|
|
|
87806
|
-
fn.once = (
|
|
87878
|
+
fn.once = ( subBuilds = null ) => {
|
|
87807
87879
|
|
|
87808
87880
|
shaderNode.once = true;
|
|
87809
|
-
shaderNode.
|
|
87881
|
+
shaderNode.subBuilds = subBuilds;
|
|
87810
87882
|
|
|
87811
87883
|
return fn;
|
|
87812
87884
|
|
|
@@ -87987,21 +88059,6 @@ void main() {
|
|
|
87987
88059
|
|
|
87988
88060
|
} );
|
|
87989
88061
|
|
|
87990
|
-
/**
|
|
87991
|
-
* @tsl
|
|
87992
|
-
* @function
|
|
87993
|
-
* @deprecated since r168. Use {@link Fn} instead.
|
|
87994
|
-
*
|
|
87995
|
-
* @param {...any} params
|
|
87996
|
-
* @returns {Function}
|
|
87997
|
-
*/
|
|
87998
|
-
const tslFn = ( ...params ) => { // @deprecated, r168
|
|
87999
|
-
|
|
88000
|
-
console.warn( 'THREE.TSL: tslFn() has been renamed to Fn().' );
|
|
88001
|
-
return Fn$1( ...params );
|
|
88002
|
-
|
|
88003
|
-
};
|
|
88004
|
-
|
|
88005
88062
|
/**
|
|
88006
88063
|
* This class represents a shader property. It can be used
|
|
88007
88064
|
* to explicitly define a property and assign a value to it.
|
|
@@ -89864,22 +89921,6 @@ void main() {
|
|
|
89864
89921
|
addMethodChaining( 'increment', increment );
|
|
89865
89922
|
addMethodChaining( 'decrement', decrement );
|
|
89866
89923
|
|
|
89867
|
-
/**
|
|
89868
|
-
* @tsl
|
|
89869
|
-
* @function
|
|
89870
|
-
* @deprecated since r168. Use {@link mod} instead.
|
|
89871
|
-
*
|
|
89872
|
-
* @param {Node} a - The first input.
|
|
89873
|
-
* @param {Node} b - The second input.
|
|
89874
|
-
* @returns {OperatorNode}
|
|
89875
|
-
*/
|
|
89876
|
-
const remainder = ( a, b ) => { // @deprecated, r168
|
|
89877
|
-
|
|
89878
|
-
console.warn( 'THREE.TSL: "remainder()" is deprecated. Use "mod( int( ... ) )" instead.' );
|
|
89879
|
-
return mod( a, b );
|
|
89880
|
-
|
|
89881
|
-
};
|
|
89882
|
-
|
|
89883
89924
|
/**
|
|
89884
89925
|
* @tsl
|
|
89885
89926
|
* @function
|
|
@@ -89896,7 +89937,6 @@ void main() {
|
|
|
89896
89937
|
|
|
89897
89938
|
};
|
|
89898
89939
|
|
|
89899
|
-
addMethodChaining( 'remainder', remainder );
|
|
89900
89940
|
addMethodChaining( 'modInt', modInt );
|
|
89901
89941
|
|
|
89902
89942
|
/**
|
|
@@ -90936,6 +90976,17 @@ void main() {
|
|
|
90936
90976
|
*/
|
|
90937
90977
|
const smoothstepElement = ( x, low, high ) => smoothstep( low, high, x );
|
|
90938
90978
|
|
|
90979
|
+
/**
|
|
90980
|
+
* Alias for `step()` with a different parameter order.
|
|
90981
|
+
*
|
|
90982
|
+
* @tsl
|
|
90983
|
+
* @function
|
|
90984
|
+
* @param {Node | number} x - The source value for interpolation.
|
|
90985
|
+
* @param {Node | number} edge - The edge value.
|
|
90986
|
+
* @returns {Node}
|
|
90987
|
+
*/
|
|
90988
|
+
const stepElement = ( x, edge ) => step( edge, x );
|
|
90989
|
+
|
|
90939
90990
|
/**
|
|
90940
90991
|
* Returns the arc-tangent of the quotient of its parameters.
|
|
90941
90992
|
*
|
|
@@ -90998,7 +91049,7 @@ void main() {
|
|
|
90998
91049
|
addMethodChaining( 'atan2', atan2 );
|
|
90999
91050
|
addMethodChaining( 'min', min$1 );
|
|
91000
91051
|
addMethodChaining( 'max', max$1 );
|
|
91001
|
-
addMethodChaining( 'step',
|
|
91052
|
+
addMethodChaining( 'step', stepElement );
|
|
91002
91053
|
addMethodChaining( 'reflect', reflect );
|
|
91003
91054
|
addMethodChaining( 'distance', distance );
|
|
91004
91055
|
addMethodChaining( 'dot', dot );
|
|
@@ -91242,25 +91293,6 @@ void main() {
|
|
|
91242
91293
|
|
|
91243
91294
|
addMethodChaining( 'select', select$1 );
|
|
91244
91295
|
|
|
91245
|
-
// Deprecated
|
|
91246
|
-
|
|
91247
|
-
/**
|
|
91248
|
-
* @tsl
|
|
91249
|
-
* @function
|
|
91250
|
-
* @deprecated since r168. Use {@link select} instead.
|
|
91251
|
-
*
|
|
91252
|
-
* @param {...any} params
|
|
91253
|
-
* @returns {ConditionalNode}
|
|
91254
|
-
*/
|
|
91255
|
-
const cond = ( ...params ) => { // @deprecated, r168
|
|
91256
|
-
|
|
91257
|
-
console.warn( 'THREE.TSL: cond() has been renamed to select().' );
|
|
91258
|
-
return select$1( ...params );
|
|
91259
|
-
|
|
91260
|
-
};
|
|
91261
|
-
|
|
91262
|
-
addMethodChaining( 'cond', cond );
|
|
91263
|
-
|
|
91264
91296
|
/**
|
|
91265
91297
|
* This node can be used as a context management component for another node.
|
|
91266
91298
|
* {@link NodeBuilder} performs its node building process in a specific context and
|
|
@@ -91614,6 +91646,91 @@ void main() {
|
|
|
91614
91646
|
|
|
91615
91647
|
addMethodChaining( 'temp', temp );
|
|
91616
91648
|
|
|
91649
|
+
/**
|
|
91650
|
+
* This node is used to build a sub-build in the node system.
|
|
91651
|
+
*
|
|
91652
|
+
* @augments Node
|
|
91653
|
+
* @param {Node} node - The node to be built in the sub-build.
|
|
91654
|
+
* @param {string} name - The name of the sub-build.
|
|
91655
|
+
* @param {string|null} [nodeType=null] - The type of the node, if known.
|
|
91656
|
+
*/
|
|
91657
|
+
class SubBuildNode extends Node {
|
|
91658
|
+
|
|
91659
|
+
static get type() {
|
|
91660
|
+
|
|
91661
|
+
return 'SubBuild';
|
|
91662
|
+
|
|
91663
|
+
}
|
|
91664
|
+
|
|
91665
|
+
constructor( node, name, nodeType = null ) {
|
|
91666
|
+
|
|
91667
|
+
super( nodeType );
|
|
91668
|
+
|
|
91669
|
+
/**
|
|
91670
|
+
* The node to be built in the sub-build.
|
|
91671
|
+
*
|
|
91672
|
+
* @type {Node}
|
|
91673
|
+
*/
|
|
91674
|
+
this.node = node;
|
|
91675
|
+
|
|
91676
|
+
/**
|
|
91677
|
+
* The name of the sub-build.
|
|
91678
|
+
*
|
|
91679
|
+
* @type {string}
|
|
91680
|
+
*/
|
|
91681
|
+
this.name = name;
|
|
91682
|
+
|
|
91683
|
+
/**
|
|
91684
|
+
* This flag can be used for type testing.
|
|
91685
|
+
*
|
|
91686
|
+
* @type {boolean}
|
|
91687
|
+
* @readonly
|
|
91688
|
+
* @default true
|
|
91689
|
+
*/
|
|
91690
|
+
this.isSubBuildNode = true;
|
|
91691
|
+
|
|
91692
|
+
}
|
|
91693
|
+
|
|
91694
|
+
getNodeType( builder ) {
|
|
91695
|
+
|
|
91696
|
+
if ( this.nodeType !== null ) return this.nodeType;
|
|
91697
|
+
|
|
91698
|
+
builder.addSubBuild( this.name );
|
|
91699
|
+
|
|
91700
|
+
const nodeType = this.node.getNodeType( builder );
|
|
91701
|
+
|
|
91702
|
+
builder.removeSubBuild();
|
|
91703
|
+
|
|
91704
|
+
return nodeType;
|
|
91705
|
+
|
|
91706
|
+
}
|
|
91707
|
+
|
|
91708
|
+
build( builder, ...params ) {
|
|
91709
|
+
|
|
91710
|
+
builder.addSubBuild( this.name );
|
|
91711
|
+
|
|
91712
|
+
const data = this.node.build( builder, ...params );
|
|
91713
|
+
|
|
91714
|
+
builder.removeSubBuild();
|
|
91715
|
+
|
|
91716
|
+
return data;
|
|
91717
|
+
|
|
91718
|
+
}
|
|
91719
|
+
|
|
91720
|
+
}
|
|
91721
|
+
|
|
91722
|
+
/**
|
|
91723
|
+
* Creates a new sub-build node.
|
|
91724
|
+
*
|
|
91725
|
+
* @tsl
|
|
91726
|
+
* @function
|
|
91727
|
+
* @param {Node} node - The node to be built in the sub-build.
|
|
91728
|
+
* @param {string} name - The name of the sub-build.
|
|
91729
|
+
* @param {string|null} [type=null] - The type of the node, if known.
|
|
91730
|
+
* @returns {Node} A node object wrapping the SubBuildNode instance.
|
|
91731
|
+
*/
|
|
91732
|
+
const subBuild = ( node, name, type = null ) => nodeObject( new SubBuildNode( nodeObject( node ), name, type ) );
|
|
91733
|
+
|
|
91617
91734
|
/**
|
|
91618
91735
|
* Class for representing shader varyings as nodes. Varyings are create from
|
|
91619
91736
|
* existing nodes like the following:
|
|
@@ -91743,7 +91860,7 @@ void main() {
|
|
|
91743
91860
|
const interpolationSampling = this.interpolationSampling;
|
|
91744
91861
|
|
|
91745
91862
|
properties.varying = varying = builder.getVaryingFromNode( this, name, type, interpolationType, interpolationSampling );
|
|
91746
|
-
properties.node = this.node;
|
|
91863
|
+
properties.node = subBuild( this.node, 'VERTEX' );
|
|
91747
91864
|
|
|
91748
91865
|
}
|
|
91749
91866
|
|
|
@@ -91772,18 +91889,19 @@ void main() {
|
|
|
91772
91889
|
|
|
91773
91890
|
generate( builder ) {
|
|
91774
91891
|
|
|
91892
|
+
const propertyKey = builder.getSubBuildProperty( 'property', builder.currentStack );
|
|
91775
91893
|
const properties = builder.getNodeProperties( this );
|
|
91776
91894
|
const varying = this.setupVarying( builder );
|
|
91777
91895
|
|
|
91778
|
-
if ( properties
|
|
91896
|
+
if ( properties[ propertyKey ] === undefined ) {
|
|
91779
91897
|
|
|
91780
91898
|
const type = this.getNodeType( builder );
|
|
91781
91899
|
const propertyName = builder.getPropertyName( varying, NodeShaderStage.VERTEX );
|
|
91782
91900
|
|
|
91783
91901
|
// force node run in vertex stage
|
|
91784
|
-
builder.flowNodeFromShaderStage( NodeShaderStage.VERTEX,
|
|
91902
|
+
builder.flowNodeFromShaderStage( NodeShaderStage.VERTEX, properties.node, type, propertyName );
|
|
91785
91903
|
|
|
91786
|
-
properties
|
|
91904
|
+
properties[ propertyKey ] = propertyName;
|
|
91787
91905
|
|
|
91788
91906
|
}
|
|
91789
91907
|
|
|
@@ -93210,20 +93328,6 @@ void main() {
|
|
|
93210
93328
|
*/
|
|
93211
93329
|
const cache = ( node, parent ) => nodeObject( new CacheNode( nodeObject( node ), parent ) );
|
|
93212
93330
|
|
|
93213
|
-
/**
|
|
93214
|
-
* Assigns a namespace to the given node by updating its context.
|
|
93215
|
-
*
|
|
93216
|
-
* Important for TSL functions that use `.once( namespace )` to ensure that the namespace will run twice,
|
|
93217
|
-
* once when the node is build in the specific namespace and once when the node is built in the others namespace.
|
|
93218
|
-
*
|
|
93219
|
-
* This is useful for nodes like `positionWorld` that need to be re-updated if used in `material.positionNode` and outside of it in the same material.
|
|
93220
|
-
*
|
|
93221
|
-
* @param {Object} node - The node to which the namespace will be assigned.
|
|
93222
|
-
* @param {string} namespace - The namespace to be assigned to the node.
|
|
93223
|
-
* @returns {Object} The updated node with the new namespace in its context.
|
|
93224
|
-
*/
|
|
93225
|
-
const namespace$1 = ( node, namespace ) => node.context( { namespace } );
|
|
93226
|
-
|
|
93227
93331
|
addMethodChaining( 'cache', cache );
|
|
93228
93332
|
|
|
93229
93333
|
/**
|
|
@@ -93897,7 +94001,7 @@ void main() {
|
|
|
93897
94001
|
* @param {number} [index=0] - The uv index.
|
|
93898
94002
|
* @return {AttributeNode<vec2>} The uv attribute node.
|
|
93899
94003
|
*/
|
|
93900
|
-
const uv = ( index = 0 ) => attribute( 'uv' + ( index > 0 ? index : '' ), 'vec2' );
|
|
94004
|
+
const uv$1 = ( index = 0 ) => attribute( 'uv' + ( index > 0 ? index : '' ), 'vec2' );
|
|
93901
94005
|
|
|
93902
94006
|
/**
|
|
93903
94007
|
* A node that represents the dimensions of a texture. The texture size is
|
|
@@ -94290,7 +94394,7 @@ void main() {
|
|
|
94290
94394
|
*/
|
|
94291
94395
|
getDefaultUV() {
|
|
94292
94396
|
|
|
94293
|
-
return uv( this.value.channel );
|
|
94397
|
+
return uv$1( this.value.channel );
|
|
94294
94398
|
|
|
94295
94399
|
}
|
|
94296
94400
|
|
|
@@ -95323,22 +95427,6 @@ void main() {
|
|
|
95323
95427
|
*/
|
|
95324
95428
|
const uniformArray = ( values, nodeType ) => nodeObject( new UniformArrayNode( values, nodeType ) );
|
|
95325
95429
|
|
|
95326
|
-
/**
|
|
95327
|
-
* @tsl
|
|
95328
|
-
* @function
|
|
95329
|
-
* @deprecated since r168. Use {@link uniformArray} instead.
|
|
95330
|
-
*
|
|
95331
|
-
* @param {Array<any>} values - Array-like data.
|
|
95332
|
-
* @param {string} nodeType - The data type of the array elements.
|
|
95333
|
-
* @returns {UniformArrayNode}
|
|
95334
|
-
*/
|
|
95335
|
-
const uniforms = ( values, nodeType ) => { // @deprecated, r168
|
|
95336
|
-
|
|
95337
|
-
console.warn( 'THREE.TSL: uniforms() has been renamed to uniformArray().' );
|
|
95338
|
-
return nodeObject( new UniformArrayNode( values, nodeType ) );
|
|
95339
|
-
|
|
95340
|
-
};
|
|
95341
|
-
|
|
95342
95430
|
/**
|
|
95343
95431
|
* The node allows to set values for built-in shader variables. That is
|
|
95344
95432
|
* required for features like hardware-accelerated vertex clipping.
|
|
@@ -95804,7 +95892,7 @@ void main() {
|
|
|
95804
95892
|
* @tsl
|
|
95805
95893
|
* @function
|
|
95806
95894
|
* @param {?Object3D} [object3d] - The 3D object.
|
|
95807
|
-
* @returns {Object3DNode<
|
|
95895
|
+
* @returns {Object3DNode<float>}
|
|
95808
95896
|
*/
|
|
95809
95897
|
const objectRadius = /*@__PURE__*/ nodeProxy( Object3DNode, Object3DNode.RADIUS ).setParameterLength( 1 );
|
|
95810
95898
|
|
|
@@ -96016,9 +96104,9 @@ void main() {
|
|
|
96016
96104
|
*/
|
|
96017
96105
|
const positionWorld = /*@__PURE__*/ ( Fn$1( ( builder ) => {
|
|
96018
96106
|
|
|
96019
|
-
return modelWorldMatrix.mul( positionLocal ).xyz.toVarying( builder.
|
|
96107
|
+
return modelWorldMatrix.mul( positionLocal ).xyz.toVarying( builder.getSubBuildProperty( 'v_positionWorld' ) );
|
|
96020
96108
|
|
|
96021
|
-
}, 'vec3' ).once( 'POSITION' ) )();
|
|
96109
|
+
}, 'vec3' ).once( [ 'POSITION' ] ) )();
|
|
96022
96110
|
|
|
96023
96111
|
/**
|
|
96024
96112
|
* TSL object that represents the position world direction of the current rendered object.
|
|
@@ -96026,13 +96114,13 @@ void main() {
|
|
|
96026
96114
|
* @tsl
|
|
96027
96115
|
* @type {Node<vec3>}
|
|
96028
96116
|
*/
|
|
96029
|
-
const positionWorldDirection = /*@__PURE__*/ ( Fn$1( (
|
|
96117
|
+
const positionWorldDirection = /*@__PURE__*/ ( Fn$1( () => {
|
|
96030
96118
|
|
|
96031
|
-
const vertexPWD = positionLocal.transformDirection( modelWorldMatrix ).toVarying(
|
|
96119
|
+
const vertexPWD = positionLocal.transformDirection( modelWorldMatrix ).toVarying( 'v_positionWorldDirection' );
|
|
96032
96120
|
|
|
96033
96121
|
return vertexPWD.normalize().toVar( 'positionWorldDirection' );
|
|
96034
96122
|
|
|
96035
|
-
}, 'vec3' ).once( 'POSITION' ) )();
|
|
96123
|
+
}, 'vec3' ).once( [ 'POSITION' ] ) )();
|
|
96036
96124
|
|
|
96037
96125
|
/**
|
|
96038
96126
|
* TSL object that represents the vertex position in view space of the current rendered object.
|
|
@@ -96042,9 +96130,9 @@ void main() {
|
|
|
96042
96130
|
*/
|
|
96043
96131
|
const positionView = /*@__PURE__*/ ( Fn$1( ( builder ) => {
|
|
96044
96132
|
|
|
96045
|
-
return builder.context.setupPositionView().toVarying(
|
|
96133
|
+
return builder.context.setupPositionView().toVarying( 'v_positionView' );
|
|
96046
96134
|
|
|
96047
|
-
}, 'vec3' ).once( 'POSITION' ) )();
|
|
96135
|
+
}, 'vec3' ).once( [ 'POSITION' ] ) )();
|
|
96048
96136
|
|
|
96049
96137
|
/**
|
|
96050
96138
|
* TSL object that represents the position view direction of the current rendered object.
|
|
@@ -96087,6 +96175,10 @@ void main() {
|
|
|
96087
96175
|
|
|
96088
96176
|
generate( builder ) {
|
|
96089
96177
|
|
|
96178
|
+
if ( builder.shaderStage !== 'fragment' ) return 'true';
|
|
96179
|
+
|
|
96180
|
+
//
|
|
96181
|
+
|
|
96090
96182
|
const { renderer, material } = builder;
|
|
96091
96183
|
|
|
96092
96184
|
if ( renderer.coordinateSystem === WebGLCoordinateSystem ) {
|
|
@@ -96122,6 +96214,34 @@ void main() {
|
|
|
96122
96214
|
*/
|
|
96123
96215
|
const faceDirection = /*@__PURE__*/ float$1( frontFacing ).mul( 2.0 ).sub( 1.0 );
|
|
96124
96216
|
|
|
96217
|
+
/**
|
|
96218
|
+
* Converts a direction vector to a face direction vector based on the material's side.
|
|
96219
|
+
*
|
|
96220
|
+
* If the material is set to `BackSide`, the direction is inverted.
|
|
96221
|
+
* If the material is set to `DoubleSide`, the direction is multiplied by `faceDirection`.
|
|
96222
|
+
*
|
|
96223
|
+
* @tsl
|
|
96224
|
+
* @param {Node<vec3>} direction - The direction vector to convert.
|
|
96225
|
+
* @returns {Node<vec3>} The converted direction vector.
|
|
96226
|
+
*/
|
|
96227
|
+
const directionToFaceDirection = /*@__PURE__*/ Fn$1( ( [ direction ], { material } ) => {
|
|
96228
|
+
|
|
96229
|
+
const side = material.side;
|
|
96230
|
+
|
|
96231
|
+
if ( side === BackSide ) {
|
|
96232
|
+
|
|
96233
|
+
direction = direction.mul( -1 );
|
|
96234
|
+
|
|
96235
|
+
} else if ( side === DoubleSide ) {
|
|
96236
|
+
|
|
96237
|
+
direction = direction.mul( faceDirection );
|
|
96238
|
+
|
|
96239
|
+
}
|
|
96240
|
+
|
|
96241
|
+
return direction;
|
|
96242
|
+
|
|
96243
|
+
} );
|
|
96244
|
+
|
|
96125
96245
|
/**
|
|
96126
96246
|
* TSL object that represents the normal attribute of the current rendered object.
|
|
96127
96247
|
*
|
|
@@ -96164,7 +96284,7 @@ void main() {
|
|
|
96164
96284
|
* @tsl
|
|
96165
96285
|
* @type {Node<vec3>}
|
|
96166
96286
|
*/
|
|
96167
|
-
const
|
|
96287
|
+
const normalViewGeometry = /*@__PURE__*/ ( Fn$1( ( builder ) => {
|
|
96168
96288
|
|
|
96169
96289
|
let node;
|
|
96170
96290
|
|
|
@@ -96174,13 +96294,13 @@ void main() {
|
|
|
96174
96294
|
|
|
96175
96295
|
} else {
|
|
96176
96296
|
|
|
96177
|
-
node =
|
|
96297
|
+
node = transformNormalToView( normalLocal ).toVarying( 'v_normalViewGeometry' ).normalize();
|
|
96178
96298
|
|
|
96179
96299
|
}
|
|
96180
96300
|
|
|
96181
96301
|
return node;
|
|
96182
96302
|
|
|
96183
|
-
}, 'vec3' ).once() )().toVar( '
|
|
96303
|
+
}, 'vec3' ).once() )().toVar( 'normalViewGeometry' );
|
|
96184
96304
|
|
|
96185
96305
|
/**
|
|
96186
96306
|
* TSL object that represents the vertex normal in world space of the current rendered object.
|
|
@@ -96188,19 +96308,19 @@ void main() {
|
|
|
96188
96308
|
* @tsl
|
|
96189
96309
|
* @type {Node<vec3>}
|
|
96190
96310
|
*/
|
|
96191
|
-
const
|
|
96311
|
+
const normalWorldGeometry = /*@__PURE__*/ ( Fn$1( ( builder ) => {
|
|
96192
96312
|
|
|
96193
|
-
let normal =
|
|
96313
|
+
let normal = normalViewGeometry.transformDirection( cameraViewMatrix );
|
|
96194
96314
|
|
|
96195
96315
|
if ( builder.material.flatShading !== true ) {
|
|
96196
96316
|
|
|
96197
|
-
normal =
|
|
96317
|
+
normal = normal.toVarying( 'v_normalWorldGeometry' );
|
|
96198
96318
|
|
|
96199
96319
|
}
|
|
96200
96320
|
|
|
96201
|
-
return normal;
|
|
96321
|
+
return normal.normalize().toVar( 'normalWorldGeometry' );
|
|
96202
96322
|
|
|
96203
|
-
}, 'vec3' ).once() )()
|
|
96323
|
+
}, 'vec3' ).once() )();
|
|
96204
96324
|
|
|
96205
96325
|
/**
|
|
96206
96326
|
* TSL object that represents the transformed vertex normal in view space of the current rendered object.
|
|
@@ -96208,17 +96328,31 @@ void main() {
|
|
|
96208
96328
|
* @tsl
|
|
96209
96329
|
* @type {Node<vec3>}
|
|
96210
96330
|
*/
|
|
96211
|
-
const
|
|
96331
|
+
const normalView = /*@__PURE__*/ ( Fn$1( ( { subBuildFn, material, context } ) => {
|
|
96332
|
+
|
|
96333
|
+
let node;
|
|
96212
96334
|
|
|
96213
|
-
|
|
96335
|
+
if ( subBuildFn === 'NORMAL' || subBuildFn === 'VERTEX' ) {
|
|
96214
96336
|
|
|
96215
|
-
|
|
96337
|
+
node = normalViewGeometry;
|
|
96216
96338
|
|
|
96217
|
-
|
|
96339
|
+
if ( material.flatShading !== true ) {
|
|
96340
|
+
|
|
96341
|
+
node = directionToFaceDirection( node );
|
|
96342
|
+
|
|
96343
|
+
}
|
|
96344
|
+
|
|
96345
|
+
} else {
|
|
96346
|
+
|
|
96347
|
+
// Use getUV context to avoid side effects from nodes overwriting getUV in the context (e.g. EnvironmentNode)
|
|
96348
|
+
|
|
96349
|
+
node = context.setupNormal().context( { getUV: null } );
|
|
96350
|
+
|
|
96351
|
+
}
|
|
96218
96352
|
|
|
96219
96353
|
return node;
|
|
96220
96354
|
|
|
96221
|
-
}, 'vec3' ).once() )().toVar( '
|
|
96355
|
+
}, 'vec3' ).once( [ 'NORMAL', 'VERTEX' ] ) )().toVar( 'normalView' );
|
|
96222
96356
|
|
|
96223
96357
|
/**
|
|
96224
96358
|
* TSL object that represents the transformed vertex normal in world space of the current rendered object.
|
|
@@ -96226,7 +96360,7 @@ void main() {
|
|
|
96226
96360
|
* @tsl
|
|
96227
96361
|
* @type {Node<vec3>}
|
|
96228
96362
|
*/
|
|
96229
|
-
const
|
|
96363
|
+
const normalWorld = /*@__PURE__*/ normalView.transformDirection( cameraViewMatrix ).toVar( 'normalWorld' );
|
|
96230
96364
|
|
|
96231
96365
|
/**
|
|
96232
96366
|
* TSL object that represents the transformed clearcoat vertex normal in view space of the current rendered object.
|
|
@@ -96234,17 +96368,25 @@ void main() {
|
|
|
96234
96368
|
* @tsl
|
|
96235
96369
|
* @type {Node<vec3>}
|
|
96236
96370
|
*/
|
|
96237
|
-
const
|
|
96371
|
+
const clearcoatNormalView = /*@__PURE__*/ ( Fn$1( ( { subBuildFn, context } ) => {
|
|
96372
|
+
|
|
96373
|
+
let node;
|
|
96238
96374
|
|
|
96239
|
-
|
|
96375
|
+
if ( subBuildFn === 'NORMAL' || subBuildFn === 'VERTEX' ) {
|
|
96240
96376
|
|
|
96241
|
-
|
|
96377
|
+
node = normalView;
|
|
96242
96378
|
|
|
96243
|
-
|
|
96379
|
+
} else {
|
|
96380
|
+
|
|
96381
|
+
// Use getUV context to avoid side effects from nodes overwriting getUV in the context (e.g. EnvironmentNode)
|
|
96382
|
+
|
|
96383
|
+
node = context.setupClearcoatNormal().context( { getUV: null } );
|
|
96384
|
+
|
|
96385
|
+
}
|
|
96244
96386
|
|
|
96245
96387
|
return node;
|
|
96246
96388
|
|
|
96247
|
-
}, 'vec3' ).once() )().toVar( '
|
|
96389
|
+
}, 'vec3' ).once( [ 'NORMAL', 'VERTEX' ] ) )().toVar( 'clearcoatNormalView' );
|
|
96248
96390
|
|
|
96249
96391
|
/**
|
|
96250
96392
|
* Transforms the normal with the given matrix.
|
|
@@ -96292,6 +96434,50 @@ void main() {
|
|
|
96292
96434
|
|
|
96293
96435
|
} );
|
|
96294
96436
|
|
|
96437
|
+
// Deprecated
|
|
96438
|
+
|
|
96439
|
+
/**
|
|
96440
|
+
* TSL object that represents the transformed vertex normal in view space of the current rendered object.
|
|
96441
|
+
*
|
|
96442
|
+
* @tsl
|
|
96443
|
+
* @type {Node<vec3>}
|
|
96444
|
+
* @deprecated since r178. Use `normalView` instead.
|
|
96445
|
+
*/
|
|
96446
|
+
const transformedNormalView = ( Fn$1( () => { // @deprecated, r177
|
|
96447
|
+
|
|
96448
|
+
console.warn( 'THREE.TSL: "transformedNormalView" is deprecated. Use "normalView" instead.' );
|
|
96449
|
+
return normalView;
|
|
96450
|
+
|
|
96451
|
+
} ).once( [ 'NORMAL', 'VERTEX' ] ) )();
|
|
96452
|
+
|
|
96453
|
+
/**
|
|
96454
|
+
* TSL object that represents the transformed vertex normal in world space of the current rendered object.
|
|
96455
|
+
*
|
|
96456
|
+
* @tsl
|
|
96457
|
+
* @type {Node<vec3>}
|
|
96458
|
+
* @deprecated since r178. Use `normalWorld` instead.
|
|
96459
|
+
*/
|
|
96460
|
+
const transformedNormalWorld = ( Fn$1( () => { // @deprecated, r177
|
|
96461
|
+
|
|
96462
|
+
console.warn( 'THREE.TSL: "transformedNormalWorld" is deprecated. Use "normalWorld" instead.' );
|
|
96463
|
+
return normalWorld;
|
|
96464
|
+
|
|
96465
|
+
} ).once( [ 'NORMAL', 'VERTEX' ] ) )();
|
|
96466
|
+
|
|
96467
|
+
/**
|
|
96468
|
+
* TSL object that represents the transformed clearcoat vertex normal in view space of the current rendered object.
|
|
96469
|
+
*
|
|
96470
|
+
* @tsl
|
|
96471
|
+
* @type {Node<vec3>}
|
|
96472
|
+
* @deprecated since r178. Use `clearcoatNormalView` instead.
|
|
96473
|
+
*/
|
|
96474
|
+
const transformedClearcoatNormalView = ( Fn$1( () => { // @deprecated, r177
|
|
96475
|
+
|
|
96476
|
+
console.warn( 'THREE.TSL: "transformedClearcoatNormalView" is deprecated. Use "clearcoatNormalView" instead.' );
|
|
96477
|
+
return clearcoatNormalView;
|
|
96478
|
+
|
|
96479
|
+
} ).once( [ 'NORMAL', 'VERTEX' ] ) )();
|
|
96480
|
+
|
|
96295
96481
|
const _e1$1 = /*@__PURE__*/ new Euler();
|
|
96296
96482
|
const _m1$1 = /*@__PURE__*/ new Matrix4();
|
|
96297
96483
|
|
|
@@ -96354,7 +96540,7 @@ void main() {
|
|
|
96354
96540
|
* @tsl
|
|
96355
96541
|
* @type {Node<vec3>}
|
|
96356
96542
|
*/
|
|
96357
|
-
const reflectView = /*@__PURE__*/ positionViewDirection.negate().reflect(
|
|
96543
|
+
const reflectView = /*@__PURE__*/ positionViewDirection.negate().reflect( normalView );
|
|
96358
96544
|
|
|
96359
96545
|
/**
|
|
96360
96546
|
* The refract vector in view space.
|
|
@@ -96362,7 +96548,7 @@ void main() {
|
|
|
96362
96548
|
* @tsl
|
|
96363
96549
|
* @type {Node<vec3>}
|
|
96364
96550
|
*/
|
|
96365
|
-
const refractView = /*@__PURE__*/ positionViewDirection.negate().refract(
|
|
96551
|
+
const refractView = /*@__PURE__*/ positionViewDirection.negate().refract( normalView, materialRefractionRatio );
|
|
96366
96552
|
|
|
96367
96553
|
/**
|
|
96368
96554
|
* Used for sampling cube maps when using cube reflection mapping.
|
|
@@ -97037,6 +97223,49 @@ void main() {
|
|
|
97037
97223
|
*/
|
|
97038
97224
|
const materialReference = ( name, type, material = null ) => nodeObject( new MaterialReferenceNode( name, type, material ) );
|
|
97039
97225
|
|
|
97226
|
+
// Normal Mapping Without Precomputed Tangents
|
|
97227
|
+
// http://www.thetenthplanet.de/archives/1180
|
|
97228
|
+
|
|
97229
|
+
const uv = uv$1();
|
|
97230
|
+
|
|
97231
|
+
const q0 = positionView.dFdx();
|
|
97232
|
+
const q1 = positionView.dFdy();
|
|
97233
|
+
const st0 = uv.dFdx();
|
|
97234
|
+
const st1 = uv.dFdy();
|
|
97235
|
+
|
|
97236
|
+
const N$1 = normalView;
|
|
97237
|
+
|
|
97238
|
+
const q1perp = q1.cross( N$1 );
|
|
97239
|
+
const q0perp = N$1.cross( q0 );
|
|
97240
|
+
|
|
97241
|
+
const T$1 = q1perp.mul( st0.x ).add( q0perp.mul( st1.x ) );
|
|
97242
|
+
const B$1 = q1perp.mul( st0.y ).add( q0perp.mul( st1.y ) );
|
|
97243
|
+
|
|
97244
|
+
const det = T$1.dot( T$1 ).max( B$1.dot( B$1 ) );
|
|
97245
|
+
const scale = det.equal( 0.0 ).select( 0.0, det.inverseSqrt() );
|
|
97246
|
+
|
|
97247
|
+
/**
|
|
97248
|
+
* Tangent vector in view space, computed dynamically from geometry and UV derivatives.
|
|
97249
|
+
* Useful for normal mapping without precomputed tangents.
|
|
97250
|
+
*
|
|
97251
|
+
* Reference: http://www.thetenthplanet.de/archives/1180
|
|
97252
|
+
*
|
|
97253
|
+
* @tsl
|
|
97254
|
+
* @type {Node<vec3>}
|
|
97255
|
+
*/
|
|
97256
|
+
const tangentViewFrame = /*@__PURE__*/ T$1.mul( scale ).toVar( 'tangentViewFrame' );
|
|
97257
|
+
|
|
97258
|
+
/**
|
|
97259
|
+
* Bitangent vector in view space, computed dynamically from geometry and UV derivatives.
|
|
97260
|
+
* Complements the tangentViewFrame for constructing the tangent space basis.
|
|
97261
|
+
*
|
|
97262
|
+
* Reference: http://www.thetenthplanet.de/archives/1180
|
|
97263
|
+
*
|
|
97264
|
+
* @tsl
|
|
97265
|
+
* @type {Node<vec3>}
|
|
97266
|
+
*/
|
|
97267
|
+
const bitangentViewFrame = /*@__PURE__*/ B$1.mul( scale ).toVar( 'bitangentViewFrame' );
|
|
97268
|
+
|
|
97040
97269
|
/**
|
|
97041
97270
|
* TSL object that represents the tangent attribute of the current rendered object.
|
|
97042
97271
|
*
|
|
@@ -97069,31 +97298,37 @@ void main() {
|
|
|
97069
97298
|
* @tsl
|
|
97070
97299
|
* @type {Node<vec3>}
|
|
97071
97300
|
*/
|
|
97072
|
-
const tangentView = /*@__PURE__*/
|
|
97301
|
+
const tangentView = /*@__PURE__*/ ( Fn$1( ( { subBuildFn, geometry, material } ) => {
|
|
97073
97302
|
|
|
97074
|
-
|
|
97075
|
-
* TSL object that represents the vertex tangent in world space of the current rendered object.
|
|
97076
|
-
*
|
|
97077
|
-
* @tsl
|
|
97078
|
-
* @type {Node<vec3>}
|
|
97079
|
-
*/
|
|
97080
|
-
const tangentWorld = /*@__PURE__*/ tangentView.transformDirection( cameraViewMatrix ).toVarying( 'v_tangentWorld' ).normalize().toVar( 'tangentWorld' );
|
|
97303
|
+
let node;
|
|
97081
97304
|
|
|
97082
|
-
|
|
97083
|
-
|
|
97084
|
-
|
|
97085
|
-
|
|
97086
|
-
|
|
97087
|
-
|
|
97088
|
-
|
|
97305
|
+
if ( subBuildFn === 'VERTEX' || geometry.hasAttribute( 'tangent' ) ) {
|
|
97306
|
+
|
|
97307
|
+
node = modelViewMatrix.mul( vec4( tangentLocal, 0 ) ).xyz.toVarying( 'v_tangentView' ).normalize();
|
|
97308
|
+
|
|
97309
|
+
} else {
|
|
97310
|
+
|
|
97311
|
+
node = tangentViewFrame;
|
|
97312
|
+
|
|
97313
|
+
}
|
|
97314
|
+
|
|
97315
|
+
if ( material.flatShading !== true ) {
|
|
97316
|
+
|
|
97317
|
+
node = directionToFaceDirection( node );
|
|
97318
|
+
|
|
97319
|
+
}
|
|
97320
|
+
|
|
97321
|
+
return node;
|
|
97322
|
+
|
|
97323
|
+
}, 'vec3' ).once( [ 'NORMAL', 'VERTEX' ] ) )().toVar( 'tangentView' );
|
|
97089
97324
|
|
|
97090
97325
|
/**
|
|
97091
|
-
* TSL object that represents the
|
|
97326
|
+
* TSL object that represents the vertex tangent in world space of the current rendered object.
|
|
97092
97327
|
*
|
|
97093
97328
|
* @tsl
|
|
97094
97329
|
* @type {Node<vec3>}
|
|
97095
97330
|
*/
|
|
97096
|
-
const
|
|
97331
|
+
const tangentWorld = /*@__PURE__*/ tangentView.transformDirection( cameraViewMatrix ).toVarying( 'v_tangentWorld' ).normalize().toVar( 'tangentWorld' );
|
|
97097
97332
|
|
|
97098
97333
|
/**
|
|
97099
97334
|
* Returns the bitangent node and assigns it to a varying if the material is not flat shaded.
|
|
@@ -97104,19 +97339,19 @@ void main() {
|
|
|
97104
97339
|
* @param {string} varyingName - The name of the varying to assign the bitangent to.
|
|
97105
97340
|
* @returns {Node<vec3>} The bitangent node.
|
|
97106
97341
|
*/
|
|
97107
|
-
const getBitangent = /*@__PURE__*/ Fn$1( ( [ crossNormalTangent, varyingName ],
|
|
97342
|
+
const getBitangent = /*@__PURE__*/ Fn$1( ( [ crossNormalTangent, varyingName ], { subBuildFn, material } ) => {
|
|
97108
97343
|
|
|
97109
97344
|
let bitangent = crossNormalTangent.mul( tangentGeometry.w ).xyz;
|
|
97110
97345
|
|
|
97111
|
-
if (
|
|
97346
|
+
if ( subBuildFn === 'NORMAL' && material.flatShading !== true ) {
|
|
97112
97347
|
|
|
97113
|
-
bitangent =
|
|
97348
|
+
bitangent = bitangent.toVarying( varyingName );
|
|
97114
97349
|
|
|
97115
97350
|
}
|
|
97116
97351
|
|
|
97117
97352
|
return bitangent;
|
|
97118
97353
|
|
|
97119
|
-
} ).once();
|
|
97354
|
+
} ).once( [ 'NORMAL' ] );
|
|
97120
97355
|
|
|
97121
97356
|
/**
|
|
97122
97357
|
* TSL object that represents the bitangent attribute of the current rendered object.
|
|
@@ -97140,7 +97375,29 @@ void main() {
|
|
|
97140
97375
|
* @tsl
|
|
97141
97376
|
* @type {Node<vec3>}
|
|
97142
97377
|
*/
|
|
97143
|
-
const bitangentView =
|
|
97378
|
+
const bitangentView = /*@__PURE__*/ ( Fn$1( ( { subBuildFn, geometry, material } ) => {
|
|
97379
|
+
|
|
97380
|
+
let node;
|
|
97381
|
+
|
|
97382
|
+
if ( subBuildFn === 'VERTEX' || geometry.hasAttribute( 'tangent' ) ) {
|
|
97383
|
+
|
|
97384
|
+
node = getBitangent( normalView.cross( tangentView ), 'v_bitangentView' ).normalize();
|
|
97385
|
+
|
|
97386
|
+
} else {
|
|
97387
|
+
|
|
97388
|
+
node = bitangentViewFrame;
|
|
97389
|
+
|
|
97390
|
+
}
|
|
97391
|
+
|
|
97392
|
+
if ( material.flatShading !== true ) {
|
|
97393
|
+
|
|
97394
|
+
node = directionToFaceDirection( node );
|
|
97395
|
+
|
|
97396
|
+
}
|
|
97397
|
+
|
|
97398
|
+
return node;
|
|
97399
|
+
|
|
97400
|
+
}, 'vec3' ).once( [ 'NORMAL', 'VERTEX' ] ) )().toVar( 'bitangentView' );
|
|
97144
97401
|
|
|
97145
97402
|
/**
|
|
97146
97403
|
* TSL object that represents the vertex bitangent in world space of the current rendered object.
|
|
@@ -97150,29 +97407,13 @@ void main() {
|
|
|
97150
97407
|
*/
|
|
97151
97408
|
const bitangentWorld = /*@__PURE__*/ getBitangent( normalWorld.cross( tangentWorld ), 'v_bitangentWorld' ).normalize().toVar( 'bitangentWorld' );
|
|
97152
97409
|
|
|
97153
|
-
/**
|
|
97154
|
-
* TSL object that represents the transformed vertex bitangent in view space of the current rendered object.
|
|
97155
|
-
*
|
|
97156
|
-
* @tsl
|
|
97157
|
-
* @type {Node<vec3>}
|
|
97158
|
-
*/
|
|
97159
|
-
const transformedBitangentView = /*@__PURE__*/ getBitangent( transformedNormalView.cross( transformedTangentView ), 'v_transformedBitangentView' ).normalize().toVar( 'transformedBitangentView' );
|
|
97160
|
-
|
|
97161
|
-
/**
|
|
97162
|
-
* TSL object that represents the transformed vertex bitangent in world space of the current rendered object.
|
|
97163
|
-
*
|
|
97164
|
-
* @tsl
|
|
97165
|
-
* @type {Node<vec4>}
|
|
97166
|
-
*/
|
|
97167
|
-
const transformedBitangentWorld = /*@__PURE__*/ transformedBitangentView.transformDirection( cameraViewMatrix ).normalize().toVar( 'transformedBitangentWorld' );
|
|
97168
|
-
|
|
97169
97410
|
/**
|
|
97170
97411
|
* TSL object that represents the TBN matrix in view space.
|
|
97171
97412
|
*
|
|
97172
97413
|
* @tsl
|
|
97173
97414
|
* @type {Node<mat3>}
|
|
97174
97415
|
*/
|
|
97175
|
-
const TBNViewMatrix = /*@__PURE__*/ mat3( tangentView, bitangentView, normalView );
|
|
97416
|
+
const TBNViewMatrix = /*@__PURE__*/ mat3( tangentView, bitangentView, normalView ).toVar( 'TBNViewMatrix' );
|
|
97176
97417
|
|
|
97177
97418
|
/**
|
|
97178
97419
|
* TSL object that represents the parallax direction.
|
|
@@ -97200,45 +97441,17 @@ void main() {
|
|
|
97200
97441
|
* @function
|
|
97201
97442
|
* @returns {Node<vec3>} Bent normals.
|
|
97202
97443
|
*/
|
|
97203
|
-
const
|
|
97444
|
+
const bentNormalView = /*@__PURE__*/ ( Fn$1( () => {
|
|
97204
97445
|
|
|
97205
97446
|
// https://google.github.io/filament/Filament.md.html#lighting/imagebasedlights/anisotropy
|
|
97206
97447
|
|
|
97207
97448
|
let bentNormal = anisotropyB.cross( positionViewDirection );
|
|
97208
97449
|
bentNormal = bentNormal.cross( anisotropyB ).normalize();
|
|
97209
|
-
bentNormal = mix$2( bentNormal,
|
|
97450
|
+
bentNormal = mix$2( bentNormal, normalView, anisotropy.mul( roughness.oneMinus() ).oneMinus().pow2().pow2() ).normalize();
|
|
97210
97451
|
|
|
97211
97452
|
return bentNormal;
|
|
97212
97453
|
|
|
97213
|
-
|
|
97214
|
-
} )();
|
|
97215
|
-
|
|
97216
|
-
// Normal Mapping Without Precomputed Tangents
|
|
97217
|
-
// http://www.thetenthplanet.de/archives/1180
|
|
97218
|
-
|
|
97219
|
-
const perturbNormal2Arb = /*@__PURE__*/ Fn$1( ( inputs ) => {
|
|
97220
|
-
|
|
97221
|
-
const { eye_pos, surf_norm, mapN, uv } = inputs;
|
|
97222
|
-
|
|
97223
|
-
const q0 = eye_pos.dFdx();
|
|
97224
|
-
const q1 = eye_pos.dFdy();
|
|
97225
|
-
const st0 = uv.dFdx();
|
|
97226
|
-
const st1 = uv.dFdy();
|
|
97227
|
-
|
|
97228
|
-
const N = surf_norm; // normalized
|
|
97229
|
-
|
|
97230
|
-
const q1perp = q1.cross( N );
|
|
97231
|
-
const q0perp = N.cross( q0 );
|
|
97232
|
-
|
|
97233
|
-
const T = q1perp.mul( st0.x ).add( q0perp.mul( st1.x ) );
|
|
97234
|
-
const B = q1perp.mul( st0.y ).add( q0perp.mul( st1.y ) );
|
|
97235
|
-
|
|
97236
|
-
const det = T.dot( T ).max( B.dot( B ) );
|
|
97237
|
-
const scale = faceDirection.mul( det.inverseSqrt() );
|
|
97238
|
-
|
|
97239
|
-
return add( T.mul( mapN.x, scale ), B.mul( mapN.y, scale ), N.mul( mapN.z ) ).normalize();
|
|
97240
|
-
|
|
97241
|
-
} );
|
|
97454
|
+
} ).once() )();
|
|
97242
97455
|
|
|
97243
97456
|
/**
|
|
97244
97457
|
* This class can be used for applying normals maps to materials.
|
|
@@ -97292,7 +97505,7 @@ void main() {
|
|
|
97292
97505
|
|
|
97293
97506
|
}
|
|
97294
97507
|
|
|
97295
|
-
setup(
|
|
97508
|
+
setup( { material } ) {
|
|
97296
97509
|
|
|
97297
97510
|
const { normalMapType, scaleNode } = this;
|
|
97298
97511
|
|
|
@@ -97300,38 +97513,37 @@ void main() {
|
|
|
97300
97513
|
|
|
97301
97514
|
if ( scaleNode !== null ) {
|
|
97302
97515
|
|
|
97303
|
-
|
|
97516
|
+
let scale = scaleNode;
|
|
97517
|
+
|
|
97518
|
+
if ( material.flatShading === true ) {
|
|
97519
|
+
|
|
97520
|
+
scale = directionToFaceDirection( scale );
|
|
97521
|
+
|
|
97522
|
+
}
|
|
97523
|
+
|
|
97524
|
+
normalMap = vec3( normalMap.xy.mul( scale ), normalMap.z );
|
|
97304
97525
|
|
|
97305
97526
|
}
|
|
97306
97527
|
|
|
97307
|
-
let
|
|
97528
|
+
let output = null;
|
|
97308
97529
|
|
|
97309
97530
|
if ( normalMapType === ObjectSpaceNormalMap ) {
|
|
97310
97531
|
|
|
97311
|
-
|
|
97532
|
+
output = transformNormalToView( normalMap );
|
|
97312
97533
|
|
|
97313
97534
|
} else if ( normalMapType === TangentSpaceNormalMap ) {
|
|
97314
97535
|
|
|
97315
|
-
|
|
97536
|
+
output = TBNViewMatrix.mul( normalMap ).normalize();
|
|
97316
97537
|
|
|
97317
|
-
|
|
97318
|
-
|
|
97319
|
-
outputNode = TBNViewMatrix.mul( normalMap ).normalize();
|
|
97320
|
-
|
|
97321
|
-
} else {
|
|
97538
|
+
} else {
|
|
97322
97539
|
|
|
97323
|
-
|
|
97324
|
-
eye_pos: positionView,
|
|
97325
|
-
surf_norm: normalView,
|
|
97326
|
-
mapN: normalMap,
|
|
97327
|
-
uv: uv()
|
|
97328
|
-
} );
|
|
97540
|
+
console.error( `THREE.NodeMaterial: Unsupported normal map type: ${ normalMapType }` );
|
|
97329
97541
|
|
|
97330
|
-
|
|
97542
|
+
output = normalView; // Fallback to default normal view
|
|
97331
97543
|
|
|
97332
97544
|
}
|
|
97333
97545
|
|
|
97334
|
-
return
|
|
97546
|
+
return output;
|
|
97335
97547
|
|
|
97336
97548
|
}
|
|
97337
97549
|
|
|
@@ -97354,7 +97566,7 @@ void main() {
|
|
|
97354
97566
|
const dHdxy_fwd = Fn$1( ( { textureNode, bumpScale } ) => {
|
|
97355
97567
|
|
|
97356
97568
|
// It's used to preserve the same TextureNode instance
|
|
97357
|
-
const sampleTexture = ( callback ) => textureNode.cache().context( { getUV: ( texNode ) => callback( texNode.uvNode || uv() ), forceUVContext: true } );
|
|
97569
|
+
const sampleTexture = ( callback ) => textureNode.cache().context( { getUV: ( texNode ) => callback( texNode.uvNode || uv$1() ), forceUVContext: true } );
|
|
97358
97570
|
|
|
97359
97571
|
const Hll = float$1( sampleTexture( ( uvNode ) => uvNode ) );
|
|
97360
97572
|
|
|
@@ -100004,23 +100216,6 @@ void main() {
|
|
|
100004
100216
|
*/
|
|
100005
100217
|
const Break = () => expression( 'break' ).toStack();
|
|
100006
100218
|
|
|
100007
|
-
// Deprecated
|
|
100008
|
-
|
|
100009
|
-
/**
|
|
100010
|
-
* @tsl
|
|
100011
|
-
* @function
|
|
100012
|
-
* @deprecated since r168. Use {@link Loop} instead.
|
|
100013
|
-
*
|
|
100014
|
-
* @param {...any} params
|
|
100015
|
-
* @returns {LoopNode}
|
|
100016
|
-
*/
|
|
100017
|
-
const loop = ( ...params ) => { // @deprecated, r168
|
|
100018
|
-
|
|
100019
|
-
console.warn( 'THREE.TSL: loop() has been renamed to Loop().' );
|
|
100020
|
-
return Loop$1( ...params );
|
|
100021
|
-
|
|
100022
|
-
};
|
|
100023
|
-
|
|
100024
100219
|
const _morphTextures = /*@__PURE__*/ new WeakMap();
|
|
100025
100220
|
const _morphVec4 = /*@__PURE__*/ new Vector4();
|
|
100026
100221
|
|
|
@@ -100792,32 +100987,6 @@ void main() {
|
|
|
100792
100987
|
|
|
100793
100988
|
}, 'vec2' ).once() )();
|
|
100794
100989
|
|
|
100795
|
-
/**
|
|
100796
|
-
* @tsl
|
|
100797
|
-
* @deprecated since r168. Use {@link screenUV} instead.
|
|
100798
|
-
* @type {Node<vec2>}
|
|
100799
|
-
*/
|
|
100800
|
-
const viewportTopLeft = /*@__PURE__*/ ( Fn$1( () => { // @deprecated, r168
|
|
100801
|
-
|
|
100802
|
-
console.warn( 'THREE.TSL: "viewportTopLeft" is deprecated. Use "screenUV" instead.' );
|
|
100803
|
-
|
|
100804
|
-
return screenUV;
|
|
100805
|
-
|
|
100806
|
-
}, 'vec2' ).once() )();
|
|
100807
|
-
|
|
100808
|
-
/**
|
|
100809
|
-
* @tsl
|
|
100810
|
-
* @deprecated since r168. Use `screenUV.flipY()` instead.
|
|
100811
|
-
* @type {Node<vec2>}
|
|
100812
|
-
*/
|
|
100813
|
-
const viewportBottomLeft = /*@__PURE__*/ ( Fn$1( () => { // @deprecated, r168
|
|
100814
|
-
|
|
100815
|
-
console.warn( 'THREE.TSL: "viewportBottomLeft" is deprecated. Use "screenUV.flipY()" instead.' );
|
|
100816
|
-
|
|
100817
|
-
return screenUV.flipY();
|
|
100818
|
-
|
|
100819
|
-
}, 'vec2' ).once() )();
|
|
100820
|
-
|
|
100821
100990
|
const _size$4 = /*@__PURE__*/ new Vector2();
|
|
100822
100991
|
|
|
100823
100992
|
/**
|
|
@@ -101694,6 +101863,238 @@ void main() {
|
|
|
101694
101863
|
*/
|
|
101695
101864
|
const vertexColor = ( index = 0 ) => nodeObject( new VertexColorNode( index ) );
|
|
101696
101865
|
|
|
101866
|
+
/**
|
|
101867
|
+
* Represents a "Color Burn" blend mode.
|
|
101868
|
+
*
|
|
101869
|
+
* It's designed to darken the base layer's colors based on the color of the blend layer.
|
|
101870
|
+
* It significantly increases the contrast of the base layer, making the colors more vibrant and saturated.
|
|
101871
|
+
* The darker the color in the blend layer, the stronger the darkening and contrast effect on the base layer.
|
|
101872
|
+
*
|
|
101873
|
+
* @tsl
|
|
101874
|
+
* @function
|
|
101875
|
+
* @param {Node<vec3>} base - The base color.
|
|
101876
|
+
* @param {Node<vec3>} blend - The blend color. A white (#ffffff) blend color does not alter the base color.
|
|
101877
|
+
* @return {Node<vec3>} The result.
|
|
101878
|
+
*/
|
|
101879
|
+
const blendBurn = /*@__PURE__*/ Fn$1( ( [ base, blend ] ) => {
|
|
101880
|
+
|
|
101881
|
+
return min$1( 1.0, base.oneMinus().div( blend ) ).oneMinus();
|
|
101882
|
+
|
|
101883
|
+
} ).setLayout( {
|
|
101884
|
+
name: 'blendBurn',
|
|
101885
|
+
type: 'vec3',
|
|
101886
|
+
inputs: [
|
|
101887
|
+
{ name: 'base', type: 'vec3' },
|
|
101888
|
+
{ name: 'blend', type: 'vec3' }
|
|
101889
|
+
]
|
|
101890
|
+
} );
|
|
101891
|
+
|
|
101892
|
+
/**
|
|
101893
|
+
* Represents a "Color Dodge" blend mode.
|
|
101894
|
+
*
|
|
101895
|
+
* It's designed to lighten the base layer's colors based on the color of the blend layer.
|
|
101896
|
+
* It significantly increases the brightness of the base layer, making the colors lighter and more vibrant.
|
|
101897
|
+
* The brighter the color in the blend layer, the stronger the lightening and contrast effect on the base layer.
|
|
101898
|
+
*
|
|
101899
|
+
* @tsl
|
|
101900
|
+
* @function
|
|
101901
|
+
* @param {Node<vec3>} base - The base color.
|
|
101902
|
+
* @param {Node<vec3>} blend - The blend color. A black (#000000) blend color does not alter the base color.
|
|
101903
|
+
* @return {Node<vec3>} The result.
|
|
101904
|
+
*/
|
|
101905
|
+
const blendDodge = /*@__PURE__*/ Fn$1( ( [ base, blend ] ) => {
|
|
101906
|
+
|
|
101907
|
+
return min$1( base.div( blend.oneMinus() ), 1.0 );
|
|
101908
|
+
|
|
101909
|
+
} ).setLayout( {
|
|
101910
|
+
name: 'blendDodge',
|
|
101911
|
+
type: 'vec3',
|
|
101912
|
+
inputs: [
|
|
101913
|
+
{ name: 'base', type: 'vec3' },
|
|
101914
|
+
{ name: 'blend', type: 'vec3' }
|
|
101915
|
+
]
|
|
101916
|
+
} );
|
|
101917
|
+
|
|
101918
|
+
/**
|
|
101919
|
+
* Represents a "Screen" blend mode.
|
|
101920
|
+
*
|
|
101921
|
+
* Similar to `blendDodge()`, this mode also lightens the base layer's colors based on the color of the blend layer.
|
|
101922
|
+
* The "Screen" blend mode is better for general brightening whereas the "Dodge" results in more subtle and nuanced
|
|
101923
|
+
* effects.
|
|
101924
|
+
*
|
|
101925
|
+
* @tsl
|
|
101926
|
+
* @function
|
|
101927
|
+
* @param {Node<vec3>} base - The base color.
|
|
101928
|
+
* @param {Node<vec3>} blend - The blend color. A black (#000000) blend color does not alter the base color.
|
|
101929
|
+
* @return {Node<vec3>} The result.
|
|
101930
|
+
*/
|
|
101931
|
+
const blendScreen = /*@__PURE__*/ Fn$1( ( [ base, blend ] ) => {
|
|
101932
|
+
|
|
101933
|
+
return base.oneMinus().mul( blend.oneMinus() ).oneMinus();
|
|
101934
|
+
|
|
101935
|
+
} ).setLayout( {
|
|
101936
|
+
name: 'blendScreen',
|
|
101937
|
+
type: 'vec3',
|
|
101938
|
+
inputs: [
|
|
101939
|
+
{ name: 'base', type: 'vec3' },
|
|
101940
|
+
{ name: 'blend', type: 'vec3' }
|
|
101941
|
+
]
|
|
101942
|
+
} );
|
|
101943
|
+
|
|
101944
|
+
/**
|
|
101945
|
+
* Represents a "Overlay" blend mode.
|
|
101946
|
+
*
|
|
101947
|
+
* It's designed to increase the contrast of the base layer based on the color of the blend layer.
|
|
101948
|
+
* It amplifies the existing colors and contrast in the base layer, making lighter areas lighter and darker areas darker.
|
|
101949
|
+
* The color of the blend layer significantly influences the resulting contrast and color shift in the base layer.
|
|
101950
|
+
*
|
|
101951
|
+
* @tsl
|
|
101952
|
+
* @function
|
|
101953
|
+
* @param {Node<vec3>} base - The base color.
|
|
101954
|
+
* @param {Node<vec3>} blend - The blend color
|
|
101955
|
+
* @return {Node<vec3>} The result.
|
|
101956
|
+
*/
|
|
101957
|
+
const blendOverlay = /*@__PURE__*/ Fn$1( ( [ base, blend ] ) => {
|
|
101958
|
+
|
|
101959
|
+
return mix$2( base.mul( 2.0 ).mul( blend ), base.oneMinus().mul( 2.0 ).mul( blend.oneMinus() ).oneMinus(), step( 0.5, base ) );
|
|
101960
|
+
|
|
101961
|
+
} ).setLayout( {
|
|
101962
|
+
name: 'blendOverlay',
|
|
101963
|
+
type: 'vec3',
|
|
101964
|
+
inputs: [
|
|
101965
|
+
{ name: 'base', type: 'vec3' },
|
|
101966
|
+
{ name: 'blend', type: 'vec3' }
|
|
101967
|
+
]
|
|
101968
|
+
} );
|
|
101969
|
+
|
|
101970
|
+
/**
|
|
101971
|
+
* This function blends two color based on their alpha values by replicating the behavior of `THREE.NormalBlending`.
|
|
101972
|
+
* It assumes both input colors have non-premultiplied alpha.
|
|
101973
|
+
*
|
|
101974
|
+
* @tsl
|
|
101975
|
+
* @function
|
|
101976
|
+
* @param {Node<vec4>} base - The base color.
|
|
101977
|
+
* @param {Node<vec4>} blend - The blend color
|
|
101978
|
+
* @return {Node<vec4>} The result.
|
|
101979
|
+
*/
|
|
101980
|
+
const blendColor = /*@__PURE__*/ Fn$1( ( [ base, blend ] ) => {
|
|
101981
|
+
|
|
101982
|
+
const outAlpha = blend.a.add( base.a.mul( blend.a.oneMinus() ) );
|
|
101983
|
+
|
|
101984
|
+
return vec4( blend.rgb.mul( blend.a ).add( base.rgb.mul( base.a ).mul( blend.a.oneMinus() ) ).div( outAlpha ), outAlpha );
|
|
101985
|
+
|
|
101986
|
+
} ).setLayout( {
|
|
101987
|
+
name: 'blendColor',
|
|
101988
|
+
type: 'vec4',
|
|
101989
|
+
inputs: [
|
|
101990
|
+
{ name: 'base', type: 'vec4' },
|
|
101991
|
+
{ name: 'blend', type: 'vec4' }
|
|
101992
|
+
]
|
|
101993
|
+
} );
|
|
101994
|
+
|
|
101995
|
+
/**
|
|
101996
|
+
* Premultiplies the RGB channels of a color by its alpha channel.
|
|
101997
|
+
*
|
|
101998
|
+
* This function is useful for converting a non-premultiplied alpha color
|
|
101999
|
+
* into a premultiplied alpha format, where the RGB values are scaled
|
|
102000
|
+
* by the alpha value. Premultiplied alpha is often used in graphics
|
|
102001
|
+
* rendering for certain operations, such as compositing and image processing.
|
|
102002
|
+
*
|
|
102003
|
+
* @tsl
|
|
102004
|
+
* @function
|
|
102005
|
+
* @param {Node<vec4>} color - The input color with non-premultiplied alpha.
|
|
102006
|
+
* @return {Node<vec4>} The color with premultiplied alpha.
|
|
102007
|
+
*/
|
|
102008
|
+
const premultiplyAlpha = /*@__PURE__*/ Fn$1( ( [ color ] ) => {
|
|
102009
|
+
|
|
102010
|
+
return vec4( color.rgb.mul( color.a ), color.a );
|
|
102011
|
+
|
|
102012
|
+
}, { color: 'vec4', return: 'vec4' } );
|
|
102013
|
+
|
|
102014
|
+
/**
|
|
102015
|
+
* Unpremultiplies the RGB channels of a color by its alpha channel.
|
|
102016
|
+
*
|
|
102017
|
+
* This function is useful for converting a premultiplied alpha color
|
|
102018
|
+
* back into a non-premultiplied alpha format, where the RGB values are
|
|
102019
|
+
* divided by the alpha value. Unpremultiplied alpha is often used in graphics
|
|
102020
|
+
* rendering for certain operations, such as compositing and image processing.
|
|
102021
|
+
*
|
|
102022
|
+
* @tsl
|
|
102023
|
+
* @function
|
|
102024
|
+
* @param {Node<vec4>} color - The input color with premultiplied alpha.
|
|
102025
|
+
* @return {Node<vec4>} The color with non-premultiplied alpha.
|
|
102026
|
+
*/
|
|
102027
|
+
const unpremultiplyAlpha = /*@__PURE__*/ Fn$1( ( [ color ] ) => {
|
|
102028
|
+
|
|
102029
|
+
If$1( color.a.equal( 0.0 ), () => vec4( 0.0 ) );
|
|
102030
|
+
|
|
102031
|
+
return vec4( color.rgb.div( color.a ), color.a );
|
|
102032
|
+
|
|
102033
|
+
}, { color: 'vec4', return: 'vec4' } );
|
|
102034
|
+
|
|
102035
|
+
|
|
102036
|
+
// Deprecated
|
|
102037
|
+
|
|
102038
|
+
/**
|
|
102039
|
+
* @tsl
|
|
102040
|
+
* @function
|
|
102041
|
+
* @deprecated since r171. Use {@link blendBurn} instead.
|
|
102042
|
+
*
|
|
102043
|
+
* @param {...any} params
|
|
102044
|
+
* @returns {Function}
|
|
102045
|
+
*/
|
|
102046
|
+
const burn = ( ...params ) => { // @deprecated, r171
|
|
102047
|
+
|
|
102048
|
+
console.warn( 'THREE.TSL: "burn" has been renamed. Use "blendBurn" instead.' );
|
|
102049
|
+
return blendBurn( params );
|
|
102050
|
+
|
|
102051
|
+
};
|
|
102052
|
+
|
|
102053
|
+
/**
|
|
102054
|
+
* @tsl
|
|
102055
|
+
* @function
|
|
102056
|
+
* @deprecated since r171. Use {@link blendDodge} instead.
|
|
102057
|
+
*
|
|
102058
|
+
* @param {...any} params
|
|
102059
|
+
* @returns {Function}
|
|
102060
|
+
*/
|
|
102061
|
+
const dodge = ( ...params ) => { // @deprecated, r171
|
|
102062
|
+
|
|
102063
|
+
console.warn( 'THREE.TSL: "dodge" has been renamed. Use "blendDodge" instead.' );
|
|
102064
|
+
return blendDodge( params );
|
|
102065
|
+
|
|
102066
|
+
};
|
|
102067
|
+
|
|
102068
|
+
/**
|
|
102069
|
+
* @tsl
|
|
102070
|
+
* @function
|
|
102071
|
+
* @deprecated since r171. Use {@link blendScreen} instead.
|
|
102072
|
+
*
|
|
102073
|
+
* @param {...any} params
|
|
102074
|
+
* @returns {Function}
|
|
102075
|
+
*/
|
|
102076
|
+
const screen = ( ...params ) => { // @deprecated, r171
|
|
102077
|
+
|
|
102078
|
+
console.warn( 'THREE.TSL: "screen" has been renamed. Use "blendScreen" instead.' );
|
|
102079
|
+
return blendScreen( params );
|
|
102080
|
+
|
|
102081
|
+
};
|
|
102082
|
+
|
|
102083
|
+
/**
|
|
102084
|
+
* @tsl
|
|
102085
|
+
* @function
|
|
102086
|
+
* @deprecated since r171. Use {@link blendOverlay} instead.
|
|
102087
|
+
*
|
|
102088
|
+
* @param {...any} params
|
|
102089
|
+
* @returns {Function}
|
|
102090
|
+
*/
|
|
102091
|
+
const overlay = ( ...params ) => { // @deprecated, r171
|
|
102092
|
+
|
|
102093
|
+
console.warn( 'THREE.TSL: "overlay" has been renamed. Use "blendOverlay" instead.' );
|
|
102094
|
+
return blendOverlay( params );
|
|
102095
|
+
|
|
102096
|
+
};
|
|
102097
|
+
|
|
101697
102098
|
/**
|
|
101698
102099
|
* Base class for all node materials.
|
|
101699
102100
|
*
|
|
@@ -102113,7 +102514,7 @@ void main() {
|
|
|
102113
102514
|
*/
|
|
102114
102515
|
setup( builder ) {
|
|
102115
102516
|
|
|
102116
|
-
builder.context.setupNormal = () => this.setupNormal( builder );
|
|
102517
|
+
builder.context.setupNormal = () => subBuild( this.setupNormal( builder ), 'NORMAL', 'vec3' );
|
|
102117
102518
|
builder.context.setupPositionView = () => this.setupPositionView( builder );
|
|
102118
102519
|
builder.context.setupModelViewProjection = () => this.setupModelViewProjection( builder );
|
|
102119
102520
|
|
|
@@ -102124,7 +102525,7 @@ void main() {
|
|
|
102124
102525
|
|
|
102125
102526
|
builder.addStack();
|
|
102126
102527
|
|
|
102127
|
-
const mvp = this.setupVertex( builder );
|
|
102528
|
+
const mvp = subBuild( this.setupVertex( builder ), 'VERTEX' );
|
|
102128
102529
|
|
|
102129
102530
|
const vertexNode = this.vertexNode || mvp;
|
|
102130
102531
|
|
|
@@ -102436,7 +102837,7 @@ void main() {
|
|
|
102436
102837
|
|
|
102437
102838
|
if ( this.positionNode !== null ) {
|
|
102438
102839
|
|
|
102439
|
-
positionLocal.assign(
|
|
102840
|
+
positionLocal.assign( subBuild( this.positionNode, 'POSITION', 'vec3' ) );
|
|
102440
102841
|
|
|
102441
102842
|
}
|
|
102442
102843
|
|
|
@@ -102746,6 +103147,19 @@ void main() {
|
|
|
102746
103147
|
|
|
102747
103148
|
}
|
|
102748
103149
|
|
|
103150
|
+
/**
|
|
103151
|
+
* Setups premultiplied alpha.
|
|
103152
|
+
*
|
|
103153
|
+
* @param {NodeBuilder} builder - The current node builder.
|
|
103154
|
+
* @param {Node<vec4>} outputNode - The existing output node.
|
|
103155
|
+
* @return {Node<vec4>} The output node.
|
|
103156
|
+
*/
|
|
103157
|
+
setupPremultipliedAlpha( builder, outputNode ) {
|
|
103158
|
+
|
|
103159
|
+
return premultiplyAlpha( outputNode );
|
|
103160
|
+
|
|
103161
|
+
}
|
|
103162
|
+
|
|
102749
103163
|
/**
|
|
102750
103164
|
* Setups the output node.
|
|
102751
103165
|
*
|
|
@@ -102763,6 +103177,14 @@ void main() {
|
|
|
102763
103177
|
|
|
102764
103178
|
}
|
|
102765
103179
|
|
|
103180
|
+
// PREMULTIPLIED ALPHA
|
|
103181
|
+
|
|
103182
|
+
if ( this.premultipliedAlpha === true ) {
|
|
103183
|
+
|
|
103184
|
+
outputNode = this.setupPremultipliedAlpha( builder, outputNode );
|
|
103185
|
+
|
|
103186
|
+
}
|
|
103187
|
+
|
|
102766
103188
|
return outputNode;
|
|
102767
103189
|
|
|
102768
103190
|
}
|
|
@@ -103200,13 +103622,15 @@ void main() {
|
|
|
103200
103622
|
|
|
103201
103623
|
// By convention, a normal packed to RGB is in sRGB color space. Convert it to working color space.
|
|
103202
103624
|
|
|
103203
|
-
diffuseColor.assign( colorSpaceToWorking( vec4( directionToColor(
|
|
103625
|
+
diffuseColor.assign( colorSpaceToWorking( vec4( directionToColor( normalView ), opacityNode ), SRGBColorSpace ) );
|
|
103204
103626
|
|
|
103205
103627
|
}
|
|
103206
103628
|
|
|
103207
103629
|
}
|
|
103208
103630
|
|
|
103209
103631
|
/**
|
|
103632
|
+
* TSL function for creating an equirect uv node.
|
|
103633
|
+
*
|
|
103210
103634
|
* Can be used to compute texture coordinates for projecting an
|
|
103211
103635
|
* equirectangular texture onto a mesh for using it as the scene's
|
|
103212
103636
|
* background.
|
|
@@ -103215,56 +103639,19 @@ void main() {
|
|
|
103215
103639
|
* scene.backgroundNode = texture( equirectTexture, equirectUV() );
|
|
103216
103640
|
* ```
|
|
103217
103641
|
*
|
|
103218
|
-
* @augments TempNode
|
|
103219
|
-
*/
|
|
103220
|
-
class EquirectUVNode extends TempNode {
|
|
103221
|
-
|
|
103222
|
-
static get type() {
|
|
103223
|
-
|
|
103224
|
-
return 'EquirectUVNode';
|
|
103225
|
-
|
|
103226
|
-
}
|
|
103227
|
-
|
|
103228
|
-
/**
|
|
103229
|
-
* Constructs a new equirect uv node.
|
|
103230
|
-
*
|
|
103231
|
-
* @param {Node<vec3>} [dirNode=positionWorldDirection] - A direction vector for sampling which is by default `positionWorldDirection`.
|
|
103232
|
-
*/
|
|
103233
|
-
constructor( dirNode = positionWorldDirection ) {
|
|
103234
|
-
|
|
103235
|
-
super( 'vec2' );
|
|
103236
|
-
|
|
103237
|
-
/**
|
|
103238
|
-
* A direction vector for sampling why is by default `positionWorldDirection`.
|
|
103239
|
-
*
|
|
103240
|
-
* @type {Node<vec3>}
|
|
103241
|
-
*/
|
|
103242
|
-
this.dirNode = dirNode;
|
|
103243
|
-
|
|
103244
|
-
}
|
|
103245
|
-
|
|
103246
|
-
setup() {
|
|
103247
|
-
|
|
103248
|
-
const dir = this.dirNode;
|
|
103249
|
-
|
|
103250
|
-
const u = dir.z.atan( dir.x ).mul( 1 / ( Math.PI * 2 ) ).add( 0.5 );
|
|
103251
|
-
const v = dir.y.clamp( -1, 1.0 ).asin().mul( 1 / Math.PI ).add( 0.5 );
|
|
103252
|
-
|
|
103253
|
-
return vec2( u, v );
|
|
103254
|
-
|
|
103255
|
-
}
|
|
103256
|
-
|
|
103257
|
-
}
|
|
103258
|
-
|
|
103259
|
-
/**
|
|
103260
|
-
* TSL function for creating an equirect uv node.
|
|
103261
|
-
*
|
|
103262
103642
|
* @tsl
|
|
103263
103643
|
* @function
|
|
103264
103644
|
* @param {?Node<vec3>} [dirNode=positionWorldDirection] - A direction vector for sampling which is by default `positionWorldDirection`.
|
|
103265
|
-
* @returns {
|
|
103645
|
+
* @returns {Node<vec2>}
|
|
103266
103646
|
*/
|
|
103267
|
-
const equirectUV = /*@__PURE__*/
|
|
103647
|
+
const equirectUV = /*@__PURE__*/ Fn$1( ( [ dir = positionWorldDirection ] ) => {
|
|
103648
|
+
|
|
103649
|
+
const u = dir.z.atan( dir.x ).mul( 1 / ( Math.PI * 2 ) ).add( 0.5 );
|
|
103650
|
+
const v = dir.y.clamp( -1, 1.0 ).asin().mul( 1 / Math.PI ).add( 0.5 );
|
|
103651
|
+
|
|
103652
|
+
return vec2( u, v );
|
|
103653
|
+
|
|
103654
|
+
} );
|
|
103268
103655
|
|
|
103269
103656
|
// @TODO: Consider rename WebGLCubeRenderTarget to just CubeRenderTarget
|
|
103270
103657
|
|
|
@@ -103892,13 +104279,13 @@ void main() {
|
|
|
103892
104279
|
|
|
103893
104280
|
/**
|
|
103894
104281
|
* Basic materials are not affected by normal and bump maps so we
|
|
103895
|
-
* return by default {@link
|
|
104282
|
+
* return by default {@link normalViewGeometry}.
|
|
103896
104283
|
*
|
|
103897
104284
|
* @return {Node<vec3>} The normal node.
|
|
103898
104285
|
*/
|
|
103899
104286
|
setupNormal() {
|
|
103900
104287
|
|
|
103901
|
-
return
|
|
104288
|
+
return directionToFaceDirection( normalViewGeometry ); // see #28839
|
|
103902
104289
|
|
|
103903
104290
|
}
|
|
103904
104291
|
|
|
@@ -103994,7 +104381,7 @@ void main() {
|
|
|
103994
104381
|
|
|
103995
104382
|
const halfDir = lightDirection.add( positionViewDirection ).normalize();
|
|
103996
104383
|
|
|
103997
|
-
const dotNH =
|
|
104384
|
+
const dotNH = normalView.dot( halfDir ).clamp();
|
|
103998
104385
|
const dotVH = positionViewDirection.dot( halfDir ).clamp();
|
|
103999
104386
|
|
|
104000
104387
|
const F = F_Schlick( { f0: specularColor, f90: 1.0, dotVH } );
|
|
@@ -104041,7 +104428,7 @@ void main() {
|
|
|
104041
104428
|
*/
|
|
104042
104429
|
direct( { lightDirection, lightColor, reflectedLight } ) {
|
|
104043
104430
|
|
|
104044
|
-
const dotNL =
|
|
104431
|
+
const dotNL = normalView.dot( lightDirection ).clamp();
|
|
104045
104432
|
const irradiance = dotNL.mul( lightColor );
|
|
104046
104433
|
|
|
104047
104434
|
reflectedLight.directDiffuse.addAssign( irradiance.mul( BRDF_Lambert( { diffuseColor: diffuseColor.rgb } ) ) );
|
|
@@ -104285,7 +104672,7 @@ void main() {
|
|
|
104285
104672
|
|
|
104286
104673
|
}
|
|
104287
104674
|
|
|
104288
|
-
const dxy =
|
|
104675
|
+
const dxy = normalViewGeometry.dFdx().abs().max( normalViewGeometry.dFdy().abs() );
|
|
104289
104676
|
const geometryRoughness = dxy.x.max( dxy.y ).max( dxy.z );
|
|
104290
104677
|
|
|
104291
104678
|
return geometryRoughness;
|
|
@@ -104398,19 +104785,15 @@ void main() {
|
|
|
104398
104785
|
} );
|
|
104399
104786
|
|
|
104400
104787
|
// GGX Distribution, Schlick Fresnel, GGX_SmithCorrelated Visibility
|
|
104401
|
-
const BRDF_GGX = /*@__PURE__*/ Fn$1( (
|
|
104402
|
-
|
|
104403
|
-
const { lightDirection, f0, f90, roughness, f, USE_IRIDESCENCE, USE_ANISOTROPY } = inputs;
|
|
104404
|
-
|
|
104405
|
-
const normalView = inputs.normalView || transformedNormalView;
|
|
104788
|
+
const BRDF_GGX = /*@__PURE__*/ Fn$1( ( { lightDirection, f0, f90, roughness, f, normalView: normalView$1 = normalView, USE_IRIDESCENCE, USE_ANISOTROPY } ) => {
|
|
104406
104789
|
|
|
104407
104790
|
const alpha = roughness.pow2(); // UE4's roughness
|
|
104408
104791
|
|
|
104409
104792
|
const halfDir = lightDirection.add( positionViewDirection ).normalize();
|
|
104410
104793
|
|
|
104411
|
-
const dotNL = normalView.dot( lightDirection ).clamp();
|
|
104412
|
-
const dotNV = normalView.dot( positionViewDirection ).clamp(); // @ TODO: Move to core dotNV
|
|
104413
|
-
const dotNH = normalView.dot( halfDir ).clamp();
|
|
104794
|
+
const dotNL = normalView$1.dot( lightDirection ).clamp();
|
|
104795
|
+
const dotNV = normalView$1.dot( positionViewDirection ).clamp(); // @ TODO: Move to core dotNV
|
|
104796
|
+
const dotNH = normalView$1.dot( halfDir ).clamp();
|
|
104414
104797
|
const dotVH = positionViewDirection.dot( halfDir ).clamp();
|
|
104415
104798
|
|
|
104416
104799
|
let F = F_Schlick( { f0, f90, dotVH } );
|
|
@@ -104539,9 +104922,9 @@ void main() {
|
|
|
104539
104922
|
|
|
104540
104923
|
const halfDir = lightDirection.add( positionViewDirection ).normalize();
|
|
104541
104924
|
|
|
104542
|
-
const dotNL =
|
|
104543
|
-
const dotNV =
|
|
104544
|
-
const dotNH =
|
|
104925
|
+
const dotNL = normalView.dot( lightDirection ).clamp();
|
|
104926
|
+
const dotNV = normalView.dot( positionViewDirection ).clamp();
|
|
104927
|
+
const dotNH = normalView.dot( halfDir ).clamp();
|
|
104545
104928
|
|
|
104546
104929
|
const D = D_Charlie( { roughness: sheenRoughness, dotNH } );
|
|
104547
104930
|
const V = V_Neubelt( { dotNV, dotNL } );
|
|
@@ -104731,10 +105114,10 @@ void main() {
|
|
|
104731
105114
|
* @tsl
|
|
104732
105115
|
* @function
|
|
104733
105116
|
* @param {TextureNode} textureNode - The texture node that should be filtered.
|
|
104734
|
-
* @param {Node<float>}
|
|
105117
|
+
* @param {Node<float>} lodNode - Defines the LOD to sample from.
|
|
104735
105118
|
* @return {Node} The filtered texture sample.
|
|
104736
105119
|
*/
|
|
104737
|
-
const
|
|
105120
|
+
const textureBicubicLevel = /*@__PURE__*/ Fn$1( ( [ textureNode, lodNode ] ) => {
|
|
104738
105121
|
|
|
104739
105122
|
const fLodSize = vec2( textureNode.size( int( lodNode ) ) );
|
|
104740
105123
|
const cLodSize = vec2( textureNode.size( int( lodNode.add( 1.0 ) ) ) );
|
|
@@ -104747,6 +105130,23 @@ void main() {
|
|
|
104747
105130
|
|
|
104748
105131
|
} );
|
|
104749
105132
|
|
|
105133
|
+
/**
|
|
105134
|
+
* Applies mipped bicubic texture filtering to the given texture node.
|
|
105135
|
+
*
|
|
105136
|
+
* @tsl
|
|
105137
|
+
* @function
|
|
105138
|
+
* @param {TextureNode} textureNode - The texture node that should be filtered.
|
|
105139
|
+
* @param {Node<float>} [strength] - Defines the strength of the bicubic filtering.
|
|
105140
|
+
* @return {Node} The filtered texture sample.
|
|
105141
|
+
*/
|
|
105142
|
+
const textureBicubic = /*@__PURE__*/ Fn$1( ( [ textureNode, strength ] ) => {
|
|
105143
|
+
|
|
105144
|
+
const lod = strength.mul( maxMipLevel( textureNode ) );
|
|
105145
|
+
|
|
105146
|
+
return textureBicubicLevel( textureNode, lod );
|
|
105147
|
+
|
|
105148
|
+
} );
|
|
105149
|
+
|
|
104750
105150
|
//
|
|
104751
105151
|
// Transmission
|
|
104752
105152
|
//
|
|
@@ -104805,7 +105205,7 @@ void main() {
|
|
|
104805
105205
|
|
|
104806
105206
|
const lod = log2( screenSize.x ).mul( applyIorToRoughness( roughness, ior ) );
|
|
104807
105207
|
|
|
104808
|
-
return
|
|
105208
|
+
return textureBicubicLevel( transmissionSample, lod );
|
|
104809
105209
|
|
|
104810
105210
|
} );
|
|
104811
105211
|
|
|
@@ -105219,7 +105619,7 @@ void main() {
|
|
|
105219
105619
|
|
|
105220
105620
|
if ( this.iridescence === true ) {
|
|
105221
105621
|
|
|
105222
|
-
const dotNVi =
|
|
105622
|
+
const dotNVi = normalView.dot( positionViewDirection ).clamp();
|
|
105223
105623
|
|
|
105224
105624
|
this.iridescenceFresnel = evalIridescence( {
|
|
105225
105625
|
outsideIOR: float$1( 1.0 ),
|
|
@@ -105237,7 +105637,7 @@ void main() {
|
|
|
105237
105637
|
|
|
105238
105638
|
const position = positionWorld;
|
|
105239
105639
|
const v = cameraPosition.sub( positionWorld ).normalize(); // TODO: Create Node for this, same issue in MaterialX
|
|
105240
|
-
const n =
|
|
105640
|
+
const n = normalWorld;
|
|
105241
105641
|
|
|
105242
105642
|
const context = builder.context;
|
|
105243
105643
|
|
|
@@ -105275,7 +105675,7 @@ void main() {
|
|
|
105275
105675
|
|
|
105276
105676
|
computeMultiscattering( singleScatter, multiScatter, specularF90 ) {
|
|
105277
105677
|
|
|
105278
|
-
const dotNV =
|
|
105678
|
+
const dotNV = normalView.dot( positionViewDirection ).clamp(); // @ TODO: Move to core dotNV
|
|
105279
105679
|
|
|
105280
105680
|
const fab = DFGApprox( { roughness, dotNV } );
|
|
105281
105681
|
|
|
@@ -105302,7 +105702,7 @@ void main() {
|
|
|
105302
105702
|
*/
|
|
105303
105703
|
direct( { lightDirection, lightColor, reflectedLight } ) {
|
|
105304
105704
|
|
|
105305
|
-
const dotNL =
|
|
105705
|
+
const dotNL = normalView.dot( lightDirection ).clamp();
|
|
105306
105706
|
const irradiance = dotNL.mul( lightColor );
|
|
105307
105707
|
|
|
105308
105708
|
if ( this.sheen === true ) {
|
|
@@ -105313,10 +105713,10 @@ void main() {
|
|
|
105313
105713
|
|
|
105314
105714
|
if ( this.clearcoat === true ) {
|
|
105315
105715
|
|
|
105316
|
-
const dotNLcc =
|
|
105716
|
+
const dotNLcc = clearcoatNormalView.dot( lightDirection ).clamp();
|
|
105317
105717
|
const ccIrradiance = dotNLcc.mul( lightColor );
|
|
105318
105718
|
|
|
105319
|
-
this.clearcoatSpecularDirect.addAssign( ccIrradiance.mul( BRDF_GGX( { lightDirection, f0: clearcoatF0, f90: clearcoatF90, roughness: clearcoatRoughness, normalView:
|
|
105719
|
+
this.clearcoatSpecularDirect.addAssign( ccIrradiance.mul( BRDF_GGX( { lightDirection, f0: clearcoatF0, f90: clearcoatF90, roughness: clearcoatRoughness, normalView: clearcoatNormalView } ) ) );
|
|
105320
105720
|
|
|
105321
105721
|
}
|
|
105322
105722
|
|
|
@@ -105340,7 +105740,7 @@ void main() {
|
|
|
105340
105740
|
const p2 = lightPosition.sub( halfWidth ).add( halfHeight );
|
|
105341
105741
|
const p3 = lightPosition.add( halfWidth ).add( halfHeight );
|
|
105342
105742
|
|
|
105343
|
-
const N =
|
|
105743
|
+
const N = normalView;
|
|
105344
105744
|
const V = positionViewDirection;
|
|
105345
105745
|
const P = positionView.toVar();
|
|
105346
105746
|
|
|
@@ -105405,7 +105805,7 @@ void main() {
|
|
|
105405
105805
|
this.sheenSpecularIndirect.addAssign( iblIrradiance.mul(
|
|
105406
105806
|
sheen,
|
|
105407
105807
|
IBLSheenBRDF( {
|
|
105408
|
-
normal:
|
|
105808
|
+
normal: normalView,
|
|
105409
105809
|
viewDir: positionViewDirection,
|
|
105410
105810
|
roughness: sheenRoughness
|
|
105411
105811
|
} )
|
|
@@ -105415,7 +105815,7 @@ void main() {
|
|
|
105415
105815
|
|
|
105416
105816
|
if ( this.clearcoat === true ) {
|
|
105417
105817
|
|
|
105418
|
-
const dotNVcc =
|
|
105818
|
+
const dotNVcc = clearcoatNormalView.dot( positionViewDirection ).clamp();
|
|
105419
105819
|
|
|
105420
105820
|
const clearcoatEnv = EnvironmentBRDF( {
|
|
105421
105821
|
dotNV: dotNVcc,
|
|
@@ -105456,7 +105856,7 @@ void main() {
|
|
|
105456
105856
|
|
|
105457
105857
|
const { ambientOcclusion, reflectedLight } = builder.context;
|
|
105458
105858
|
|
|
105459
|
-
const dotNV =
|
|
105859
|
+
const dotNV = normalView.dot( positionViewDirection ).clamp(); // @ TODO: Move to core dotNV
|
|
105460
105860
|
|
|
105461
105861
|
const aoNV = dotNV.add( ambientOcclusion );
|
|
105462
105862
|
const aoExp = roughness.mul( -16 ).oneMinus().negate().exp2();
|
|
@@ -105491,7 +105891,7 @@ void main() {
|
|
|
105491
105891
|
|
|
105492
105892
|
if ( this.clearcoat === true ) {
|
|
105493
105893
|
|
|
105494
|
-
const dotNVcc =
|
|
105894
|
+
const dotNVcc = clearcoatNormalView.dot( positionViewDirection ).clamp();
|
|
105495
105895
|
|
|
105496
105896
|
const Fcc = F_Schlick( {
|
|
105497
105897
|
dotVH: dotNVcc,
|
|
@@ -105851,7 +106251,7 @@ void main() {
|
|
|
105851
106251
|
0, 4, 2
|
|
105852
106252
|
];
|
|
105853
106253
|
|
|
105854
|
-
const _direction = /*@__PURE__*/ getDirection( uv(), attribute( 'faceIndex' ) ).normalize();
|
|
106254
|
+
const _direction = /*@__PURE__*/ getDirection( uv$1(), attribute( 'faceIndex' ) ).normalize();
|
|
105855
106255
|
const _outputDirection = /*@__PURE__*/ vec3( _direction.x, _direction.y, _direction.z );
|
|
105856
106256
|
|
|
105857
106257
|
/**
|
|
@@ -107160,10 +107560,10 @@ void main() {
|
|
|
107160
107560
|
//
|
|
107161
107561
|
|
|
107162
107562
|
const useAnisotropy = material.useAnisotropy === true || material.anisotropy > 0;
|
|
107163
|
-
const radianceNormalView = useAnisotropy ?
|
|
107563
|
+
const radianceNormalView = useAnisotropy ? bentNormalView : normalView;
|
|
107164
107564
|
|
|
107165
107565
|
const radiance = envNode.context( createRadianceContext( roughness, radianceNormalView ) ).mul( materialEnvIntensity );
|
|
107166
|
-
const irradiance = envNode.context( createIrradianceContext(
|
|
107566
|
+
const irradiance = envNode.context( createIrradianceContext( normalWorld ) ).mul( Math.PI ).mul( materialEnvIntensity );
|
|
107167
107567
|
|
|
107168
107568
|
const isolateRadiance = cache( radiance );
|
|
107169
107569
|
const isolateIrradiance = cache( irradiance );
|
|
@@ -107180,7 +107580,7 @@ void main() {
|
|
|
107180
107580
|
|
|
107181
107581
|
if ( clearcoatRadiance ) {
|
|
107182
107582
|
|
|
107183
|
-
const clearcoatRadianceContext = envNode.context( createRadianceContext( clearcoatRoughness,
|
|
107583
|
+
const clearcoatRadianceContext = envNode.context( createRadianceContext( clearcoatRoughness, clearcoatNormalView ) ).mul( materialEnvIntensity );
|
|
107184
107584
|
const isolateClearcoatRadiance = cache( clearcoatRadianceContext );
|
|
107185
107585
|
|
|
107186
107586
|
clearcoatRadiance.addAssign( isolateClearcoatRadiance );
|
|
@@ -107881,7 +108281,7 @@ void main() {
|
|
|
107881
108281
|
|
|
107882
108282
|
setup( builder ) {
|
|
107883
108283
|
|
|
107884
|
-
builder.context.setupClearcoatNormal = () => this.setupClearcoatNormal( builder );
|
|
108284
|
+
builder.context.setupClearcoatNormal = () => subBuild( this.setupClearcoatNormal( builder ), 'NORMAL', 'vec3' );
|
|
107885
108285
|
|
|
107886
108286
|
super.setup( builder );
|
|
107887
108287
|
|
|
@@ -108039,47 +108439,23 @@ void main() {
|
|
|
108039
108439
|
}
|
|
108040
108440
|
|
|
108041
108441
|
/**
|
|
108442
|
+
* TSL function for creating a matcap uv node.
|
|
108443
|
+
*
|
|
108042
108444
|
* Can be used to compute texture coordinates for projecting a
|
|
108043
108445
|
* matcap onto a mesh. Used by {@link MeshMatcapNodeMaterial}.
|
|
108044
108446
|
*
|
|
108045
|
-
* @
|
|
108447
|
+
* @tsl
|
|
108448
|
+
* @function
|
|
108449
|
+
* @returns {Node<vec2>} The matcap UV coordinates.
|
|
108046
108450
|
*/
|
|
108047
|
-
|
|
108048
|
-
|
|
108049
|
-
static get type() {
|
|
108050
|
-
|
|
108051
|
-
return 'MatcapUVNode';
|
|
108052
|
-
|
|
108053
|
-
}
|
|
108054
|
-
|
|
108055
|
-
/**
|
|
108056
|
-
* Constructs a new matcap uv node.
|
|
108057
|
-
*/
|
|
108058
|
-
constructor() {
|
|
108451
|
+
const matcapUV = /*@__PURE__*/ Fn$1( () => {
|
|
108059
108452
|
|
|
108060
|
-
|
|
108061
|
-
|
|
108062
|
-
}
|
|
108063
|
-
|
|
108064
|
-
setup() {
|
|
108453
|
+
const x = vec3( positionViewDirection.z, 0, positionViewDirection.x.negate() ).normalize();
|
|
108454
|
+
const y = positionViewDirection.cross( x );
|
|
108065
108455
|
|
|
108066
|
-
|
|
108067
|
-
const y = positionViewDirection.cross( x );
|
|
108456
|
+
return vec2( x.dot( normalView ), y.dot( normalView ) ).mul( 0.495 ).add( 0.5 ); // 0.495 to remove artifacts caused by undersized matcap disks
|
|
108068
108457
|
|
|
108069
|
-
|
|
108070
|
-
|
|
108071
|
-
}
|
|
108072
|
-
|
|
108073
|
-
}
|
|
108074
|
-
|
|
108075
|
-
/**
|
|
108076
|
-
* TSL function for creating a matcap uv node.
|
|
108077
|
-
*
|
|
108078
|
-
* @tsl
|
|
108079
|
-
* @function
|
|
108080
|
-
* @returns {MatcapUVNode}
|
|
108081
|
-
*/
|
|
108082
|
-
const matcapUV = /*@__PURE__*/ nodeImmutable( MatcapUVNode );
|
|
108458
|
+
} ).once( [ 'NORMAL', 'VERTEX' ] )().toVar( 'matcapUV' );
|
|
108083
108459
|
|
|
108084
108460
|
const _defaultValues$3 = /*@__PURE__*/ new MeshMatcapMaterial();
|
|
108085
108461
|
|
|
@@ -109113,6 +109489,16 @@ void main() {
|
|
|
109113
109489
|
*/
|
|
109114
109490
|
this.attributes = null;
|
|
109115
109491
|
|
|
109492
|
+
/**
|
|
109493
|
+
* An object holding the version of the
|
|
109494
|
+
* attributes. The keys are the attribute names
|
|
109495
|
+
* and the values are the attribute versions.
|
|
109496
|
+
*
|
|
109497
|
+
* @type {?Object<string, number>}
|
|
109498
|
+
* @default null
|
|
109499
|
+
*/
|
|
109500
|
+
this.attributesId = null;
|
|
109501
|
+
|
|
109116
109502
|
/**
|
|
109117
109503
|
* A reference to a render pipeline the render
|
|
109118
109504
|
* object is processed with.
|
|
@@ -109232,7 +109618,7 @@ void main() {
|
|
|
109232
109618
|
|
|
109233
109619
|
/**
|
|
109234
109620
|
* An event listener which is executed when `dispose()` is called on
|
|
109235
|
-
* the render object
|
|
109621
|
+
* the material of this render object.
|
|
109236
109622
|
*
|
|
109237
109623
|
* @method
|
|
109238
109624
|
*/
|
|
@@ -109242,7 +109628,23 @@ void main() {
|
|
|
109242
109628
|
|
|
109243
109629
|
};
|
|
109244
109630
|
|
|
109631
|
+
/**
|
|
109632
|
+
* An event listener which is executed when `dispose()` is called on
|
|
109633
|
+
* the geometry of this render object.
|
|
109634
|
+
*
|
|
109635
|
+
* @method
|
|
109636
|
+
*/
|
|
109637
|
+
this.onGeometryDispose = () => {
|
|
109638
|
+
|
|
109639
|
+
// clear geometry cache attributes
|
|
109640
|
+
|
|
109641
|
+
this.attributes = null;
|
|
109642
|
+
this.attributesId = null;
|
|
109643
|
+
|
|
109644
|
+
};
|
|
109645
|
+
|
|
109245
109646
|
this.material.addEventListener( 'dispose', this.onMaterialDispose );
|
|
109647
|
+
this.geometry.addEventListener( 'dispose', this.onGeometryDispose );
|
|
109246
109648
|
|
|
109247
109649
|
}
|
|
109248
109650
|
|
|
@@ -109381,6 +109783,7 @@ void main() {
|
|
|
109381
109783
|
|
|
109382
109784
|
this.geometry = geometry;
|
|
109383
109785
|
this.attributes = null;
|
|
109786
|
+
this.attributesId = null;
|
|
109384
109787
|
|
|
109385
109788
|
}
|
|
109386
109789
|
|
|
@@ -109400,9 +109803,25 @@ void main() {
|
|
|
109400
109803
|
const attributes = [];
|
|
109401
109804
|
const vertexBuffers = new Set();
|
|
109402
109805
|
|
|
109806
|
+
const attributesId = {};
|
|
109807
|
+
|
|
109403
109808
|
for ( const nodeAttribute of nodeAttributes ) {
|
|
109404
109809
|
|
|
109405
|
-
|
|
109810
|
+
let attribute;
|
|
109811
|
+
|
|
109812
|
+
if ( nodeAttribute.node && nodeAttribute.node.attribute ) {
|
|
109813
|
+
|
|
109814
|
+
// node attribute
|
|
109815
|
+
attribute = nodeAttribute.node.attribute;
|
|
109816
|
+
|
|
109817
|
+
} else {
|
|
109818
|
+
|
|
109819
|
+
// geometry attribute
|
|
109820
|
+
attribute = geometry.getAttribute( nodeAttribute.name );
|
|
109821
|
+
|
|
109822
|
+
attributesId[ nodeAttribute.name ] = attribute.version;
|
|
109823
|
+
|
|
109824
|
+
}
|
|
109406
109825
|
|
|
109407
109826
|
if ( attribute === undefined ) continue;
|
|
109408
109827
|
|
|
@@ -109414,6 +109833,7 @@ void main() {
|
|
|
109414
109833
|
}
|
|
109415
109834
|
|
|
109416
109835
|
this.attributes = attributes;
|
|
109836
|
+
this.attributesId = attributesId;
|
|
109417
109837
|
this.vertexBuffers = Array.from( vertexBuffers.values() );
|
|
109418
109838
|
|
|
109419
109839
|
return attributes;
|
|
@@ -109678,7 +110098,27 @@ void main() {
|
|
|
109678
110098
|
*/
|
|
109679
110099
|
get needsGeometryUpdate() {
|
|
109680
110100
|
|
|
109681
|
-
|
|
110101
|
+
if ( this.geometry.id !== this.object.geometry.id ) return true;
|
|
110102
|
+
|
|
110103
|
+
if ( this.attributes !== null ) {
|
|
110104
|
+
|
|
110105
|
+
const attributesId = this.attributesId;
|
|
110106
|
+
|
|
110107
|
+
for ( const name in attributesId ) {
|
|
110108
|
+
|
|
110109
|
+
const attribute = this.geometry.getAttribute( name );
|
|
110110
|
+
|
|
110111
|
+
if ( attribute === undefined || attributesId[ name ] !== attribute.id ) {
|
|
110112
|
+
|
|
110113
|
+
return true;
|
|
110114
|
+
|
|
110115
|
+
}
|
|
110116
|
+
|
|
110117
|
+
}
|
|
110118
|
+
|
|
110119
|
+
}
|
|
110120
|
+
|
|
110121
|
+
return false;
|
|
109682
110122
|
|
|
109683
110123
|
}
|
|
109684
110124
|
|
|
@@ -109756,6 +110196,7 @@ void main() {
|
|
|
109756
110196
|
dispose() {
|
|
109757
110197
|
|
|
109758
110198
|
this.material.removeEventListener( 'dispose', this.onMaterialDispose );
|
|
110199
|
+
this.geometry.removeEventListener( 'dispose', this.onGeometryDispose );
|
|
109759
110200
|
|
|
109760
110201
|
this.onDispose();
|
|
109761
110202
|
|
|
@@ -113310,10 +113751,13 @@ void main() {
|
|
|
113310
113751
|
|
|
113311
113752
|
build( builder, ...params ) {
|
|
113312
113753
|
|
|
113754
|
+
const previousBuildStack = builder.currentStack;
|
|
113313
113755
|
const previousStack = getCurrentStack();
|
|
113314
113756
|
|
|
113315
113757
|
setCurrentStack( this );
|
|
113316
113758
|
|
|
113759
|
+
builder.currentStack = this;
|
|
113760
|
+
|
|
113317
113761
|
const buildStage = builder.buildStage;
|
|
113318
113762
|
|
|
113319
113763
|
for ( const node of this.nodes ) {
|
|
@@ -113343,38 +113787,13 @@ void main() {
|
|
|
113343
113787
|
|
|
113344
113788
|
}
|
|
113345
113789
|
|
|
113346
|
-
|
|
113347
|
-
|
|
113348
|
-
return this.outputNode ? this.outputNode.build( builder, ...params ) : super.build( builder, ...params );
|
|
113349
|
-
|
|
113350
|
-
}
|
|
113351
|
-
|
|
113352
|
-
// Deprecated
|
|
113353
|
-
|
|
113354
|
-
/**
|
|
113355
|
-
* @function
|
|
113356
|
-
* @deprecated since r168. Use {@link StackNode#Else} instead.
|
|
113357
|
-
*
|
|
113358
|
-
* @param {...any} params
|
|
113359
|
-
* @returns {StackNode}
|
|
113360
|
-
*/
|
|
113361
|
-
else( ...params ) { // @deprecated, r168
|
|
113362
|
-
|
|
113363
|
-
console.warn( 'THREE.TSL: .else() has been renamed to .Else().' );
|
|
113364
|
-
return this.Else( ...params );
|
|
113790
|
+
const result = this.outputNode ? this.outputNode.build( builder, ...params ) : super.build( builder, ...params );
|
|
113365
113791
|
|
|
113366
|
-
|
|
113792
|
+
setCurrentStack( previousStack );
|
|
113367
113793
|
|
|
113368
|
-
|
|
113369
|
-
* @deprecated since r168. Use {@link StackNode#ElseIf} instead.
|
|
113370
|
-
*
|
|
113371
|
-
* @param {...any} params
|
|
113372
|
-
* @returns {StackNode}
|
|
113373
|
-
*/
|
|
113374
|
-
elseif( ...params ) { // @deprecated, r168
|
|
113794
|
+
builder.currentStack = previousBuildStack;
|
|
113375
113795
|
|
|
113376
|
-
|
|
113377
|
-
return this.ElseIf( ...params );
|
|
113796
|
+
return result;
|
|
113378
113797
|
|
|
113379
113798
|
}
|
|
113380
113799
|
|
|
@@ -114443,7 +114862,7 @@ void main() {
|
|
|
114443
114862
|
* @param {Node<vec2>} [uvNode=uv()] - The uv node.
|
|
114444
114863
|
* @param {Node<float>} [frameNode=float()] - The node that defines the current frame/sprite.
|
|
114445
114864
|
*/
|
|
114446
|
-
constructor( countNode, uvNode = uv(), frameNode = float$1( 0 ) ) {
|
|
114865
|
+
constructor( countNode, uvNode = uv$1(), frameNode = float$1( 0 ) ) {
|
|
114447
114866
|
|
|
114448
114867
|
super( 'vec2' );
|
|
114449
114868
|
|
|
@@ -114503,118 +114922,14 @@ void main() {
|
|
|
114503
114922
|
const spritesheetUV = /*@__PURE__*/ nodeProxy( SpriteSheetUVNode ).setParameterLength( 3 );
|
|
114504
114923
|
|
|
114505
114924
|
/**
|
|
114925
|
+
* TSL function for creating a triplanar textures node.
|
|
114926
|
+
*
|
|
114506
114927
|
* Can be used for triplanar texture mapping.
|
|
114507
114928
|
*
|
|
114508
114929
|
* ```js
|
|
114509
114930
|
* material.colorNode = triplanarTexture( texture( diffuseMap ) );
|
|
114510
114931
|
* ```
|
|
114511
114932
|
*
|
|
114512
|
-
* @augments Node
|
|
114513
|
-
*/
|
|
114514
|
-
class TriplanarTexturesNode extends Node {
|
|
114515
|
-
|
|
114516
|
-
static get type() {
|
|
114517
|
-
|
|
114518
|
-
return 'TriplanarTexturesNode';
|
|
114519
|
-
|
|
114520
|
-
}
|
|
114521
|
-
|
|
114522
|
-
/**
|
|
114523
|
-
* Constructs a new triplanar textures node.
|
|
114524
|
-
*
|
|
114525
|
-
* @param {Node} textureXNode - First texture node.
|
|
114526
|
-
* @param {?Node} [textureYNode=null] - Second texture node. When not set, the shader will sample from `textureXNode` instead.
|
|
114527
|
-
* @param {?Node} [textureZNode=null] - Third texture node. When not set, the shader will sample from `textureXNode` instead.
|
|
114528
|
-
* @param {?Node<float>} [scaleNode=float(1)] - The scale node.
|
|
114529
|
-
* @param {?Node<vec3>} [positionNode=positionLocal] - Vertex positions in local space.
|
|
114530
|
-
* @param {?Node<vec3>} [normalNode=normalLocal] - Normals in local space.
|
|
114531
|
-
*/
|
|
114532
|
-
constructor( textureXNode, textureYNode = null, textureZNode = null, scaleNode = float$1( 1 ), positionNode = positionLocal, normalNode = normalLocal ) {
|
|
114533
|
-
|
|
114534
|
-
super( 'vec4' );
|
|
114535
|
-
|
|
114536
|
-
/**
|
|
114537
|
-
* First texture node.
|
|
114538
|
-
*
|
|
114539
|
-
* @type {Node}
|
|
114540
|
-
*/
|
|
114541
|
-
this.textureXNode = textureXNode;
|
|
114542
|
-
|
|
114543
|
-
/**
|
|
114544
|
-
* Second texture node. When not set, the shader will sample from `textureXNode` instead.
|
|
114545
|
-
*
|
|
114546
|
-
* @type {?Node}
|
|
114547
|
-
* @default null
|
|
114548
|
-
*/
|
|
114549
|
-
this.textureYNode = textureYNode;
|
|
114550
|
-
|
|
114551
|
-
/**
|
|
114552
|
-
* Third texture node. When not set, the shader will sample from `textureXNode` instead.
|
|
114553
|
-
*
|
|
114554
|
-
* @type {?Node}
|
|
114555
|
-
* @default null
|
|
114556
|
-
*/
|
|
114557
|
-
this.textureZNode = textureZNode;
|
|
114558
|
-
|
|
114559
|
-
/**
|
|
114560
|
-
* The scale node.
|
|
114561
|
-
*
|
|
114562
|
-
* @type {Node<float>}
|
|
114563
|
-
* @default float(1)
|
|
114564
|
-
*/
|
|
114565
|
-
this.scaleNode = scaleNode;
|
|
114566
|
-
|
|
114567
|
-
/**
|
|
114568
|
-
* Vertex positions in local space.
|
|
114569
|
-
*
|
|
114570
|
-
* @type {Node<vec3>}
|
|
114571
|
-
* @default positionLocal
|
|
114572
|
-
*/
|
|
114573
|
-
this.positionNode = positionNode;
|
|
114574
|
-
|
|
114575
|
-
/**
|
|
114576
|
-
* Normals in local space.
|
|
114577
|
-
*
|
|
114578
|
-
* @type {Node<vec3>}
|
|
114579
|
-
* @default normalLocal
|
|
114580
|
-
*/
|
|
114581
|
-
this.normalNode = normalNode;
|
|
114582
|
-
|
|
114583
|
-
}
|
|
114584
|
-
|
|
114585
|
-
setup() {
|
|
114586
|
-
|
|
114587
|
-
const { textureXNode, textureYNode, textureZNode, scaleNode, positionNode, normalNode } = this;
|
|
114588
|
-
|
|
114589
|
-
// Ref: https://github.com/keijiro/StandardTriplanar
|
|
114590
|
-
|
|
114591
|
-
// Blending factor of triplanar mapping
|
|
114592
|
-
let bf = normalNode.abs().normalize();
|
|
114593
|
-
bf = bf.div( bf.dot( vec3( 1.0 ) ) );
|
|
114594
|
-
|
|
114595
|
-
// Triplanar mapping
|
|
114596
|
-
const tx = positionNode.yz.mul( scaleNode );
|
|
114597
|
-
const ty = positionNode.zx.mul( scaleNode );
|
|
114598
|
-
const tz = positionNode.xy.mul( scaleNode );
|
|
114599
|
-
|
|
114600
|
-
// Base color
|
|
114601
|
-
const textureX = textureXNode.value;
|
|
114602
|
-
const textureY = textureYNode !== null ? textureYNode.value : textureX;
|
|
114603
|
-
const textureZ = textureZNode !== null ? textureZNode.value : textureX;
|
|
114604
|
-
|
|
114605
|
-
const cx = texture( textureX, tx ).mul( bf.x );
|
|
114606
|
-
const cy = texture( textureY, ty ).mul( bf.y );
|
|
114607
|
-
const cz = texture( textureZ, tz ).mul( bf.z );
|
|
114608
|
-
|
|
114609
|
-
return add( cx, cy, cz );
|
|
114610
|
-
|
|
114611
|
-
}
|
|
114612
|
-
|
|
114613
|
-
}
|
|
114614
|
-
|
|
114615
|
-
/**
|
|
114616
|
-
* TSL function for creating a triplanar textures node.
|
|
114617
|
-
*
|
|
114618
114933
|
* @tsl
|
|
114619
114934
|
* @function
|
|
114620
114935
|
* @param {Node} textureXNode - First texture node.
|
|
@@ -114623,9 +114938,33 @@ void main() {
|
|
|
114623
114938
|
* @param {?Node<float>} [scaleNode=float(1)] - The scale node.
|
|
114624
114939
|
* @param {?Node<vec3>} [positionNode=positionLocal] - Vertex positions in local space.
|
|
114625
114940
|
* @param {?Node<vec3>} [normalNode=normalLocal] - Normals in local space.
|
|
114626
|
-
* @returns {
|
|
114941
|
+
* @returns {Node<vec4>}
|
|
114627
114942
|
*/
|
|
114628
|
-
const triplanarTextures = /*@__PURE__*/
|
|
114943
|
+
const triplanarTextures = /*@__PURE__*/ Fn$1( ( [ textureXNode, textureYNode = null, textureZNode = null, scaleNode = float$1( 1 ), positionNode = positionLocal, normalNode = normalLocal ] ) => {
|
|
114944
|
+
|
|
114945
|
+
// Reference: https://github.com/keijiro/StandardTriplanar
|
|
114946
|
+
|
|
114947
|
+
// Blending factor of triplanar mapping
|
|
114948
|
+
let bf = normalNode.abs().normalize();
|
|
114949
|
+
bf = bf.div( bf.dot( vec3( 1.0 ) ) );
|
|
114950
|
+
|
|
114951
|
+
// Triplanar mapping
|
|
114952
|
+
const tx = positionNode.yz.mul( scaleNode );
|
|
114953
|
+
const ty = positionNode.zx.mul( scaleNode );
|
|
114954
|
+
const tz = positionNode.xy.mul( scaleNode );
|
|
114955
|
+
|
|
114956
|
+
// Base color
|
|
114957
|
+
const textureX = textureXNode.value;
|
|
114958
|
+
const textureY = textureYNode !== null ? textureYNode.value : textureX;
|
|
114959
|
+
const textureZ = textureZNode !== null ? textureZNode.value : textureX;
|
|
114960
|
+
|
|
114961
|
+
const cx = texture( textureX, tx ).mul( bf.x );
|
|
114962
|
+
const cy = texture( textureY, ty ).mul( bf.y );
|
|
114963
|
+
const cz = texture( textureZ, tz ).mul( bf.z );
|
|
114964
|
+
|
|
114965
|
+
return add( cx, cy, cz );
|
|
114966
|
+
|
|
114967
|
+
} );
|
|
114629
114968
|
|
|
114630
114969
|
/**
|
|
114631
114970
|
* TSL function for creating a triplanar textures node.
|
|
@@ -114638,7 +114977,7 @@ void main() {
|
|
|
114638
114977
|
* @param {?Node<float>} [scaleNode=float(1)] - The scale node.
|
|
114639
114978
|
* @param {?Node<vec3>} [positionNode=positionLocal] - Vertex positions in local space.
|
|
114640
114979
|
* @param {?Node<vec3>} [normalNode=normalLocal] - Normals in local space.
|
|
114641
|
-
* @returns {
|
|
114980
|
+
* @returns {Node<vec4>}
|
|
114642
114981
|
*/
|
|
114643
114982
|
const triplanarTexture = ( ...params ) => triplanarTextures( ...params );
|
|
114644
114983
|
|
|
@@ -114782,10 +115121,17 @@ void main() {
|
|
|
114782
115121
|
|
|
114783
115122
|
clone() {
|
|
114784
115123
|
|
|
114785
|
-
const
|
|
114786
|
-
|
|
115124
|
+
const newNode = new this.constructor( this.reflectorNode );
|
|
115125
|
+
newNode.uvNode = this.uvNode;
|
|
115126
|
+
newNode.levelNode = this.levelNode;
|
|
115127
|
+
newNode.biasNode = this.biasNode;
|
|
115128
|
+
newNode.sampler = this.sampler;
|
|
115129
|
+
newNode.depthNode = this.depthNode;
|
|
115130
|
+
newNode.compareNode = this.compareNode;
|
|
115131
|
+
newNode.gradNode = this.gradNode;
|
|
115132
|
+
newNode._reflectorBaseNode = this._reflectorBaseNode;
|
|
114787
115133
|
|
|
114788
|
-
return
|
|
115134
|
+
return newNode;
|
|
114789
115135
|
|
|
114790
115136
|
}
|
|
114791
115137
|
|
|
@@ -115327,7 +115673,7 @@ void main() {
|
|
|
115327
115673
|
|
|
115328
115674
|
const renderTarget = new RenderTarget( width, height, options );
|
|
115329
115675
|
|
|
115330
|
-
super( renderTarget.texture, uv() );
|
|
115676
|
+
super( renderTarget.texture, uv$1() );
|
|
115331
115677
|
|
|
115332
115678
|
/**
|
|
115333
115679
|
* The node to render a texture with.
|
|
@@ -115419,7 +115765,7 @@ void main() {
|
|
|
115419
115765
|
* @readonly
|
|
115420
115766
|
* @default true
|
|
115421
115767
|
*/
|
|
115422
|
-
get
|
|
115768
|
+
get autoResize() {
|
|
115423
115769
|
|
|
115424
115770
|
return this.width === null;
|
|
115425
115771
|
|
|
@@ -115476,13 +115822,21 @@ void main() {
|
|
|
115476
115822
|
|
|
115477
115823
|
//
|
|
115478
115824
|
|
|
115479
|
-
if ( this.
|
|
115480
|
-
|
|
115481
|
-
this.pixelRatio = renderer.getPixelRatio();
|
|
115825
|
+
if ( this.autoResize === true ) {
|
|
115482
115826
|
|
|
115827
|
+
const pixelRatio = renderer.getPixelRatio();
|
|
115483
115828
|
const size = renderer.getSize( _size$1 );
|
|
115484
115829
|
|
|
115485
|
-
|
|
115830
|
+
const effectiveWidth = size.width * pixelRatio;
|
|
115831
|
+
const effectiveHeight = size.height * pixelRatio;
|
|
115832
|
+
|
|
115833
|
+
if ( effectiveWidth !== this.renderTarget.width || effectiveHeight !== this.renderTarget.height ) {
|
|
115834
|
+
|
|
115835
|
+
this.renderTarget.setSize( effectiveWidth, effectiveHeight );
|
|
115836
|
+
|
|
115837
|
+
this.textureNeedsUpdate = true;
|
|
115838
|
+
|
|
115839
|
+
}
|
|
115486
115840
|
|
|
115487
115841
|
}
|
|
115488
115842
|
|
|
@@ -115638,6 +115992,82 @@ void main() {
|
|
|
115638
115992
|
|
|
115639
115993
|
} );
|
|
115640
115994
|
|
|
115995
|
+
/**
|
|
115996
|
+
* Class representing a node that samples a value using a provided callback function.
|
|
115997
|
+
*
|
|
115998
|
+
* @extends Node
|
|
115999
|
+
*/
|
|
116000
|
+
class SampleNode extends Node {
|
|
116001
|
+
|
|
116002
|
+
/**
|
|
116003
|
+
* Returns the type of the node.
|
|
116004
|
+
*
|
|
116005
|
+
* @type {string}
|
|
116006
|
+
* @readonly
|
|
116007
|
+
* @static
|
|
116008
|
+
*/
|
|
116009
|
+
static get type() {
|
|
116010
|
+
|
|
116011
|
+
return 'SampleNode';
|
|
116012
|
+
|
|
116013
|
+
}
|
|
116014
|
+
|
|
116015
|
+
/**
|
|
116016
|
+
* Creates an instance of SampleNode.
|
|
116017
|
+
*
|
|
116018
|
+
* @param {Function} callback - The function to be called when sampling. Should accept a UV node and return a value.
|
|
116019
|
+
*/
|
|
116020
|
+
constructor( callback ) {
|
|
116021
|
+
|
|
116022
|
+
super();
|
|
116023
|
+
|
|
116024
|
+
this.callback = callback;
|
|
116025
|
+
|
|
116026
|
+
/**
|
|
116027
|
+
* This flag can be used for type testing.
|
|
116028
|
+
*
|
|
116029
|
+
* @type {boolean}
|
|
116030
|
+
* @readonly
|
|
116031
|
+
* @default true
|
|
116032
|
+
*/
|
|
116033
|
+
this.isSampleNode = true;
|
|
116034
|
+
|
|
116035
|
+
}
|
|
116036
|
+
|
|
116037
|
+
/**
|
|
116038
|
+
* Sets up the node by sampling with the default UV accessor.
|
|
116039
|
+
*
|
|
116040
|
+
* @returns {Node} The result of the callback function when called with the UV node.
|
|
116041
|
+
*/
|
|
116042
|
+
setup() {
|
|
116043
|
+
|
|
116044
|
+
return this.sample( uv$1() );
|
|
116045
|
+
|
|
116046
|
+
}
|
|
116047
|
+
|
|
116048
|
+
/**
|
|
116049
|
+
* Calls the callback function with the provided UV node.
|
|
116050
|
+
*
|
|
116051
|
+
* @param {Node<vec2>} uv - The UV node or value to be passed to the callback.
|
|
116052
|
+
* @returns {Node} The result of the callback function.
|
|
116053
|
+
*/
|
|
116054
|
+
sample( uv ) {
|
|
116055
|
+
|
|
116056
|
+
return this.callback( uv );
|
|
116057
|
+
|
|
116058
|
+
}
|
|
116059
|
+
|
|
116060
|
+
}
|
|
116061
|
+
|
|
116062
|
+
/**
|
|
116063
|
+
* Helper function to create a SampleNode wrapped as a node object.
|
|
116064
|
+
*
|
|
116065
|
+
* @function
|
|
116066
|
+
* @param {Function} callback - The function to be called when sampling. Should accept a UV node and return a value.
|
|
116067
|
+
* @returns {SampleNode} The created SampleNode instance wrapped as a node object.
|
|
116068
|
+
*/
|
|
116069
|
+
const sample = ( callback ) => nodeObject( new SampleNode( callback ) );
|
|
116070
|
+
|
|
115641
116071
|
/**
|
|
115642
116072
|
* This special type of instanced buffer attribute is intended for compute shaders.
|
|
115643
116073
|
* In earlier three.js versions it was only possible to update attribute data
|
|
@@ -116245,9 +116675,9 @@ void main() {
|
|
|
116245
116675
|
|
|
116246
116676
|
const step = 0.01;
|
|
116247
116677
|
|
|
116248
|
-
const x = texture.sample( uv.add( vec3( -
|
|
116249
|
-
const y = texture.sample( uv.add( vec3( 0.0, -
|
|
116250
|
-
const z = texture.sample( uv.add( vec3( 0.0, 0.0, -
|
|
116678
|
+
const x = texture.sample( uv.add( vec3( - step, 0.0, 0.0 ) ) ).r.sub( texture.sample( uv.add( vec3( step, 0.0, 0.0 ) ) ).r );
|
|
116679
|
+
const y = texture.sample( uv.add( vec3( 0.0, - step, 0.0 ) ) ).r.sub( texture.sample( uv.add( vec3( 0.0, step, 0.0 ) ) ).r );
|
|
116680
|
+
const z = texture.sample( uv.add( vec3( 0.0, 0.0, - step ) ) ).r.sub( texture.sample( uv.add( vec3( 0.0, 0.0, step ) ) ).r );
|
|
116251
116681
|
|
|
116252
116682
|
ret.assign( vec3( x, y, z ) );
|
|
116253
116683
|
|
|
@@ -116677,238 +117107,6 @@ void main() {
|
|
|
116677
117107
|
*/
|
|
116678
117108
|
const velocity = /*@__PURE__*/ nodeImmutable( VelocityNode );
|
|
116679
117109
|
|
|
116680
|
-
/**
|
|
116681
|
-
* Represents a "Color Burn" blend mode.
|
|
116682
|
-
*
|
|
116683
|
-
* It's designed to darken the base layer's colors based on the color of the blend layer.
|
|
116684
|
-
* It significantly increases the contrast of the base layer, making the colors more vibrant and saturated.
|
|
116685
|
-
* The darker the color in the blend layer, the stronger the darkening and contrast effect on the base layer.
|
|
116686
|
-
*
|
|
116687
|
-
* @tsl
|
|
116688
|
-
* @function
|
|
116689
|
-
* @param {Node<vec3>} base - The base color.
|
|
116690
|
-
* @param {Node<vec3>} blend - The blend color. A white (#ffffff) blend color does not alter the base color.
|
|
116691
|
-
* @return {Node<vec3>} The result.
|
|
116692
|
-
*/
|
|
116693
|
-
const blendBurn = /*@__PURE__*/ Fn$1( ( [ base, blend ] ) => {
|
|
116694
|
-
|
|
116695
|
-
return min$1( 1.0, base.oneMinus().div( blend ) ).oneMinus();
|
|
116696
|
-
|
|
116697
|
-
} ).setLayout( {
|
|
116698
|
-
name: 'blendBurn',
|
|
116699
|
-
type: 'vec3',
|
|
116700
|
-
inputs: [
|
|
116701
|
-
{ name: 'base', type: 'vec3' },
|
|
116702
|
-
{ name: 'blend', type: 'vec3' }
|
|
116703
|
-
]
|
|
116704
|
-
} );
|
|
116705
|
-
|
|
116706
|
-
/**
|
|
116707
|
-
* Represents a "Color Dodge" blend mode.
|
|
116708
|
-
*
|
|
116709
|
-
* It's designed to lighten the base layer's colors based on the color of the blend layer.
|
|
116710
|
-
* It significantly increases the brightness of the base layer, making the colors lighter and more vibrant.
|
|
116711
|
-
* The brighter the color in the blend layer, the stronger the lightening and contrast effect on the base layer.
|
|
116712
|
-
*
|
|
116713
|
-
* @tsl
|
|
116714
|
-
* @function
|
|
116715
|
-
* @param {Node<vec3>} base - The base color.
|
|
116716
|
-
* @param {Node<vec3>} blend - The blend color. A black (#000000) blend color does not alter the base color.
|
|
116717
|
-
* @return {Node<vec3>} The result.
|
|
116718
|
-
*/
|
|
116719
|
-
const blendDodge = /*@__PURE__*/ Fn$1( ( [ base, blend ] ) => {
|
|
116720
|
-
|
|
116721
|
-
return min$1( base.div( blend.oneMinus() ), 1.0 );
|
|
116722
|
-
|
|
116723
|
-
} ).setLayout( {
|
|
116724
|
-
name: 'blendDodge',
|
|
116725
|
-
type: 'vec3',
|
|
116726
|
-
inputs: [
|
|
116727
|
-
{ name: 'base', type: 'vec3' },
|
|
116728
|
-
{ name: 'blend', type: 'vec3' }
|
|
116729
|
-
]
|
|
116730
|
-
} );
|
|
116731
|
-
|
|
116732
|
-
/**
|
|
116733
|
-
* Represents a "Screen" blend mode.
|
|
116734
|
-
*
|
|
116735
|
-
* Similar to `blendDodge()`, this mode also lightens the base layer's colors based on the color of the blend layer.
|
|
116736
|
-
* The "Screen" blend mode is better for general brightening whereas the "Dodge" results in more subtle and nuanced
|
|
116737
|
-
* effects.
|
|
116738
|
-
*
|
|
116739
|
-
* @tsl
|
|
116740
|
-
* @function
|
|
116741
|
-
* @param {Node<vec3>} base - The base color.
|
|
116742
|
-
* @param {Node<vec3>} blend - The blend color. A black (#000000) blend color does not alter the base color.
|
|
116743
|
-
* @return {Node<vec3>} The result.
|
|
116744
|
-
*/
|
|
116745
|
-
const blendScreen = /*@__PURE__*/ Fn$1( ( [ base, blend ] ) => {
|
|
116746
|
-
|
|
116747
|
-
return base.oneMinus().mul( blend.oneMinus() ).oneMinus();
|
|
116748
|
-
|
|
116749
|
-
} ).setLayout( {
|
|
116750
|
-
name: 'blendScreen',
|
|
116751
|
-
type: 'vec3',
|
|
116752
|
-
inputs: [
|
|
116753
|
-
{ name: 'base', type: 'vec3' },
|
|
116754
|
-
{ name: 'blend', type: 'vec3' }
|
|
116755
|
-
]
|
|
116756
|
-
} );
|
|
116757
|
-
|
|
116758
|
-
/**
|
|
116759
|
-
* Represents a "Overlay" blend mode.
|
|
116760
|
-
*
|
|
116761
|
-
* It's designed to increase the contrast of the base layer based on the color of the blend layer.
|
|
116762
|
-
* It amplifies the existing colors and contrast in the base layer, making lighter areas lighter and darker areas darker.
|
|
116763
|
-
* The color of the blend layer significantly influences the resulting contrast and color shift in the base layer.
|
|
116764
|
-
*
|
|
116765
|
-
* @tsl
|
|
116766
|
-
* @function
|
|
116767
|
-
* @param {Node<vec3>} base - The base color.
|
|
116768
|
-
* @param {Node<vec3>} blend - The blend color
|
|
116769
|
-
* @return {Node<vec3>} The result.
|
|
116770
|
-
*/
|
|
116771
|
-
const blendOverlay = /*@__PURE__*/ Fn$1( ( [ base, blend ] ) => {
|
|
116772
|
-
|
|
116773
|
-
return mix$2( base.mul( 2.0 ).mul( blend ), base.oneMinus().mul( 2.0 ).mul( blend.oneMinus() ).oneMinus(), step( 0.5, base ) );
|
|
116774
|
-
|
|
116775
|
-
} ).setLayout( {
|
|
116776
|
-
name: 'blendOverlay',
|
|
116777
|
-
type: 'vec3',
|
|
116778
|
-
inputs: [
|
|
116779
|
-
{ name: 'base', type: 'vec3' },
|
|
116780
|
-
{ name: 'blend', type: 'vec3' }
|
|
116781
|
-
]
|
|
116782
|
-
} );
|
|
116783
|
-
|
|
116784
|
-
/**
|
|
116785
|
-
* This function blends two color based on their alpha values by replicating the behavior of `THREE.NormalBlending`.
|
|
116786
|
-
* It assumes both input colors have non-premultiplied alpha.
|
|
116787
|
-
*
|
|
116788
|
-
* @tsl
|
|
116789
|
-
* @function
|
|
116790
|
-
* @param {Node<vec4>} base - The base color.
|
|
116791
|
-
* @param {Node<vec4>} blend - The blend color
|
|
116792
|
-
* @return {Node<vec4>} The result.
|
|
116793
|
-
*/
|
|
116794
|
-
const blendColor = /*@__PURE__*/ Fn$1( ( [ base, blend ] ) => {
|
|
116795
|
-
|
|
116796
|
-
const outAlpha = blend.a.add( base.a.mul( blend.a.oneMinus() ) );
|
|
116797
|
-
|
|
116798
|
-
return vec4( blend.rgb.mul( blend.a ).add( base.rgb.mul( base.a ).mul( blend.a.oneMinus() ) ).div( outAlpha ), outAlpha );
|
|
116799
|
-
|
|
116800
|
-
} ).setLayout( {
|
|
116801
|
-
name: 'blendColor',
|
|
116802
|
-
type: 'vec4',
|
|
116803
|
-
inputs: [
|
|
116804
|
-
{ name: 'base', type: 'vec4' },
|
|
116805
|
-
{ name: 'blend', type: 'vec4' }
|
|
116806
|
-
]
|
|
116807
|
-
} );
|
|
116808
|
-
|
|
116809
|
-
/**
|
|
116810
|
-
* Premultiplies the RGB channels of a color by its alpha channel.
|
|
116811
|
-
*
|
|
116812
|
-
* This function is useful for converting a non-premultiplied alpha color
|
|
116813
|
-
* into a premultiplied alpha format, where the RGB values are scaled
|
|
116814
|
-
* by the alpha value. Premultiplied alpha is often used in graphics
|
|
116815
|
-
* rendering for certain operations, such as compositing and image processing.
|
|
116816
|
-
*
|
|
116817
|
-
* @tsl
|
|
116818
|
-
* @function
|
|
116819
|
-
* @param {Node<vec4>} color - The input color with non-premultiplied alpha.
|
|
116820
|
-
* @return {Node<vec4>} The color with premultiplied alpha.
|
|
116821
|
-
*/
|
|
116822
|
-
const premult = /*@__PURE__*/ Fn$1( ( [ color ] ) => {
|
|
116823
|
-
|
|
116824
|
-
return vec4( color.rgb.mul( color.a ), color.a );
|
|
116825
|
-
|
|
116826
|
-
}, { color: 'vec4', return: 'vec4' } );
|
|
116827
|
-
|
|
116828
|
-
/**
|
|
116829
|
-
* Unpremultiplies the RGB channels of a color by its alpha channel.
|
|
116830
|
-
*
|
|
116831
|
-
* This function is useful for converting a premultiplied alpha color
|
|
116832
|
-
* back into a non-premultiplied alpha format, where the RGB values are
|
|
116833
|
-
* divided by the alpha value. Unpremultiplied alpha is often used in graphics
|
|
116834
|
-
* rendering for certain operations, such as compositing and image processing.
|
|
116835
|
-
*
|
|
116836
|
-
* @tsl
|
|
116837
|
-
* @function
|
|
116838
|
-
* @param {Node<vec4>} color - The input color with premultiplied alpha.
|
|
116839
|
-
* @return {Node<vec4>} The color with non-premultiplied alpha.
|
|
116840
|
-
*/
|
|
116841
|
-
const unpremult = /*@__PURE__*/ Fn$1( ( [ color ] ) => {
|
|
116842
|
-
|
|
116843
|
-
If$1( color.a.equal( 0.0 ), () => vec4( 0.0 ) );
|
|
116844
|
-
|
|
116845
|
-
return vec4( color.rgb.div( color.a ), color.a );
|
|
116846
|
-
|
|
116847
|
-
}, { color: 'vec4', return: 'vec4' } );
|
|
116848
|
-
|
|
116849
|
-
|
|
116850
|
-
// Deprecated
|
|
116851
|
-
|
|
116852
|
-
/**
|
|
116853
|
-
* @tsl
|
|
116854
|
-
* @function
|
|
116855
|
-
* @deprecated since r171. Use {@link blendBurn} instead.
|
|
116856
|
-
*
|
|
116857
|
-
* @param {...any} params
|
|
116858
|
-
* @returns {Function}
|
|
116859
|
-
*/
|
|
116860
|
-
const burn = ( ...params ) => { // @deprecated, r171
|
|
116861
|
-
|
|
116862
|
-
console.warn( 'THREE.TSL: "burn" has been renamed. Use "blendBurn" instead.' );
|
|
116863
|
-
return blendBurn( params );
|
|
116864
|
-
|
|
116865
|
-
};
|
|
116866
|
-
|
|
116867
|
-
/**
|
|
116868
|
-
* @tsl
|
|
116869
|
-
* @function
|
|
116870
|
-
* @deprecated since r171. Use {@link blendDodge} instead.
|
|
116871
|
-
*
|
|
116872
|
-
* @param {...any} params
|
|
116873
|
-
* @returns {Function}
|
|
116874
|
-
*/
|
|
116875
|
-
const dodge = ( ...params ) => { // @deprecated, r171
|
|
116876
|
-
|
|
116877
|
-
console.warn( 'THREE.TSL: "dodge" has been renamed. Use "blendDodge" instead.' );
|
|
116878
|
-
return blendDodge( params );
|
|
116879
|
-
|
|
116880
|
-
};
|
|
116881
|
-
|
|
116882
|
-
/**
|
|
116883
|
-
* @tsl
|
|
116884
|
-
* @function
|
|
116885
|
-
* @deprecated since r171. Use {@link blendScreen} instead.
|
|
116886
|
-
*
|
|
116887
|
-
* @param {...any} params
|
|
116888
|
-
* @returns {Function}
|
|
116889
|
-
*/
|
|
116890
|
-
const screen = ( ...params ) => { // @deprecated, r171
|
|
116891
|
-
|
|
116892
|
-
console.warn( 'THREE.TSL: "screen" has been renamed. Use "blendScreen" instead.' );
|
|
116893
|
-
return blendScreen( params );
|
|
116894
|
-
|
|
116895
|
-
};
|
|
116896
|
-
|
|
116897
|
-
/**
|
|
116898
|
-
* @tsl
|
|
116899
|
-
* @function
|
|
116900
|
-
* @deprecated since r171. Use {@link blendOverlay} instead.
|
|
116901
|
-
*
|
|
116902
|
-
* @param {...any} params
|
|
116903
|
-
* @returns {Function}
|
|
116904
|
-
*/
|
|
116905
|
-
const overlay = ( ...params ) => { // @deprecated, r171
|
|
116906
|
-
|
|
116907
|
-
console.warn( 'THREE.TSL: "overlay" has been renamed. Use "blendOverlay" instead.' );
|
|
116908
|
-
return blendOverlay( params );
|
|
116909
|
-
|
|
116910
|
-
};
|
|
116911
|
-
|
|
116912
117110
|
/**
|
|
116913
117111
|
* Computes a grayscale value for the given RGB color value.
|
|
116914
117112
|
*
|
|
@@ -117221,7 +117419,16 @@ void main() {
|
|
|
117221
117419
|
|
|
117222
117420
|
clone() {
|
|
117223
117421
|
|
|
117224
|
-
|
|
117422
|
+
const newNode = new this.constructor( this.passNode, this.textureName, this.previousTexture );
|
|
117423
|
+
newNode.uvNode = this.uvNode;
|
|
117424
|
+
newNode.levelNode = this.levelNode;
|
|
117425
|
+
newNode.biasNode = this.biasNode;
|
|
117426
|
+
newNode.sampler = this.sampler;
|
|
117427
|
+
newNode.depthNode = this.depthNode;
|
|
117428
|
+
newNode.compareNode = this.compareNode;
|
|
117429
|
+
newNode.gradNode = this.gradNode;
|
|
117430
|
+
|
|
117431
|
+
return newNode;
|
|
117225
117432
|
|
|
117226
117433
|
}
|
|
117227
117434
|
|
|
@@ -117681,13 +117888,6 @@ void main() {
|
|
|
117681
117888
|
|
|
117682
117889
|
this.renderTarget.samples = this.options.samples === undefined ? renderer.samples : this.options.samples;
|
|
117683
117890
|
|
|
117684
|
-
// TODO: Disable MSAA for WebGL backend for now
|
|
117685
|
-
if ( renderer.backend.isWebGLBackend === true ) {
|
|
117686
|
-
|
|
117687
|
-
this.renderTarget.samples = 0;
|
|
117688
|
-
|
|
117689
|
-
}
|
|
117690
|
-
|
|
117691
117891
|
this.renderTarget.texture.type = renderer.getColorBufferType();
|
|
117692
117892
|
|
|
117693
117893
|
return this.scope === PassNode.COLOR ? this.getTextureNode() : this.getLinearDepthNode();
|
|
@@ -120780,21 +120980,21 @@ void main() {
|
|
|
120780
120980
|
*
|
|
120781
120981
|
* @type {Node<vec3>}
|
|
120782
120982
|
*/
|
|
120783
|
-
this.totalDiffuseNode = vec3
|
|
120983
|
+
this.totalDiffuseNode = property( 'vec3', 'totalDiffuse' );
|
|
120784
120984
|
|
|
120785
120985
|
/**
|
|
120786
120986
|
* A node representing the total specular light.
|
|
120787
120987
|
*
|
|
120788
120988
|
* @type {Node<vec3>}
|
|
120789
120989
|
*/
|
|
120790
|
-
this.totalSpecularNode = vec3
|
|
120990
|
+
this.totalSpecularNode = property( 'vec3', 'totalSpecular' );
|
|
120791
120991
|
|
|
120792
120992
|
/**
|
|
120793
120993
|
* A node representing the outgoing light.
|
|
120794
120994
|
*
|
|
120795
120995
|
* @type {Node<vec3>}
|
|
120796
120996
|
*/
|
|
120797
|
-
this.outgoingLightNode = vec3
|
|
120997
|
+
this.outgoingLightNode = property( 'vec3', 'outgoingLight' );
|
|
120798
120998
|
|
|
120799
120999
|
/**
|
|
120800
121000
|
* An array representing the lights in the scene.
|
|
@@ -122152,7 +122352,7 @@ void main() {
|
|
|
122152
122352
|
const shadowIntensity = reference( 'intensity', 'float', shadow ).setGroup( renderGroup );
|
|
122153
122353
|
const normalBias = reference( 'normalBias', 'float', shadow ).setGroup( renderGroup );
|
|
122154
122354
|
|
|
122155
|
-
const shadowPosition = lightShadowMatrix( light ).mul( shadowPositionWorld.add(
|
|
122355
|
+
const shadowPosition = lightShadowMatrix( light ).mul( shadowPositionWorld.add( normalWorld.mul( normalBias ) ) );
|
|
122156
122356
|
const shadowCoord = this.setupShadowCoord( builder, shadowPosition );
|
|
122157
122357
|
|
|
122158
122358
|
//
|
|
@@ -123073,7 +123273,7 @@ void main() {
|
|
|
123073
123273
|
* @param {Node<vec2>} coord - The uv coordinates.
|
|
123074
123274
|
* @return {Node<float>} The result data.
|
|
123075
123275
|
*/
|
|
123076
|
-
const checker = /*@__PURE__*/ Fn$1( ( [ coord = uv() ] ) => {
|
|
123276
|
+
const checker = /*@__PURE__*/ Fn$1( ( [ coord = uv$1() ] ) => {
|
|
123077
123277
|
|
|
123078
123278
|
const uv = coord.mul( 2.0 );
|
|
123079
123279
|
|
|
@@ -123093,7 +123293,7 @@ void main() {
|
|
|
123093
123293
|
* @param {Node<vec2>} coord - The uv to generate the circle.
|
|
123094
123294
|
* @return {Node<float>} The circle shape.
|
|
123095
123295
|
*/
|
|
123096
|
-
const shapeCircle = Fn$1( ( [ coord = uv() ], { renderer, material } ) => {
|
|
123296
|
+
const shapeCircle = Fn$1( ( [ coord = uv$1() ], { renderer, material } ) => {
|
|
123097
123297
|
|
|
123098
123298
|
const len2 = lengthSq( coord.mul( 2 ).sub( 1 ) );
|
|
123099
123299
|
|
|
@@ -124595,14 +124795,14 @@ void main() {
|
|
|
124595
124795
|
};
|
|
124596
124796
|
|
|
124597
124797
|
const _ramp = ( a, b, uv, p ) => mix$2( a, b, uv[ p ].clamp() );
|
|
124598
|
-
const mx_ramplr = ( valuel, valuer, texcoord = uv() ) => _ramp( valuel, valuer, texcoord, 'x' );
|
|
124599
|
-
const mx_ramptb = ( valuet, valueb, texcoord = uv() ) => _ramp( valuet, valueb, texcoord, 'y' );
|
|
124798
|
+
const mx_ramplr = ( valuel, valuer, texcoord = uv$1() ) => _ramp( valuel, valuer, texcoord, 'x' );
|
|
124799
|
+
const mx_ramptb = ( valuet, valueb, texcoord = uv$1() ) => _ramp( valuet, valueb, texcoord, 'y' );
|
|
124600
124800
|
|
|
124601
124801
|
const _split = ( a, b, center, uv, p ) => mix$2( a, b, mx_aastep( center, uv[ p ] ) );
|
|
124602
|
-
const mx_splitlr = ( valuel, valuer, center, texcoord = uv() ) => _split( valuel, valuer, center, texcoord, 'x' );
|
|
124603
|
-
const mx_splittb = ( valuet, valueb, center, texcoord = uv() ) => _split( valuet, valueb, center, texcoord, 'y' );
|
|
124802
|
+
const mx_splitlr = ( valuel, valuer, center, texcoord = uv$1() ) => _split( valuel, valuer, center, texcoord, 'x' );
|
|
124803
|
+
const mx_splittb = ( valuet, valueb, center, texcoord = uv$1() ) => _split( valuet, valueb, center, texcoord, 'y' );
|
|
124604
124804
|
|
|
124605
|
-
const mx_transform_uv = ( uv_scale = 1, uv_offset = 0, uv_geo = uv() ) => uv_geo.mul( uv_scale ).add( uv_offset );
|
|
124805
|
+
const mx_transform_uv = ( uv_scale = 1, uv_offset = 0, uv_geo = uv$1() ) => uv_geo.mul( uv_scale ).add( uv_offset );
|
|
124606
124806
|
|
|
124607
124807
|
const mx_safepower = ( in1, in2 = 1 ) => {
|
|
124608
124808
|
|
|
@@ -124614,10 +124814,10 @@ void main() {
|
|
|
124614
124814
|
|
|
124615
124815
|
const mx_contrast = ( input, amount = 1, pivot = .5 ) => float$1( input ).sub( pivot ).mul( amount ).add( pivot );
|
|
124616
124816
|
|
|
124617
|
-
const mx_noise_float = ( texcoord = uv(), amplitude = 1, pivot = 0 ) => mx_perlin_noise_float( texcoord.convert( 'vec2|vec3' ) ).mul( amplitude ).add( pivot );
|
|
124817
|
+
const mx_noise_float = ( texcoord = uv$1(), amplitude = 1, pivot = 0 ) => mx_perlin_noise_float( texcoord.convert( 'vec2|vec3' ) ).mul( amplitude ).add( pivot );
|
|
124618
124818
|
//export const mx_noise_vec2 = ( texcoord = uv(), amplitude = 1, pivot = 0 ) => mx_perlin_noise_vec3( texcoord.convert( 'vec2|vec3' ) ).mul( amplitude ).add( pivot );
|
|
124619
|
-
const mx_noise_vec3 = ( texcoord = uv(), amplitude = 1, pivot = 0 ) => mx_perlin_noise_vec3( texcoord.convert( 'vec2|vec3' ) ).mul( amplitude ).add( pivot );
|
|
124620
|
-
const mx_noise_vec4 = ( texcoord = uv(), amplitude = 1, pivot = 0 ) => {
|
|
124819
|
+
const mx_noise_vec3 = ( texcoord = uv$1(), amplitude = 1, pivot = 0 ) => mx_perlin_noise_vec3( texcoord.convert( 'vec2|vec3' ) ).mul( amplitude ).add( pivot );
|
|
124820
|
+
const mx_noise_vec4 = ( texcoord = uv$1(), amplitude = 1, pivot = 0 ) => {
|
|
124621
124821
|
|
|
124622
124822
|
texcoord = texcoord.convert( 'vec2|vec3' ); // overloading type
|
|
124623
124823
|
|
|
@@ -124627,16 +124827,16 @@ void main() {
|
|
|
124627
124827
|
|
|
124628
124828
|
};
|
|
124629
124829
|
|
|
124630
|
-
const mx_worley_noise_float = ( texcoord = uv(), jitter = 1 ) => mx_worley_noise_float$1( texcoord.convert( 'vec2|vec3' ), jitter, int( 1 ) );
|
|
124631
|
-
const mx_worley_noise_vec2 = ( texcoord = uv(), jitter = 1 ) => mx_worley_noise_vec2$1( texcoord.convert( 'vec2|vec3' ), jitter, int( 1 ) );
|
|
124632
|
-
const mx_worley_noise_vec3 = ( texcoord = uv(), jitter = 1 ) => mx_worley_noise_vec3$1( texcoord.convert( 'vec2|vec3' ), jitter, int( 1 ) );
|
|
124830
|
+
const mx_worley_noise_float = ( texcoord = uv$1(), jitter = 1 ) => mx_worley_noise_float$1( texcoord.convert( 'vec2|vec3' ), jitter, int( 1 ) );
|
|
124831
|
+
const mx_worley_noise_vec2 = ( texcoord = uv$1(), jitter = 1 ) => mx_worley_noise_vec2$1( texcoord.convert( 'vec2|vec3' ), jitter, int( 1 ) );
|
|
124832
|
+
const mx_worley_noise_vec3 = ( texcoord = uv$1(), jitter = 1 ) => mx_worley_noise_vec3$1( texcoord.convert( 'vec2|vec3' ), jitter, int( 1 ) );
|
|
124633
124833
|
|
|
124634
|
-
const mx_cell_noise_float = ( texcoord = uv() ) => mx_cell_noise_float$1( texcoord.convert( 'vec2|vec3' ) );
|
|
124834
|
+
const mx_cell_noise_float = ( texcoord = uv$1() ) => mx_cell_noise_float$1( texcoord.convert( 'vec2|vec3' ) );
|
|
124635
124835
|
|
|
124636
|
-
const mx_fractal_noise_float = ( position = uv(), octaves = 3, lacunarity = 2, diminish = .5, amplitude = 1 ) => mx_fractal_noise_float$1( position, int( octaves ), lacunarity, diminish ).mul( amplitude );
|
|
124637
|
-
const mx_fractal_noise_vec2 = ( position = uv(), octaves = 3, lacunarity = 2, diminish = .5, amplitude = 1 ) => mx_fractal_noise_vec2$1( position, int( octaves ), lacunarity, diminish ).mul( amplitude );
|
|
124638
|
-
const mx_fractal_noise_vec3 = ( position = uv(), octaves = 3, lacunarity = 2, diminish = .5, amplitude = 1 ) => mx_fractal_noise_vec3$1( position, int( octaves ), lacunarity, diminish ).mul( amplitude );
|
|
124639
|
-
const mx_fractal_noise_vec4 = ( position = uv(), octaves = 3, lacunarity = 2, diminish = .5, amplitude = 1 ) => mx_fractal_noise_vec4$1( position, int( octaves ), lacunarity, diminish ).mul( amplitude );
|
|
124836
|
+
const mx_fractal_noise_float = ( position = uv$1(), octaves = 3, lacunarity = 2, diminish = .5, amplitude = 1 ) => mx_fractal_noise_float$1( position, int( octaves ), lacunarity, diminish ).mul( amplitude );
|
|
124837
|
+
const mx_fractal_noise_vec2 = ( position = uv$1(), octaves = 3, lacunarity = 2, diminish = .5, amplitude = 1 ) => mx_fractal_noise_vec2$1( position, int( octaves ), lacunarity, diminish ).mul( amplitude );
|
|
124838
|
+
const mx_fractal_noise_vec3 = ( position = uv$1(), octaves = 3, lacunarity = 2, diminish = .5, amplitude = 1 ) => mx_fractal_noise_vec3$1( position, int( octaves ), lacunarity, diminish ).mul( amplitude );
|
|
124839
|
+
const mx_fractal_noise_vec4 = ( position = uv$1(), octaves = 3, lacunarity = 2, diminish = .5, amplitude = 1 ) => mx_fractal_noise_vec4$1( position, int( octaves ), lacunarity, diminish ).mul( amplitude );
|
|
124640
124840
|
|
|
124641
124841
|
/**
|
|
124642
124842
|
* This computes a parallax corrected normal which is used for box-projected cube mapping (BPCEM).
|
|
@@ -124774,6 +124974,7 @@ void main() {
|
|
|
124774
124974
|
backgroundIntensity: backgroundIntensity,
|
|
124775
124975
|
backgroundRotation: backgroundRotation,
|
|
124776
124976
|
batch: batch,
|
|
124977
|
+
bentNormalView: bentNormalView,
|
|
124777
124978
|
billboarding: billboarding,
|
|
124778
124979
|
bitAnd: bitAnd,
|
|
124779
124980
|
bitNot: bitNot,
|
|
@@ -124817,6 +125018,7 @@ void main() {
|
|
|
124817
125018
|
cineonToneMapping: cineonToneMapping,
|
|
124818
125019
|
clamp: clamp,
|
|
124819
125020
|
clearcoat: clearcoat,
|
|
125021
|
+
clearcoatNormalView: clearcoatNormalView,
|
|
124820
125022
|
clearcoatRoughness: clearcoatRoughness,
|
|
124821
125023
|
code: code,
|
|
124822
125024
|
color: color,
|
|
@@ -124824,7 +125026,6 @@ void main() {
|
|
|
124824
125026
|
colorToDirection: colorToDirection,
|
|
124825
125027
|
compute: compute,
|
|
124826
125028
|
computeSkinning: computeSkinning,
|
|
124827
|
-
cond: cond,
|
|
124828
125029
|
context: context,
|
|
124829
125030
|
convert: convert,
|
|
124830
125031
|
convertColorSpace: convertColorSpace,
|
|
@@ -124853,6 +125054,7 @@ void main() {
|
|
|
124853
125054
|
diffuseColor: diffuseColor,
|
|
124854
125055
|
directPointLight: directPointLight,
|
|
124855
125056
|
directionToColor: directionToColor,
|
|
125057
|
+
directionToFaceDirection: directionToFaceDirection,
|
|
124856
125058
|
dispersion: dispersion,
|
|
124857
125059
|
distance: distance,
|
|
124858
125060
|
div: div,
|
|
@@ -124945,7 +125147,6 @@ void main() {
|
|
|
124945
125147
|
log: log,
|
|
124946
125148
|
log2: log2,
|
|
124947
125149
|
logarithmicDepthToViewZ: logarithmicDepthToViewZ,
|
|
124948
|
-
loop: loop,
|
|
124949
125150
|
luminance: luminance,
|
|
124950
125151
|
mat2: mat2,
|
|
124951
125152
|
mat3: mat3,
|
|
@@ -125037,7 +125238,6 @@ void main() {
|
|
|
125037
125238
|
mx_worley_noise_float: mx_worley_noise_float,
|
|
125038
125239
|
mx_worley_noise_vec2: mx_worley_noise_vec2,
|
|
125039
125240
|
mx_worley_noise_vec3: mx_worley_noise_vec3,
|
|
125040
|
-
namespace: namespace$1,
|
|
125041
125241
|
negate: negate$1,
|
|
125042
125242
|
neutralToneMapping: neutralToneMapping,
|
|
125043
125243
|
nodeArray: nodeArray,
|
|
@@ -125050,7 +125250,9 @@ void main() {
|
|
|
125050
125250
|
normalLocal: normalLocal,
|
|
125051
125251
|
normalMap: normalMap,
|
|
125052
125252
|
normalView: normalView,
|
|
125253
|
+
normalViewGeometry: normalViewGeometry,
|
|
125053
125254
|
normalWorld: normalWorld,
|
|
125255
|
+
normalWorldGeometry: normalWorldGeometry,
|
|
125054
125256
|
normalize: normalize,
|
|
125055
125257
|
not: not,
|
|
125056
125258
|
notEqual: notEqual,
|
|
@@ -125097,7 +125299,7 @@ void main() {
|
|
|
125097
125299
|
pow2: pow2,
|
|
125098
125300
|
pow3: pow3,
|
|
125099
125301
|
pow4: pow4,
|
|
125100
|
-
|
|
125302
|
+
premultiplyAlpha: premultiplyAlpha,
|
|
125101
125303
|
property: property,
|
|
125102
125304
|
radians: radians,
|
|
125103
125305
|
rand: rand,
|
|
@@ -125115,7 +125317,6 @@ void main() {
|
|
|
125115
125317
|
refractVector: refractVector,
|
|
125116
125318
|
refractView: refractView,
|
|
125117
125319
|
reinhardToneMapping: reinhardToneMapping,
|
|
125118
|
-
remainder: remainder,
|
|
125119
125320
|
remap: remap,
|
|
125120
125321
|
remapClamp: remapClamp,
|
|
125121
125322
|
renderGroup: renderGroup,
|
|
@@ -125128,6 +125329,7 @@ void main() {
|
|
|
125128
125329
|
rtt: rtt,
|
|
125129
125330
|
sRGBTransferEOTF: sRGBTransferEOTF,
|
|
125130
125331
|
sRGBTransferOETF: sRGBTransferOETF,
|
|
125332
|
+
sample: sample,
|
|
125131
125333
|
sampler: sampler,
|
|
125132
125334
|
samplerComparison: samplerComparison,
|
|
125133
125335
|
saturate: saturate$1,
|
|
@@ -125164,6 +125366,7 @@ void main() {
|
|
|
125164
125366
|
sqrt: sqrt$1,
|
|
125165
125367
|
stack: stack,
|
|
125166
125368
|
step: step,
|
|
125369
|
+
stepElement: stepElement,
|
|
125167
125370
|
storage: storage$1,
|
|
125168
125371
|
storageBarrier: storageBarrier,
|
|
125169
125372
|
storageObject: storageObject,
|
|
@@ -125171,6 +125374,7 @@ void main() {
|
|
|
125171
125374
|
string: string,
|
|
125172
125375
|
struct: struct,
|
|
125173
125376
|
sub: sub,
|
|
125377
|
+
subBuild: subBuild,
|
|
125174
125378
|
subgroupIndex: subgroupIndex,
|
|
125175
125379
|
subgroupSize: subgroupSize,
|
|
125176
125380
|
tan: tan,
|
|
@@ -125183,6 +125387,7 @@ void main() {
|
|
|
125183
125387
|
texture3D: texture3D,
|
|
125184
125388
|
textureBarrier: textureBarrier,
|
|
125185
125389
|
textureBicubic: textureBicubic,
|
|
125390
|
+
textureBicubicLevel: textureBicubicLevel,
|
|
125186
125391
|
textureCubeUV: textureCubeUV,
|
|
125187
125392
|
textureLoad: textureLoad,
|
|
125188
125393
|
textureSize: textureSize,
|
|
@@ -125198,31 +125403,24 @@ void main() {
|
|
|
125198
125403
|
transformDirection: transformDirection,
|
|
125199
125404
|
transformNormal: transformNormal,
|
|
125200
125405
|
transformNormalToView: transformNormalToView,
|
|
125201
|
-
transformedBentNormalView: transformedBentNormalView,
|
|
125202
|
-
transformedBitangentView: transformedBitangentView,
|
|
125203
|
-
transformedBitangentWorld: transformedBitangentWorld,
|
|
125204
125406
|
transformedClearcoatNormalView: transformedClearcoatNormalView,
|
|
125205
125407
|
transformedNormalView: transformedNormalView,
|
|
125206
125408
|
transformedNormalWorld: transformedNormalWorld,
|
|
125207
|
-
transformedTangentView: transformedTangentView,
|
|
125208
|
-
transformedTangentWorld: transformedTangentWorld,
|
|
125209
125409
|
transmission: transmission,
|
|
125210
125410
|
transpose: transpose,
|
|
125211
125411
|
triNoise3D: triNoise3D,
|
|
125212
125412
|
triplanarTexture: triplanarTexture,
|
|
125213
125413
|
triplanarTextures: triplanarTextures,
|
|
125214
125414
|
trunc: trunc,
|
|
125215
|
-
tslFn: tslFn,
|
|
125216
125415
|
uint: uint,
|
|
125217
125416
|
uniform: uniform$1,
|
|
125218
125417
|
uniformArray: uniformArray,
|
|
125219
125418
|
uniformCubeTexture: uniformCubeTexture,
|
|
125220
125419
|
uniformGroup: uniformGroup,
|
|
125221
125420
|
uniformTexture: uniformTexture,
|
|
125222
|
-
|
|
125223
|
-
unpremult: unpremult,
|
|
125421
|
+
unpremultiplyAlpha: unpremultiplyAlpha,
|
|
125224
125422
|
userData: userData,
|
|
125225
|
-
uv: uv,
|
|
125423
|
+
uv: uv$1,
|
|
125226
125424
|
uvec2: uvec2,
|
|
125227
125425
|
uvec3: uvec3,
|
|
125228
125426
|
uvec4: uvec4,
|
|
@@ -125241,7 +125439,6 @@ void main() {
|
|
|
125241
125439
|
viewZToOrthographicDepth: viewZToOrthographicDepth,
|
|
125242
125440
|
viewZToPerspectiveDepth: viewZToPerspectiveDepth,
|
|
125243
125441
|
viewport: viewport,
|
|
125244
|
-
viewportBottomLeft: viewportBottomLeft,
|
|
125245
125442
|
viewportCoordinate: viewportCoordinate,
|
|
125246
125443
|
viewportDepthTexture: viewportDepthTexture,
|
|
125247
125444
|
viewportLinearDepth: viewportLinearDepth,
|
|
@@ -125251,7 +125448,6 @@ void main() {
|
|
|
125251
125448
|
viewportSharedTexture: viewportSharedTexture,
|
|
125252
125449
|
viewportSize: viewportSize,
|
|
125253
125450
|
viewportTexture: viewportTexture,
|
|
125254
|
-
viewportTopLeft: viewportTopLeft,
|
|
125255
125451
|
viewportUV: viewportUV,
|
|
125256
125452
|
wgsl: wgsl,
|
|
125257
125453
|
wgslFn: wgslFn,
|
|
@@ -125344,7 +125540,7 @@ void main() {
|
|
|
125344
125540
|
|
|
125345
125541
|
const backgroundMeshNode = context( vec4( backgroundNode ).mul( backgroundIntensity ), {
|
|
125346
125542
|
// @TODO: Add Texture2D support using node context
|
|
125347
|
-
getUV: () => backgroundRotation.mul(
|
|
125543
|
+
getUV: () => backgroundRotation.mul( normalWorldGeometry ),
|
|
125348
125544
|
getTextureLevel: () => backgroundBlurriness
|
|
125349
125545
|
} );
|
|
125350
125546
|
|
|
@@ -127214,6 +127410,30 @@ void main() {
|
|
|
127214
127410
|
*/
|
|
127215
127411
|
this.buildStage = null;
|
|
127216
127412
|
|
|
127413
|
+
/**
|
|
127414
|
+
* The sub-build layers.
|
|
127415
|
+
*
|
|
127416
|
+
* @type {Array<SubBuildNode>}
|
|
127417
|
+
* @default []
|
|
127418
|
+
*/
|
|
127419
|
+
this.subBuildLayers = [];
|
|
127420
|
+
|
|
127421
|
+
/**
|
|
127422
|
+
* The current stack of nodes.
|
|
127423
|
+
*
|
|
127424
|
+
* @type {?StackNode}
|
|
127425
|
+
* @default null
|
|
127426
|
+
*/
|
|
127427
|
+
this.currentStack = null;
|
|
127428
|
+
|
|
127429
|
+
/**
|
|
127430
|
+
* The current sub-build TSL function(Fn).
|
|
127431
|
+
*
|
|
127432
|
+
* @type {?string}
|
|
127433
|
+
* @default null
|
|
127434
|
+
*/
|
|
127435
|
+
this.subBuildFn = null;
|
|
127436
|
+
|
|
127217
127437
|
}
|
|
127218
127438
|
|
|
127219
127439
|
/**
|
|
@@ -128370,7 +128590,23 @@ void main() {
|
|
|
128370
128590
|
|
|
128371
128591
|
if ( nodeData[ shaderStage ] === undefined ) nodeData[ shaderStage ] = {};
|
|
128372
128592
|
|
|
128373
|
-
|
|
128593
|
+
//
|
|
128594
|
+
|
|
128595
|
+
let data = nodeData[ shaderStage ];
|
|
128596
|
+
|
|
128597
|
+
const subBuilds = nodeData.any ? nodeData.any.subBuilds : null;
|
|
128598
|
+
const subBuild = this.getClosestSubBuild( subBuilds );
|
|
128599
|
+
|
|
128600
|
+
if ( subBuild ) {
|
|
128601
|
+
|
|
128602
|
+
if ( data.subBuildsCache === undefined ) data.subBuildsCache = {};
|
|
128603
|
+
|
|
128604
|
+
data = data.subBuildsCache[ subBuild ] || ( data.subBuildsCache[ subBuild ] = {} );
|
|
128605
|
+
data.subBuilds = subBuilds;
|
|
128606
|
+
|
|
128607
|
+
}
|
|
128608
|
+
|
|
128609
|
+
return data;
|
|
128374
128610
|
|
|
128375
128611
|
}
|
|
128376
128612
|
|
|
@@ -128531,8 +128767,9 @@ void main() {
|
|
|
128531
128767
|
getVarFromNode( node, name = null, type = node.getNodeType( this ), shaderStage = this.shaderStage, readOnly = false ) {
|
|
128532
128768
|
|
|
128533
128769
|
const nodeData = this.getDataFromNode( node, shaderStage );
|
|
128770
|
+
const subBuildVariable = this.getSubBuildProperty( 'variable', nodeData.subBuilds );
|
|
128534
128771
|
|
|
128535
|
-
let nodeVar = nodeData
|
|
128772
|
+
let nodeVar = nodeData[ subBuildVariable ];
|
|
128536
128773
|
|
|
128537
128774
|
if ( nodeVar === undefined ) {
|
|
128538
128775
|
|
|
@@ -128551,6 +128788,14 @@ void main() {
|
|
|
128551
128788
|
|
|
128552
128789
|
//
|
|
128553
128790
|
|
|
128791
|
+
if ( subBuildVariable !== 'variable' ) {
|
|
128792
|
+
|
|
128793
|
+
name = this.getSubBuildProperty( name, nodeData.subBuilds );
|
|
128794
|
+
|
|
128795
|
+
}
|
|
128796
|
+
|
|
128797
|
+
//
|
|
128798
|
+
|
|
128554
128799
|
const count = this.getArrayCount( node );
|
|
128555
128800
|
|
|
128556
128801
|
nodeVar = new NodeVar( name, type, readOnly, count );
|
|
@@ -128563,7 +128808,7 @@ void main() {
|
|
|
128563
128808
|
|
|
128564
128809
|
this.registerDeclaration( nodeVar );
|
|
128565
128810
|
|
|
128566
|
-
nodeData
|
|
128811
|
+
nodeData[ subBuildVariable ] = nodeVar;
|
|
128567
128812
|
|
|
128568
128813
|
}
|
|
128569
128814
|
|
|
@@ -128631,8 +128876,9 @@ void main() {
|
|
|
128631
128876
|
getVaryingFromNode( node, name = null, type = node.getNodeType( this ), interpolationType = null, interpolationSampling = null ) {
|
|
128632
128877
|
|
|
128633
128878
|
const nodeData = this.getDataFromNode( node, 'any' );
|
|
128879
|
+
const subBuildVarying = this.getSubBuildProperty( 'varying', nodeData.subBuilds );
|
|
128634
128880
|
|
|
128635
|
-
let nodeVarying = nodeData
|
|
128881
|
+
let nodeVarying = nodeData[ subBuildVarying ];
|
|
128636
128882
|
|
|
128637
128883
|
if ( nodeVarying === undefined ) {
|
|
128638
128884
|
|
|
@@ -128641,69 +128887,27 @@ void main() {
|
|
|
128641
128887
|
|
|
128642
128888
|
if ( name === null ) name = 'nodeVarying' + index;
|
|
128643
128889
|
|
|
128644
|
-
|
|
128645
|
-
|
|
128646
|
-
varyings.push( nodeVarying );
|
|
128647
|
-
|
|
128648
|
-
this.registerDeclaration( nodeVarying );
|
|
128649
|
-
|
|
128650
|
-
nodeData.varying = nodeVarying;
|
|
128651
|
-
|
|
128652
|
-
}
|
|
128653
|
-
|
|
128654
|
-
return nodeVarying;
|
|
128655
|
-
|
|
128656
|
-
}
|
|
128657
|
-
|
|
128658
|
-
/**
|
|
128659
|
-
* Returns the current namespace for the node builder.
|
|
128660
|
-
*
|
|
128661
|
-
* @return {string} The current namespace.
|
|
128662
|
-
*/
|
|
128663
|
-
get namespace() {
|
|
128664
|
-
|
|
128665
|
-
return this.context.namespace;
|
|
128666
|
-
|
|
128667
|
-
}
|
|
128668
|
-
|
|
128669
|
-
/**
|
|
128670
|
-
* Returns the output namespace for the node builder, which is used for the current output node.
|
|
128671
|
-
*
|
|
128672
|
-
* @return {string} The output namespace.
|
|
128673
|
-
*/
|
|
128674
|
-
getOutputNamespace() {
|
|
128890
|
+
//
|
|
128675
128891
|
|
|
128676
|
-
|
|
128892
|
+
if ( subBuildVarying !== 'varying' ) {
|
|
128677
128893
|
|
|
128678
|
-
|
|
128894
|
+
name = this.getSubBuildProperty( name, nodeData.subBuilds );
|
|
128679
128895
|
|
|
128680
|
-
|
|
128681
|
-
* Returns the namespace for the given property.
|
|
128682
|
-
*
|
|
128683
|
-
* If the property name is not set, it returns the namespace only.
|
|
128684
|
-
* If the namespace is not set, it returns the property name.
|
|
128685
|
-
* If the namespace is set, it returns the namespace concatenated with the property name.
|
|
128686
|
-
*
|
|
128687
|
-
* @param {string} [property=''] - The property name.
|
|
128688
|
-
* @return {string} The namespace for the property.
|
|
128689
|
-
*/
|
|
128690
|
-
getNamespace( property = '' ) {
|
|
128691
|
-
|
|
128692
|
-
const ns = this.namespace;
|
|
128896
|
+
}
|
|
128693
128897
|
|
|
128694
|
-
|
|
128898
|
+
//
|
|
128695
128899
|
|
|
128696
|
-
|
|
128900
|
+
nodeVarying = new NodeVarying( name, type, interpolationType, interpolationSampling );
|
|
128697
128901
|
|
|
128698
|
-
|
|
128902
|
+
varyings.push( nodeVarying );
|
|
128699
128903
|
|
|
128700
|
-
|
|
128904
|
+
this.registerDeclaration( nodeVarying );
|
|
128701
128905
|
|
|
128702
|
-
|
|
128906
|
+
nodeData[ subBuildVarying ] = nodeVarying;
|
|
128703
128907
|
|
|
128704
128908
|
}
|
|
128705
128909
|
|
|
128706
|
-
return
|
|
128910
|
+
return nodeVarying;
|
|
128707
128911
|
|
|
128708
128912
|
}
|
|
128709
128913
|
|
|
@@ -129360,6 +129564,145 @@ void main() {
|
|
|
129360
129564
|
|
|
129361
129565
|
}
|
|
129362
129566
|
|
|
129567
|
+
/**
|
|
129568
|
+
* Returns the current sub-build layer.
|
|
129569
|
+
*
|
|
129570
|
+
* @return {SubBuildNode} The current sub-build layers.
|
|
129571
|
+
*/
|
|
129572
|
+
get subBuild() {
|
|
129573
|
+
|
|
129574
|
+
return this.subBuildLayers[ this.subBuildLayers.length - 1 ] || null;
|
|
129575
|
+
|
|
129576
|
+
}
|
|
129577
|
+
|
|
129578
|
+
/**
|
|
129579
|
+
* Adds a sub-build layer to the node builder.
|
|
129580
|
+
*
|
|
129581
|
+
* @param {SubBuildNode} subBuild - The sub-build layer to add.
|
|
129582
|
+
*/
|
|
129583
|
+
addSubBuild( subBuild ) {
|
|
129584
|
+
|
|
129585
|
+
this.subBuildLayers.push( subBuild );
|
|
129586
|
+
|
|
129587
|
+
}
|
|
129588
|
+
|
|
129589
|
+
/**
|
|
129590
|
+
* Removes the last sub-build layer from the node builder.
|
|
129591
|
+
*
|
|
129592
|
+
* @return {SubBuildNode} The removed sub-build layer.
|
|
129593
|
+
*/
|
|
129594
|
+
removeSubBuild() {
|
|
129595
|
+
|
|
129596
|
+
return this.subBuildLayers.pop();
|
|
129597
|
+
|
|
129598
|
+
}
|
|
129599
|
+
|
|
129600
|
+
/**
|
|
129601
|
+
* Returns the closest sub-build layer for the given data.
|
|
129602
|
+
*
|
|
129603
|
+
* @param {Node|Set|Array} data - The data to get the closest sub-build layer from.
|
|
129604
|
+
* @return {?string} The closest sub-build name or null if none found.
|
|
129605
|
+
*/
|
|
129606
|
+
getClosestSubBuild( data ) {
|
|
129607
|
+
|
|
129608
|
+
let subBuilds;
|
|
129609
|
+
|
|
129610
|
+
if ( data && data.isNode ) {
|
|
129611
|
+
|
|
129612
|
+
if ( data.isShaderCallNodeInternal ) {
|
|
129613
|
+
|
|
129614
|
+
subBuilds = data.shaderNode.subBuilds;
|
|
129615
|
+
|
|
129616
|
+
} else if ( data.isStackNode ) {
|
|
129617
|
+
|
|
129618
|
+
subBuilds = [ data.subBuild ];
|
|
129619
|
+
|
|
129620
|
+
} else {
|
|
129621
|
+
|
|
129622
|
+
subBuilds = this.getDataFromNode( data, 'any' ).subBuilds;
|
|
129623
|
+
|
|
129624
|
+
}
|
|
129625
|
+
|
|
129626
|
+
} else if ( data instanceof Set ) {
|
|
129627
|
+
|
|
129628
|
+
subBuilds = [ ...data ];
|
|
129629
|
+
|
|
129630
|
+
} else {
|
|
129631
|
+
|
|
129632
|
+
subBuilds = data;
|
|
129633
|
+
|
|
129634
|
+
}
|
|
129635
|
+
|
|
129636
|
+
if ( ! subBuilds ) return null;
|
|
129637
|
+
|
|
129638
|
+
const subBuildLayers = this.subBuildLayers;
|
|
129639
|
+
|
|
129640
|
+
for ( let i = subBuilds.length - 1; i >= 0; i -- ) {
|
|
129641
|
+
|
|
129642
|
+
const subBuild = subBuilds[ i ];
|
|
129643
|
+
|
|
129644
|
+
if ( subBuildLayers.includes( subBuild ) ) {
|
|
129645
|
+
|
|
129646
|
+
return subBuild;
|
|
129647
|
+
|
|
129648
|
+
}
|
|
129649
|
+
|
|
129650
|
+
}
|
|
129651
|
+
|
|
129652
|
+
return null;
|
|
129653
|
+
|
|
129654
|
+
}
|
|
129655
|
+
|
|
129656
|
+
|
|
129657
|
+
/**
|
|
129658
|
+
* Returns the output node of a sub-build layer.
|
|
129659
|
+
*
|
|
129660
|
+
* @param {Node} node - The node to get the output from.
|
|
129661
|
+
* @return {string} The output node name.
|
|
129662
|
+
*/
|
|
129663
|
+
getSubBuildOutput( node ) {
|
|
129664
|
+
|
|
129665
|
+
return this.getSubBuildProperty( 'outputNode', node );
|
|
129666
|
+
|
|
129667
|
+
}
|
|
129668
|
+
|
|
129669
|
+
/**
|
|
129670
|
+
* Returns the sub-build property name for the given property and node.
|
|
129671
|
+
*
|
|
129672
|
+
* @param {string} [property=''] - The property name.
|
|
129673
|
+
* @param {?Node} [node=null] - The node to get the sub-build from.
|
|
129674
|
+
* @return {string} The sub-build property name.
|
|
129675
|
+
*/
|
|
129676
|
+
getSubBuildProperty( property = '', node = null ) {
|
|
129677
|
+
|
|
129678
|
+
let subBuild;
|
|
129679
|
+
|
|
129680
|
+
if ( node !== null ) {
|
|
129681
|
+
|
|
129682
|
+
subBuild = this.getClosestSubBuild( node );
|
|
129683
|
+
|
|
129684
|
+
} else {
|
|
129685
|
+
|
|
129686
|
+
subBuild = this.subBuildFn;
|
|
129687
|
+
|
|
129688
|
+
}
|
|
129689
|
+
|
|
129690
|
+
let result;
|
|
129691
|
+
|
|
129692
|
+
if ( subBuild ) {
|
|
129693
|
+
|
|
129694
|
+
result = property ? ( subBuild + '_' + property ) : subBuild;
|
|
129695
|
+
|
|
129696
|
+
} else {
|
|
129697
|
+
|
|
129698
|
+
result = property;
|
|
129699
|
+
|
|
129700
|
+
}
|
|
129701
|
+
|
|
129702
|
+
return result;
|
|
129703
|
+
|
|
129704
|
+
}
|
|
129705
|
+
|
|
129363
129706
|
/**
|
|
129364
129707
|
* Central build method which controls the build for the given object.
|
|
129365
129708
|
*
|
|
@@ -129569,22 +129912,6 @@ void main() {
|
|
|
129569
129912
|
*/
|
|
129570
129913
|
*[ Symbol.iterator ]() { }
|
|
129571
129914
|
|
|
129572
|
-
// Deprecated
|
|
129573
|
-
|
|
129574
|
-
/**
|
|
129575
|
-
* @function
|
|
129576
|
-
* @deprecated since r168. Use `new NodeMaterial()` instead, with targeted node material name.
|
|
129577
|
-
*
|
|
129578
|
-
* @param {string} [type='NodeMaterial'] - The node material type.
|
|
129579
|
-
* @throws {Error}
|
|
129580
|
-
*/
|
|
129581
|
-
createNodeMaterial( type = 'NodeMaterial' ) { // @deprecated, r168
|
|
129582
|
-
|
|
129583
|
-
throw new Error( `THREE.NodeBuilder: createNodeMaterial() was deprecated. Use new ${ type }() instead.` );
|
|
129584
|
-
|
|
129585
|
-
}
|
|
129586
|
-
|
|
129587
|
-
|
|
129588
129915
|
}
|
|
129589
129916
|
|
|
129590
129917
|
/**
|
|
@@ -132274,10 +132601,11 @@ void main() {
|
|
|
132274
132601
|
* are defined by external textures. This flag is
|
|
132275
132602
|
* set to `true` when using the WebXR Layers API.
|
|
132276
132603
|
*
|
|
132604
|
+
* @private
|
|
132277
132605
|
* @type {boolean}
|
|
132278
132606
|
* @default false
|
|
132279
132607
|
*/
|
|
132280
|
-
this.
|
|
132608
|
+
this._hasExternalTextures = false;
|
|
132281
132609
|
|
|
132282
132610
|
/**
|
|
132283
132611
|
* Whether a depth buffer should automatically be allocated
|
|
@@ -132290,10 +132618,25 @@ void main() {
|
|
|
132290
132618
|
*
|
|
132291
132619
|
* Reference: {@link https://www.w3.org/TR/webxrlayers-1/#dom-xrprojectionlayer-ignoredepthvalues}.
|
|
132292
132620
|
*
|
|
132621
|
+
* @private
|
|
132293
132622
|
* @type {boolean}
|
|
132294
132623
|
* @default true
|
|
132295
132624
|
*/
|
|
132296
|
-
this.
|
|
132625
|
+
this._autoAllocateDepthBuffer = true;
|
|
132626
|
+
|
|
132627
|
+
/**
|
|
132628
|
+
* Whether this render target is associated with a XRWebGLLayer.
|
|
132629
|
+
*
|
|
132630
|
+
* A XRWebGLLayer points to an opaque framebuffer. Basically,
|
|
132631
|
+
* this means that you don't have access to its bound color,
|
|
132632
|
+
* stencil and depth buffers. We need to handle this framebuffer
|
|
132633
|
+
* differently since its textures are always bound.
|
|
132634
|
+
*
|
|
132635
|
+
* @private
|
|
132636
|
+
* @type {boolean}
|
|
132637
|
+
* @default false
|
|
132638
|
+
* */
|
|
132639
|
+
this._isOpaqueFramebuffer = false;
|
|
132297
132640
|
|
|
132298
132641
|
}
|
|
132299
132642
|
|
|
@@ -132301,8 +132644,9 @@ void main() {
|
|
|
132301
132644
|
|
|
132302
132645
|
super.copy( source );
|
|
132303
132646
|
|
|
132304
|
-
this.
|
|
132305
|
-
this.
|
|
132647
|
+
this._hasExternalTextures = source._hasExternalTextures;
|
|
132648
|
+
this._autoAllocateDepthBuffer = source._autoAllocateDepthBuffer;
|
|
132649
|
+
this._isOpaqueFramebuffer = source._isOpaqueFramebuffer;
|
|
132306
132650
|
|
|
132307
132651
|
return this;
|
|
132308
132652
|
|
|
@@ -132935,7 +133279,7 @@ void main() {
|
|
|
132935
133279
|
resolveStencilBuffer: false
|
|
132936
133280
|
} );
|
|
132937
133281
|
|
|
132938
|
-
renderTarget.
|
|
133282
|
+
renderTarget._autoAllocateDepthBuffer = true;
|
|
132939
133283
|
|
|
132940
133284
|
const material = new MeshBasicMaterial( { color: 0xffffff, side: FrontSide } );
|
|
132941
133285
|
material.map = renderTarget.texture;
|
|
@@ -133026,7 +133370,7 @@ void main() {
|
|
|
133026
133370
|
resolveStencilBuffer: false
|
|
133027
133371
|
} );
|
|
133028
133372
|
|
|
133029
|
-
renderTarget.
|
|
133373
|
+
renderTarget._autoAllocateDepthBuffer = true;
|
|
133030
133374
|
|
|
133031
133375
|
const material = new MeshBasicMaterial( { color: 0xffffff, side: BackSide } );
|
|
133032
133376
|
material.map = renderTarget.texture;
|
|
@@ -133100,7 +133444,7 @@ void main() {
|
|
|
133100
133444
|
for ( const layer of this._layers ) {
|
|
133101
133445
|
|
|
133102
133446
|
layer.renderTarget.isXRRenderTarget = this._session !== null;
|
|
133103
|
-
layer.renderTarget.
|
|
133447
|
+
layer.renderTarget._hasExternalTextures = layer.renderTarget.isXRRenderTarget;
|
|
133104
133448
|
|
|
133105
133449
|
if ( layer.renderTarget.isXRRenderTarget && this._supportsLayers ) {
|
|
133106
133450
|
|
|
@@ -133268,7 +133612,7 @@ void main() {
|
|
|
133268
133612
|
multiview: this._useMultiview
|
|
133269
133613
|
} );
|
|
133270
133614
|
|
|
133271
|
-
this._xrRenderTarget.
|
|
133615
|
+
this._xrRenderTarget._hasExternalTextures = true;
|
|
133272
133616
|
this._xrRenderTarget.depth = this._useMultiview ? 2 : 1;
|
|
133273
133617
|
|
|
133274
133618
|
this._supportsLayers = session.enabledFeatures.includes( 'layers' );
|
|
@@ -133330,6 +133674,7 @@ void main() {
|
|
|
133330
133674
|
}
|
|
133331
133675
|
);
|
|
133332
133676
|
|
|
133677
|
+
this._xrRenderTarget._isOpaqueFramebuffer = true;
|
|
133333
133678
|
this._referenceSpace = await session.requestReferenceSpace( this.getReferenceSpaceType() );
|
|
133334
133679
|
|
|
133335
133680
|
}
|
|
@@ -135157,7 +135502,7 @@ void main() {
|
|
|
135157
135502
|
frameBufferTarget.scissorTest = this._scissorTest;
|
|
135158
135503
|
frameBufferTarget.multiview = outputRenderTarget !== null ? outputRenderTarget.multiview : false;
|
|
135159
135504
|
frameBufferTarget.resolveDepthBuffer = outputRenderTarget !== null ? outputRenderTarget.resolveDepthBuffer : true;
|
|
135160
|
-
frameBufferTarget.
|
|
135505
|
+
frameBufferTarget._autoAllocateDepthBuffer = outputRenderTarget !== null ? outputRenderTarget._autoAllocateDepthBuffer : false;
|
|
135161
135506
|
|
|
135162
135507
|
return frameBufferTarget;
|
|
135163
135508
|
|
|
@@ -138009,9 +138354,7 @@ void main() {
|
|
|
138009
138354
|
};
|
|
138010
138355
|
|
|
138011
138356
|
const interpolationModeMap = {
|
|
138012
|
-
'centroid': 'centroid'
|
|
138013
|
-
'flat first': 'flat',
|
|
138014
|
-
'flat either': 'flat'
|
|
138357
|
+
'centroid': 'centroid'
|
|
138015
138358
|
};
|
|
138016
138359
|
|
|
138017
138360
|
const defaultPrecisions = `
|
|
@@ -140174,6 +140517,10 @@ void main() {
|
|
|
140174
140517
|
|
|
140175
140518
|
type = gl.FLOAT;
|
|
140176
140519
|
|
|
140520
|
+
} else if ( typeof Float16Array !== 'undefined' && array instanceof Float16Array ) {
|
|
140521
|
+
|
|
140522
|
+
type = gl.HALF_FLOAT;
|
|
140523
|
+
|
|
140177
140524
|
} else if ( array instanceof Uint16Array ) {
|
|
140178
140525
|
|
|
140179
140526
|
if ( attribute.isFloat16BufferAttribute ) {
|
|
@@ -140709,7 +141056,7 @@ void main() {
|
|
|
140709
141056
|
break;
|
|
140710
141057
|
|
|
140711
141058
|
case MultiplyBlending:
|
|
140712
|
-
gl.blendFuncSeparate( gl.
|
|
141059
|
+
gl.blendFuncSeparate( gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA, gl.ZERO, gl.ONE );
|
|
140713
141060
|
break;
|
|
140714
141061
|
|
|
140715
141062
|
default:
|
|
@@ -140727,15 +141074,15 @@ void main() {
|
|
|
140727
141074
|
break;
|
|
140728
141075
|
|
|
140729
141076
|
case AdditiveBlending:
|
|
140730
|
-
gl.
|
|
141077
|
+
gl.blendFuncSeparate( gl.SRC_ALPHA, gl.ONE, gl.ONE, gl.ONE );
|
|
140731
141078
|
break;
|
|
140732
141079
|
|
|
140733
141080
|
case SubtractiveBlending:
|
|
140734
|
-
|
|
141081
|
+
console.error( 'THREE.WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true' );
|
|
140735
141082
|
break;
|
|
140736
141083
|
|
|
140737
141084
|
case MultiplyBlending:
|
|
140738
|
-
|
|
141085
|
+
console.error( 'THREE.WebGLState: MultiplyBlending requires material.premultipliedAlpha = true' );
|
|
140739
141086
|
break;
|
|
140740
141087
|
|
|
140741
141088
|
default:
|
|
@@ -142838,6 +143185,8 @@ void main() {
|
|
|
142838
143185
|
|
|
142839
143186
|
}
|
|
142840
143187
|
|
|
143188
|
+
gl.bindRenderbuffer( gl.RENDERBUFFER, null );
|
|
143189
|
+
|
|
142841
143190
|
}
|
|
142842
143191
|
|
|
142843
143192
|
/**
|
|
@@ -144078,13 +144427,13 @@ void main() {
|
|
|
144078
144427
|
|
|
144079
144428
|
// The multisample_render_to_texture extension doesn't work properly if there
|
|
144080
144429
|
// are midframe flushes and an external depth texture.
|
|
144081
|
-
if ( ( this.extensions.has( 'WEBGL_multisampled_render_to_texture' ) === true ) && renderTarget.
|
|
144430
|
+
if ( ( this.extensions.has( 'WEBGL_multisampled_render_to_texture' ) === true ) && renderTarget._autoAllocateDepthBuffer === true && renderTarget.multiview === false ) {
|
|
144082
144431
|
|
|
144083
144432
|
console.warn( 'THREE.WebGLBackend: Render-to-texture extension was disabled because an external texture was provided' );
|
|
144084
144433
|
|
|
144085
144434
|
}
|
|
144086
144435
|
|
|
144087
|
-
renderTarget.
|
|
144436
|
+
renderTarget._autoAllocateDepthBuffer = false;
|
|
144088
144437
|
|
|
144089
144438
|
}
|
|
144090
144439
|
|
|
@@ -144257,29 +144606,60 @@ void main() {
|
|
|
144257
144606
|
}
|
|
144258
144607
|
|
|
144259
144608
|
this._currentContext = previousContext;
|
|
144609
|
+
const renderTarget = renderContext.renderTarget;
|
|
144260
144610
|
|
|
144261
|
-
if ( renderContext.textures !== null &&
|
|
144262
|
-
|
|
144263
|
-
const renderTargetContextData = this.get( renderContext.renderTarget );
|
|
144611
|
+
if ( renderContext.textures !== null && renderTarget ) {
|
|
144264
144612
|
|
|
144265
|
-
const
|
|
144613
|
+
const renderTargetContextData = this.get( renderTarget );
|
|
144266
144614
|
|
|
144267
|
-
if ( samples > 0 && this._useMultisampledExtension(
|
|
144615
|
+
if ( renderTarget.samples > 0 && this._useMultisampledExtension( renderTarget ) === false ) {
|
|
144268
144616
|
|
|
144269
144617
|
const fb = renderTargetContextData.framebuffers[ renderContext.getCacheKey() ];
|
|
144270
144618
|
|
|
144271
|
-
|
|
144619
|
+
let mask = gl.COLOR_BUFFER_BIT;
|
|
144620
|
+
|
|
144621
|
+
if ( renderTarget.resolveDepthBuffer ) {
|
|
144622
|
+
|
|
144623
|
+
if ( renderTarget.depthBuffer ) mask |= gl.DEPTH_BUFFER_BIT;
|
|
144624
|
+
if ( renderTarget.stencilBuffer && renderTarget.resolveStencilBuffer ) mask |= gl.STENCIL_BUFFER_BIT;
|
|
144625
|
+
|
|
144626
|
+
}
|
|
144272
144627
|
|
|
144273
144628
|
const msaaFrameBuffer = renderTargetContextData.msaaFrameBuffer;
|
|
144629
|
+
const msaaRenderbuffers = renderTargetContextData.msaaRenderbuffers;
|
|
144274
144630
|
|
|
144275
144631
|
const textures = renderContext.textures;
|
|
144632
|
+
const isMRT = textures.length > 1;
|
|
144276
144633
|
|
|
144277
144634
|
state.bindFramebuffer( gl.READ_FRAMEBUFFER, msaaFrameBuffer );
|
|
144278
144635
|
state.bindFramebuffer( gl.DRAW_FRAMEBUFFER, fb );
|
|
144279
144636
|
|
|
144637
|
+
if ( isMRT ) {
|
|
144638
|
+
|
|
144639
|
+
// blitFramebuffer() can only copy/resolve the first color attachment of a framebuffer. When using MRT,
|
|
144640
|
+
// the engine temporarily removes all attachments and then configures each attachment for the resolve.
|
|
144641
|
+
|
|
144642
|
+
for ( let i = 0; i < textures.length; i ++ ) {
|
|
144643
|
+
|
|
144644
|
+
gl.framebufferRenderbuffer( gl.READ_FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + i, gl.RENDERBUFFER, null );
|
|
144645
|
+
gl.framebufferTexture2D( gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + i, gl.TEXTURE_2D, null, 0 );
|
|
144646
|
+
|
|
144647
|
+
}
|
|
144648
|
+
|
|
144649
|
+
}
|
|
144650
|
+
|
|
144280
144651
|
for ( let i = 0; i < textures.length; i ++ ) {
|
|
144281
144652
|
|
|
144282
|
-
|
|
144653
|
+
if ( isMRT ) {
|
|
144654
|
+
|
|
144655
|
+
// configure attachment for resolve
|
|
144656
|
+
|
|
144657
|
+
const { textureGPU } = this.get( textures[ i ] );
|
|
144658
|
+
|
|
144659
|
+
gl.framebufferRenderbuffer( gl.READ_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, msaaRenderbuffers[ i ] );
|
|
144660
|
+
gl.framebufferTexture2D( gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, textureGPU, 0 );
|
|
144661
|
+
|
|
144662
|
+
}
|
|
144283
144663
|
|
|
144284
144664
|
if ( renderContext.scissor ) {
|
|
144285
144665
|
|
|
@@ -144289,27 +144669,36 @@ void main() {
|
|
|
144289
144669
|
|
|
144290
144670
|
gl.blitFramebuffer( x, viewY, x + width, viewY + height, x, viewY, x + width, viewY + height, mask, gl.NEAREST );
|
|
144291
144671
|
|
|
144292
|
-
|
|
144672
|
+
} else {
|
|
144293
144673
|
|
|
144294
|
-
|
|
144674
|
+
gl.blitFramebuffer( 0, 0, renderContext.width, renderContext.height, 0, 0, renderContext.width, renderContext.height, mask, gl.NEAREST );
|
|
144295
144675
|
|
|
144296
|
-
|
|
144676
|
+
}
|
|
144297
144677
|
|
|
144298
|
-
|
|
144678
|
+
}
|
|
144299
144679
|
|
|
144300
|
-
|
|
144680
|
+
if ( isMRT ) {
|
|
144681
|
+
|
|
144682
|
+
// restore attachments
|
|
144301
144683
|
|
|
144302
|
-
|
|
144684
|
+
for ( let i = 0; i < textures.length; i ++ ) {
|
|
144303
144685
|
|
|
144304
|
-
|
|
144686
|
+
const { textureGPU } = this.get( textures[ i ] );
|
|
144305
144687
|
|
|
144306
|
-
|
|
144688
|
+
gl.framebufferRenderbuffer( gl.READ_FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + i, gl.RENDERBUFFER, msaaRenderbuffers[ i ] );
|
|
144689
|
+
gl.framebufferTexture2D( gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + i, gl.TEXTURE_2D, textureGPU, 0 );
|
|
144307
144690
|
|
|
144308
144691
|
}
|
|
144309
144692
|
|
|
144310
144693
|
}
|
|
144311
144694
|
|
|
144312
|
-
|
|
144695
|
+
if ( this._supportsInvalidateFramebuffer === true ) {
|
|
144696
|
+
|
|
144697
|
+
gl.invalidateFramebuffer( gl.READ_FRAMEBUFFER, renderTargetContextData.invalidationArray );
|
|
144698
|
+
|
|
144699
|
+
}
|
|
144700
|
+
|
|
144701
|
+
} else if ( renderTarget.resolveDepthBuffer === false && renderTargetContextData.framebuffers ) {
|
|
144313
144702
|
|
|
144314
144703
|
const fb = renderTargetContextData.framebuffers[ renderContext.getCacheKey() ];
|
|
144315
144704
|
state.bindFramebuffer( gl.DRAW_FRAMEBUFFER, fb );
|
|
@@ -144610,7 +144999,7 @@ void main() {
|
|
|
144610
144999
|
|
|
144611
145000
|
if ( vaoGPU === undefined ) {
|
|
144612
145001
|
|
|
144613
|
-
this._createVao( attributes );
|
|
145002
|
+
this.vaoCache[ vaoKey ] = this._createVao( attributes );
|
|
144614
145003
|
|
|
144615
145004
|
} else {
|
|
144616
145005
|
|
|
@@ -144646,7 +145035,7 @@ void main() {
|
|
|
144646
145035
|
|
|
144647
145036
|
const dualAttributeData = transformBuffers[ i ];
|
|
144648
145037
|
|
|
144649
|
-
if ( dualAttributeData.pbo ) {
|
|
145038
|
+
if ( dualAttributeData.pbo && this.has( dualAttributeData.pbo ) ) {
|
|
144650
145039
|
|
|
144651
145040
|
this.textureUtils.copyBufferToTexture( dualAttributeData.transformBuffer, dualAttributeData.pbo );
|
|
144652
145041
|
|
|
@@ -144728,28 +145117,23 @@ void main() {
|
|
|
144728
145117
|
|
|
144729
145118
|
// vertex state
|
|
144730
145119
|
|
|
144731
|
-
const
|
|
145120
|
+
const attributes = renderObject.getAttributes();
|
|
145121
|
+
const attributesData = this.get( attributes );
|
|
144732
145122
|
|
|
144733
|
-
let vaoGPU =
|
|
145123
|
+
let vaoGPU = attributesData.vaoGPU;
|
|
144734
145124
|
|
|
144735
|
-
if ( vaoGPU === undefined
|
|
145125
|
+
if ( vaoGPU === undefined ) {
|
|
144736
145126
|
|
|
144737
|
-
const vaoKey = this._getVaoKey(
|
|
145127
|
+
const vaoKey = this._getVaoKey( attributes );
|
|
144738
145128
|
|
|
144739
145129
|
vaoGPU = this.vaoCache[ vaoKey ];
|
|
144740
145130
|
|
|
144741
145131
|
if ( vaoGPU === undefined ) {
|
|
144742
145132
|
|
|
144743
|
-
|
|
144744
|
-
|
|
144745
|
-
( { vaoGPU, staticVao } = this._createVao( renderObject.getAttributes() ) );
|
|
144746
|
-
|
|
144747
|
-
if ( staticVao ) {
|
|
145133
|
+
vaoGPU = this._createVao( attributes );
|
|
144748
145134
|
|
|
144749
|
-
|
|
144750
|
-
|
|
144751
|
-
|
|
144752
|
-
}
|
|
145135
|
+
this.vaoCache[ vaoKey ] = vaoGPU;
|
|
145136
|
+
attributesData.vaoGPU = vaoGPU;
|
|
144753
145137
|
|
|
144754
145138
|
}
|
|
144755
145139
|
|
|
@@ -145716,7 +146100,7 @@ void main() {
|
|
|
145716
146100
|
const isRenderTarget3D = renderTarget.isRenderTarget3D === true;
|
|
145717
146101
|
const isRenderTargetArray = renderTarget.depth > 1;
|
|
145718
146102
|
const isXRRenderTarget = renderTarget.isXRRenderTarget === true;
|
|
145719
|
-
const
|
|
146103
|
+
const _hasExternalTextures = ( isXRRenderTarget === true && renderTarget._hasExternalTextures === true );
|
|
145720
146104
|
|
|
145721
146105
|
let msaaFb = renderTargetContextData.msaaFrameBuffer;
|
|
145722
146106
|
let depthRenderbuffer = renderTargetContextData.depthRenderbuffer;
|
|
@@ -145733,7 +146117,7 @@ void main() {
|
|
|
145733
146117
|
|
|
145734
146118
|
fb = renderTargetContextData.cubeFramebuffers[ cacheKey ];
|
|
145735
146119
|
|
|
145736
|
-
} else if ( isXRRenderTarget &&
|
|
146120
|
+
} else if ( isXRRenderTarget && _hasExternalTextures === false ) {
|
|
145737
146121
|
|
|
145738
146122
|
fb = this._xrFramebuffer;
|
|
145739
146123
|
|
|
@@ -145803,13 +146187,11 @@ void main() {
|
|
|
145803
146187
|
|
|
145804
146188
|
}
|
|
145805
146189
|
|
|
145806
|
-
state.drawBuffers( descriptor, fb );
|
|
145807
|
-
|
|
145808
146190
|
}
|
|
145809
146191
|
|
|
145810
146192
|
const depthStyle = stencilBuffer ? gl.DEPTH_STENCIL_ATTACHMENT : gl.DEPTH_ATTACHMENT;
|
|
145811
146193
|
|
|
145812
|
-
if ( renderTarget.
|
|
146194
|
+
if ( renderTarget._autoAllocateDepthBuffer === true ) {
|
|
145813
146195
|
|
|
145814
146196
|
const renderbuffer = gl.createRenderbuffer();
|
|
145815
146197
|
this.textureUtils.setupRenderBufferStorage( renderbuffer, descriptor, 0, useMultisampledRTT );
|
|
@@ -145834,7 +146216,7 @@ void main() {
|
|
|
145834
146216
|
|
|
145835
146217
|
multiviewExt.framebufferTextureMultisampleMultiviewOVR( gl.FRAMEBUFFER, depthStyle, textureData.textureGPU, 0, samples, 0, 2 );
|
|
145836
146218
|
|
|
145837
|
-
} else if (
|
|
146219
|
+
} else if ( _hasExternalTextures && useMultisampledRTT ) {
|
|
145838
146220
|
|
|
145839
146221
|
multisampledRTTExt.framebufferTexture2DMultisampleEXT( gl.FRAMEBUFFER, depthStyle, gl.TEXTURE_2D, textureData.textureGPU, 0, samples );
|
|
145840
146222
|
|
|
@@ -145885,7 +146267,7 @@ void main() {
|
|
|
145885
146267
|
|
|
145886
146268
|
// rebind external XR textures
|
|
145887
146269
|
|
|
145888
|
-
if ( isXRRenderTarget || useMultisampledRTT || renderTarget.multiview ) {
|
|
146270
|
+
if ( ( isXRRenderTarget || useMultisampledRTT || renderTarget.multiview ) && ( renderTarget._isOpaqueFramebuffer !== true ) ) {
|
|
145889
146271
|
|
|
145890
146272
|
state.bindFramebuffer( gl.FRAMEBUFFER, fb );
|
|
145891
146273
|
|
|
@@ -145911,7 +146293,7 @@ void main() {
|
|
|
145911
146293
|
|
|
145912
146294
|
const depthStyle = stencilBuffer ? gl.DEPTH_STENCIL_ATTACHMENT : gl.DEPTH_ATTACHMENT;
|
|
145913
146295
|
|
|
145914
|
-
if ( renderTarget.
|
|
146296
|
+
if ( renderTarget._autoAllocateDepthBuffer === true ) {
|
|
145915
146297
|
|
|
145916
146298
|
const renderbuffer = renderTargetContextData.xrDepthRenderbuffer;
|
|
145917
146299
|
gl.bindRenderbuffer( gl.RENDERBUFFER, renderbuffer );
|
|
@@ -145963,13 +146345,6 @@ void main() {
|
|
|
145963
146345
|
|
|
145964
146346
|
invalidationArray.push( gl.COLOR_ATTACHMENT0 + i );
|
|
145965
146347
|
|
|
145966
|
-
if ( depthBuffer ) {
|
|
145967
|
-
|
|
145968
|
-
const depthStyle = stencilBuffer ? gl.DEPTH_STENCIL_ATTACHMENT : gl.DEPTH_ATTACHMENT;
|
|
145969
|
-
invalidationArray.push( depthStyle );
|
|
145970
|
-
|
|
145971
|
-
}
|
|
145972
|
-
|
|
145973
146348
|
const texture = descriptor.textures[ i ];
|
|
145974
146349
|
const textureData = this.get( texture );
|
|
145975
146350
|
|
|
@@ -145979,10 +146354,12 @@ void main() {
|
|
|
145979
146354
|
|
|
145980
146355
|
}
|
|
145981
146356
|
|
|
146357
|
+
gl.bindRenderbuffer( gl.RENDERBUFFER, null );
|
|
146358
|
+
|
|
145982
146359
|
renderTargetContextData.msaaFrameBuffer = msaaFb;
|
|
145983
146360
|
renderTargetContextData.msaaRenderbuffers = msaaRenderbuffers;
|
|
145984
146361
|
|
|
145985
|
-
if ( depthRenderbuffer === undefined ) {
|
|
146362
|
+
if ( depthBuffer && depthRenderbuffer === undefined ) {
|
|
145986
146363
|
|
|
145987
146364
|
depthRenderbuffer = gl.createRenderbuffer();
|
|
145988
146365
|
this.textureUtils.setupRenderBufferStorage( depthRenderbuffer, descriptor, samples );
|
|
@@ -146006,6 +146383,8 @@ void main() {
|
|
|
146006
146383
|
|
|
146007
146384
|
}
|
|
146008
146385
|
|
|
146386
|
+
state.drawBuffers( descriptor, fb );
|
|
146387
|
+
|
|
146009
146388
|
}
|
|
146010
146389
|
|
|
146011
146390
|
state.bindFramebuffer( gl.FRAMEBUFFER, currentFrameBuffer );
|
|
@@ -146047,9 +146426,6 @@ void main() {
|
|
|
146047
146426
|
const { gl } = this;
|
|
146048
146427
|
|
|
146049
146428
|
const vaoGPU = gl.createVertexArray();
|
|
146050
|
-
let key = '';
|
|
146051
|
-
|
|
146052
|
-
let staticVao = true;
|
|
146053
146429
|
|
|
146054
146430
|
gl.bindVertexArray( vaoGPU );
|
|
146055
146431
|
|
|
@@ -146058,13 +146434,9 @@ void main() {
|
|
|
146058
146434
|
const attribute = attributes[ i ];
|
|
146059
146435
|
const attributeData = this.get( attribute );
|
|
146060
146436
|
|
|
146061
|
-
key += ':' + attributeData.id;
|
|
146062
|
-
|
|
146063
146437
|
gl.bindBuffer( gl.ARRAY_BUFFER, attributeData.bufferGPU );
|
|
146064
146438
|
gl.enableVertexAttribArray( i );
|
|
146065
146439
|
|
|
146066
|
-
if ( attribute.isStorageBufferAttribute || attribute.isStorageInstancedBufferAttribute ) staticVao = false;
|
|
146067
|
-
|
|
146068
146440
|
let stride, offset;
|
|
146069
146441
|
|
|
146070
146442
|
if ( attribute.isInterleavedBufferAttribute === true ) {
|
|
@@ -146103,9 +146475,7 @@ void main() {
|
|
|
146103
146475
|
|
|
146104
146476
|
gl.bindBuffer( gl.ARRAY_BUFFER, null );
|
|
146105
146477
|
|
|
146106
|
-
|
|
146107
|
-
|
|
146108
|
-
return { vaoGPU, staticVao };
|
|
146478
|
+
return vaoGPU;
|
|
146109
146479
|
|
|
146110
146480
|
}
|
|
146111
146481
|
|
|
@@ -146242,7 +146612,7 @@ void main() {
|
|
|
146242
146612
|
|
|
146243
146613
|
}
|
|
146244
146614
|
|
|
146245
|
-
return renderTarget.samples > 0 && this.extensions.has( 'WEBGL_multisampled_render_to_texture' ) === true && renderTarget.
|
|
146615
|
+
return renderTarget.samples > 0 && this.extensions.has( 'WEBGL_multisampled_render_to_texture' ) === true && renderTarget._autoAllocateDepthBuffer !== false;
|
|
146246
146616
|
|
|
146247
146617
|
}
|
|
146248
146618
|
|
|
@@ -146526,20 +146896,26 @@ void main() {
|
|
|
146526
146896
|
};
|
|
146527
146897
|
|
|
146528
146898
|
const GPUFeatureName = {
|
|
146899
|
+
CoreFeaturesAndLimits: 'core-features-and-limits',
|
|
146529
146900
|
DepthClipControl: 'depth-clip-control',
|
|
146530
146901
|
Depth32FloatStencil8: 'depth32float-stencil8',
|
|
146531
146902
|
TextureCompressionBC: 'texture-compression-bc',
|
|
146903
|
+
TextureCompressionBCSliced3D: 'texture-compression-bc-sliced-3d',
|
|
146532
146904
|
TextureCompressionETC2: 'texture-compression-etc2',
|
|
146533
146905
|
TextureCompressionASTC: 'texture-compression-astc',
|
|
146906
|
+
TextureCompressionASTCSliced3D: 'texture-compression-astc-sliced-3d',
|
|
146534
146907
|
TimestampQuery: 'timestamp-query',
|
|
146535
146908
|
IndirectFirstInstance: 'indirect-first-instance',
|
|
146536
146909
|
ShaderF16: 'shader-f16',
|
|
146537
146910
|
RG11B10UFloat: 'rg11b10ufloat-renderable',
|
|
146538
146911
|
BGRA8UNormStorage: 'bgra8unorm-storage',
|
|
146539
146912
|
Float32Filterable: 'float32-filterable',
|
|
146913
|
+
Float32Blendable: 'float32-blendable',
|
|
146540
146914
|
ClipDistances: 'clip-distances',
|
|
146541
146915
|
DualSourceBlending: 'dual-source-blending',
|
|
146542
|
-
Subgroups: 'subgroups'
|
|
146916
|
+
Subgroups: 'subgroups',
|
|
146917
|
+
TextureFormatsTier1: 'texture-formats-tier1',
|
|
146918
|
+
TextureFormatsTier2: 'texture-formats-tier2'
|
|
146543
146919
|
};
|
|
146544
146920
|
|
|
146545
146921
|
/**
|
|
@@ -148223,7 +148599,7 @@ fn main( @location( 0 ) vTex : vec2<f32> ) -> @location( 0 ) vec4<f32> {
|
|
|
148223
148599
|
|
|
148224
148600
|
let dimension;
|
|
148225
148601
|
|
|
148226
|
-
if ( texture.isData3DTexture ) {
|
|
148602
|
+
if ( texture.is3DTexture || texture.isData3DTexture ) {
|
|
148227
148603
|
|
|
148228
148604
|
dimension = GPUTextureDimension.ThreeD;
|
|
148229
148605
|
|
|
@@ -150497,24 +150873,29 @@ ${ flowData.code }
|
|
|
150497
150873
|
|
|
150498
150874
|
}
|
|
150499
150875
|
|
|
150500
|
-
} else if (
|
|
150876
|
+
} else if ( uniform.node.isStorageTextureNode === true ) {
|
|
150501
150877
|
|
|
150502
|
-
|
|
150878
|
+
const format = getFormat( texture );
|
|
150879
|
+
const access = this.getStorageAccess( uniform.node, shaderStage );
|
|
150503
150880
|
|
|
150504
|
-
|
|
150881
|
+
const is3D = uniform.node.value.is3DTexture;
|
|
150882
|
+
const isArrayTexture = uniform.node.value.isArrayTexture;
|
|
150505
150883
|
|
|
150506
|
-
|
|
150884
|
+
const dimension = is3D ? '3d' : `2d${ isArrayTexture ? '_array' : '' }`;
|
|
150507
150885
|
|
|
150508
|
-
|
|
150886
|
+
textureType = `texture_storage_${ dimension }<${ format }, ${ access }>`;
|
|
150509
150887
|
|
|
150510
|
-
|
|
150888
|
+
} else if ( texture.isArrayTexture === true || texture.isDataArrayTexture === true || texture.isCompressedArrayTexture === true ) {
|
|
150511
150889
|
|
|
150512
|
-
|
|
150890
|
+
textureType = 'texture_2d_array<f32>';
|
|
150513
150891
|
|
|
150514
|
-
|
|
150515
|
-
const access = this.getStorageAccess( uniform.node, shaderStage );
|
|
150892
|
+
} else if ( texture.is3DTexture === true || texture.isData3DTexture === true ) {
|
|
150516
150893
|
|
|
150517
|
-
textureType =
|
|
150894
|
+
textureType = 'texture_3d<f32>';
|
|
150895
|
+
|
|
150896
|
+
} else if ( texture.isVideoTexture === true ) {
|
|
150897
|
+
|
|
150898
|
+
textureType = 'texture_external';
|
|
150518
150899
|
|
|
150519
150900
|
} else {
|
|
150520
150901
|
|
|
@@ -151211,6 +151592,12 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
151211
151592
|
[ Float32Array, [ 'float32', ]],
|
|
151212
151593
|
] );
|
|
151213
151594
|
|
|
151595
|
+
if ( typeof Float16Array !== 'undefined' ) {
|
|
151596
|
+
|
|
151597
|
+
typedArraysToVertexFormatPrefix.set( Float16Array, [ 'float16' ] );
|
|
151598
|
+
|
|
151599
|
+
}
|
|
151600
|
+
|
|
151214
151601
|
const typedAttributeToVertexFormatPrefix = new Map( [
|
|
151215
151602
|
[ Float16BufferAttribute, [ 'float16', ]],
|
|
151216
151603
|
] );
|
|
@@ -151770,6 +152157,16 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
151770
152157
|
|
|
151771
152158
|
}
|
|
151772
152159
|
|
|
152160
|
+
if ( binding.texture.isArrayTexture ) {
|
|
152161
|
+
|
|
152162
|
+
storageTexture.viewDimension = GPUTextureViewDimension.TwoDArray;
|
|
152163
|
+
|
|
152164
|
+
} else if ( binding.texture.is3DTexture ) {
|
|
152165
|
+
|
|
152166
|
+
storageTexture.viewDimension = GPUTextureViewDimension.ThreeD;
|
|
152167
|
+
|
|
152168
|
+
}
|
|
152169
|
+
|
|
151773
152170
|
bindingGPU.storageTexture = storageTexture;
|
|
151774
152171
|
|
|
151775
152172
|
} else if ( binding.isSampledTexture ) {
|
|
@@ -152472,7 +152869,7 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
152472
152869
|
break;
|
|
152473
152870
|
|
|
152474
152871
|
case MultiplyBlending:
|
|
152475
|
-
setBlend( GPUBlendFactor.
|
|
152872
|
+
setBlend( GPUBlendFactor.Dst, GPUBlendFactor.OneMinusSrcAlpha, GPUBlendFactor.Zero, GPUBlendFactor.One );
|
|
152476
152873
|
break;
|
|
152477
152874
|
|
|
152478
152875
|
}
|
|
@@ -152486,15 +152883,15 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
152486
152883
|
break;
|
|
152487
152884
|
|
|
152488
152885
|
case AdditiveBlending:
|
|
152489
|
-
setBlend( GPUBlendFactor.SrcAlpha, GPUBlendFactor.One, GPUBlendFactor.
|
|
152886
|
+
setBlend( GPUBlendFactor.SrcAlpha, GPUBlendFactor.One, GPUBlendFactor.One, GPUBlendFactor.One );
|
|
152490
152887
|
break;
|
|
152491
152888
|
|
|
152492
152889
|
case SubtractiveBlending:
|
|
152493
|
-
|
|
152890
|
+
console.error( 'THREE.WebGPURenderer: SubtractiveBlending requires material.premultipliedAlpha = true' );
|
|
152494
152891
|
break;
|
|
152495
152892
|
|
|
152496
152893
|
case MultiplyBlending:
|
|
152497
|
-
|
|
152894
|
+
console.error( 'THREE.WebGPURenderer: MultiplyBlending requires material.premultipliedAlpha = true' );
|
|
152498
152895
|
break;
|
|
152499
152896
|
|
|
152500
152897
|
}
|
|
@@ -155232,7 +155629,15 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
155232
155629
|
*/
|
|
155233
155630
|
createIndexAttribute( attribute ) {
|
|
155234
155631
|
|
|
155235
|
-
|
|
155632
|
+
let usage = GPUBufferUsage.INDEX | GPUBufferUsage.COPY_SRC | GPUBufferUsage.COPY_DST;
|
|
155633
|
+
|
|
155634
|
+
if ( attribute.isStorageBufferAttribute || attribute.isStorageInstancedBufferAttribute ) {
|
|
155635
|
+
|
|
155636
|
+
usage |= GPUBufferUsage.STORAGE;
|
|
155637
|
+
|
|
155638
|
+
}
|
|
155639
|
+
|
|
155640
|
+
this.attributeUtils.createAttribute( attribute, usage );
|
|
155236
155641
|
|
|
155237
155642
|
}
|
|
155238
155643
|
|
|
@@ -155854,6 +156259,7 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
155854
156259
|
TSL.backgroundIntensity;
|
|
155855
156260
|
TSL.backgroundRotation;
|
|
155856
156261
|
TSL.batch;
|
|
156262
|
+
TSL.bentNormalView;
|
|
155857
156263
|
TSL.billboarding;
|
|
155858
156264
|
TSL.bitAnd;
|
|
155859
156265
|
TSL.bitNot;
|
|
@@ -156113,7 +156519,6 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
156113
156519
|
TSL.mx_worley_noise_float;
|
|
156114
156520
|
TSL.mx_worley_noise_vec2;
|
|
156115
156521
|
TSL.mx_worley_noise_vec3;
|
|
156116
|
-
TSL.namespace;
|
|
156117
156522
|
const negate = TSL.negate;
|
|
156118
156523
|
TSL.neutralToneMapping;
|
|
156119
156524
|
TSL.nodeArray;
|
|
@@ -156126,7 +156531,9 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
156126
156531
|
TSL.normalLocal;
|
|
156127
156532
|
TSL.normalMap;
|
|
156128
156533
|
TSL.normalView;
|
|
156534
|
+
TSL.normalViewGeometry;
|
|
156129
156535
|
TSL.normalWorld;
|
|
156536
|
+
TSL.normalWorldGeometry;
|
|
156130
156537
|
TSL.normalize;
|
|
156131
156538
|
TSL.not;
|
|
156132
156539
|
TSL.notEqual;
|
|
@@ -156172,7 +156579,7 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
156172
156579
|
TSL.pow2;
|
|
156173
156580
|
TSL.pow3;
|
|
156174
156581
|
TSL.pow4;
|
|
156175
|
-
TSL.
|
|
156582
|
+
TSL.premultiplyAlpha;
|
|
156176
156583
|
TSL.property;
|
|
156177
156584
|
TSL.radians;
|
|
156178
156585
|
TSL.rand;
|
|
@@ -156204,6 +156611,7 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
156204
156611
|
TSL.rtt;
|
|
156205
156612
|
TSL.sRGBTransferEOTF;
|
|
156206
156613
|
TSL.sRGBTransferOETF;
|
|
156614
|
+
TSL.sample;
|
|
156207
156615
|
TSL.sampler;
|
|
156208
156616
|
TSL.samplerComparison;
|
|
156209
156617
|
TSL.saturate;
|
|
@@ -156248,6 +156656,7 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
156248
156656
|
TSL.string;
|
|
156249
156657
|
TSL.struct;
|
|
156250
156658
|
TSL.sub;
|
|
156659
|
+
TSL.subBuild;
|
|
156251
156660
|
TSL.subgroupIndex;
|
|
156252
156661
|
TSL.subgroupSize;
|
|
156253
156662
|
TSL.tan;
|
|
@@ -156260,6 +156669,7 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
156260
156669
|
TSL.texture3D;
|
|
156261
156670
|
TSL.textureBarrier;
|
|
156262
156671
|
TSL.textureBicubic;
|
|
156672
|
+
TSL.textureBicubicLevel;
|
|
156263
156673
|
TSL.textureCubeUV;
|
|
156264
156674
|
TSL.textureLoad;
|
|
156265
156675
|
TSL.textureSize;
|
|
@@ -156275,14 +156685,9 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
156275
156685
|
TSL.transformDirection;
|
|
156276
156686
|
TSL.transformNormal;
|
|
156277
156687
|
TSL.transformNormalToView;
|
|
156278
|
-
TSL.transformedBentNormalView;
|
|
156279
|
-
TSL.transformedBitangentView;
|
|
156280
|
-
TSL.transformedBitangentWorld;
|
|
156281
156688
|
TSL.transformedClearcoatNormalView;
|
|
156282
156689
|
TSL.transformedNormalView;
|
|
156283
156690
|
TSL.transformedNormalWorld;
|
|
156284
|
-
TSL.transformedTangentView;
|
|
156285
|
-
TSL.transformedTangentWorld;
|
|
156286
156691
|
TSL.transmission;
|
|
156287
156692
|
TSL.transpose;
|
|
156288
156693
|
TSL.triNoise3D;
|
|
@@ -156297,7 +156702,7 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
156297
156702
|
TSL.uniformGroup;
|
|
156298
156703
|
TSL.uniformTexture;
|
|
156299
156704
|
TSL.uniforms;
|
|
156300
|
-
TSL.
|
|
156705
|
+
TSL.unpremultiplyAlpha;
|
|
156301
156706
|
TSL.userData;
|
|
156302
156707
|
TSL.uv;
|
|
156303
156708
|
TSL.uvec2;
|
|
@@ -158454,19 +158859,17 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
158454
158859
|
i = 0;
|
|
158455
158860
|
}
|
|
158456
158861
|
_regeneratorDefine = function (e, r, n, t) {
|
|
158457
|
-
|
|
158862
|
+
function o(r, n) {
|
|
158863
|
+
_regeneratorDefine(e, r, function (e) {
|
|
158864
|
+
return this._invoke(r, n, e);
|
|
158865
|
+
});
|
|
158866
|
+
}
|
|
158867
|
+
r ? i ? i(e, r, {
|
|
158458
158868
|
value: n,
|
|
158459
158869
|
enumerable: !t,
|
|
158460
158870
|
configurable: !t,
|
|
158461
158871
|
writable: !t
|
|
158462
|
-
}) : e[r] = n;
|
|
158463
|
-
function o(r, n) {
|
|
158464
|
-
_regeneratorDefine(e, r, function (e) {
|
|
158465
|
-
return this._invoke(r, n, e);
|
|
158466
|
-
});
|
|
158467
|
-
}
|
|
158468
|
-
o("next", 0), o("throw", 1), o("return", 2);
|
|
158469
|
-
}
|
|
158872
|
+
}) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
|
|
158470
158873
|
}, _regeneratorDefine(e, r, n, t);
|
|
158471
158874
|
}
|
|
158472
158875
|
function _setPrototypeOf$1(t, e) {
|
|
@@ -159268,12 +159671,18 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
159268
159671
|
arcStartLng: {
|
|
159269
159672
|
"default": 'startLng'
|
|
159270
159673
|
},
|
|
159674
|
+
arcStartAltitude: {
|
|
159675
|
+
"default": 0
|
|
159676
|
+
},
|
|
159271
159677
|
arcEndLat: {
|
|
159272
159678
|
"default": 'endLat'
|
|
159273
159679
|
},
|
|
159274
159680
|
arcEndLng: {
|
|
159275
159681
|
"default": 'endLng'
|
|
159276
159682
|
},
|
|
159683
|
+
arcEndAltitude: {
|
|
159684
|
+
"default": 0
|
|
159685
|
+
},
|
|
159277
159686
|
arcColor: {
|
|
159278
159687
|
"default": function _default() {
|
|
159279
159688
|
return '#ffffaa';
|
|
@@ -159378,8 +159787,10 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
159378
159787
|
// Data accessors
|
|
159379
159788
|
var startLatAccessor = index$2(state.arcStartLat);
|
|
159380
159789
|
var startLngAccessor = index$2(state.arcStartLng);
|
|
159790
|
+
var startAltAccessor = index$2(state.arcStartAltitude);
|
|
159381
159791
|
var endLatAccessor = index$2(state.arcEndLat);
|
|
159382
159792
|
var endLngAccessor = index$2(state.arcEndLng);
|
|
159793
|
+
var endAltAccessor = index$2(state.arcEndAltitude);
|
|
159383
159794
|
var altitudeAccessor = index$2(state.arcAltitude);
|
|
159384
159795
|
var altitudeAutoScaleAccessor = index$2(state.arcAltitudeAutoScale);
|
|
159385
159796
|
var strokeAccessor = index$2(state.arcStroke);
|
|
@@ -159455,8 +159866,10 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
159455
159866
|
altAutoScale: +altitudeAutoScaleAccessor(arc),
|
|
159456
159867
|
startLat: +startLatAccessor(arc),
|
|
159457
159868
|
startLng: +startLngAccessor(arc),
|
|
159869
|
+
startAlt: +startAltAccessor(arc),
|
|
159458
159870
|
endLat: +endLatAccessor(arc),
|
|
159459
|
-
endLng: +endLngAccessor(arc)
|
|
159871
|
+
endLng: +endLngAccessor(arc),
|
|
159872
|
+
endAlt: +endAltAccessor(arc)
|
|
159460
159873
|
};
|
|
159461
159874
|
var currentTargetD = group.__currentTargetD || Object.assign({}, targetD, {
|
|
159462
159875
|
altAutoScale: -1e-3
|
|
@@ -159481,8 +159894,10 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
159481
159894
|
altAutoScale = _ref4.altAutoScale,
|
|
159482
159895
|
startLat = _ref4.startLat,
|
|
159483
159896
|
startLng = _ref4.startLng,
|
|
159897
|
+
startAlt = _ref4.startAlt,
|
|
159484
159898
|
endLat = _ref4.endLat,
|
|
159485
|
-
endLng = _ref4.endLng
|
|
159899
|
+
endLng = _ref4.endLng,
|
|
159900
|
+
endAlt = _ref4.endAlt;
|
|
159486
159901
|
var getVec = function getVec(_ref5) {
|
|
159487
159902
|
var _ref6 = _slicedToArray$2(_ref5, 3),
|
|
159488
159903
|
lng = _ref6[0],
|
|
@@ -159501,20 +159916,19 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
159501
159916
|
var altitude = alt;
|
|
159502
159917
|
(altitude === null || altitude === undefined) && (
|
|
159503
159918
|
// by default set altitude proportional to the great-arc distance
|
|
159504
|
-
altitude = geoDistance$1(startPnt, endPnt) / 2 * altAutoScale);
|
|
159505
|
-
if (altitude) {
|
|
159919
|
+
altitude = geoDistance$1(startPnt, endPnt) / 2 * altAutoScale + Math.max(startAlt, endAlt));
|
|
159920
|
+
if (altitude || startAlt || endAlt) {
|
|
159506
159921
|
var interpolate = geoInterpolate(startPnt, endPnt);
|
|
159922
|
+
var calcAltCp = function calcAltCp(a0, a1) {
|
|
159923
|
+
return a1 + (a1 - a0) * (a0 < a1 ? 0.5 : 0.25);
|
|
159924
|
+
};
|
|
159507
159925
|
var _map = [0.25, 0.75].map(function (t) {
|
|
159508
|
-
return [].concat(_toConsumableArray$1(interpolate(t)), [
|
|
159926
|
+
return [].concat(_toConsumableArray$1(interpolate(t)), [calcAltCp(t < 0.5 ? startAlt : endAlt, altitude)]);
|
|
159509
159927
|
}),
|
|
159510
159928
|
_map2 = _slicedToArray$2(_map, 2),
|
|
159511
159929
|
m1Pnt = _map2[0],
|
|
159512
159930
|
m2Pnt = _map2[1];
|
|
159513
|
-
var curve = _construct$1(THREE$e.CubicBezierCurve3, _toConsumableArray$1([startPnt, m1Pnt, m2Pnt, endPnt].map(getVec)));
|
|
159514
|
-
|
|
159515
|
-
//const mPnt = [...interpolate(0.5), altitude * 2];
|
|
159516
|
-
//curve = new THREE.QuadraticBezierCurve3(...[startPnt, mPnt, endPnt].map(getVec));
|
|
159517
|
-
|
|
159931
|
+
var curve = _construct$1(THREE$e.CubicBezierCurve3, _toConsumableArray$1([[].concat(startPnt, [startAlt]), m1Pnt, m2Pnt, [].concat(endPnt, [endAlt])].map(getVec)));
|
|
159518
159932
|
return curve;
|
|
159519
159933
|
} else {
|
|
159520
159934
|
// ground line
|
|
@@ -162055,7 +162469,7 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
162055
162469
|
return _defineProperty$2({}, p, bindPointsLayer.linkProp(p));
|
|
162056
162470
|
})));
|
|
162057
162471
|
var bindArcsLayer = linkKapsule$1('arcsLayer', ArcsLayerKapsule);
|
|
162058
|
-
var linkedArcsLayerProps = Object.assign.apply(Object, _toConsumableArray$1(['arcsData', 'arcStartLat', 'arcStartLng', 'arcEndLat', 'arcEndLng', 'arcColor', 'arcAltitude', 'arcAltitudeAutoScale', 'arcStroke', 'arcCurveResolution', 'arcCircularResolution', 'arcDashLength', 'arcDashGap', 'arcDashInitialGap', 'arcDashAnimateTime', 'arcsTransitionDuration'].map(function (p) {
|
|
162472
|
+
var linkedArcsLayerProps = Object.assign.apply(Object, _toConsumableArray$1(['arcsData', 'arcStartLat', 'arcStartLng', 'arcStartAltitude', 'arcEndLat', 'arcEndLng', 'arcEndAltitude', 'arcColor', 'arcAltitude', 'arcAltitudeAutoScale', 'arcStroke', 'arcCurveResolution', 'arcCircularResolution', 'arcDashLength', 'arcDashGap', 'arcDashInitialGap', 'arcDashAnimateTime', 'arcsTransitionDuration'].map(function (p) {
|
|
162059
162473
|
return _defineProperty$2({}, p, bindArcsLayer.linkProp(p));
|
|
162060
162474
|
})));
|
|
162061
162475
|
var bindHexBinLayer = linkKapsule$1('hexBinLayer', HexBinLayerKapsule);
|
|
@@ -168875,7 +169289,7 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
168875
169289
|
return [event.pageX, event.pageY];
|
|
168876
169290
|
}
|
|
168877
169291
|
|
|
168878
|
-
var n,l,u,t,i,r,o,e,f,c,s,a,p={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,w=Array.isArray;function d(n,l){for(var u in l)n[u]=l[u];return n}function g(n){n&&n.parentNode&&n.parentNode.removeChild(n);}function _(l,u,t){var i,r,o,e={};for(o in u)"key"==o?i=u[o]:"ref"==o?r=u[o]:e[o]=u[o];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps) void 0===e[o]&&(e[o]=l.defaultProps[o]);return m(l,e,i,r,null)}function m(n,t,i,r,o){var e={type:n,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++u:o,__i:-1,__u:0};return null==o&&null!=l.vnode&&l.vnode(e),e}function k(n){return n.children}function x(n,l){this.props=n,this.context=l;}function S(n,l){if(null==l)return n.__?S(n.__,n.__i+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?S(n):null}function C(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return C(n)}}function M(n){(!n.__d&&(n.__d=true)&&i.push(n)&&!$.__r++||r!=l.debounceRendering)&&((r=l.debounceRendering)||o)($);}function $(){for(var n,u,t,r,o,f,c,s=1;i.length;)i.length>s&&i.sort(e),n=i.shift(),s=i.length,n.__d&&(t=void 0,o=(r=(u=n).__v).__e,f=[],c=[],u.__P&&((t=d({},r)).__v=r.__v+1,l.vnode&&l.vnode(t),O(u.__P,t,r,u.__n,u.__P.namespaceURI,32&r.__u?[o]:null,f,null==o?S(r):o,!!(32&r.__u),c),t.__v=r.__v,t.__.__k[t.__i]=t,z(f,t,c),t.__e!=o&&C(t)));$.__r=0;}function I(n,l,u,t,i,r,o,e,f,c,s){var a,h,y,w,d,g,_=t&&t.__k||v,m=l.length;for(f=P(u,l,_,f,m),a=0;a<m;a++)null!=(y=u.__k[a])&&(h=-1==y.__i?p:_[y.__i]||p,y.__i=a,g=O(n,y,h,i,r,o,e,f,c,s),w=y.__e,y.ref&&h.ref!=y.ref&&(h.ref&&q(h.ref,null,y),s.push(y.ref,y.__c||w,y)),null==d&&null!=w&&(d=w),4&y.__u||h.__k===y.__k?f=A(y,f,n):"function"==typeof y.type&&void 0!==g?f=g:w&&(f=w.nextSibling),y.__u&=-7);return u.__e=d,f}function P(n,l,u,t,i){var r,o,e,f,c,s=u.length,a=s,h=0;for(n.__k=new Array(i),r=0;r<i;r++)null!=(o=l[r])&&"boolean"!=typeof o&&"function"!=typeof o?(f=r+h,(o=n.__k[r]="string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?m(null,o,null,null,null):w(o)?m(k,{children:o},null,null,null):null==o.constructor&&o.__b>0?m(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=n,o.__b=n.__b+1,e=null,-1!=(c=o.__i=L(o,u,f,a))&&(a--,(e=u[c])&&(e.__u|=2)),null==e||null==e.__v?(-1==c&&(i>s?h--:i<s&&h++),"function"!=typeof o.type&&(o.__u|=4)):c!=f&&(c==f-1?h--:c==f+1?h++:(c>f?h--:h++,o.__u|=4))):n.__k[r]=null;if(a)for(r=0;r<s;r++)null!=(e=u[r])&&0==(2&e.__u)&&(e.__e==t&&(t=S(e)),B(e,e));return t}function A(n,l,u){var t,i;if("function"==typeof n.type){for(t=n.__k,i=0;t&&i<t.length;i++)t[i]&&(t[i].__=n,l=A(t[i],l,u));return l}n.__e!=l&&(l&&n.type&&!u.contains(l)&&(l=S(n)),u.insertBefore(n.__e,l||null),l=n.__e);do{l=l&&l.nextSibling;}while(null!=l&&8==l.nodeType);return l}function L(n,l,u,t){var i,r,o=n.key,e=n.type,f=l[u];if(null===f&&null==n.key||f&&o==f.key&&e==f.type&&0==(2&f.__u))return u;if(t>(null!=f&&0==(2&f.__u)?1:0))for(i=u-1,r=u+1;i>=0||r<l.length;){if(i>=0){if((f=l[i])&&0==(2&f.__u)&&o==f.key&&e==f.type)return i;i--;}if(r<l.length){if((f=l[r])&&0==(2&f.__u)&&o==f.key&&e==f.type)return r;r++;}}return -1}function T(n,l,u){"-"==l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||y.test(l)?u:u+"px";}function j(n,l,u,t,i){var r,o;n:if("style"==l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||T(n.style,l,"");if(u)for(l in u)t&&u[l]==t[l]||T(n.style,l,u[l]);}else if("o"==l[0]&&"n"==l[1])r=l!=(l=l.replace(f,"$1")),o=l.toLowerCase(),l=o in n||"onFocusOut"==l||"onFocusIn"==l?o.slice(2):l.slice(2),n.l||(n.l={}),n.l[l+r]=u,u?t?u.u=t.u:(u.u=c,n.addEventListener(l,r?a:s,r)):n.removeEventListener(l,r?a:s,r);else {if("http://www.w3.org/2000/svg"==i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&"popover"!=l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||false===u&&"-"!=l[4]?n.removeAttribute(l):n.setAttribute(l,"popover"==l&&1==u?"":u));}}function F(n){return function(u){if(this.l){var t=this.l[u.type+n];if(null==u.t)u.t=c++;else if(u.t<t.u)return;return t(l.event?l.event(u):u)}}}function O(n,u,t,i,r,o,e,f,c,s){var a,h,p,v,y,_,m,b,S,C,M,$,P,A,H,L,T,j=u.type;if(null!=u.constructor)return null;128&t.__u&&(c=!!(32&t.__u),o=[f=u.__e=t.__e]),(a=l.__b)&&a(u);n:if("function"==typeof j)try{if(b=u.props,S="prototype"in j&&j.prototype.render,C=(a=j.contextType)&&i[a.__c],M=a?C?C.props.value:a.__:i,t.__c?m=(h=u.__c=t.__c).__=h.__E:(S?u.__c=h=new j(b,M):(u.__c=h=new x(b,M),h.constructor=j,h.render=D),C&&C.sub(h),h.props=b,h.state||(h.state={}),h.context=M,h.__n=i,p=h.__d=!0,h.__h=[],h._sb=[]),S&&null==h.__s&&(h.__s=h.state),S&&null!=j.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=d({},h.__s)),d(h.__s,j.getDerivedStateFromProps(b,h.__s))),v=h.props,y=h.state,h.__v=u,p)S&&null==j.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),S&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else {if(S&&null==j.getDerivedStateFromProps&&b!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(b,M),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(b,h.__s,M)||u.__v==t.__v){for(u.__v!=t.__v&&(h.props=b,h.state=h.__s,h.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.some(function(n){n&&(n.__=u);}),$=0;$<h._sb.length;$++)h.__h.push(h._sb[$]);h._sb=[],h.__h.length&&e.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(b,h.__s,M),S&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(v,y,_);});}if(h.context=M,h.props=b,h.__P=n,h.__e=!1,P=l.__r,A=0,S){for(h.state=h.__s,h.__d=!1,P&&P(u),a=h.render(h.props,h.state,h.context),H=0;H<h._sb.length;H++)h.__h.push(h._sb[H]);h._sb=[];}else do{h.__d=!1,P&&P(u),a=h.render(h.props,h.state,h.context),h.state=h.__s;}while(h.__d&&++A<25);h.state=h.__s,null!=h.getChildContext&&(i=d(d({},i),h.getChildContext())),S&&!p&&null!=h.getSnapshotBeforeUpdate&&(_=h.getSnapshotBeforeUpdate(v,y)),L=a,null!=a&&a.type===k&&null==a.key&&(L=N(a.props.children)),f=I(n,w(L)?L:[L],u,t,i,r,o,e,f,c,s),h.base=u.__e,u.__u&=-161,h.__h.length&&e.push(h),m&&(h.__E=h.__=null);}catch(n){if(u.__v=null,c||null!=o)if(n.then){for(u.__u|=c?160:128;f&&8==f.nodeType&&f.nextSibling;)f=f.nextSibling;o[o.indexOf(f)]=null,u.__e=f;}else for(T=o.length;T--;)g(o[T]);else u.__e=t.__e,u.__k=t.__k;l.__e(n,u,t);}else null==o&&u.__v==t.__v?(u.__k=t.__k,u.__e=t.__e):f=u.__e=V(t.__e,u,t,i,r,o,e,c,s);return (a=l.diffed)&&a(u),128&u.__u?void 0:f}function z(n,u,t){for(var i=0;i<t.length;i++)q(t[i],t[++i],t[++i]);l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l.__e(n,u.__v);}});}function N(n){return "object"!=typeof n||null==n||n.__b&&n.__b>0?n:w(n)?n.map(N):d({},n)}function V(u,t,i,r,o,e,f,c,s){var a,h,v,y,d,_,m,b=i.props,k=t.props,x=t.type;if("svg"==x?o="http://www.w3.org/2000/svg":"math"==x?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=e)for(a=0;a<e.length;a++)if((d=e[a])&&"setAttribute"in d==!!x&&(x?d.localName==x:3==d.nodeType)){u=d,e[a]=null;break}if(null==u){if(null==x)return document.createTextNode(k);u=document.createElementNS(o,x,k.is&&k),c&&(l.__m&&l.__m(t,e),c=false),e=null;}if(null==x)b===k||c&&u.data==k||(u.data=k);else {if(e=e&&n.call(u.childNodes),b=i.props||p,!c&&null!=e)for(b={},a=0;a<u.attributes.length;a++)b[(d=u.attributes[a]).name]=d.value;for(a in b)if(d=b[a],"children"==a);else if("dangerouslySetInnerHTML"==a)v=d;else if(!(a in k)){if("value"==a&&"defaultValue"in k||"checked"==a&&"defaultChecked"in k)continue;j(u,a,null,d,o);}for(a in k)d=k[a],"children"==a?y=d:"dangerouslySetInnerHTML"==a?h=d:"value"==a?_=d:"checked"==a?m=d:c&&"function"!=typeof d||b[a]===d||j(u,a,d,b[a],o);if(h)c||v&&(h.__html==v.__html||h.__html==u.innerHTML)||(u.innerHTML=h.__html),t.__k=[];else if(v&&(u.innerHTML=""),I("template"==t.type?u.content:u,w(y)?y:[y],t,i,r,"foreignObject"==x?"http://www.w3.org/1999/xhtml":o,e,f,e?e[0]:i.__k&&S(i,0),c,s),null!=e)for(a=e.length;a--;)g(e[a]);c||(a="value","progress"==x&&null==_?u.removeAttribute("value"):null!=_&&(_!==u[a]||"progress"==x&&!_||"option"==x&&_!=b[a])&&j(u,a,_,b[a],o),a="checked",null!=m&&m!=u[a]&&j(u,a,m,b[a],o));}return u}function q(n,u,t){try{if("function"==typeof n){var i="function"==typeof n.__u;i&&n.__u(),i&&null==u||(n.__u=n(u));}else n.current=u;}catch(n){l.__e(n,t);}}function B(n,u,t){var i,r;if(l.unmount&&l.unmount(n),(i=n.ref)&&(i.current&&i.current!=n.__e||q(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount();}catch(n){l.__e(n,u);}i.base=i.__P=null;}if(i=n.__k)for(r=0;r<i.length;r++)i[r]&&B(i[r],u,t||"function"!=typeof n.type);t||g(n.__e),n.__c=n.__=n.__e=void 0;}function D(n,l,u){return this.constructor(n,u)}function E(u,t,i){var r,o,e,f;t==document&&(t=document.documentElement),l.__&&l.__(u,t),o=(r="function"=="undefined")?null:t.__k,e=[],f=[],O(t,u=(t).__k=_(k,null,[u]),o||p,p,t.namespaceURI,o?null:t.firstChild?n.call(t.childNodes):null,e,o?o.__e:t.firstChild,r,f),z(e,u,f);}function J(l,u,t){var i,r,o,e,f=d({},l.props);for(o in l.type&&l.type.defaultProps&&(e=l.type.defaultProps),u)"key"==o?i=u[o]:"ref"==o?r=u[o]:f[o]=void 0===u[o]&&null!=e?e[o]:u[o];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),m(l.type,f,i||l.key,r||l.ref,null)}n=v.slice,l={__e:function(n,l,u,t){for(var i,r,o;l=l.__;)if((i=l.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(n)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),o=i.__d),o)return i.__E=i}catch(l){n=l;}throw n}},u=0,t=function(n){return null!=n&&null==n.constructor},x.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=d({},this.state),"function"==typeof n&&(n=n(d({},u),this.props)),n&&d(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this));},x.prototype.forceUpdate=function(n){this.__v&&(this.__e=true,n&&this.__h.push(n),M(this));},x.prototype.render=k,i=[],o="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e=function(n,l){return n.__v.__b-l.__v.__b},$.__r=0,f=/(PointerCapture)$|Capture$/i,c=0,s=F(false),a=F(true);
|
|
169292
|
+
var n,l,u,t,i,r,o,e,f,c,s,a,p={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,w=Array.isArray;function d(n,l){for(var u in l)n[u]=l[u];return n}function g(n){n&&n.parentNode&&n.parentNode.removeChild(n);}function _(l,u,t){var i,r,o,e={};for(o in u)"key"==o?i=u[o]:"ref"==o?r=u[o]:e[o]=u[o];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps) void 0===e[o]&&(e[o]=l.defaultProps[o]);return m(l,e,i,r,null)}function m(n,t,i,r,o){var e={type:n,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++u:o,__i:-1,__u:0};return null==o&&null!=l.vnode&&l.vnode(e),e}function k(n){return n.children}function x(n,l){this.props=n,this.context=l;}function S(n,l){if(null==l)return n.__?S(n.__,n.__i+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?S(n):null}function C(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return C(n)}}function M(n){(!n.__d&&(n.__d=true)&&i.push(n)&&!$.__r++||r!=l.debounceRendering)&&((r=l.debounceRendering)||o)($);}function $(){for(var n,u,t,r,o,f,c,s=1;i.length;)i.length>s&&i.sort(e),n=i.shift(),s=i.length,n.__d&&(t=void 0,o=(r=(u=n).__v).__e,f=[],c=[],u.__P&&((t=d({},r)).__v=r.__v+1,l.vnode&&l.vnode(t),O(u.__P,t,r,u.__n,u.__P.namespaceURI,32&r.__u?[o]:null,f,null==o?S(r):o,!!(32&r.__u),c),t.__v=r.__v,t.__.__k[t.__i]=t,N(f,t,c),t.__e!=o&&C(t)));$.__r=0;}function I(n,l,u,t,i,r,o,e,f,c,s){var a,h,y,w,d,g,_=t&&t.__k||v,m=l.length;for(f=P(u,l,_,f,m),a=0;a<m;a++)null!=(y=u.__k[a])&&(h=-1==y.__i?p:_[y.__i]||p,y.__i=a,g=O(n,y,h,i,r,o,e,f,c,s),w=y.__e,y.ref&&h.ref!=y.ref&&(h.ref&&B(h.ref,null,y),s.push(y.ref,y.__c||w,y)),null==d&&null!=w&&(d=w),4&y.__u||h.__k===y.__k?f=A(y,f,n):"function"==typeof y.type&&void 0!==g?f=g:w&&(f=w.nextSibling),y.__u&=-7);return u.__e=d,f}function P(n,l,u,t,i){var r,o,e,f,c,s=u.length,a=s,h=0;for(n.__k=new Array(i),r=0;r<i;r++)null!=(o=l[r])&&"boolean"!=typeof o&&"function"!=typeof o?(f=r+h,(o=n.__k[r]="string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?m(null,o,null,null,null):w(o)?m(k,{children:o},null,null,null):null==o.constructor&&o.__b>0?m(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=n,o.__b=n.__b+1,e=null,-1!=(c=o.__i=L(o,u,f,a))&&(a--,(e=u[c])&&(e.__u|=2)),null==e||null==e.__v?(-1==c&&(i>s?h--:i<s&&h++),"function"!=typeof o.type&&(o.__u|=4)):c!=f&&(c==f-1?h--:c==f+1?h++:(c>f?h--:h++,o.__u|=4))):n.__k[r]=null;if(a)for(r=0;r<s;r++)null!=(e=u[r])&&0==(2&e.__u)&&(e.__e==t&&(t=S(e)),D(e,e));return t}function A(n,l,u){var t,i;if("function"==typeof n.type){for(t=n.__k,i=0;t&&i<t.length;i++)t[i]&&(t[i].__=n,l=A(t[i],l,u));return l}n.__e!=l&&(l&&n.type&&!u.contains(l)&&(l=S(n)),u.insertBefore(n.__e,l||null),l=n.__e);do{l=l&&l.nextSibling;}while(null!=l&&8==l.nodeType);return l}function L(n,l,u,t){var i,r,o,e=n.key,f=n.type,c=l[u],s=null!=c&&0==(2&c.__u);if(null===c&&null==n.key||s&&e==c.key&&f==c.type)return u;if(t>(s?1:0))for(i=u-1,r=u+1;i>=0||r<l.length;)if(null!=(c=l[o=i>=0?i--:r++])&&0==(2&c.__u)&&e==c.key&&f==c.type)return o;return -1}function T(n,l,u){"-"==l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||y.test(l)?u:u+"px";}function j(n,l,u,t,i){var r,o;n:if("style"==l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||T(n.style,l,"");if(u)for(l in u)t&&u[l]==t[l]||T(n.style,l,u[l]);}else if("o"==l[0]&&"n"==l[1])r=l!=(l=l.replace(f,"$1")),o=l.toLowerCase(),l=o in n||"onFocusOut"==l||"onFocusIn"==l?o.slice(2):l.slice(2),n.l||(n.l={}),n.l[l+r]=u,u?t?u.u=t.u:(u.u=c,n.addEventListener(l,r?a:s,r)):n.removeEventListener(l,r?a:s,r);else {if("http://www.w3.org/2000/svg"==i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&"popover"!=l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||false===u&&"-"!=l[4]?n.removeAttribute(l):n.setAttribute(l,"popover"==l&&1==u?"":u));}}function F(n){return function(u){if(this.l){var t=this.l[u.type+n];if(null==u.t)u.t=c++;else if(u.t<t.u)return;return t(l.event?l.event(u):u)}}}function O(n,u,t,i,r,o,e,f,c,s){var a,h,p,v,y,_,m,b,S,C,M,$,P,A,H,L,T,j=u.type;if(null!=u.constructor)return null;128&t.__u&&(c=!!(32&t.__u),o=[f=u.__e=t.__e]),(a=l.__b)&&a(u);n:if("function"==typeof j)try{if(b=u.props,S="prototype"in j&&j.prototype.render,C=(a=j.contextType)&&i[a.__c],M=a?C?C.props.value:a.__:i,t.__c?m=(h=u.__c=t.__c).__=h.__E:(S?u.__c=h=new j(b,M):(u.__c=h=new x(b,M),h.constructor=j,h.render=E),C&&C.sub(h),h.props=b,h.state||(h.state={}),h.context=M,h.__n=i,p=h.__d=!0,h.__h=[],h._sb=[]),S&&null==h.__s&&(h.__s=h.state),S&&null!=j.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=d({},h.__s)),d(h.__s,j.getDerivedStateFromProps(b,h.__s))),v=h.props,y=h.state,h.__v=u,p)S&&null==j.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),S&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else {if(S&&null==j.getDerivedStateFromProps&&b!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(b,M),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(b,h.__s,M)||u.__v==t.__v){for(u.__v!=t.__v&&(h.props=b,h.state=h.__s,h.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.some(function(n){n&&(n.__=u);}),$=0;$<h._sb.length;$++)h.__h.push(h._sb[$]);h._sb=[],h.__h.length&&e.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(b,h.__s,M),S&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(v,y,_);});}if(h.context=M,h.props=b,h.__P=n,h.__e=!1,P=l.__r,A=0,S){for(h.state=h.__s,h.__d=!1,P&&P(u),a=h.render(h.props,h.state,h.context),H=0;H<h._sb.length;H++)h.__h.push(h._sb[H]);h._sb=[];}else do{h.__d=!1,P&&P(u),a=h.render(h.props,h.state,h.context),h.state=h.__s;}while(h.__d&&++A<25);h.state=h.__s,null!=h.getChildContext&&(i=d(d({},i),h.getChildContext())),S&&!p&&null!=h.getSnapshotBeforeUpdate&&(_=h.getSnapshotBeforeUpdate(v,y)),L=a,null!=a&&a.type===k&&null==a.key&&(L=V(a.props.children)),f=I(n,w(L)?L:[L],u,t,i,r,o,e,f,c,s),h.base=u.__e,u.__u&=-161,h.__h.length&&e.push(h),m&&(h.__E=h.__=null);}catch(n){if(u.__v=null,c||null!=o)if(n.then){for(u.__u|=c?160:128;f&&8==f.nodeType&&f.nextSibling;)f=f.nextSibling;o[o.indexOf(f)]=null,u.__e=f;}else {for(T=o.length;T--;)g(o[T]);z(u);}else u.__e=t.__e,u.__k=t.__k,n.then||z(u);l.__e(n,u,t);}else null==o&&u.__v==t.__v?(u.__k=t.__k,u.__e=t.__e):f=u.__e=q(t.__e,u,t,i,r,o,e,c,s);return (a=l.diffed)&&a(u),128&u.__u?void 0:f}function z(n){n&&n.__c&&(n.__c.__e=true),n&&n.__k&&n.__k.forEach(z);}function N(n,u,t){for(var i=0;i<t.length;i++)B(t[i],t[++i],t[++i]);l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l.__e(n,u.__v);}});}function V(n){return "object"!=typeof n||null==n||n.__b&&n.__b>0?n:w(n)?n.map(V):d({},n)}function q(u,t,i,r,o,e,f,c,s){var a,h,v,y,d,_,m,b=i.props,k=t.props,x=t.type;if("svg"==x?o="http://www.w3.org/2000/svg":"math"==x?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=e)for(a=0;a<e.length;a++)if((d=e[a])&&"setAttribute"in d==!!x&&(x?d.localName==x:3==d.nodeType)){u=d,e[a]=null;break}if(null==u){if(null==x)return document.createTextNode(k);u=document.createElementNS(o,x,k.is&&k),c&&(l.__m&&l.__m(t,e),c=false),e=null;}if(null==x)b===k||c&&u.data==k||(u.data=k);else {if(e=e&&n.call(u.childNodes),b=i.props||p,!c&&null!=e)for(b={},a=0;a<u.attributes.length;a++)b[(d=u.attributes[a]).name]=d.value;for(a in b)if(d=b[a],"children"==a);else if("dangerouslySetInnerHTML"==a)v=d;else if(!(a in k)){if("value"==a&&"defaultValue"in k||"checked"==a&&"defaultChecked"in k)continue;j(u,a,null,d,o);}for(a in k)d=k[a],"children"==a?y=d:"dangerouslySetInnerHTML"==a?h=d:"value"==a?_=d:"checked"==a?m=d:c&&"function"!=typeof d||b[a]===d||j(u,a,d,b[a],o);if(h)c||v&&(h.__html==v.__html||h.__html==u.innerHTML)||(u.innerHTML=h.__html),t.__k=[];else if(v&&(u.innerHTML=""),I("template"==t.type?u.content:u,w(y)?y:[y],t,i,r,"foreignObject"==x?"http://www.w3.org/1999/xhtml":o,e,f,e?e[0]:i.__k&&S(i,0),c,s),null!=e)for(a=e.length;a--;)g(e[a]);c||(a="value","progress"==x&&null==_?u.removeAttribute("value"):null!=_&&(_!==u[a]||"progress"==x&&!_||"option"==x&&_!=b[a])&&j(u,a,_,b[a],o),a="checked",null!=m&&m!=u[a]&&j(u,a,m,b[a],o));}return u}function B(n,u,t){try{if("function"==typeof n){var i="function"==typeof n.__u;i&&n.__u(),i&&null==u||(n.__u=n(u));}else n.current=u;}catch(n){l.__e(n,t);}}function D(n,u,t){var i,r;if(l.unmount&&l.unmount(n),(i=n.ref)&&(i.current&&i.current!=n.__e||B(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount();}catch(n){l.__e(n,u);}i.base=i.__P=null;}if(i=n.__k)for(r=0;r<i.length;r++)i[r]&&D(i[r],u,t||"function"!=typeof n.type);t||g(n.__e),n.__c=n.__=n.__e=void 0;}function E(n,l,u){return this.constructor(n,u)}function G(u,t,i){var r,o,e,f;t==document&&(t=document.documentElement),l.__&&l.__(u,t),o=(r="function"=="undefined")?null:t.__k,e=[],f=[],O(t,u=(t).__k=_(k,null,[u]),o||p,p,t.namespaceURI,o?null:t.firstChild?n.call(t.childNodes):null,e,o?o.__e:t.firstChild,r,f),N(e,u,f);}function K(l,u,t){var i,r,o,e,f=d({},l.props);for(o in l.type&&l.type.defaultProps&&(e=l.type.defaultProps),u)"key"==o?i=u[o]:"ref"==o?r=u[o]:f[o]=void 0===u[o]&&null!=e?e[o]:u[o];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),m(l.type,f,i||l.key,r||l.ref,null)}n=v.slice,l={__e:function(n,l,u,t){for(var i,r,o;l=l.__;)if((i=l.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(n)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),o=i.__d),o)return i.__E=i}catch(l){n=l;}throw n}},u=0,t=function(n){return null!=n&&null==n.constructor},x.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=d({},this.state),"function"==typeof n&&(n=n(d({},u),this.props)),n&&d(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this));},x.prototype.forceUpdate=function(n){this.__v&&(this.__e=true,n&&this.__h.push(n),M(this));},x.prototype.render=k,i=[],o="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e=function(n,l){return n.__v.__b-l.__v.__b},$.__r=0,f=/(PointerCapture)$|Capture$/i,c=0,s=F(false),a=F(true);
|
|
168879
169293
|
|
|
168880
169294
|
function _arrayLikeToArray$1(r, a) {
|
|
168881
169295
|
(null == a || a > r.length) && (a = r.length);
|
|
@@ -168978,7 +169392,7 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
168978
169392
|
var _reactElement2VNode = function reactElement2VNode(el) {
|
|
168979
169393
|
// Among other things, react VNodes (and all its children) need to have constructor: undefined attributes in order to be recognised, cloneElement (applied recursively) does the necessary conversion
|
|
168980
169394
|
if (!(_typeof(el) === 'object')) return el;
|
|
168981
|
-
var res =
|
|
169395
|
+
var res = K(el);
|
|
168982
169396
|
if (res.props) {
|
|
168983
169397
|
var _res$props;
|
|
168984
169398
|
res.props = _objectSpread2({}, res.props);
|
|
@@ -168989,11 +169403,11 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
168989
169403
|
return res;
|
|
168990
169404
|
};
|
|
168991
169405
|
var isReactRenderable = function isReactRenderable(o) {
|
|
168992
|
-
return t(
|
|
169406
|
+
return t(K(o));
|
|
168993
169407
|
};
|
|
168994
169408
|
var render = function render(jsx, domEl) {
|
|
168995
169409
|
delete domEl.__k; // Wipe traces of previous preact renders
|
|
168996
|
-
|
|
169410
|
+
G(_reactElement2VNode(jsx), domEl);
|
|
168997
169411
|
};
|
|
168998
169412
|
|
|
168999
169413
|
function styleInject$1(css, ref) {
|
|
@@ -169404,7 +169818,7 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
169404
169818
|
}
|
|
169405
169819
|
function setLookAt(lookAt) {
|
|
169406
169820
|
var lookAtVect = new three.Vector3(lookAt.x, lookAt.y, lookAt.z);
|
|
169407
|
-
if (state.controls.target) {
|
|
169821
|
+
if (state.controls.enabled && state.controls.target) {
|
|
169408
169822
|
state.controls.target = lookAtVect;
|
|
169409
169823
|
} else {
|
|
169410
169824
|
// Fly controls doesn't have target attribute
|
|
@@ -169563,9 +169977,9 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
169563
169977
|
|
|
169564
169978
|
// detect point drag
|
|
169565
169979
|
!state.isPointerDragging && ev.type === 'pointermove' && (ev.pressure > 0 || state.isPointerPressed) // ev.pressure always 0 on Safari, so we used the isPointerPressed tracker
|
|
169566
|
-
&& (ev.pointerType
|
|
169980
|
+
&& (ev.pointerType === 'mouse' || ev.movementX === undefined || [ev.movementX, ev.movementY].some(function (m) {
|
|
169567
169981
|
return Math.abs(m) > 1;
|
|
169568
|
-
})) // relax drag trigger sensitivity on touch events
|
|
169982
|
+
})) // relax drag trigger sensitivity on non-mouse (touch/pen) events
|
|
169569
169983
|
&& (state.isPointerDragging = true);
|
|
169570
169984
|
if (state.enablePointerInteraction) {
|
|
169571
169985
|
// update the pointer pos
|
|
@@ -169806,7 +170220,7 @@ var<${access}> ${ name } : ${ structName };`;
|
|
|
169806
170220
|
|
|
169807
170221
|
// Expose config from ThreeGlobe
|
|
169808
170222
|
var bindGlobe = linkKapsule('globe', threeGlobe);
|
|
169809
|
-
var linkedGlobeProps = Object.assign.apply(Object, _toConsumableArray$7(['globeImageUrl', 'bumpImageUrl', 'globeTileEngineUrl', 'globeTileEngineMaxLevel', 'globeCurvatureResolution', 'showGlobe', 'showGraticules', 'showAtmosphere', 'atmosphereColor', 'atmosphereAltitude', 'onGlobeReady', 'pointsData', 'pointLat', 'pointLng', 'pointColor', 'pointAltitude', 'pointRadius', 'pointResolution', 'pointsMerge', 'pointsTransitionDuration', 'arcsData', 'arcStartLat', 'arcStartLng', 'arcEndLat', 'arcEndLng', 'arcColor', 'arcAltitude', 'arcAltitudeAutoScale', 'arcStroke', 'arcCurveResolution', 'arcCircularResolution', 'arcDashLength', 'arcDashGap', 'arcDashInitialGap', 'arcDashAnimateTime', 'arcsTransitionDuration', 'polygonsData', 'polygonGeoJsonGeometry', 'polygonCapColor', 'polygonCapMaterial', 'polygonSideColor', 'polygonSideMaterial', 'polygonStrokeColor', 'polygonAltitude', 'polygonCapCurvatureResolution', 'polygonsTransitionDuration', 'pathsData', 'pathPoints', 'pathPointLat', 'pathPointLng', 'pathPointAlt', 'pathResolution', 'pathColor', 'pathStroke', 'pathDashLength', 'pathDashGap', 'pathDashInitialGap', 'pathDashAnimateTime', 'pathTransitionDuration', 'heatmapsData', 'heatmapPoints', 'heatmapPointLat', 'heatmapPointLng', 'heatmapPointWeight', 'heatmapBandwidth', 'heatmapColorFn', 'heatmapColorSaturation', 'heatmapBaseAltitude', 'heatmapTopAltitude', 'heatmapsTransitionDuration', 'hexBinPointsData', 'hexBinPointLat', 'hexBinPointLng', 'hexBinPointWeight', 'hexBinResolution', 'hexMargin', 'hexTopCurvatureResolution', 'hexTopColor', 'hexSideColor', 'hexAltitude', 'hexBinMerge', 'hexTransitionDuration', 'hexPolygonsData', 'hexPolygonGeoJsonGeometry', 'hexPolygonColor', 'hexPolygonAltitude', 'hexPolygonResolution', 'hexPolygonMargin', 'hexPolygonUseDots', 'hexPolygonCurvatureResolution', 'hexPolygonDotResolution', 'hexPolygonsTransitionDuration', 'tilesData', 'tileLat', 'tileLng', 'tileAltitude', 'tileWidth', 'tileHeight', 'tileUseGlobeProjection', 'tileMaterial', 'tileCurvatureResolution', 'tilesTransitionDuration', 'particlesData', 'particlesList', 'particleLat', 'particleLng', 'particleAltitude', 'particlesSize', 'particlesSizeAttenuation', 'particlesColor', 'particlesTexture', 'ringsData', 'ringLat', 'ringLng', 'ringAltitude', 'ringColor', 'ringResolution', 'ringMaxRadius', 'ringPropagationSpeed', 'ringRepeatPeriod', 'labelsData', 'labelLat', 'labelLng', 'labelAltitude', 'labelRotation', 'labelText', 'labelSize', 'labelTypeFace', 'labelColor', 'labelResolution', 'labelIncludeDot', 'labelDotRadius', 'labelDotOrientation', 'labelsTransitionDuration', 'htmlElementsData', 'htmlLat', 'htmlLng', 'htmlAltitude', 'htmlElement', 'htmlElementVisibilityModifier', 'htmlTransitionDuration', 'objectsData', 'objectLat', 'objectLng', 'objectAltitude', 'objectRotation', 'objectFacesSurface', 'objectThreeObject', 'customLayerData', 'customThreeObject', 'customThreeObjectUpdate'].map(function (p) {
|
|
170223
|
+
var linkedGlobeProps = Object.assign.apply(Object, _toConsumableArray$7(['globeImageUrl', 'bumpImageUrl', 'globeTileEngineUrl', 'globeTileEngineMaxLevel', 'globeCurvatureResolution', 'showGlobe', 'showGraticules', 'showAtmosphere', 'atmosphereColor', 'atmosphereAltitude', 'onGlobeReady', 'pointsData', 'pointLat', 'pointLng', 'pointColor', 'pointAltitude', 'pointRadius', 'pointResolution', 'pointsMerge', 'pointsTransitionDuration', 'arcsData', 'arcStartLat', 'arcStartLng', 'arcStartAltitude', 'arcEndLat', 'arcEndLng', 'arcEndAltitude', 'arcColor', 'arcAltitude', 'arcAltitudeAutoScale', 'arcStroke', 'arcCurveResolution', 'arcCircularResolution', 'arcDashLength', 'arcDashGap', 'arcDashInitialGap', 'arcDashAnimateTime', 'arcsTransitionDuration', 'polygonsData', 'polygonGeoJsonGeometry', 'polygonCapColor', 'polygonCapMaterial', 'polygonSideColor', 'polygonSideMaterial', 'polygonStrokeColor', 'polygonAltitude', 'polygonCapCurvatureResolution', 'polygonsTransitionDuration', 'pathsData', 'pathPoints', 'pathPointLat', 'pathPointLng', 'pathPointAlt', 'pathResolution', 'pathColor', 'pathStroke', 'pathDashLength', 'pathDashGap', 'pathDashInitialGap', 'pathDashAnimateTime', 'pathTransitionDuration', 'heatmapsData', 'heatmapPoints', 'heatmapPointLat', 'heatmapPointLng', 'heatmapPointWeight', 'heatmapBandwidth', 'heatmapColorFn', 'heatmapColorSaturation', 'heatmapBaseAltitude', 'heatmapTopAltitude', 'heatmapsTransitionDuration', 'hexBinPointsData', 'hexBinPointLat', 'hexBinPointLng', 'hexBinPointWeight', 'hexBinResolution', 'hexMargin', 'hexTopCurvatureResolution', 'hexTopColor', 'hexSideColor', 'hexAltitude', 'hexBinMerge', 'hexTransitionDuration', 'hexPolygonsData', 'hexPolygonGeoJsonGeometry', 'hexPolygonColor', 'hexPolygonAltitude', 'hexPolygonResolution', 'hexPolygonMargin', 'hexPolygonUseDots', 'hexPolygonCurvatureResolution', 'hexPolygonDotResolution', 'hexPolygonsTransitionDuration', 'tilesData', 'tileLat', 'tileLng', 'tileAltitude', 'tileWidth', 'tileHeight', 'tileUseGlobeProjection', 'tileMaterial', 'tileCurvatureResolution', 'tilesTransitionDuration', 'particlesData', 'particlesList', 'particleLat', 'particleLng', 'particleAltitude', 'particlesSize', 'particlesSizeAttenuation', 'particlesColor', 'particlesTexture', 'ringsData', 'ringLat', 'ringLng', 'ringAltitude', 'ringColor', 'ringResolution', 'ringMaxRadius', 'ringPropagationSpeed', 'ringRepeatPeriod', 'labelsData', 'labelLat', 'labelLng', 'labelAltitude', 'labelRotation', 'labelText', 'labelSize', 'labelTypeFace', 'labelColor', 'labelResolution', 'labelIncludeDot', 'labelDotRadius', 'labelDotOrientation', 'labelsTransitionDuration', 'htmlElementsData', 'htmlLat', 'htmlLng', 'htmlAltitude', 'htmlElement', 'htmlElementVisibilityModifier', 'htmlTransitionDuration', 'objectsData', 'objectLat', 'objectLng', 'objectAltitude', 'objectRotation', 'objectFacesSurface', 'objectThreeObject', 'customLayerData', 'customThreeObject', 'customThreeObjectUpdate'].map(function (p) {
|
|
169810
170224
|
return _defineProperty$4({}, p, bindGlobe.linkProp(p));
|
|
169811
170225
|
})));
|
|
169812
170226
|
var linkedGlobeMethods = Object.assign.apply(Object, _toConsumableArray$7(['globeMaterial', 'getGlobeRadius', 'getCoords', 'toGeoCoords'].map(function (p) {
|