globe.gl 2.28.5 → 2.29.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/dist/globe.gl.js +523 -202
- package/dist/globe.gl.js.map +1 -1
- package/dist/globe.gl.min.js +5 -5
- package/dist/globe.gl.mjs +2 -1
- package/package.json +8 -8
package/dist/globe.gl.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Version 2.
|
|
1
|
+
// Version 2.29.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) :
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
* Copyright 2010-2023 Three.js Authors
|
|
143
143
|
* SPDX-License-Identifier: MIT
|
|
144
144
|
*/
|
|
145
|
-
const REVISION = '
|
|
145
|
+
const REVISION = '155';
|
|
146
146
|
|
|
147
147
|
const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
|
|
148
148
|
const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
|
|
@@ -2960,13 +2960,13 @@
|
|
|
2960
2960
|
* Texture parameters for an auto-generated target texture
|
|
2961
2961
|
* depthBuffer/stencilBuffer: Booleans to indicate if we should generate these buffers
|
|
2962
2962
|
*/
|
|
2963
|
-
class
|
|
2963
|
+
class RenderTarget extends EventDispatcher {
|
|
2964
2964
|
|
|
2965
2965
|
constructor( width = 1, height = 1, options = {} ) {
|
|
2966
2966
|
|
|
2967
2967
|
super();
|
|
2968
2968
|
|
|
2969
|
-
this.
|
|
2969
|
+
this.isRenderTarget = true;
|
|
2970
2970
|
|
|
2971
2971
|
this.width = width;
|
|
2972
2972
|
this.height = height;
|
|
@@ -3069,6 +3069,18 @@
|
|
|
3069
3069
|
|
|
3070
3070
|
}
|
|
3071
3071
|
|
|
3072
|
+
class WebGLRenderTarget extends RenderTarget {
|
|
3073
|
+
|
|
3074
|
+
constructor( width = 1, height = 1, options = {} ) {
|
|
3075
|
+
|
|
3076
|
+
super( width, height, options );
|
|
3077
|
+
|
|
3078
|
+
this.isWebGLRenderTarget = true;
|
|
3079
|
+
|
|
3080
|
+
}
|
|
3081
|
+
|
|
3082
|
+
}
|
|
3083
|
+
|
|
3072
3084
|
class DataArrayTexture extends Texture {
|
|
3073
3085
|
|
|
3074
3086
|
constructor( data = null, width = 1, height = 1, depth = 1 ) {
|
|
@@ -7985,7 +7997,7 @@
|
|
|
7985
7997
|
this.frustumCulled = source.frustumCulled;
|
|
7986
7998
|
this.renderOrder = source.renderOrder;
|
|
7987
7999
|
|
|
7988
|
-
this.animations = source.animations;
|
|
8000
|
+
this.animations = source.animations.slice();
|
|
7989
8001
|
|
|
7990
8002
|
this.userData = JSON.parse( JSON.stringify( source.userData ) );
|
|
7991
8003
|
|
|
@@ -8359,6 +8371,7 @@
|
|
|
8359
8371
|
|
|
8360
8372
|
this.opacity = 1;
|
|
8361
8373
|
this.transparent = false;
|
|
8374
|
+
this.alphaHash = false;
|
|
8362
8375
|
|
|
8363
8376
|
this.blendSrc = SrcAlphaFactor;
|
|
8364
8377
|
this.blendDst = OneMinusSrcAlphaFactor;
|
|
@@ -8687,6 +8700,7 @@
|
|
|
8687
8700
|
if ( this.dithering === true ) data.dithering = true;
|
|
8688
8701
|
|
|
8689
8702
|
if ( this.alphaTest > 0 ) data.alphaTest = this.alphaTest;
|
|
8703
|
+
if ( this.alphaHash === true ) data.alphaHash = this.alphaHash;
|
|
8690
8704
|
if ( this.alphaToCoverage === true ) data.alphaToCoverage = this.alphaToCoverage;
|
|
8691
8705
|
if ( this.premultipliedAlpha === true ) data.premultipliedAlpha = this.premultipliedAlpha;
|
|
8692
8706
|
if ( this.forceSinglePass === true ) data.forceSinglePass = this.forceSinglePass;
|
|
@@ -8808,6 +8822,7 @@
|
|
|
8808
8822
|
this.dithering = source.dithering;
|
|
8809
8823
|
|
|
8810
8824
|
this.alphaTest = source.alphaTest;
|
|
8825
|
+
this.alphaHash = source.alphaHash;
|
|
8811
8826
|
this.alphaToCoverage = source.alphaToCoverage;
|
|
8812
8827
|
this.premultipliedAlpha = source.premultipliedAlpha;
|
|
8813
8828
|
this.forceSinglePass = source.forceSinglePass;
|
|
@@ -9705,6 +9720,26 @@
|
|
|
9705
9720
|
|
|
9706
9721
|
}
|
|
9707
9722
|
|
|
9723
|
+
getComponent( index, component ) {
|
|
9724
|
+
|
|
9725
|
+
let value = this.array[ index * this.itemSize + component ];
|
|
9726
|
+
|
|
9727
|
+
if ( this.normalized ) value = denormalize( value, this.array );
|
|
9728
|
+
|
|
9729
|
+
return value;
|
|
9730
|
+
|
|
9731
|
+
}
|
|
9732
|
+
|
|
9733
|
+
setComponent( index, component, value ) {
|
|
9734
|
+
|
|
9735
|
+
if ( this.normalized ) value = normalize$1( value, this.array );
|
|
9736
|
+
|
|
9737
|
+
this.array[ index * this.itemSize + component ] = value;
|
|
9738
|
+
|
|
9739
|
+
return this;
|
|
9740
|
+
|
|
9741
|
+
}
|
|
9742
|
+
|
|
9708
9743
|
getX( index ) {
|
|
9709
9744
|
|
|
9710
9745
|
let x = this.array[ index * this.itemSize ];
|
|
@@ -9876,30 +9911,6 @@
|
|
|
9876
9911
|
|
|
9877
9912
|
}
|
|
9878
9913
|
|
|
9879
|
-
copyColorsArray() { // @deprecated, r144
|
|
9880
|
-
|
|
9881
|
-
console.error( 'THREE.BufferAttribute: copyColorsArray() was removed in r144.' );
|
|
9882
|
-
|
|
9883
|
-
}
|
|
9884
|
-
|
|
9885
|
-
copyVector2sArray() { // @deprecated, r144
|
|
9886
|
-
|
|
9887
|
-
console.error( 'THREE.BufferAttribute: copyVector2sArray() was removed in r144.' );
|
|
9888
|
-
|
|
9889
|
-
}
|
|
9890
|
-
|
|
9891
|
-
copyVector3sArray() { // @deprecated, r144
|
|
9892
|
-
|
|
9893
|
-
console.error( 'THREE.BufferAttribute: copyVector3sArray() was removed in r144.' );
|
|
9894
|
-
|
|
9895
|
-
}
|
|
9896
|
-
|
|
9897
|
-
copyVector4sArray() { // @deprecated, r144
|
|
9898
|
-
|
|
9899
|
-
console.error( 'THREE.BufferAttribute: copyVector4sArray() was removed in r144.' );
|
|
9900
|
-
|
|
9901
|
-
}
|
|
9902
|
-
|
|
9903
9914
|
}
|
|
9904
9915
|
|
|
9905
9916
|
class Uint16BufferAttribute extends BufferAttribute {
|
|
@@ -10649,13 +10660,6 @@
|
|
|
10649
10660
|
|
|
10650
10661
|
}
|
|
10651
10662
|
|
|
10652
|
-
merge() { // @deprecated, r144
|
|
10653
|
-
|
|
10654
|
-
console.error( 'THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeGeometries() instead.' );
|
|
10655
|
-
return this;
|
|
10656
|
-
|
|
10657
|
-
}
|
|
10658
|
-
|
|
10659
10663
|
normalizeNormals() {
|
|
10660
10664
|
|
|
10661
10665
|
const normals = this.attributes.normal;
|
|
@@ -12304,10 +12308,8 @@
|
|
|
12304
12308
|
|
|
12305
12309
|
const currentRenderTarget = renderer.getRenderTarget();
|
|
12306
12310
|
|
|
12307
|
-
const currentToneMapping = renderer.toneMapping;
|
|
12308
12311
|
const currentXrEnabled = renderer.xr.enabled;
|
|
12309
12312
|
|
|
12310
|
-
renderer.toneMapping = NoToneMapping;
|
|
12311
12313
|
renderer.xr.enabled = false;
|
|
12312
12314
|
|
|
12313
12315
|
const generateMipmaps = renderTarget.texture.generateMipmaps;
|
|
@@ -12336,7 +12338,6 @@
|
|
|
12336
12338
|
|
|
12337
12339
|
renderer.setRenderTarget( currentRenderTarget );
|
|
12338
12340
|
|
|
12339
|
-
renderer.toneMapping = currentToneMapping;
|
|
12340
12341
|
renderer.xr.enabled = currentXrEnabled;
|
|
12341
12342
|
|
|
12342
12343
|
renderTarget.texture.needsPMREMUpdate = true;
|
|
@@ -13237,6 +13238,10 @@
|
|
|
13237
13238
|
|
|
13238
13239
|
}
|
|
13239
13240
|
|
|
13241
|
+
var alphahash_fragment = "#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif";
|
|
13242
|
+
|
|
13243
|
+
var alphahash_pars_fragment = "#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif";
|
|
13244
|
+
|
|
13240
13245
|
var alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif";
|
|
13241
13246
|
|
|
13242
13247
|
var alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif";
|
|
@@ -13249,13 +13254,13 @@
|
|
|
13249
13254
|
|
|
13250
13255
|
var aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif";
|
|
13251
13256
|
|
|
13252
|
-
var begin_vertex = "vec3 transformed = vec3( position )
|
|
13257
|
+
var begin_vertex = "vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif";
|
|
13253
13258
|
|
|
13254
13259
|
var beginnormal_vertex = "vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif";
|
|
13255
13260
|
|
|
13256
13261
|
var bsdfs = "float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated";
|
|
13257
13262
|
|
|
13258
|
-
var iridescence_fragment = "#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\
|
|
13263
|
+
var iridescence_fragment = "#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif";
|
|
13259
13264
|
|
|
13260
13265
|
var bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos.xyz );\n\t\tvec3 vSigmaY = dFdy( surf_pos.xyz );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif";
|
|
13261
13266
|
|
|
@@ -13275,7 +13280,7 @@
|
|
|
13275
13280
|
|
|
13276
13281
|
var color_vertex = "#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif";
|
|
13277
13282
|
|
|
13278
|
-
var common = "#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated";
|
|
13283
|
+
var common = "#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated";
|
|
13279
13284
|
|
|
13280
13285
|
var cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif";
|
|
13281
13286
|
|
|
@@ -13289,9 +13294,9 @@
|
|
|
13289
13294
|
|
|
13290
13295
|
var emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif";
|
|
13291
13296
|
|
|
13292
|
-
var
|
|
13297
|
+
var colorspace_fragment = "gl_FragColor = linearToOutputTexel( gl_FragColor );";
|
|
13293
13298
|
|
|
13294
|
-
var
|
|
13299
|
+
var colorspace_pars_fragment = "vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}";
|
|
13295
13300
|
|
|
13296
13301
|
var envmap_fragment = "#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif";
|
|
13297
13302
|
|
|
@@ -13371,7 +13376,7 @@
|
|
|
13371
13376
|
|
|
13372
13377
|
var morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif";
|
|
13373
13378
|
|
|
13374
|
-
var normal_fragment_begin = "float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal
|
|
13379
|
+
var normal_fragment_begin = "float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 geometryNormal = normal;";
|
|
13375
13380
|
|
|
13376
13381
|
var normal_fragment_maps = "#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif";
|
|
13377
13382
|
|
|
@@ -13391,7 +13396,7 @@
|
|
|
13391
13396
|
|
|
13392
13397
|
var iridescence_pars_fragment = "#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif";
|
|
13393
13398
|
|
|
13394
|
-
var
|
|
13399
|
+
var opaque_fragment = "#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );";
|
|
13395
13400
|
|
|
13396
13401
|
var packing = "vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}";
|
|
13397
13402
|
|
|
@@ -13435,53 +13440,53 @@
|
|
|
13435
13440
|
|
|
13436
13441
|
var transmission_pars_fragment = "#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif";
|
|
13437
13442
|
|
|
13438
|
-
var uv_pars_fragment = "#
|
|
13443
|
+
var uv_pars_fragment = "#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif";
|
|
13439
13444
|
|
|
13440
|
-
var uv_pars_vertex = "#
|
|
13445
|
+
var uv_pars_vertex = "#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif";
|
|
13441
13446
|
|
|
13442
|
-
var uv_vertex = "#
|
|
13447
|
+
var uv_vertex = "#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif";
|
|
13443
13448
|
|
|
13444
13449
|
var worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif";
|
|
13445
13450
|
|
|
13446
13451
|
const vertex$h = "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}";
|
|
13447
13452
|
|
|
13448
|
-
const fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <
|
|
13453
|
+
const fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}";
|
|
13449
13454
|
|
|
13450
13455
|
const vertex$g = "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}";
|
|
13451
13456
|
|
|
13452
|
-
const fragment$g = "#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <
|
|
13457
|
+
const fragment$g = "#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}";
|
|
13453
13458
|
|
|
13454
13459
|
const vertex$f = "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}";
|
|
13455
13460
|
|
|
13456
|
-
const fragment$f = "uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <
|
|
13461
|
+
const fragment$f = "uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}";
|
|
13457
13462
|
|
|
13458
13463
|
const vertex$e = "#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}";
|
|
13459
13464
|
|
|
13460
|
-
const fragment$e = "#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}";
|
|
13465
|
+
const fragment$e = "#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}";
|
|
13461
13466
|
|
|
13462
13467
|
const vertex$d = "#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}";
|
|
13463
13468
|
|
|
13464
|
-
const fragment$d = "#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}";
|
|
13469
|
+
const fragment$d = "#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}";
|
|
13465
13470
|
|
|
13466
13471
|
const vertex$c = "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}";
|
|
13467
13472
|
|
|
13468
|
-
const fragment$c = "uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <
|
|
13473
|
+
const fragment$c = "uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}";
|
|
13469
13474
|
|
|
13470
13475
|
const vertex$b = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}";
|
|
13471
13476
|
|
|
13472
|
-
const fragment$b = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <
|
|
13477
|
+
const fragment$b = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}";
|
|
13473
13478
|
|
|
13474
13479
|
const vertex$a = "#include <common>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}";
|
|
13475
13480
|
|
|
13476
|
-
const fragment$a = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <
|
|
13481
|
+
const fragment$a = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
|
|
13477
13482
|
|
|
13478
13483
|
const vertex$9 = "#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
|
|
13479
13484
|
|
|
13480
|
-
const fragment$9 = "#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <
|
|
13485
|
+
const fragment$9 = "#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
|
|
13481
13486
|
|
|
13482
13487
|
const vertex$8 = "#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}";
|
|
13483
13488
|
|
|
13484
|
-
const fragment$8 = "#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <
|
|
13489
|
+
const fragment$8 = "#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
|
|
13485
13490
|
|
|
13486
13491
|
const vertex$7 = "#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}";
|
|
13487
13492
|
|
|
@@ -13489,29 +13494,31 @@
|
|
|
13489
13494
|
|
|
13490
13495
|
const vertex$6 = "#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
|
|
13491
13496
|
|
|
13492
|
-
const fragment$6 = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <
|
|
13497
|
+
const fragment$6 = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
|
|
13493
13498
|
|
|
13494
13499
|
const vertex$5 = "#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}";
|
|
13495
13500
|
|
|
13496
|
-
const fragment$5 = "#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <
|
|
13501
|
+
const fragment$5 = "#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
|
|
13497
13502
|
|
|
13498
13503
|
const vertex$4 = "#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
|
|
13499
13504
|
|
|
13500
|
-
const fragment$4 = "#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <
|
|
13505
|
+
const fragment$4 = "#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
|
|
13501
13506
|
|
|
13502
13507
|
const vertex$3 = "uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}";
|
|
13503
13508
|
|
|
13504
|
-
const fragment$3 = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <
|
|
13509
|
+
const fragment$3 = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}";
|
|
13505
13510
|
|
|
13506
13511
|
const vertex$2 = "#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
|
|
13507
13512
|
|
|
13508
|
-
const fragment$2 = "uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <
|
|
13513
|
+
const fragment$2 = "uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}";
|
|
13509
13514
|
|
|
13510
13515
|
const vertex$1 = "uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}";
|
|
13511
13516
|
|
|
13512
|
-
const fragment$1 = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <
|
|
13517
|
+
const fragment$1 = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}";
|
|
13513
13518
|
|
|
13514
13519
|
const ShaderChunk = {
|
|
13520
|
+
alphahash_fragment: alphahash_fragment,
|
|
13521
|
+
alphahash_pars_fragment: alphahash_pars_fragment,
|
|
13515
13522
|
alphamap_fragment: alphamap_fragment,
|
|
13516
13523
|
alphamap_pars_fragment: alphamap_pars_fragment,
|
|
13517
13524
|
alphatest_fragment: alphatest_fragment,
|
|
@@ -13538,8 +13545,8 @@
|
|
|
13538
13545
|
displacementmap_vertex: displacementmap_vertex,
|
|
13539
13546
|
emissivemap_fragment: emissivemap_fragment,
|
|
13540
13547
|
emissivemap_pars_fragment: emissivemap_pars_fragment,
|
|
13541
|
-
|
|
13542
|
-
|
|
13548
|
+
colorspace_fragment: colorspace_fragment,
|
|
13549
|
+
colorspace_pars_fragment: colorspace_pars_fragment,
|
|
13543
13550
|
envmap_fragment: envmap_fragment,
|
|
13544
13551
|
envmap_common_pars_fragment: envmap_common_pars_fragment,
|
|
13545
13552
|
envmap_pars_fragment: envmap_pars_fragment,
|
|
@@ -13589,7 +13596,7 @@
|
|
|
13589
13596
|
clearcoat_normal_fragment_maps: clearcoat_normal_fragment_maps,
|
|
13590
13597
|
clearcoat_pars_fragment: clearcoat_pars_fragment,
|
|
13591
13598
|
iridescence_pars_fragment: iridescence_pars_fragment,
|
|
13592
|
-
|
|
13599
|
+
opaque_fragment: opaque_fragment,
|
|
13593
13600
|
packing: packing,
|
|
13594
13601
|
premultiplied_alpha_fragment: premultiplied_alpha_fragment,
|
|
13595
13602
|
project_vertex: project_vertex,
|
|
@@ -16881,7 +16888,7 @@
|
|
|
16881
16888
|
|
|
16882
16889
|
}
|
|
16883
16890
|
|
|
16884
|
-
} else {
|
|
16891
|
+
} else if ( geometryPosition !== undefined ) {
|
|
16885
16892
|
|
|
16886
16893
|
const array = geometryPosition.array;
|
|
16887
16894
|
version = geometryPosition.version;
|
|
@@ -16896,6 +16903,10 @@
|
|
|
16896
16903
|
|
|
16897
16904
|
}
|
|
16898
16905
|
|
|
16906
|
+
} else {
|
|
16907
|
+
|
|
16908
|
+
return;
|
|
16909
|
+
|
|
16899
16910
|
}
|
|
16900
16911
|
|
|
16901
16912
|
const attribute = new ( arrayNeedsUint32( indices ) ? Uint32BufferAttribute : Uint16BufferAttribute )( indices, 1 );
|
|
@@ -17416,11 +17427,31 @@
|
|
|
17416
17427
|
|
|
17417
17428
|
}
|
|
17418
17429
|
|
|
17419
|
-
|
|
17430
|
+
if ( updateMap.get( object ) !== frame ) {
|
|
17431
|
+
|
|
17432
|
+
attributes.update( object.instanceMatrix, gl.ARRAY_BUFFER );
|
|
17433
|
+
|
|
17434
|
+
if ( object.instanceColor !== null ) {
|
|
17420
17435
|
|
|
17421
|
-
|
|
17436
|
+
attributes.update( object.instanceColor, gl.ARRAY_BUFFER );
|
|
17437
|
+
|
|
17438
|
+
}
|
|
17422
17439
|
|
|
17423
|
-
|
|
17440
|
+
updateMap.set( object, frame );
|
|
17441
|
+
|
|
17442
|
+
}
|
|
17443
|
+
|
|
17444
|
+
}
|
|
17445
|
+
|
|
17446
|
+
if ( object.isSkinnedMesh ) {
|
|
17447
|
+
|
|
17448
|
+
const skeleton = object.skeleton;
|
|
17449
|
+
|
|
17450
|
+
if ( updateMap.get( skeleton ) !== frame ) {
|
|
17451
|
+
|
|
17452
|
+
skeleton.update();
|
|
17453
|
+
|
|
17454
|
+
updateMap.set( skeleton, frame );
|
|
17424
17455
|
|
|
17425
17456
|
}
|
|
17426
17457
|
|
|
@@ -18817,13 +18848,30 @@
|
|
|
18817
18848
|
|
|
18818
18849
|
}
|
|
18819
18850
|
|
|
18851
|
+
const shaderChunkMap = new Map( [
|
|
18852
|
+
[ 'encodings_fragment', 'colorspace_fragment' ], // @deprecated, r154
|
|
18853
|
+
[ 'encodings_pars_fragment', 'colorspace_pars_fragment' ], // @deprecated, r154
|
|
18854
|
+
[ 'output_fragment', 'opaque_fragment' ], // @deprecated, r154
|
|
18855
|
+
] );
|
|
18856
|
+
|
|
18820
18857
|
function includeReplacer( match, include ) {
|
|
18821
18858
|
|
|
18822
|
-
|
|
18859
|
+
let string = ShaderChunk[ include ];
|
|
18823
18860
|
|
|
18824
18861
|
if ( string === undefined ) {
|
|
18825
18862
|
|
|
18826
|
-
|
|
18863
|
+
const newInclude = shaderChunkMap.get( include );
|
|
18864
|
+
|
|
18865
|
+
if ( newInclude !== undefined ) {
|
|
18866
|
+
|
|
18867
|
+
string = ShaderChunk[ newInclude ];
|
|
18868
|
+
console.warn( 'THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.', include, newInclude );
|
|
18869
|
+
|
|
18870
|
+
} else {
|
|
18871
|
+
|
|
18872
|
+
throw new Error( 'Can not resolve #include <' + include + '>' );
|
|
18873
|
+
|
|
18874
|
+
}
|
|
18827
18875
|
|
|
18828
18876
|
}
|
|
18829
18877
|
|
|
@@ -19099,6 +19147,7 @@
|
|
|
19099
19147
|
parameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',
|
|
19100
19148
|
parameters.metalnessMap ? '#define USE_METALNESSMAP' : '',
|
|
19101
19149
|
parameters.alphaMap ? '#define USE_ALPHAMAP' : '',
|
|
19150
|
+
parameters.alphaHash ? '#define USE_ALPHAHASH' : '',
|
|
19102
19151
|
|
|
19103
19152
|
parameters.transmission ? '#define USE_TRANSMISSION' : '',
|
|
19104
19153
|
parameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '',
|
|
@@ -19142,7 +19191,7 @@
|
|
|
19142
19191
|
|
|
19143
19192
|
//
|
|
19144
19193
|
|
|
19145
|
-
parameters.vertexTangents ? '#define USE_TANGENT' : '',
|
|
19194
|
+
parameters.vertexTangents && parameters.flatShading === false ? '#define USE_TANGENT' : '',
|
|
19146
19195
|
parameters.vertexColors ? '#define USE_COLOR' : '',
|
|
19147
19196
|
parameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '',
|
|
19148
19197
|
parameters.vertexUv1s ? '#define USE_UV1' : '',
|
|
@@ -19320,6 +19369,7 @@
|
|
|
19320
19369
|
|
|
19321
19370
|
parameters.alphaMap ? '#define USE_ALPHAMAP' : '',
|
|
19322
19371
|
parameters.alphaTest ? '#define USE_ALPHATEST' : '',
|
|
19372
|
+
parameters.alphaHash ? '#define USE_ALPHAHASH' : '',
|
|
19323
19373
|
|
|
19324
19374
|
parameters.sheen ? '#define USE_SHEEN' : '',
|
|
19325
19375
|
parameters.sheenColorMap ? '#define USE_SHEEN_COLORMAP' : '',
|
|
@@ -19329,7 +19379,7 @@
|
|
|
19329
19379
|
parameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '',
|
|
19330
19380
|
parameters.thicknessMap ? '#define USE_THICKNESSMAP' : '',
|
|
19331
19381
|
|
|
19332
|
-
parameters.vertexTangents ? '#define USE_TANGENT' : '',
|
|
19382
|
+
parameters.vertexTangents && parameters.flatShading === false ? '#define USE_TANGENT' : '',
|
|
19333
19383
|
parameters.vertexColors || parameters.instancingColor ? '#define USE_COLOR' : '',
|
|
19334
19384
|
parameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '',
|
|
19335
19385
|
parameters.vertexUv1s ? '#define USE_UV1' : '',
|
|
@@ -19366,7 +19416,7 @@
|
|
|
19366
19416
|
parameters.dithering ? '#define DITHERING' : '',
|
|
19367
19417
|
parameters.opaque ? '#define OPAQUE' : '',
|
|
19368
19418
|
|
|
19369
|
-
ShaderChunk[ '
|
|
19419
|
+
ShaderChunk[ 'colorspace_pars_fragment' ], // this code is required here because it is used by the various encoding/decoding function defined below
|
|
19370
19420
|
getTexelEncodingFunction( 'linearToOutputTexel', parameters.outputColorSpace ),
|
|
19371
19421
|
|
|
19372
19422
|
parameters.useDepthPacking ? '#define DEPTH_PACKING ' + parameters.depthPacking : '',
|
|
@@ -19856,12 +19906,26 @@
|
|
|
19856
19906
|
|
|
19857
19907
|
const HAS_ALPHATEST = material.alphaTest > 0;
|
|
19858
19908
|
|
|
19909
|
+
const HAS_ALPHAHASH = !! material.alphaHash;
|
|
19910
|
+
|
|
19859
19911
|
const HAS_EXTENSIONS = !! material.extensions;
|
|
19860
19912
|
|
|
19861
19913
|
const HAS_ATTRIBUTE_UV1 = !! geometry.attributes.uv1;
|
|
19862
19914
|
const HAS_ATTRIBUTE_UV2 = !! geometry.attributes.uv2;
|
|
19863
19915
|
const HAS_ATTRIBUTE_UV3 = !! geometry.attributes.uv3;
|
|
19864
19916
|
|
|
19917
|
+
let toneMapping = NoToneMapping;
|
|
19918
|
+
|
|
19919
|
+
if ( material.toneMapped ) {
|
|
19920
|
+
|
|
19921
|
+
if ( currentRenderTarget === null || currentRenderTarget.isXRRenderTarget === true ) {
|
|
19922
|
+
|
|
19923
|
+
toneMapping = renderer.toneMapping;
|
|
19924
|
+
|
|
19925
|
+
}
|
|
19926
|
+
|
|
19927
|
+
}
|
|
19928
|
+
|
|
19865
19929
|
const parameters = {
|
|
19866
19930
|
|
|
19867
19931
|
isWebGL2: IS_WEBGL2,
|
|
@@ -19936,6 +20000,7 @@
|
|
|
19936
20000
|
|
|
19937
20001
|
alphaMap: HAS_ALPHAMAP,
|
|
19938
20002
|
alphaTest: HAS_ALPHATEST,
|
|
20003
|
+
alphaHash: HAS_ALPHAHASH,
|
|
19939
20004
|
|
|
19940
20005
|
combine: material.combine,
|
|
19941
20006
|
|
|
@@ -20021,8 +20086,8 @@
|
|
|
20021
20086
|
shadowMapEnabled: renderer.shadowMap.enabled && shadows.length > 0,
|
|
20022
20087
|
shadowMapType: renderer.shadowMap.type,
|
|
20023
20088
|
|
|
20024
|
-
toneMapping:
|
|
20025
|
-
useLegacyLights: renderer.
|
|
20089
|
+
toneMapping: toneMapping,
|
|
20090
|
+
useLegacyLights: renderer._useLegacyLights,
|
|
20026
20091
|
|
|
20027
20092
|
premultipliedAlpha: material.premultipliedAlpha,
|
|
20028
20093
|
|
|
@@ -23194,6 +23259,17 @@
|
|
|
23194
23259
|
|
|
23195
23260
|
}
|
|
23196
23261
|
|
|
23262
|
+
if ( glFormat === _gl.RED_INTEGER ) {
|
|
23263
|
+
|
|
23264
|
+
if ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.R8UI;
|
|
23265
|
+
if ( glType === _gl.UNSIGNED_SHORT ) internalFormat = _gl.R16UI;
|
|
23266
|
+
if ( glType === _gl.UNSIGNED_INT ) internalFormat = _gl.R32UI;
|
|
23267
|
+
if ( glType === _gl.BYTE ) internalFormat = _gl.R8I;
|
|
23268
|
+
if ( glType === _gl.SHORT ) internalFormat = _gl.R16I;
|
|
23269
|
+
if ( glType === _gl.INT ) internalFormat = _gl.R32I;
|
|
23270
|
+
|
|
23271
|
+
}
|
|
23272
|
+
|
|
23197
23273
|
if ( glFormat === _gl.RG ) {
|
|
23198
23274
|
|
|
23199
23275
|
if ( glType === _gl.FLOAT ) internalFormat = _gl.RG32F;
|
|
@@ -23370,14 +23446,32 @@
|
|
|
23370
23446
|
|
|
23371
23447
|
for ( let i = 0; i < 6; i ++ ) {
|
|
23372
23448
|
|
|
23373
|
-
|
|
23449
|
+
if ( Array.isArray( renderTargetProperties.__webglFramebuffer[ i ] ) ) {
|
|
23450
|
+
|
|
23451
|
+
for ( let level = 0; level < renderTargetProperties.__webglFramebuffer[ i ].length; level ++ ) _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ i ][ level ] );
|
|
23452
|
+
|
|
23453
|
+
} else {
|
|
23454
|
+
|
|
23455
|
+
_gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ i ] );
|
|
23456
|
+
|
|
23457
|
+
}
|
|
23458
|
+
|
|
23374
23459
|
if ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer[ i ] );
|
|
23375
23460
|
|
|
23376
23461
|
}
|
|
23377
23462
|
|
|
23378
23463
|
} else {
|
|
23379
23464
|
|
|
23380
|
-
|
|
23465
|
+
if ( Array.isArray( renderTargetProperties.__webglFramebuffer ) ) {
|
|
23466
|
+
|
|
23467
|
+
for ( let level = 0; level < renderTargetProperties.__webglFramebuffer.length; level ++ ) _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ level ] );
|
|
23468
|
+
|
|
23469
|
+
} else {
|
|
23470
|
+
|
|
23471
|
+
_gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer );
|
|
23472
|
+
|
|
23473
|
+
}
|
|
23474
|
+
|
|
23381
23475
|
if ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer );
|
|
23382
23476
|
if ( renderTargetProperties.__webglMultisampledFramebuffer ) _gl.deleteFramebuffer( renderTargetProperties.__webglMultisampledFramebuffer );
|
|
23383
23477
|
|
|
@@ -24352,7 +24446,7 @@
|
|
|
24352
24446
|
// Render targets
|
|
24353
24447
|
|
|
24354
24448
|
// Setup storage for target texture and bind it to correct framebuffer
|
|
24355
|
-
function setupFrameBufferTexture( framebuffer, renderTarget, texture, attachment, textureTarget ) {
|
|
24449
|
+
function setupFrameBufferTexture( framebuffer, renderTarget, texture, attachment, textureTarget, level ) {
|
|
24356
24450
|
|
|
24357
24451
|
const glFormat = utils.convert( texture.format, texture.colorSpace );
|
|
24358
24452
|
const glType = utils.convert( texture.type );
|
|
@@ -24361,13 +24455,16 @@
|
|
|
24361
24455
|
|
|
24362
24456
|
if ( ! renderTargetProperties.__hasExternalTextures ) {
|
|
24363
24457
|
|
|
24458
|
+
const width = Math.max( 1, renderTarget.width >> level );
|
|
24459
|
+
const height = Math.max( 1, renderTarget.height >> level );
|
|
24460
|
+
|
|
24364
24461
|
if ( textureTarget === _gl.TEXTURE_3D || textureTarget === _gl.TEXTURE_2D_ARRAY ) {
|
|
24365
24462
|
|
|
24366
|
-
state.texImage3D( textureTarget,
|
|
24463
|
+
state.texImage3D( textureTarget, level, glInternalFormat, width, height, renderTarget.depth, 0, glFormat, glType, null );
|
|
24367
24464
|
|
|
24368
24465
|
} else {
|
|
24369
24466
|
|
|
24370
|
-
state.texImage2D( textureTarget,
|
|
24467
|
+
state.texImage2D( textureTarget, level, glInternalFormat, width, height, 0, glFormat, glType, null );
|
|
24371
24468
|
|
|
24372
24469
|
}
|
|
24373
24470
|
|
|
@@ -24381,7 +24478,7 @@
|
|
|
24381
24478
|
|
|
24382
24479
|
} else if ( textureTarget === _gl.TEXTURE_2D || ( textureTarget >= _gl.TEXTURE_CUBE_MAP_POSITIVE_X && textureTarget <= _gl.TEXTURE_CUBE_MAP_NEGATIVE_Z ) ) { // see #24753
|
|
24383
24480
|
|
|
24384
|
-
_gl.framebufferTexture2D( _gl.FRAMEBUFFER, attachment, textureTarget, properties.get( texture ).__webglTexture,
|
|
24481
|
+
_gl.framebufferTexture2D( _gl.FRAMEBUFFER, attachment, textureTarget, properties.get( texture ).__webglTexture, level );
|
|
24385
24482
|
|
|
24386
24483
|
}
|
|
24387
24484
|
|
|
@@ -24602,7 +24699,7 @@
|
|
|
24602
24699
|
|
|
24603
24700
|
if ( colorTexture !== undefined ) {
|
|
24604
24701
|
|
|
24605
|
-
setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, renderTarget.texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D );
|
|
24702
|
+
setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, renderTarget.texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D, 0 );
|
|
24606
24703
|
|
|
24607
24704
|
}
|
|
24608
24705
|
|
|
@@ -24649,13 +24746,41 @@
|
|
|
24649
24746
|
|
|
24650
24747
|
for ( let i = 0; i < 6; i ++ ) {
|
|
24651
24748
|
|
|
24652
|
-
|
|
24749
|
+
if ( isWebGL2 && texture.mipmaps && texture.mipmaps.length > 0 ) {
|
|
24750
|
+
|
|
24751
|
+
renderTargetProperties.__webglFramebuffer[ i ] = [];
|
|
24752
|
+
|
|
24753
|
+
for ( let level = 0; level < texture.mipmaps.length; level ++ ) {
|
|
24754
|
+
|
|
24755
|
+
renderTargetProperties.__webglFramebuffer[ i ][ level ] = _gl.createFramebuffer();
|
|
24756
|
+
|
|
24757
|
+
}
|
|
24758
|
+
|
|
24759
|
+
} else {
|
|
24760
|
+
|
|
24761
|
+
renderTargetProperties.__webglFramebuffer[ i ] = _gl.createFramebuffer();
|
|
24762
|
+
|
|
24763
|
+
}
|
|
24653
24764
|
|
|
24654
24765
|
}
|
|
24655
24766
|
|
|
24656
24767
|
} else {
|
|
24657
24768
|
|
|
24658
|
-
|
|
24769
|
+
if ( isWebGL2 && texture.mipmaps && texture.mipmaps.length > 0 ) {
|
|
24770
|
+
|
|
24771
|
+
renderTargetProperties.__webglFramebuffer = [];
|
|
24772
|
+
|
|
24773
|
+
for ( let level = 0; level < texture.mipmaps.length; level ++ ) {
|
|
24774
|
+
|
|
24775
|
+
renderTargetProperties.__webglFramebuffer[ level ] = _gl.createFramebuffer();
|
|
24776
|
+
|
|
24777
|
+
}
|
|
24778
|
+
|
|
24779
|
+
} else {
|
|
24780
|
+
|
|
24781
|
+
renderTargetProperties.__webglFramebuffer = _gl.createFramebuffer();
|
|
24782
|
+
|
|
24783
|
+
}
|
|
24659
24784
|
|
|
24660
24785
|
if ( isMultipleRenderTargets ) {
|
|
24661
24786
|
|
|
@@ -24735,7 +24860,19 @@
|
|
|
24735
24860
|
|
|
24736
24861
|
for ( let i = 0; i < 6; i ++ ) {
|
|
24737
24862
|
|
|
24738
|
-
|
|
24863
|
+
if ( isWebGL2 && texture.mipmaps && texture.mipmaps.length > 0 ) {
|
|
24864
|
+
|
|
24865
|
+
for ( let level = 0; level < texture.mipmaps.length; level ++ ) {
|
|
24866
|
+
|
|
24867
|
+
setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ][ level ], renderTarget, texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, level );
|
|
24868
|
+
|
|
24869
|
+
}
|
|
24870
|
+
|
|
24871
|
+
} else {
|
|
24872
|
+
|
|
24873
|
+
setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ], renderTarget, texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0 );
|
|
24874
|
+
|
|
24875
|
+
}
|
|
24739
24876
|
|
|
24740
24877
|
}
|
|
24741
24878
|
|
|
@@ -24758,7 +24895,7 @@
|
|
|
24758
24895
|
|
|
24759
24896
|
state.bindTexture( _gl.TEXTURE_2D, attachmentProperties.__webglTexture );
|
|
24760
24897
|
setTextureParameters( _gl.TEXTURE_2D, attachment, supportsMips );
|
|
24761
|
-
setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, attachment, _gl.COLOR_ATTACHMENT0 + i, _gl.TEXTURE_2D );
|
|
24898
|
+
setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, attachment, _gl.COLOR_ATTACHMENT0 + i, _gl.TEXTURE_2D, 0 );
|
|
24762
24899
|
|
|
24763
24900
|
if ( textureNeedsGenerateMipmaps( attachment, supportsMips ) ) {
|
|
24764
24901
|
|
|
@@ -24790,7 +24927,20 @@
|
|
|
24790
24927
|
|
|
24791
24928
|
state.bindTexture( glTextureType, textureProperties.__webglTexture );
|
|
24792
24929
|
setTextureParameters( glTextureType, texture, supportsMips );
|
|
24793
|
-
|
|
24930
|
+
|
|
24931
|
+
if ( isWebGL2 && texture.mipmaps && texture.mipmaps.length > 0 ) {
|
|
24932
|
+
|
|
24933
|
+
for ( let level = 0; level < texture.mipmaps.length; level ++ ) {
|
|
24934
|
+
|
|
24935
|
+
setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ level ], renderTarget, texture, _gl.COLOR_ATTACHMENT0, glTextureType, level );
|
|
24936
|
+
|
|
24937
|
+
}
|
|
24938
|
+
|
|
24939
|
+
} else {
|
|
24940
|
+
|
|
24941
|
+
setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, texture, _gl.COLOR_ATTACHMENT0, glTextureType, 0 );
|
|
24942
|
+
|
|
24943
|
+
}
|
|
24794
24944
|
|
|
24795
24945
|
if ( textureNeedsGenerateMipmaps( texture, supportsMips ) ) {
|
|
24796
24946
|
|
|
@@ -25777,8 +25927,6 @@
|
|
|
25777
25927
|
|
|
25778
25928
|
//
|
|
25779
25929
|
|
|
25780
|
-
let userCamera = null;
|
|
25781
|
-
|
|
25782
25930
|
const cameraL = new PerspectiveCamera();
|
|
25783
25931
|
cameraL.layers.enable( 1 );
|
|
25784
25932
|
cameraL.viewport = new Vector4();
|
|
@@ -25798,19 +25946,11 @@
|
|
|
25798
25946
|
|
|
25799
25947
|
//
|
|
25800
25948
|
|
|
25801
|
-
this.cameraAutoUpdate = true;
|
|
25949
|
+
this.cameraAutoUpdate = true;
|
|
25802
25950
|
this.enabled = false;
|
|
25803
25951
|
|
|
25804
25952
|
this.isPresenting = false;
|
|
25805
25953
|
|
|
25806
|
-
this.getCamera = function () {}; // @deprecated, r153
|
|
25807
|
-
|
|
25808
|
-
this.setUserCamera = function ( value ) {
|
|
25809
|
-
|
|
25810
|
-
userCamera = value;
|
|
25811
|
-
|
|
25812
|
-
};
|
|
25813
|
-
|
|
25814
25954
|
this.getController = function ( index ) {
|
|
25815
25955
|
|
|
25816
25956
|
let controller = controllers[ index ];
|
|
@@ -26247,15 +26387,9 @@
|
|
|
26247
26387
|
|
|
26248
26388
|
}
|
|
26249
26389
|
|
|
26250
|
-
this.
|
|
26251
|
-
|
|
26252
|
-
if ( session === null ) return camera;
|
|
26253
|
-
|
|
26254
|
-
if ( userCamera ) {
|
|
26390
|
+
this.updateCamera = function ( camera ) {
|
|
26255
26391
|
|
|
26256
|
-
|
|
26257
|
-
|
|
26258
|
-
}
|
|
26392
|
+
if ( session === null ) return;
|
|
26259
26393
|
|
|
26260
26394
|
cameraXR.near = cameraR.near = cameraL.near = camera.near;
|
|
26261
26395
|
cameraXR.far = cameraR.far = cameraL.far = camera.far;
|
|
@@ -26301,19 +26435,11 @@
|
|
|
26301
26435
|
|
|
26302
26436
|
// update user camera and its children
|
|
26303
26437
|
|
|
26304
|
-
|
|
26305
|
-
|
|
26306
|
-
updateUserCamera( cameraXR, parent );
|
|
26307
|
-
|
|
26308
|
-
}
|
|
26309
|
-
|
|
26310
|
-
return cameraXR;
|
|
26438
|
+
updateUserCamera( camera, cameraXR, parent );
|
|
26311
26439
|
|
|
26312
26440
|
};
|
|
26313
26441
|
|
|
26314
|
-
function updateUserCamera( cameraXR, parent ) {
|
|
26315
|
-
|
|
26316
|
-
const camera = userCamera;
|
|
26442
|
+
function updateUserCamera( camera, cameraXR, parent ) {
|
|
26317
26443
|
|
|
26318
26444
|
if ( parent === null ) {
|
|
26319
26445
|
|
|
@@ -26350,6 +26476,12 @@
|
|
|
26350
26476
|
|
|
26351
26477
|
}
|
|
26352
26478
|
|
|
26479
|
+
this.getCamera = function () {
|
|
26480
|
+
|
|
26481
|
+
return cameraXR;
|
|
26482
|
+
|
|
26483
|
+
};
|
|
26484
|
+
|
|
26353
26485
|
this.getFoveation = function () {
|
|
26354
26486
|
|
|
26355
26487
|
if ( glProjLayer === null && glBaseLayer === null ) {
|
|
@@ -26747,7 +26879,7 @@
|
|
|
26747
26879
|
uniforms.lightMap.value = material.lightMap;
|
|
26748
26880
|
|
|
26749
26881
|
// artist-friendly light intensity scaling factor
|
|
26750
|
-
const scaleFactor = ( renderer.
|
|
26882
|
+
const scaleFactor = ( renderer._useLegacyLights === true ) ? Math.PI : 1;
|
|
26751
26883
|
|
|
26752
26884
|
uniforms.lightMapIntensity.value = material.lightMapIntensity * scaleFactor;
|
|
26753
26885
|
|
|
@@ -27586,7 +27718,7 @@
|
|
|
27586
27718
|
|
|
27587
27719
|
// physical lights
|
|
27588
27720
|
|
|
27589
|
-
this.
|
|
27721
|
+
this._useLegacyLights = false;
|
|
27590
27722
|
|
|
27591
27723
|
// tone mapping
|
|
27592
27724
|
|
|
@@ -27723,7 +27855,7 @@
|
|
|
27723
27855
|
|
|
27724
27856
|
}
|
|
27725
27857
|
|
|
27726
|
-
if ( _gl instanceof WebGLRenderingContext ) { // @deprecated, r153
|
|
27858
|
+
if ( typeof WebGLRenderingContext !== 'undefined' && _gl instanceof WebGLRenderingContext ) { // @deprecated, r153
|
|
27727
27859
|
|
|
27728
27860
|
console.warn( 'THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163.' );
|
|
27729
27861
|
|
|
@@ -28041,15 +28173,13 @@
|
|
|
28041
28173
|
const g = clearColor.g;
|
|
28042
28174
|
const b = clearColor.b;
|
|
28043
28175
|
|
|
28044
|
-
const __webglFramebuffer = properties.get( _currentRenderTarget ).__webglFramebuffer;
|
|
28045
|
-
|
|
28046
28176
|
if ( isUnsignedType ) {
|
|
28047
28177
|
|
|
28048
28178
|
uintClearColor[ 0 ] = r;
|
|
28049
28179
|
uintClearColor[ 1 ] = g;
|
|
28050
28180
|
uintClearColor[ 2 ] = b;
|
|
28051
28181
|
uintClearColor[ 3 ] = a;
|
|
28052
|
-
_gl.clearBufferuiv( _gl.COLOR,
|
|
28182
|
+
_gl.clearBufferuiv( _gl.COLOR, 0, uintClearColor );
|
|
28053
28183
|
|
|
28054
28184
|
} else {
|
|
28055
28185
|
|
|
@@ -28057,7 +28187,7 @@
|
|
|
28057
28187
|
intClearColor[ 1 ] = g;
|
|
28058
28188
|
intClearColor[ 2 ] = b;
|
|
28059
28189
|
intClearColor[ 3 ] = a;
|
|
28060
|
-
_gl.clearBufferiv( _gl.COLOR,
|
|
28190
|
+
_gl.clearBufferiv( _gl.COLOR, 0, intClearColor );
|
|
28061
28191
|
|
|
28062
28192
|
}
|
|
28063
28193
|
|
|
@@ -28231,6 +28361,9 @@
|
|
|
28231
28361
|
if ( material.wireframe === true ) {
|
|
28232
28362
|
|
|
28233
28363
|
index = geometries.getWireframeAttribute( geometry );
|
|
28364
|
+
|
|
28365
|
+
if ( index === undefined ) return;
|
|
28366
|
+
|
|
28234
28367
|
rangeFactor = 2;
|
|
28235
28368
|
|
|
28236
28369
|
}
|
|
@@ -28395,7 +28528,7 @@
|
|
|
28395
28528
|
|
|
28396
28529
|
} );
|
|
28397
28530
|
|
|
28398
|
-
currentRenderState.setupLights( _this.
|
|
28531
|
+
currentRenderState.setupLights( _this._useLegacyLights );
|
|
28399
28532
|
|
|
28400
28533
|
scene.traverse( function ( object ) {
|
|
28401
28534
|
|
|
@@ -28490,7 +28623,9 @@
|
|
|
28490
28623
|
|
|
28491
28624
|
if ( xr.enabled === true && xr.isPresenting === true ) {
|
|
28492
28625
|
|
|
28493
|
-
|
|
28626
|
+
if ( xr.cameraAutoUpdate === true ) xr.updateCamera( camera );
|
|
28627
|
+
|
|
28628
|
+
camera = xr.getCamera(); // use XR camera for rendering
|
|
28494
28629
|
|
|
28495
28630
|
}
|
|
28496
28631
|
|
|
@@ -28525,6 +28660,8 @@
|
|
|
28525
28660
|
|
|
28526
28661
|
//
|
|
28527
28662
|
|
|
28663
|
+
this.info.render.frame ++;
|
|
28664
|
+
|
|
28528
28665
|
if ( _clippingEnabled === true ) clipping.beginShadows();
|
|
28529
28666
|
|
|
28530
28667
|
const shadowsArray = currentRenderState.state.shadowsArray;
|
|
@@ -28537,7 +28674,6 @@
|
|
|
28537
28674
|
|
|
28538
28675
|
if ( this.info.autoReset === true ) this.info.reset();
|
|
28539
28676
|
|
|
28540
|
-
this.info.render.frame ++;
|
|
28541
28677
|
|
|
28542
28678
|
//
|
|
28543
28679
|
|
|
@@ -28545,7 +28681,7 @@
|
|
|
28545
28681
|
|
|
28546
28682
|
// render scene
|
|
28547
28683
|
|
|
28548
|
-
currentRenderState.setupLights( _this.
|
|
28684
|
+
currentRenderState.setupLights( _this._useLegacyLights );
|
|
28549
28685
|
|
|
28550
28686
|
if ( camera.isArrayCamera ) {
|
|
28551
28687
|
|
|
@@ -28667,19 +28803,6 @@
|
|
|
28667
28803
|
|
|
28668
28804
|
if ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) {
|
|
28669
28805
|
|
|
28670
|
-
if ( object.isSkinnedMesh ) {
|
|
28671
|
-
|
|
28672
|
-
// update skeleton only once in a frame
|
|
28673
|
-
|
|
28674
|
-
if ( object.skeleton.frame !== info.render.frame ) {
|
|
28675
|
-
|
|
28676
|
-
object.skeleton.update();
|
|
28677
|
-
object.skeleton.frame = info.render.frame;
|
|
28678
|
-
|
|
28679
|
-
}
|
|
28680
|
-
|
|
28681
|
-
}
|
|
28682
|
-
|
|
28683
28806
|
const geometry = objects.update( object );
|
|
28684
28807
|
const material = object.material;
|
|
28685
28808
|
|
|
@@ -28780,7 +28903,7 @@
|
|
|
28780
28903
|
generateMipmaps: true,
|
|
28781
28904
|
type: extensions.has( 'EXT_color_buffer_half_float' ) ? HalfFloatType : UnsignedByteType,
|
|
28782
28905
|
minFilter: LinearMipmapLinearFilter,
|
|
28783
|
-
samples: ( isWebGL2
|
|
28906
|
+
samples: ( isWebGL2 ) ? 4 : 0
|
|
28784
28907
|
} );
|
|
28785
28908
|
|
|
28786
28909
|
// debug
|
|
@@ -29047,6 +29170,7 @@
|
|
|
29047
29170
|
|
|
29048
29171
|
materialProperties.outputColorSpace = parameters.outputColorSpace;
|
|
29049
29172
|
materialProperties.instancing = parameters.instancing;
|
|
29173
|
+
materialProperties.instancingColor = parameters.instancingColor;
|
|
29050
29174
|
materialProperties.skinning = parameters.skinning;
|
|
29051
29175
|
materialProperties.morphTargets = parameters.morphTargets;
|
|
29052
29176
|
materialProperties.morphNormals = parameters.morphNormals;
|
|
@@ -29075,7 +29199,18 @@
|
|
|
29075
29199
|
const morphTargets = !! geometry.morphAttributes.position;
|
|
29076
29200
|
const morphNormals = !! geometry.morphAttributes.normal;
|
|
29077
29201
|
const morphColors = !! geometry.morphAttributes.color;
|
|
29078
|
-
|
|
29202
|
+
|
|
29203
|
+
let toneMapping = NoToneMapping;
|
|
29204
|
+
|
|
29205
|
+
if ( material.toneMapped ) {
|
|
29206
|
+
|
|
29207
|
+
if ( _currentRenderTarget === null || _currentRenderTarget.isXRRenderTarget === true ) {
|
|
29208
|
+
|
|
29209
|
+
toneMapping = _this.toneMapping;
|
|
29210
|
+
|
|
29211
|
+
}
|
|
29212
|
+
|
|
29213
|
+
}
|
|
29079
29214
|
|
|
29080
29215
|
const morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color;
|
|
29081
29216
|
const morphTargetsCount = ( morphAttribute !== undefined ) ? morphAttribute.length : 0;
|
|
@@ -29130,6 +29265,14 @@
|
|
|
29130
29265
|
|
|
29131
29266
|
needsProgramChange = true;
|
|
29132
29267
|
|
|
29268
|
+
} else if ( object.isInstancedMesh && materialProperties.instancingColor === true && object.instanceColor === null ) {
|
|
29269
|
+
|
|
29270
|
+
needsProgramChange = true;
|
|
29271
|
+
|
|
29272
|
+
} else if ( object.isInstancedMesh && materialProperties.instancingColor === false && object.instanceColor !== null ) {
|
|
29273
|
+
|
|
29274
|
+
needsProgramChange = true;
|
|
29275
|
+
|
|
29133
29276
|
} else if ( materialProperties.envMap !== envMap ) {
|
|
29134
29277
|
|
|
29135
29278
|
needsProgramChange = true;
|
|
@@ -29545,7 +29688,16 @@
|
|
|
29545
29688
|
|
|
29546
29689
|
if ( renderTarget.isWebGLCubeRenderTarget ) {
|
|
29547
29690
|
|
|
29548
|
-
|
|
29691
|
+
if ( Array.isArray( __webglFramebuffer[ activeCubeFace ] ) ) {
|
|
29692
|
+
|
|
29693
|
+
framebuffer = __webglFramebuffer[ activeCubeFace ][ activeMipmapLevel ];
|
|
29694
|
+
|
|
29695
|
+
} else {
|
|
29696
|
+
|
|
29697
|
+
framebuffer = __webglFramebuffer[ activeCubeFace ];
|
|
29698
|
+
|
|
29699
|
+
}
|
|
29700
|
+
|
|
29549
29701
|
isCube = true;
|
|
29550
29702
|
|
|
29551
29703
|
} else if ( ( capabilities.isWebGL2 && renderTarget.samples > 0 ) && textures.useMultisampledRTT( renderTarget ) === false ) {
|
|
@@ -29554,7 +29706,15 @@
|
|
|
29554
29706
|
|
|
29555
29707
|
} else {
|
|
29556
29708
|
|
|
29557
|
-
|
|
29709
|
+
if ( Array.isArray( __webglFramebuffer ) ) {
|
|
29710
|
+
|
|
29711
|
+
framebuffer = __webglFramebuffer[ activeMipmapLevel ];
|
|
29712
|
+
|
|
29713
|
+
} else {
|
|
29714
|
+
|
|
29715
|
+
framebuffer = __webglFramebuffer;
|
|
29716
|
+
|
|
29717
|
+
}
|
|
29558
29718
|
|
|
29559
29719
|
}
|
|
29560
29720
|
|
|
@@ -29853,14 +30013,14 @@
|
|
|
29853
30013
|
|
|
29854
30014
|
get physicallyCorrectLights() { // @deprecated, r150
|
|
29855
30015
|
|
|
29856
|
-
console.warn( 'THREE.WebGLRenderer:
|
|
30016
|
+
console.warn( 'THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead.' );
|
|
29857
30017
|
return ! this.useLegacyLights;
|
|
29858
30018
|
|
|
29859
30019
|
}
|
|
29860
30020
|
|
|
29861
30021
|
set physicallyCorrectLights( value ) { // @deprecated, r150
|
|
29862
30022
|
|
|
29863
|
-
console.warn( 'THREE.WebGLRenderer:
|
|
30023
|
+
console.warn( 'THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead.' );
|
|
29864
30024
|
this.useLegacyLights = ! value;
|
|
29865
30025
|
|
|
29866
30026
|
}
|
|
@@ -29879,6 +30039,20 @@
|
|
|
29879
30039
|
|
|
29880
30040
|
}
|
|
29881
30041
|
|
|
30042
|
+
get useLegacyLights() { // @deprecated, r155
|
|
30043
|
+
|
|
30044
|
+
console.warn( 'THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733.' );
|
|
30045
|
+
return this._useLegacyLights;
|
|
30046
|
+
|
|
30047
|
+
}
|
|
30048
|
+
|
|
30049
|
+
set useLegacyLights( value ) { // @deprecated, r155
|
|
30050
|
+
|
|
30051
|
+
console.warn( 'THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733.' );
|
|
30052
|
+
this._useLegacyLights = value;
|
|
30053
|
+
|
|
30054
|
+
}
|
|
30055
|
+
|
|
29882
30056
|
}
|
|
29883
30057
|
|
|
29884
30058
|
class WebGL1Renderer extends WebGLRenderer {}
|
|
@@ -29943,20 +30117,6 @@
|
|
|
29943
30117
|
|
|
29944
30118
|
}
|
|
29945
30119
|
|
|
29946
|
-
get autoUpdate() { // @deprecated, r144
|
|
29947
|
-
|
|
29948
|
-
console.warn( 'THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144.' );
|
|
29949
|
-
return this.matrixWorldAutoUpdate;
|
|
29950
|
-
|
|
29951
|
-
}
|
|
29952
|
-
|
|
29953
|
-
set autoUpdate( value ) { // @deprecated, r144
|
|
29954
|
-
|
|
29955
|
-
console.warn( 'THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144.' );
|
|
29956
|
-
this.matrixWorldAutoUpdate = value;
|
|
29957
|
-
|
|
29958
|
-
}
|
|
29959
|
-
|
|
29960
30120
|
}
|
|
29961
30121
|
|
|
29962
30122
|
class InterleavedBuffer {
|
|
@@ -35761,6 +35921,8 @@
|
|
|
35761
35921
|
|
|
35762
35922
|
}
|
|
35763
35923
|
|
|
35924
|
+
Loader.DEFAULT_MATERIAL_NAME = '__DEFAULT';
|
|
35925
|
+
|
|
35764
35926
|
class ImageLoader extends Loader {
|
|
35765
35927
|
|
|
35766
35928
|
constructor( manager ) {
|
|
@@ -43359,14 +43521,21 @@
|
|
|
43359
43521
|
}
|
|
43360
43522
|
|
|
43361
43523
|
|
|
43362
|
-
|
|
43363
|
-
|
|
43524
|
+
/**
|
|
43525
|
+
* Modifies the supplied geometry if it is non-indexed, otherwise creates a new,
|
|
43526
|
+
* non-indexed geometry. Returns the geometry with smooth normals everywhere except
|
|
43527
|
+
* faces that meet at an angle greater than the crease angle.
|
|
43528
|
+
*
|
|
43529
|
+
* @param {BufferGeometry} geometry
|
|
43530
|
+
* @param {number} [creaseAngle]
|
|
43531
|
+
* @return {BufferGeometry}
|
|
43532
|
+
*/
|
|
43364
43533
|
function toCreasedNormals( geometry, creaseAngle = Math.PI / 3 /* 60 degrees */ ) {
|
|
43365
43534
|
|
|
43366
43535
|
const creaseDot = Math.cos( creaseAngle );
|
|
43367
43536
|
const hashMultiplier = ( 1 + 1e-10 ) * 1e2;
|
|
43368
43537
|
|
|
43369
|
-
// reusable
|
|
43538
|
+
// reusable vectors
|
|
43370
43539
|
const verts = [ new Vector3(), new Vector3(), new Vector3() ];
|
|
43371
43540
|
const tempVec1 = new Vector3();
|
|
43372
43541
|
const tempVec2 = new Vector3();
|
|
@@ -43383,7 +43552,9 @@
|
|
|
43383
43552
|
|
|
43384
43553
|
}
|
|
43385
43554
|
|
|
43386
|
-
|
|
43555
|
+
// BufferGeometry.toNonIndexed() warns if the geometry is non-indexed
|
|
43556
|
+
// and returns the original geometry
|
|
43557
|
+
const resultGeometry = geometry.index ? geometry.toNonIndexed() : geometry;
|
|
43387
43558
|
const posAttr = resultGeometry.attributes.position;
|
|
43388
43559
|
const vertexMap = {};
|
|
43389
43560
|
|
|
@@ -66809,12 +66980,20 @@
|
|
|
66809
66980
|
margin: margin,
|
|
66810
66981
|
curvatureResolution: curvatureResolution
|
|
66811
66982
|
};
|
|
66983
|
+
var memD = {
|
|
66984
|
+
geoJson: geoJson,
|
|
66985
|
+
h3Res: h3Res
|
|
66986
|
+
};
|
|
66812
66987
|
var currentTargetD = obj.__currentTargetD || Object.assign({}, targetD, {
|
|
66813
66988
|
alt: -1e-3
|
|
66814
66989
|
});
|
|
66990
|
+
var currentMemD = obj.__currentMemD || memD;
|
|
66815
66991
|
if (Object.keys(targetD).some(function (k) {
|
|
66816
66992
|
return currentTargetD[k] !== targetD[k];
|
|
66993
|
+
}) || Object.keys(memD).some(function (k) {
|
|
66994
|
+
return currentMemD[k] !== memD[k];
|
|
66817
66995
|
})) {
|
|
66996
|
+
obj.__currentMemD = memD;
|
|
66818
66997
|
var h3Idxs = [];
|
|
66819
66998
|
if (geoJson.type === 'Polygon') {
|
|
66820
66999
|
polygonToCells(geoJson.coordinates, h3Res, true).forEach(function (idx) {
|
|
@@ -67469,6 +67648,7 @@
|
|
|
67469
67648
|
var THREE$5 = _objectSpread2(_objectSpread2({}, window.THREE ? window.THREE // Prefer consumption from global THREE, if exists
|
|
67470
67649
|
: {
|
|
67471
67650
|
CircleGeometry: CircleGeometry,
|
|
67651
|
+
DoubleSide: DoubleSide,
|
|
67472
67652
|
Group: Group$1,
|
|
67473
67653
|
Mesh: Mesh,
|
|
67474
67654
|
MeshLambertMaterial: MeshLambertMaterial,
|
|
@@ -67565,6 +67745,7 @@
|
|
|
67565
67745
|
threeDigest(state.labelsData, state.scene, {
|
|
67566
67746
|
createObj: function createObj() {
|
|
67567
67747
|
var material = new THREE$5.MeshLambertMaterial();
|
|
67748
|
+
material.side = DoubleSide;
|
|
67568
67749
|
var obj = new THREE$5.Group(); // container
|
|
67569
67750
|
|
|
67570
67751
|
obj.add(new THREE$5.Mesh(circleGeometry, material)); // dot
|
|
@@ -69211,6 +69392,9 @@
|
|
|
69211
69392
|
const _changeEvent$1 = { type: 'change' };
|
|
69212
69393
|
const _startEvent = { type: 'start' };
|
|
69213
69394
|
const _endEvent = { type: 'end' };
|
|
69395
|
+
const _ray = new Ray();
|
|
69396
|
+
const _plane = new Plane();
|
|
69397
|
+
const TILT_LIMIT = Math.cos( 70 * MathUtils.DEG2RAD );
|
|
69214
69398
|
|
|
69215
69399
|
class OrbitControls extends EventDispatcher {
|
|
69216
69400
|
|
|
@@ -69265,6 +69449,7 @@
|
|
|
69265
69449
|
this.panSpeed = 1.0;
|
|
69266
69450
|
this.screenSpacePanning = true; // if false, pan orthogonal to world-space direction camera.up
|
|
69267
69451
|
this.keyPanSpeed = 7.0; // pixels moved per arrow key push
|
|
69452
|
+
this.zoomToCursor = false;
|
|
69268
69453
|
|
|
69269
69454
|
// Set to true to automatically rotate around the target
|
|
69270
69455
|
// If auto-rotate is enabled, you must call controls.update() in your animation loop
|
|
@@ -69423,11 +69608,6 @@
|
|
|
69423
69608
|
spherical.makeSafe();
|
|
69424
69609
|
|
|
69425
69610
|
|
|
69426
|
-
spherical.radius *= scale;
|
|
69427
|
-
|
|
69428
|
-
// restrict radius to be between desired limits
|
|
69429
|
-
spherical.radius = Math.max( scope.minDistance, Math.min( scope.maxDistance, spherical.radius ) );
|
|
69430
|
-
|
|
69431
69611
|
// move target to panned location
|
|
69432
69612
|
|
|
69433
69613
|
if ( scope.enableDamping === true ) {
|
|
@@ -69440,6 +69620,19 @@
|
|
|
69440
69620
|
|
|
69441
69621
|
}
|
|
69442
69622
|
|
|
69623
|
+
// adjust the camera position based on zoom only if we're not zooming to the cursor or if it's an ortho camera
|
|
69624
|
+
// we adjust zoom later in these cases
|
|
69625
|
+
if ( scope.zoomToCursor && performCursorZoom || scope.object.isOrthographicCamera ) {
|
|
69626
|
+
|
|
69627
|
+
spherical.radius = clampDistance( spherical.radius );
|
|
69628
|
+
|
|
69629
|
+
} else {
|
|
69630
|
+
|
|
69631
|
+
spherical.radius = clampDistance( spherical.radius * scale );
|
|
69632
|
+
|
|
69633
|
+
}
|
|
69634
|
+
|
|
69635
|
+
|
|
69443
69636
|
offset.setFromSpherical( spherical );
|
|
69444
69637
|
|
|
69445
69638
|
// rotate offset back to "camera-up-vector-is-up" space
|
|
@@ -69464,7 +69657,91 @@
|
|
|
69464
69657
|
|
|
69465
69658
|
}
|
|
69466
69659
|
|
|
69660
|
+
// adjust camera position
|
|
69661
|
+
let zoomChanged = false;
|
|
69662
|
+
if ( scope.zoomToCursor && performCursorZoom ) {
|
|
69663
|
+
|
|
69664
|
+
let newRadius = null;
|
|
69665
|
+
if ( scope.object.isPerspectiveCamera ) {
|
|
69666
|
+
|
|
69667
|
+
// move the camera down the pointer ray
|
|
69668
|
+
// this method avoids floating point error
|
|
69669
|
+
const prevRadius = offset.length();
|
|
69670
|
+
newRadius = clampDistance( prevRadius * scale );
|
|
69671
|
+
|
|
69672
|
+
const radiusDelta = prevRadius - newRadius;
|
|
69673
|
+
scope.object.position.addScaledVector( dollyDirection, radiusDelta );
|
|
69674
|
+
scope.object.updateMatrixWorld();
|
|
69675
|
+
|
|
69676
|
+
} else if ( scope.object.isOrthographicCamera ) {
|
|
69677
|
+
|
|
69678
|
+
// adjust the ortho camera position based on zoom changes
|
|
69679
|
+
const mouseBefore = new Vector3( mouse.x, mouse.y, 0 );
|
|
69680
|
+
mouseBefore.unproject( scope.object );
|
|
69681
|
+
|
|
69682
|
+
scope.object.zoom = Math.max( scope.minZoom, Math.min( scope.maxZoom, scope.object.zoom / scale ) );
|
|
69683
|
+
scope.object.updateProjectionMatrix();
|
|
69684
|
+
zoomChanged = true;
|
|
69685
|
+
|
|
69686
|
+
const mouseAfter = new Vector3( mouse.x, mouse.y, 0 );
|
|
69687
|
+
mouseAfter.unproject( scope.object );
|
|
69688
|
+
|
|
69689
|
+
scope.object.position.sub( mouseAfter ).add( mouseBefore );
|
|
69690
|
+
scope.object.updateMatrixWorld();
|
|
69691
|
+
|
|
69692
|
+
newRadius = offset.length();
|
|
69693
|
+
|
|
69694
|
+
} else {
|
|
69695
|
+
|
|
69696
|
+
console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled.' );
|
|
69697
|
+
scope.zoomToCursor = false;
|
|
69698
|
+
|
|
69699
|
+
}
|
|
69700
|
+
|
|
69701
|
+
// handle the placement of the target
|
|
69702
|
+
if ( newRadius !== null ) {
|
|
69703
|
+
|
|
69704
|
+
if ( this.screenSpacePanning ) {
|
|
69705
|
+
|
|
69706
|
+
// position the orbit target in front of the new camera position
|
|
69707
|
+
scope.target.set( 0, 0, - 1 )
|
|
69708
|
+
.transformDirection( scope.object.matrix )
|
|
69709
|
+
.multiplyScalar( newRadius )
|
|
69710
|
+
.add( scope.object.position );
|
|
69711
|
+
|
|
69712
|
+
} else {
|
|
69713
|
+
|
|
69714
|
+
// get the ray and translation plane to compute target
|
|
69715
|
+
_ray.origin.copy( scope.object.position );
|
|
69716
|
+
_ray.direction.set( 0, 0, - 1 ).transformDirection( scope.object.matrix );
|
|
69717
|
+
|
|
69718
|
+
// if the camera is 20 degrees above the horizon then don't adjust the focus target to avoid
|
|
69719
|
+
// extremely large values
|
|
69720
|
+
if ( Math.abs( scope.object.up.dot( _ray.direction ) ) < TILT_LIMIT ) {
|
|
69721
|
+
|
|
69722
|
+
object.lookAt( scope.target );
|
|
69723
|
+
|
|
69724
|
+
} else {
|
|
69725
|
+
|
|
69726
|
+
_plane.setFromNormalAndCoplanarPoint( scope.object.up, scope.target );
|
|
69727
|
+
_ray.intersectPlane( _plane, scope.target );
|
|
69728
|
+
|
|
69729
|
+
}
|
|
69730
|
+
|
|
69731
|
+
}
|
|
69732
|
+
|
|
69733
|
+
}
|
|
69734
|
+
|
|
69735
|
+
} else if ( scope.object.isOrthographicCamera ) {
|
|
69736
|
+
|
|
69737
|
+
scope.object.zoom = Math.max( scope.minZoom, Math.min( scope.maxZoom, scope.object.zoom / scale ) );
|
|
69738
|
+
scope.object.updateProjectionMatrix();
|
|
69739
|
+
zoomChanged = true;
|
|
69740
|
+
|
|
69741
|
+
}
|
|
69742
|
+
|
|
69467
69743
|
scale = 1;
|
|
69744
|
+
performCursorZoom = false;
|
|
69468
69745
|
|
|
69469
69746
|
// update condition is:
|
|
69470
69747
|
// min(camera displacement, camera rotation in radians)^2 > EPS
|
|
@@ -69543,7 +69820,6 @@
|
|
|
69543
69820
|
|
|
69544
69821
|
let scale = 1;
|
|
69545
69822
|
const panOffset = new Vector3();
|
|
69546
|
-
let zoomChanged = false;
|
|
69547
69823
|
|
|
69548
69824
|
const rotateStart = new Vector2();
|
|
69549
69825
|
const rotateEnd = new Vector2();
|
|
@@ -69557,6 +69833,10 @@
|
|
|
69557
69833
|
const dollyEnd = new Vector2();
|
|
69558
69834
|
const dollyDelta = new Vector2();
|
|
69559
69835
|
|
|
69836
|
+
const dollyDirection = new Vector3();
|
|
69837
|
+
const mouse = new Vector2();
|
|
69838
|
+
let performCursorZoom = false;
|
|
69839
|
+
|
|
69560
69840
|
const pointers = [];
|
|
69561
69841
|
const pointerPositions = {};
|
|
69562
69842
|
|
|
@@ -69667,16 +69947,10 @@
|
|
|
69667
69947
|
|
|
69668
69948
|
function dollyOut( dollyScale ) {
|
|
69669
69949
|
|
|
69670
|
-
if ( scope.object.isPerspectiveCamera ) {
|
|
69950
|
+
if ( scope.object.isPerspectiveCamera || scope.object.isOrthographicCamera ) {
|
|
69671
69951
|
|
|
69672
69952
|
scale /= dollyScale;
|
|
69673
69953
|
|
|
69674
|
-
} else if ( scope.object.isOrthographicCamera ) {
|
|
69675
|
-
|
|
69676
|
-
scope.object.zoom = Math.max( scope.minZoom, Math.min( scope.maxZoom, scope.object.zoom * dollyScale ) );
|
|
69677
|
-
scope.object.updateProjectionMatrix();
|
|
69678
|
-
zoomChanged = true;
|
|
69679
|
-
|
|
69680
69954
|
} else {
|
|
69681
69955
|
|
|
69682
69956
|
console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );
|
|
@@ -69688,16 +69962,10 @@
|
|
|
69688
69962
|
|
|
69689
69963
|
function dollyIn( dollyScale ) {
|
|
69690
69964
|
|
|
69691
|
-
if ( scope.object.isPerspectiveCamera ) {
|
|
69965
|
+
if ( scope.object.isPerspectiveCamera || scope.object.isOrthographicCamera ) {
|
|
69692
69966
|
|
|
69693
69967
|
scale *= dollyScale;
|
|
69694
69968
|
|
|
69695
|
-
} else if ( scope.object.isOrthographicCamera ) {
|
|
69696
|
-
|
|
69697
|
-
scope.object.zoom = Math.max( scope.minZoom, Math.min( scope.maxZoom, scope.object.zoom / dollyScale ) );
|
|
69698
|
-
scope.object.updateProjectionMatrix();
|
|
69699
|
-
zoomChanged = true;
|
|
69700
|
-
|
|
69701
69969
|
} else {
|
|
69702
69970
|
|
|
69703
69971
|
console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );
|
|
@@ -69707,6 +69975,35 @@
|
|
|
69707
69975
|
|
|
69708
69976
|
}
|
|
69709
69977
|
|
|
69978
|
+
function updateMouseParameters( event ) {
|
|
69979
|
+
|
|
69980
|
+
if ( ! scope.zoomToCursor ) {
|
|
69981
|
+
|
|
69982
|
+
return;
|
|
69983
|
+
|
|
69984
|
+
}
|
|
69985
|
+
|
|
69986
|
+
performCursorZoom = true;
|
|
69987
|
+
|
|
69988
|
+
const rect = scope.domElement.getBoundingClientRect();
|
|
69989
|
+
const x = event.clientX - rect.left;
|
|
69990
|
+
const y = event.clientY - rect.top;
|
|
69991
|
+
const w = rect.width;
|
|
69992
|
+
const h = rect.height;
|
|
69993
|
+
|
|
69994
|
+
mouse.x = ( x / w ) * 2 - 1;
|
|
69995
|
+
mouse.y = - ( y / h ) * 2 + 1;
|
|
69996
|
+
|
|
69997
|
+
dollyDirection.set( mouse.x, mouse.y, 1 ).unproject( object ).sub( object.position ).normalize();
|
|
69998
|
+
|
|
69999
|
+
}
|
|
70000
|
+
|
|
70001
|
+
function clampDistance( dist ) {
|
|
70002
|
+
|
|
70003
|
+
return Math.max( scope.minDistance, Math.min( scope.maxDistance, dist ) );
|
|
70004
|
+
|
|
70005
|
+
}
|
|
70006
|
+
|
|
69710
70007
|
//
|
|
69711
70008
|
// event callbacks - update the object state
|
|
69712
70009
|
//
|
|
@@ -69719,6 +70016,7 @@
|
|
|
69719
70016
|
|
|
69720
70017
|
function handleMouseDownDolly( event ) {
|
|
69721
70018
|
|
|
70019
|
+
updateMouseParameters( event );
|
|
69722
70020
|
dollyStart.set( event.clientX, event.clientY );
|
|
69723
70021
|
|
|
69724
70022
|
}
|
|
@@ -69785,6 +70083,8 @@
|
|
|
69785
70083
|
|
|
69786
70084
|
function handleMouseWheel( event ) {
|
|
69787
70085
|
|
|
70086
|
+
updateMouseParameters( event );
|
|
70087
|
+
|
|
69788
70088
|
if ( event.deltaY < 0 ) {
|
|
69789
70089
|
|
|
69790
70090
|
dollyIn( getZoomScale() );
|
|
@@ -70469,6 +70769,9 @@
|
|
|
70469
70769
|
|
|
70470
70770
|
// API
|
|
70471
70771
|
|
|
70772
|
+
// Set to false to disable this control
|
|
70773
|
+
this.enabled = true;
|
|
70774
|
+
|
|
70472
70775
|
this.movementSpeed = 1.0;
|
|
70473
70776
|
this.rollSpeed = 0.005;
|
|
70474
70777
|
|
|
@@ -70496,7 +70799,7 @@
|
|
|
70496
70799
|
|
|
70497
70800
|
this.keydown = function ( event ) {
|
|
70498
70801
|
|
|
70499
|
-
if ( event.altKey ) {
|
|
70802
|
+
if ( event.altKey || this.enabled === false ) {
|
|
70500
70803
|
|
|
70501
70804
|
return;
|
|
70502
70805
|
|
|
@@ -70534,6 +70837,8 @@
|
|
|
70534
70837
|
|
|
70535
70838
|
this.keyup = function ( event ) {
|
|
70536
70839
|
|
|
70840
|
+
if ( this.enabled === false ) return;
|
|
70841
|
+
|
|
70537
70842
|
switch ( event.code ) {
|
|
70538
70843
|
|
|
70539
70844
|
case 'ShiftLeft':
|
|
@@ -70566,6 +70871,8 @@
|
|
|
70566
70871
|
|
|
70567
70872
|
this.pointerdown = function ( event ) {
|
|
70568
70873
|
|
|
70874
|
+
if ( this.enabled === false ) return;
|
|
70875
|
+
|
|
70569
70876
|
if ( this.dragToLook ) {
|
|
70570
70877
|
|
|
70571
70878
|
this.status ++;
|
|
@@ -70587,6 +70894,8 @@
|
|
|
70587
70894
|
|
|
70588
70895
|
this.pointermove = function ( event ) {
|
|
70589
70896
|
|
|
70897
|
+
if ( this.enabled === false ) return;
|
|
70898
|
+
|
|
70590
70899
|
if ( ! this.dragToLook || this.status > 0 ) {
|
|
70591
70900
|
|
|
70592
70901
|
const container = this.getContainerDimensions();
|
|
@@ -70604,6 +70913,8 @@
|
|
|
70604
70913
|
|
|
70605
70914
|
this.pointerup = function ( event ) {
|
|
70606
70915
|
|
|
70916
|
+
if ( this.enabled === false ) return;
|
|
70917
|
+
|
|
70607
70918
|
if ( this.dragToLook ) {
|
|
70608
70919
|
|
|
70609
70920
|
this.status --;
|
|
@@ -70627,8 +70938,18 @@
|
|
|
70627
70938
|
|
|
70628
70939
|
};
|
|
70629
70940
|
|
|
70941
|
+
this.contextMenu = function ( event ) {
|
|
70942
|
+
|
|
70943
|
+
if ( this.enabled === false ) return;
|
|
70944
|
+
|
|
70945
|
+
event.preventDefault();
|
|
70946
|
+
|
|
70947
|
+
};
|
|
70948
|
+
|
|
70630
70949
|
this.update = function ( delta ) {
|
|
70631
70950
|
|
|
70951
|
+
if ( this.enabled === false ) return;
|
|
70952
|
+
|
|
70632
70953
|
const moveMult = delta * scope.movementSpeed;
|
|
70633
70954
|
const rotMult = delta * scope.rollSpeed;
|
|
70634
70955
|
|
|
@@ -70696,7 +71017,7 @@
|
|
|
70696
71017
|
|
|
70697
71018
|
this.dispose = function () {
|
|
70698
71019
|
|
|
70699
|
-
this.domElement.removeEventListener( 'contextmenu',
|
|
71020
|
+
this.domElement.removeEventListener( 'contextmenu', _contextmenu );
|
|
70700
71021
|
this.domElement.removeEventListener( 'pointerdown', _pointerdown );
|
|
70701
71022
|
this.domElement.removeEventListener( 'pointermove', _pointermove );
|
|
70702
71023
|
this.domElement.removeEventListener( 'pointerup', _pointerup );
|
|
@@ -70706,13 +71027,14 @@
|
|
|
70706
71027
|
|
|
70707
71028
|
};
|
|
70708
71029
|
|
|
71030
|
+
const _contextmenu = this.contextMenu.bind( this );
|
|
70709
71031
|
const _pointermove = this.pointermove.bind( this );
|
|
70710
71032
|
const _pointerdown = this.pointerdown.bind( this );
|
|
70711
71033
|
const _pointerup = this.pointerup.bind( this );
|
|
70712
71034
|
const _keydown = this.keydown.bind( this );
|
|
70713
71035
|
const _keyup = this.keyup.bind( this );
|
|
70714
71036
|
|
|
70715
|
-
this.domElement.addEventListener( 'contextmenu',
|
|
71037
|
+
this.domElement.addEventListener( 'contextmenu', _contextmenu );
|
|
70716
71038
|
this.domElement.addEventListener( 'pointerdown', _pointerdown );
|
|
70717
71039
|
this.domElement.addEventListener( 'pointermove', _pointermove );
|
|
70718
71040
|
this.domElement.addEventListener( 'pointerup', _pointerup );
|
|
@@ -70727,12 +71049,6 @@
|
|
|
70727
71049
|
|
|
70728
71050
|
}
|
|
70729
71051
|
|
|
70730
|
-
function contextmenu( event ) {
|
|
70731
|
-
|
|
70732
|
-
event.preventDefault();
|
|
70733
|
-
|
|
70734
|
-
}
|
|
70735
|
-
|
|
70736
71052
|
/**
|
|
70737
71053
|
* Full-screen textured quad shader
|
|
70738
71054
|
*/
|
|
@@ -70769,8 +71085,8 @@
|
|
|
70769
71085
|
|
|
70770
71086
|
void main() {
|
|
70771
71087
|
|
|
70772
|
-
|
|
70773
|
-
gl_FragColor
|
|
71088
|
+
vec4 texel = texture2D( tDiffuse, vUv );
|
|
71089
|
+
gl_FragColor = opacity * texel;
|
|
70774
71090
|
|
|
70775
71091
|
|
|
70776
71092
|
}`
|
|
@@ -70986,11 +71302,14 @@
|
|
|
70986
71302
|
if ( this.clear ) renderer.clear();
|
|
70987
71303
|
renderer.render( this.scene, this.camera );
|
|
70988
71304
|
|
|
70989
|
-
// unlock color and depth buffer for subsequent rendering
|
|
71305
|
+
// unlock color and depth buffer and make them writable for subsequent rendering/clearing
|
|
70990
71306
|
|
|
70991
71307
|
state.buffers.color.setLocked( false );
|
|
70992
71308
|
state.buffers.depth.setLocked( false );
|
|
70993
71309
|
|
|
71310
|
+
state.buffers.color.setMask( true );
|
|
71311
|
+
state.buffers.depth.setMask( true );
|
|
71312
|
+
|
|
70994
71313
|
// only render where stencil is set to 1
|
|
70995
71314
|
|
|
70996
71315
|
state.buffers.stencil.setLocked( false );
|
|
@@ -71057,6 +71376,7 @@
|
|
|
71057
71376
|
this.passes = [];
|
|
71058
71377
|
|
|
71059
71378
|
this.copyPass = new ShaderPass( CopyShader );
|
|
71379
|
+
this.copyPass.material.blending = NoBlending;
|
|
71060
71380
|
|
|
71061
71381
|
this.clock = new Clock();
|
|
71062
71382
|
|
|
@@ -72092,7 +72412,7 @@
|
|
|
72092
72412
|
}
|
|
72093
72413
|
}
|
|
72094
72414
|
|
|
72095
|
-
var css_248z = ".scene-nav-info {\n bottom: 5px;\n width: 100%;\n text-align: center;\n color: slategrey;\n opacity: 0.7;\n font-size: 10px;\n}\n\n.scene-tooltip {\n top: 0;\n color: lavender;\n font-size: 15px;\n}\n\n.scene-nav-info, .scene-tooltip {\n position: absolute;\n font-family: sans-serif;\n pointer-events: none;\n}\n\n.scene-container canvas:focus {\n outline: none;\n}";
|
|
72415
|
+
var css_248z = ".scene-nav-info {\n bottom: 5px;\n width: 100%;\n text-align: center;\n color: slategrey;\n opacity: 0.7;\n font-size: 10px;\n}\n\n.scene-tooltip {\n top: 0;\n color: lavender;\n font-size: 15px;\n}\n\n.scene-nav-info, .scene-tooltip {\n position: absolute;\n font-family: sans-serif;\n pointer-events: none;\n user-select: none;\n}\n\n.scene-container canvas:focus {\n outline: none;\n}";
|
|
72096
72416
|
styleInject(css_248z);
|
|
72097
72417
|
|
|
72098
72418
|
function _iterableToArrayLimit(arr, i) {
|
|
@@ -73148,9 +73468,10 @@
|
|
|
73148
73468
|
return d;
|
|
73149
73469
|
}
|
|
73150
73470
|
};
|
|
73471
|
+
state.renderObjs.renderer().useLegacyLights = false; // force behavior of three < 155
|
|
73151
73472
|
state.renderObjs.objects([
|
|
73152
73473
|
// Populate scene
|
|
73153
|
-
new THREE.AmbientLight(0xcccccc), new THREE.DirectionalLight(0xffffff, 0.6), state.globe]).hoverOrderComparator(function (a, b) {
|
|
73474
|
+
new THREE.AmbientLight(0xcccccc, Math.PI), new THREE.DirectionalLight(0xffffff, 0.6 * Math.PI), state.globe]).hoverOrderComparator(function (a, b) {
|
|
73154
73475
|
var aObj = getGlobeObj(a);
|
|
73155
73476
|
var bObj = getGlobeObj(b);
|
|
73156
73477
|
|