|
@@ -165,7 +165,7 @@ c.name&&(g.name=c.name);"{}"!==JSON.stringify(c.userData)&&(g.userData=c.userDat
|
|
c.color.getHex(),g.intensity=c.intensity;else if(c instanceof THREE.PointLight)g.color=c.color.getHex(),g.intensity=c.intensity,g.distance=c.distance;else if(c instanceof THREE.SpotLight)g.color=c.color.getHex(),g.intensity=c.intensity,g.distance=c.distance,g.angle=c.angle,g.exponent=c.exponent;else if(c instanceof THREE.HemisphereLight)g.color=c.color.getHex(),g.groundColor=c.groundColor.getHex();else if(c instanceof THREE.Mesh){var h=c.geometry;void 0===a.geometries&&(a.geometries=[]);if(void 0===
|
|
c.color.getHex(),g.intensity=c.intensity;else if(c instanceof THREE.PointLight)g.color=c.color.getHex(),g.intensity=c.intensity,g.distance=c.distance;else if(c instanceof THREE.SpotLight)g.color=c.color.getHex(),g.intensity=c.intensity,g.distance=c.distance,g.angle=c.angle,g.exponent=c.exponent;else if(c instanceof THREE.HemisphereLight)g.color=c.color.getHex(),g.groundColor=c.groundColor.getHex();else if(c instanceof THREE.Mesh){var h=c.geometry;void 0===a.geometries&&(a.geometries=[]);if(void 0===
|
|
b[h.uuid]){var k=h.toJSON();delete k.metadata;b[h.uuid]=k;a.geometries.push(k)}g.geometry=h.uuid;g.material=d(c.material)}else c instanceof THREE.Sprite&&(g.material=d(c.material));g.matrix=c.matrix.toArray();if(0<c.children.length)for(g.children=[],h=0;h<c.children.length;h++)g.children.push(e(c.children[h]));return g};a.object=e(this);return a},clone:function(a,b){void 0===a&&(a=new THREE.Object3D);void 0===b&&(b=!0);a.name=this.name;a.up.copy(this.up);a.position.copy(this.position);a.quaternion.copy(this.quaternion);
|
|
b[h.uuid]){var k=h.toJSON();delete k.metadata;b[h.uuid]=k;a.geometries.push(k)}g.geometry=h.uuid;g.material=d(c.material)}else c instanceof THREE.Sprite&&(g.material=d(c.material));g.matrix=c.matrix.toArray();if(0<c.children.length)for(g.children=[],h=0;h<c.children.length;h++)g.children.push(e(c.children[h]));return g};a.object=e(this);return a},clone:function(a,b){void 0===a&&(a=new THREE.Object3D);void 0===b&&(b=!0);a.name=this.name;a.up.copy(this.up);a.position.copy(this.position);a.quaternion.copy(this.quaternion);
|
|
a.scale.copy(this.scale);a.renderDepth=this.renderDepth;a.rotationAutoUpdate=this.rotationAutoUpdate;a.matrix.copy(this.matrix);a.matrixWorld.copy(this.matrixWorld);a.matrixAutoUpdate=this.matrixAutoUpdate;a.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate;a.visible=this.visible;a.castShadow=this.castShadow;a.receiveShadow=this.receiveShadow;a.frustumCulled=this.frustumCulled;a.userData=JSON.parse(JSON.stringify(this.userData));void 0!==this.script&&(a.script=this.script.clone());if(!0===b)for(var c=
|
|
a.scale.copy(this.scale);a.renderDepth=this.renderDepth;a.rotationAutoUpdate=this.rotationAutoUpdate;a.matrix.copy(this.matrix);a.matrixWorld.copy(this.matrixWorld);a.matrixAutoUpdate=this.matrixAutoUpdate;a.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate;a.visible=this.visible;a.castShadow=this.castShadow;a.receiveShadow=this.receiveShadow;a.frustumCulled=this.frustumCulled;a.userData=JSON.parse(JSON.stringify(this.userData));void 0!==this.script&&(a.script=this.script.clone());if(!0===b)for(var c=
|
|
-0;c<this.children.length;c++)a.add(this.children[c].clone());return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype);THREE.Object3DIdCount=0;
|
|
|
|
|
|
+0;c<this.children.length;c++)a.add(this.children[c].clone());return a}};THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype);THREE.Object3DIdCount=0;
|
|
THREE.Projector=function(){function a(){if(q===t){var a=new THREE.RenderableVertex;s.push(a);t++;q++;return a}return s[q++]}function b(){if(p===x){var a=new THREE.RenderableFace;v.push(a);x++;p++;return a}return v[p++]}function c(){if(E===z){var a=new THREE.RenderableLine;y.push(a);z++;E++;return a}return y[E++]}function d(){if(D===A){var a=new THREE.RenderableSprite;w.push(a);A++;D++;return a}return w[D++]}function e(a,b){return a.z!==b.z?b.z-a.z:a.id!==b.id?a.id-b.id:0}function f(a,b){var c=0,d=
|
|
THREE.Projector=function(){function a(){if(q===t){var a=new THREE.RenderableVertex;s.push(a);t++;q++;return a}return s[q++]}function b(){if(p===x){var a=new THREE.RenderableFace;v.push(a);x++;p++;return a}return v[p++]}function c(){if(E===z){var a=new THREE.RenderableLine;y.push(a);z++;E++;return a}return y[E++]}function d(){if(D===A){var a=new THREE.RenderableSprite;w.push(a);A++;D++;return a}return w[D++]}function e(a,b){return a.z!==b.z?b.z-a.z:a.id!==b.id?a.id-b.id:0}function f(a,b){var c=0,d=
|
|
1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;if(0<=e&&0<=f&&0<=g&&0<=h)return!0;if(0>e&&0>f||0>g&&0>h)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>g?c=Math.max(c,g/(g-h)):0>h&&(d=Math.min(d,g/(g-h)));if(d<c)return!1;a.lerp(b,c);b.lerp(a,1-d);return!0}var g,h,k=[],m=0,n,q,s=[],t=0,r,p,v=[],x=0,u,E,y=[],z=0,B,D,w=[],A=0,N={objects:[],lights:[],elements:[]},P=new THREE.Vector3,K=new THREE.Vector3,R=new THREE.Vector3,M=new THREE.Vector3,H=new THREE.Vector4,C=new THREE.Box3(new THREE.Vector3(-1,
|
|
1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;if(0<=e&&0<=f&&0<=g&&0<=h)return!0;if(0>e&&0>f||0>g&&0>h)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>g?c=Math.max(c,g/(g-h)):0>h&&(d=Math.min(d,g/(g-h)));if(d<c)return!1;a.lerp(b,c);b.lerp(a,1-d);return!0}var g,h,k=[],m=0,n,q,s=[],t=0,r,p,v=[],x=0,u,E,y=[],z=0,B,D,w=[],A=0,N={objects:[],lights:[],elements:[]},P=new THREE.Vector3,K=new THREE.Vector3,R=new THREE.Vector3,M=new THREE.Vector3,H=new THREE.Vector4,C=new THREE.Box3(new THREE.Vector3(-1,
|
|
-1,-1),new THREE.Vector3(1,1,1)),T=new THREE.Box3,L=Array(3),V=new THREE.Matrix4,J=new THREE.Matrix4,Y,aa=new THREE.Matrix4,na=new THREE.Matrix3,I=new THREE.Frustum,ba=new THREE.Vector4,Q=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);J.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);return a.applyProjection(J)};this.unprojectVector=function(){var a=new THREE.Matrix4;return function(b,c){a.getInverse(c.projectionMatrix);J.multiplyMatrices(c.matrixWorld,
|
|
-1,-1),new THREE.Vector3(1,1,1)),T=new THREE.Box3,L=Array(3),V=new THREE.Matrix4,J=new THREE.Matrix4,Y,aa=new THREE.Matrix4,na=new THREE.Matrix3,I=new THREE.Frustum,ba=new THREE.Vector4,Q=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);J.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);return a.applyProjection(J)};this.unprojectVector=function(){var a=new THREE.Matrix4;return function(b,c){a.getInverse(c.projectionMatrix);J.multiplyMatrices(c.matrixWorld,
|
|
@@ -425,7 +425,7 @@ THREE.ShaderChunk.worldpos_vertex="#if defined( USE_ENVMAP ) || defined( PHONG )
|
|
THREE.ShaderChunk.shadowmap_pars_fragment="#ifdef USE_SHADOWMAP\n\n\tuniform sampler2D shadowMap[ MAX_SHADOWS ];\n\tuniform vec2 shadowMapSize[ MAX_SHADOWS ];\n\n\tuniform float shadowDarkness[ MAX_SHADOWS ];\n\tuniform float shadowBias[ MAX_SHADOWS ];\n\n\tvarying vec4 vShadowCoord[ MAX_SHADOWS ];\n\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\n\t\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\tfloat depth = dot( rgba_depth, bit_shift );\n\t\treturn depth;\n\n\t}\n\n#endif";
|
|
THREE.ShaderChunk.shadowmap_pars_fragment="#ifdef USE_SHADOWMAP\n\n\tuniform sampler2D shadowMap[ MAX_SHADOWS ];\n\tuniform vec2 shadowMapSize[ MAX_SHADOWS ];\n\n\tuniform float shadowDarkness[ MAX_SHADOWS ];\n\tuniform float shadowBias[ MAX_SHADOWS ];\n\n\tvarying vec4 vShadowCoord[ MAX_SHADOWS ];\n\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\n\t\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\tfloat depth = dot( rgba_depth, bit_shift );\n\t\treturn depth;\n\n\t}\n\n#endif";
|
|
THREE.ShaderChunk.skinning_pars_vertex="#ifdef USE_SKINNING\n\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\n\t#ifdef BONE_TEXTURE\n\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\n\t\t\ty = dy * ( y + 0.5 );\n\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\n\t\t\treturn bone;\n\n\t\t}\n\n\t#else\n\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\n\t\t}\n\n\t#endif\n\n#endif\n";
|
|
THREE.ShaderChunk.skinning_pars_vertex="#ifdef USE_SKINNING\n\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\n\t#ifdef BONE_TEXTURE\n\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\n\t\t\ty = dy * ( y + 0.5 );\n\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\n\t\t\treturn bone;\n\n\t\t}\n\n\t#else\n\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\n\t\t}\n\n\t#endif\n\n#endif\n";
|
|
THREE.ShaderChunk.logdepthbuf_pars_fragment="#ifdef USE_LOGDEPTHBUF\n\n\tuniform float logDepthBufFC;\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\t#extension GL_EXT_frag_depth : enable\n\t\tvarying float vFragDepth;\n\n\t#endif\n\n#endif";THREE.ShaderChunk.alphamap_fragment="#ifdef USE_ALPHAMAP\n\n\tgl_FragColor.a *= texture2D( alphaMap, vUv ).g;\n\n#endif\n";THREE.ShaderChunk.alphamap_pars_fragment="#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n";
|
|
THREE.ShaderChunk.logdepthbuf_pars_fragment="#ifdef USE_LOGDEPTHBUF\n\n\tuniform float logDepthBufFC;\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\t#extension GL_EXT_frag_depth : enable\n\t\tvarying float vFragDepth;\n\n\t#endif\n\n#endif";THREE.ShaderChunk.alphamap_fragment="#ifdef USE_ALPHAMAP\n\n\tgl_FragColor.a *= texture2D( alphaMap, vUv ).g;\n\n#endif\n";THREE.ShaderChunk.alphamap_pars_fragment="#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n";
|
|
-THREE.UniformsUtils={merge:function(a){var b,c,d,e={};for(b=0;b<a.length;b++)for(c in d=this.clone(a[b]),d)e[c]=d[c];return e},clone:function(a){var b,c,d,e={};for(b in a)for(c in e[b]={},a[b])d=a[b][c],e[b][c]=d instanceof THREE.Color||d instanceof THREE.Vector2||d instanceof THREE.Vector3||d instanceof THREE.Vector4||d instanceof THREE.Matrix4||d instanceof THREE.Texture?d.clone():d instanceof Array?d.slice():d;return e}};
|
|
|
|
|
|
+THREE.UniformsUtils={merge:function(a){for(var b={},c=0;c<a.length;c++){var d=this.clone(a[c]),e;for(e in d)b[e]=d[e]}return b},clone:function(a){var b={},c;for(c in a){b[c]={};for(var d in a[c]){var e=a[c][d];b[c][d]=e instanceof THREE.Color||e instanceof THREE.Vector2||e instanceof THREE.Vector3||e instanceof THREE.Vector4||e instanceof THREE.Matrix4||e instanceof THREE.Texture?e.clone():e instanceof Array?e.slice():e}}return b}};
|
|
THREE.UniformsLib={common:{diffuse:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},map:{type:"t",value:null},offsetRepeat:{type:"v4",value:new THREE.Vector4(0,0,1,1)},lightMap:{type:"t",value:null},specularMap:{type:"t",value:null},alphaMap:{type:"t",value:null},envMap:{type:"t",value:null},flipEnvMap:{type:"f",value:-1},useRefract:{type:"i",value:0},reflectivity:{type:"f",value:1},refractionRatio:{type:"f",value:0.98},combine:{type:"i",value:0},morphTargetInfluences:{type:"f",
|
|
THREE.UniformsLib={common:{diffuse:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},map:{type:"t",value:null},offsetRepeat:{type:"v4",value:new THREE.Vector4(0,0,1,1)},lightMap:{type:"t",value:null},specularMap:{type:"t",value:null},alphaMap:{type:"t",value:null},envMap:{type:"t",value:null},flipEnvMap:{type:"f",value:-1},useRefract:{type:"i",value:0},reflectivity:{type:"f",value:1},refractionRatio:{type:"f",value:0.98},combine:{type:"i",value:0},morphTargetInfluences:{type:"f",
|
|
value:0}},bump:{bumpMap:{type:"t",value:null},bumpScale:{type:"f",value:1}},normalmap:{normalMap:{type:"t",value:null},normalScale:{type:"v2",value:new THREE.Vector2(1,1)}},fog:{fogDensity:{type:"f",value:2.5E-4},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2E3},fogColor:{type:"c",value:new THREE.Color(16777215)}},lights:{ambientLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]},directionalLightColor:{type:"fv",value:[]},hemisphereLightDirection:{type:"fv",value:[]},
|
|
value:0}},bump:{bumpMap:{type:"t",value:null},bumpScale:{type:"f",value:1}},normalmap:{normalMap:{type:"t",value:null},normalScale:{type:"v2",value:new THREE.Vector2(1,1)}},fog:{fogDensity:{type:"f",value:2.5E-4},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2E3},fogColor:{type:"c",value:new THREE.Color(16777215)}},lights:{ambientLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]},directionalLightColor:{type:"fv",value:[]},hemisphereLightDirection:{type:"fv",value:[]},
|
|
hemisphereLightSkyColor:{type:"fv",value:[]},hemisphereLightGroundColor:{type:"fv",value:[]},pointLightColor:{type:"fv",value:[]},pointLightPosition:{type:"fv",value:[]},pointLightDistance:{type:"fv1",value:[]},spotLightColor:{type:"fv",value:[]},spotLightPosition:{type:"fv",value:[]},spotLightDirection:{type:"fv",value:[]},spotLightDistance:{type:"fv1",value:[]},spotLightAngleCos:{type:"fv1",value:[]},spotLightExponent:{type:"fv1",value:[]}},particle:{psColor:{type:"c",value:new THREE.Color(15658734)},
|
|
hemisphereLightSkyColor:{type:"fv",value:[]},hemisphereLightGroundColor:{type:"fv",value:[]},pointLightColor:{type:"fv",value:[]},pointLightPosition:{type:"fv",value:[]},pointLightDistance:{type:"fv1",value:[]},spotLightColor:{type:"fv",value:[]},spotLightPosition:{type:"fv",value:[]},spotLightDirection:{type:"fv",value:[]},spotLightDistance:{type:"fv1",value:[]},spotLightAngleCos:{type:"fv1",value:[]},spotLightExponent:{type:"fv1",value:[]}},particle:{psColor:{type:"c",value:new THREE.Color(15658734)},
|
|
@@ -467,7 +467,7 @@ g));c=null!==Bb&&21845<f?Uint32Array:Uint16Array;a.__typeArray=c;a.__faceArray=n
|
|
[]);for(var m in e.attributes){var f=e.attributes[m],h={},n;for(n in f)h[n]=f[n];if(!h.__webglInitialized||h.createUniqueBuffers)h.__webglInitialized=!0,c=1,"v2"===h.type?c=2:"v3"===h.type?c=3:"v4"===h.type?c=4:"c"===h.type&&(c=3),h.size=c,h.array=new Float32Array(g*c),h.buffer=l.createBuffer(),h.buffer.belongsToAttribute=m,f.needsUpdate=!0,h.__original=f;a.__webglCustomAttributesList.push(h)}}a.__inittedArrays=!0}function d(a,b){return a.material instanceof THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:
|
|
[]);for(var m in e.attributes){var f=e.attributes[m],h={},n;for(n in f)h[n]=f[n];if(!h.__webglInitialized||h.createUniqueBuffers)h.__webglInitialized=!0,c=1,"v2"===h.type?c=2:"v3"===h.type?c=3:"v4"===h.type?c=4:"c"===h.type&&(c=3),h.size=c,h.array=new Float32Array(g*c),h.buffer=l.createBuffer(),h.buffer.belongsToAttribute=m,f.needsUpdate=!0,h.__original=f;a.__webglCustomAttributesList.push(h)}}a.__inittedArrays=!0}function d(a,b){return a.material instanceof THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:
|
|
a.material}function e(a,b,c,d){c=c.attributes;var e=b.attributes;b=b.attributesKeys;for(var f=0,k=b.length;f<k;f++){var m=b[f],n=e[m];if(0<=n){var r=c[m];void 0!==r?(m=r.itemSize,l.bindBuffer(l.ARRAY_BUFFER,r.buffer),g(n),l.vertexAttribPointer(n,m,l.FLOAT,!1,0,d*m*4)):void 0!==a.defaultAttributeValues&&(2===a.defaultAttributeValues[m].length?l.vertexAttrib2fv(n,a.defaultAttributeValues[m]):3===a.defaultAttributeValues[m].length&&l.vertexAttrib3fv(n,a.defaultAttributeValues[m]))}}h()}function f(){for(var a=
|
|
a.material}function e(a,b,c,d){c=c.attributes;var e=b.attributes;b=b.attributesKeys;for(var f=0,k=b.length;f<k;f++){var m=b[f],n=e[m];if(0<=n){var r=c[m];void 0!==r?(m=r.itemSize,l.bindBuffer(l.ARRAY_BUFFER,r.buffer),g(n),l.vertexAttribPointer(n,m,l.FLOAT,!1,0,d*m*4)):void 0!==a.defaultAttributeValues&&(2===a.defaultAttributeValues[m].length?l.vertexAttrib2fv(n,a.defaultAttributeValues[m]):3===a.defaultAttributeValues[m].length&&l.vertexAttrib3fv(n,a.defaultAttributeValues[m]))}}h()}function f(){for(var a=
|
|
0,b=tb.length;a<b;a++)tb[a]=0}function g(a){tb[a]=1;0===wb[a]&&(l.enableVertexAttribArray(a),wb[a]=1)}function h(){for(var a=0,b=wb.length;a<b;a++)wb[a]!==tb[a]&&(l.disableVertexAttribArray(a),wb[a]=0)}function k(a,b){return a.material.id!==b.material.id?b.material.id-a.material.id:a.z!==b.z?b.z-a.z:a.id-b.id}function m(a,b){return a.z!==b.z?a.z-b.z:a.id-b.id}function n(a,b){return b[0]-a[0]}function q(a,e,g){if(!1!==e.visible){e instanceof THREE.Light&&Oa.push(e);if(!(e instanceof THREE.Scene)){void 0===
|
|
0,b=tb.length;a<b;a++)tb[a]=0}function g(a){tb[a]=1;0===wb[a]&&(l.enableVertexAttribArray(a),wb[a]=1)}function h(){for(var a=0,b=wb.length;a<b;a++)wb[a]!==tb[a]&&(l.disableVertexAttribArray(a),wb[a]=0)}function k(a,b){return a.material.id!==b.material.id?b.material.id-a.material.id:a.z!==b.z?b.z-a.z:a.id-b.id}function m(a,b){return a.z!==b.z?a.z-b.z:a.id-b.id}function n(a,b){return b[0]-a[0]}function q(a,e,g){if(!1!==e.visible){e instanceof THREE.Light&&Oa.push(e);if(!(e instanceof THREE.Scene)){void 0===
|
|
-e.__webglInit&&(e.__webglInit=!0,e.addEventListener("dispose",Hc),e._modelViewMatrix=new THREE.Matrix4,e._normalMatrix=new THREE.Matrix3);var f=e.geometry;if(void 0!==f&&void 0===f.__webglInit&&(f.__webglInit=!0,f.addEventListener("dispose",Ic),!(f instanceof THREE.BufferGeometry)))if(e instanceof THREE.Mesh)void 0!==e.__webglActive&&y(e,a),v(a,e,f);else if(e instanceof THREE.Line){if(!f.__webglVertexBuffer){f.__webglVertexBuffer=l.createBuffer();f.__webglColorBuffer=l.createBuffer();f.__webglLineDistanceBuffer=
|
|
|
|
|
|
+e.__webglInit&&(e.__webglInit=!0,e._modelViewMatrix=new THREE.Matrix4,e._normalMatrix=new THREE.Matrix3,e.addEventListener("removed",Hc));var f=e.geometry;if(void 0!==f&&void 0===f.__webglInit&&(f.__webglInit=!0,f.addEventListener("dispose",Ic),!(f instanceof THREE.BufferGeometry)))if(e instanceof THREE.Mesh)void 0!==e.__webglActive&&y(e,a),v(a,e,f);else if(e instanceof THREE.Line){if(!f.__webglVertexBuffer){f.__webglVertexBuffer=l.createBuffer();f.__webglColorBuffer=l.createBuffer();f.__webglLineDistanceBuffer=
|
|
l.createBuffer();G.info.memory.geometries++;var h=f.vertices.length;f.__vertexArray=new Float32Array(3*h);f.__colorArray=new Float32Array(3*h);f.__lineDistanceArray=new Float32Array(1*h);f.__webglLineCount=h;b(f,e);f.verticesNeedUpdate=!0;f.colorsNeedUpdate=!0;f.lineDistancesNeedUpdate=!0}}else if(e instanceof THREE.PointCloud&&!f.__webglVertexBuffer){f.__webglVertexBuffer=l.createBuffer();f.__webglColorBuffer=l.createBuffer();G.info.memory.geometries++;var k=f.vertices.length;f.__vertexArray=new Float32Array(3*
|
|
l.createBuffer();G.info.memory.geometries++;var h=f.vertices.length;f.__vertexArray=new Float32Array(3*h);f.__colorArray=new Float32Array(3*h);f.__lineDistanceArray=new Float32Array(1*h);f.__webglLineCount=h;b(f,e);f.verticesNeedUpdate=!0;f.colorsNeedUpdate=!0;f.lineDistancesNeedUpdate=!0}}else if(e instanceof THREE.PointCloud&&!f.__webglVertexBuffer){f.__webglVertexBuffer=l.createBuffer();f.__webglColorBuffer=l.createBuffer();G.info.memory.geometries++;var k=f.vertices.length;f.__vertexArray=new Float32Array(3*
|
|
k);f.__colorArray=new Float32Array(3*k);f.__sortArray=[];f.__webglParticleCount=k;b(f,e);f.verticesNeedUpdate=!0;f.colorsNeedUpdate=!0}if(void 0===e.__webglActive){if(e instanceof THREE.Mesh)if(f instanceof THREE.BufferGeometry)x(Ka,f,e);else{if(f instanceof THREE.Geometry)for(var m=0,r=f.geometryGroupsList.length;m<r;m++)x(Ka,f.geometryGroupsList[m],e)}else e instanceof THREE.Line||e instanceof THREE.PointCloud?x(Ka,f,e):(e instanceof THREE.ImmediateRenderObject||e.immediateRenderCallback)&&la.push({id:null,
|
|
k);f.__colorArray=new Float32Array(3*k);f.__sortArray=[];f.__webglParticleCount=k;b(f,e);f.verticesNeedUpdate=!0;f.colorsNeedUpdate=!0}if(void 0===e.__webglActive){if(e instanceof THREE.Mesh)if(f instanceof THREE.BufferGeometry)x(Ka,f,e);else{if(f instanceof THREE.Geometry)for(var m=0,r=f.geometryGroupsList.length;m<r;m++)x(Ka,f.geometryGroupsList[m],e)}else e instanceof THREE.Line||e instanceof THREE.PointCloud?x(Ka,f,e):(e instanceof THREE.ImmediateRenderObject||e.immediateRenderCallback)&&la.push({id:null,
|
|
object:e,opaque:null,transparent:null,z:0});e.__webglActive=!0}var s=Ka[e.id];if(s&&(!1===e.frustumCulled||!0===zc.intersectsObject(e))){var p=e.geometry,t,w,z;if(p instanceof THREE.BufferGeometry)for(var D=p.attributes,A=p.attributesKeys,B=0,C=A.length;B<C;B++){var L=A[B],H=D[L];void 0===H.buffer&&(H.buffer=l.createBuffer(),H.needsUpdate=!0);if(!0===H.needsUpdate){var N="index"===L?l.ELEMENT_ARRAY_BUFFER:l.ARRAY_BUFFER;l.bindBuffer(N,H.buffer);l.bufferData(N,H.array,l.STATIC_DRAW);H.needsUpdate=
|
|
object:e,opaque:null,transparent:null,z:0});e.__webglActive=!0}var s=Ka[e.id];if(s&&(!1===e.frustumCulled||!0===zc.intersectsObject(e))){var p=e.geometry,t,w,z;if(p instanceof THREE.BufferGeometry)for(var D=p.attributes,A=p.attributesKeys,B=0,C=A.length;B<C;B++){var L=A[B],H=D[L];void 0===H.buffer&&(H.buffer=l.createBuffer(),H.needsUpdate=!0);if(!0===H.needsUpdate){var N="index"===L?l.ELEMENT_ARRAY_BUFFER:l.ARRAY_BUFFER;l.bindBuffer(N,H.buffer);l.bufferData(N,H.array,l.STATIC_DRAW);H.needsUpdate=
|
|
@@ -503,50 +503,50 @@ h.blendEquation,h.blendSrc,h.blendDst);G.setDepthTest(h.depthTest);G.setDepthWri
|
|
!1;for(var f=0,g=d.geometryGroupsList.length;f<g;f++){a=d.geometryGroupsList[f];if(a.__webglVertexBuffer)e=!1;else{e=a;e.__webglVertexBuffer=l.createBuffer();e.__webglNormalBuffer=l.createBuffer();e.__webglTangentBuffer=l.createBuffer();e.__webglColorBuffer=l.createBuffer();e.__webglUVBuffer=l.createBuffer();e.__webglUV2Buffer=l.createBuffer();e.__webglSkinIndicesBuffer=l.createBuffer();e.__webglSkinWeightsBuffer=l.createBuffer();e.__webglFaceBuffer=l.createBuffer();e.__webglLineBuffer=l.createBuffer();
|
|
!1;for(var f=0,g=d.geometryGroupsList.length;f<g;f++){a=d.geometryGroupsList[f];if(a.__webglVertexBuffer)e=!1;else{e=a;e.__webglVertexBuffer=l.createBuffer();e.__webglNormalBuffer=l.createBuffer();e.__webglTangentBuffer=l.createBuffer();e.__webglColorBuffer=l.createBuffer();e.__webglUVBuffer=l.createBuffer();e.__webglUV2Buffer=l.createBuffer();e.__webglSkinIndicesBuffer=l.createBuffer();e.__webglSkinWeightsBuffer=l.createBuffer();e.__webglFaceBuffer=l.createBuffer();e.__webglLineBuffer=l.createBuffer();
|
|
var h=void 0,k=void 0;if(e.numMorphTargets)for(e.__webglMorphTargetsBuffers=[],h=0,k=e.numMorphTargets;h<k;h++)e.__webglMorphTargetsBuffers.push(l.createBuffer());if(e.numMorphNormals)for(e.__webglMorphNormalsBuffers=[],h=0,k=e.numMorphNormals;h<k;h++)e.__webglMorphNormalsBuffers.push(l.createBuffer());G.info.memory.geometries++;c(a,b);d.verticesNeedUpdate=!0;d.morphTargetsNeedUpdate=!0;d.elementsNeedUpdate=!0;d.uvsNeedUpdate=!0;d.normalsNeedUpdate=!0;d.tangentsNeedUpdate=!0;e=d.colorsNeedUpdate=
|
|
var h=void 0,k=void 0;if(e.numMorphTargets)for(e.__webglMorphTargetsBuffers=[],h=0,k=e.numMorphTargets;h<k;h++)e.__webglMorphTargetsBuffers.push(l.createBuffer());if(e.numMorphNormals)for(e.__webglMorphNormalsBuffers=[],h=0,k=e.numMorphNormals;h<k;h++)e.__webglMorphNormalsBuffers.push(l.createBuffer());G.info.memory.geometries++;c(a,b);d.verticesNeedUpdate=!0;d.morphTargetsNeedUpdate=!0;d.elementsNeedUpdate=!0;d.uvsNeedUpdate=!0;d.normalsNeedUpdate=!0;d.tangentsNeedUpdate=!0;e=d.colorsNeedUpdate=
|
|
!0}(e||void 0===b.__webglActive)&&x(Ka,a,b)}b.__webglActive=!0}function x(a,b,c){var d=c.id;a[d]=a[d]||[];a[d].push({id:d,buffer:b,object:c,material:null,z:0})}function u(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function E(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function y(a){if(a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line)delete Ka[a.id];else if(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)for(var b=
|
|
!0}(e||void 0===b.__webglActive)&&x(Ka,a,b)}b.__webglActive=!0}function x(a,b,c){var d=c.id;a[d]=a[d]||[];a[d].push({id:d,buffer:b,object:c,material:null,z:0})}function u(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function E(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function y(a){if(a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line)delete Ka[a.id];else if(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)for(var b=
|
|
-la,c=b.length-1;0<=c;c--)b[c].object===a&&b.splice(c,1);delete a.__webglActive}function z(a,b,c,d,e){var f,g,h,k;Ha=0;if(d.needsUpdate){d.program&&pc(d);d.addEventListener("dispose",qc);var m;d instanceof THREE.MeshDepthMaterial?m="depth":d instanceof THREE.MeshNormalMaterial?m="normal":d instanceof THREE.MeshBasicMaterial?m="basic":d instanceof THREE.MeshLambertMaterial?m="lambert":d instanceof THREE.MeshPhongMaterial?m="phong":d instanceof THREE.LineBasicMaterial?m="basic":d instanceof THREE.LineDashedMaterial?
|
|
|
|
-m="dashed":d instanceof THREE.PointCloudMaterial&&(m="particle_basic");if(m){var n=THREE.ShaderLib[m];d.__webglShader={uniforms:THREE.UniformsUtils.clone(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader}}else d.__webglShader={uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var p=0,r=0,s=0,q=0,t=0,u=b.length;t<u;t++){var v=b[t];v.onlyShadow||!1===v.visible||(v instanceof THREE.DirectionalLight&&p++,v instanceof THREE.PointLight&&r++,v instanceof
|
|
|
|
-THREE.SpotLight&&s++,v instanceof THREE.HemisphereLight&&q++)}f=p;g=r;h=s;k=q;for(var x,y=0,w=0,E=b.length;w<E;w++){var z=b[w];z.castShadow&&(z instanceof THREE.SpotLight&&y++,z instanceof THREE.DirectionalLight&&!z.shadowCascade&&y++)}x=y;var C;if(ic&&e&&e.skeleton&&e.skeleton.useVertexTexture)C=1024;else{var K=l.getParameter(l.MAX_VERTEX_UNIFORM_VECTORS),H=Math.floor((K-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(H=Math.min(e.skeleton.bones.length,H),H<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+
|
|
|
|
-e.skeleton.bones.length+", this GPU supports just "+H+" (try OpenGL instead of ANGLE)"));C=H}var P={precision:Y,supportsVertexTextures:rc,map:!!d.map,envMap:!!d.envMap,lightMap:!!d.lightMap,bumpMap:!!d.bumpMap,normalMap:!!d.normalMap,specularMap:!!d.specularMap,alphaMap:!!d.alphaMap,vertexColors:d.vertexColors,fog:c,useFog:d.fog,fogExp:c instanceof THREE.FogExp2,sizeAttenuation:d.sizeAttenuation,logarithmicDepthBuffer:Ga,skinning:d.skinning,maxBones:C,useVertexTexture:ic&&e&&e.skeleton&&e.skeleton.useVertexTexture,
|
|
|
|
-morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:G.maxMorphTargets,maxMorphNormals:G.maxMorphNormals,maxDirLights:f,maxPointLights:g,maxSpotLights:h,maxHemiLights:k,maxShadows:x,shadowMapEnabled:G.shadowMapEnabled&&e.receiveShadow&&0<x,shadowMapType:G.shadowMapType,shadowMapDebug:G.shadowMapDebug,shadowMapCascade:G.shadowMapCascade,alphaTest:d.alphaTest,metal:d.metal,wrapAround:d.wrapAround,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},J=[];m?J.push(m):
|
|
|
|
-(J.push(d.fragmentShader),J.push(d.vertexShader));if(void 0!==d.defines)for(var I in d.defines)J.push(I),J.push(d.defines[I]);for(I in P)J.push(I),J.push(P[I]);for(var T=J.join(),Q,aa=0,Da=bb.length;aa<Da;aa++){var ca=bb[aa];if(ca.code===T){Q=ca;Q.usedTimes++;break}}void 0===Q&&(Q=new THREE.WebGLProgram(G,T,d,P),bb.push(Q),G.info.memory.programs=bb.length);d.program=Q;var Oa=Q.attributes;if(d.morphTargets){d.numSupportedMorphTargets=0;for(var da,Na="morphTarget",sa=0;sa<G.maxMorphTargets;sa++)da=
|
|
|
|
-Na+sa,0<=Oa[da]&&d.numSupportedMorphTargets++}if(d.morphNormals)for(d.numSupportedMorphNormals=0,Na="morphNormal",sa=0;sa<G.maxMorphNormals;sa++)da=Na+sa,0<=Oa[da]&&d.numSupportedMorphNormals++;d.uniformsList=[];for(var Ka in d.__webglShader.uniforms){var ia=d.program.uniforms[Ka];ia&&d.uniformsList.push([d.__webglShader.uniforms[Ka],ia])}d.needsUpdate=!1}d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(G.maxMorphTargets));var ja=!1,ga=!1,pa=!1,na=
|
|
|
|
-d.program,la=na.uniforms,S=d.__webglShader.uniforms;na.id!==nb&&(l.useProgram(na.program),nb=na.id,pa=ga=ja=!0);d.id!==qa&&(-1===qa&&(pa=!0),qa=d.id,ga=!0);if(ja||a!==cb)l.uniformMatrix4fv(la.projectionMatrix,!1,a.projectionMatrix.elements),Ga&&l.uniform1f(la.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==cb&&(cb=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==la.cameraPosition&&(oa.setFromMatrixPosition(a.matrixWorld),l.uniform3f(la.cameraPosition,
|
|
|
|
-oa.x,oa.y,oa.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==la.viewMatrix&&l.uniformMatrix4fv(la.viewMatrix,!1,a.matrixWorldInverse.elements);if(d.skinning)if(e.bindMatrix&&null!==la.bindMatrix&&l.uniformMatrix4fv(la.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&null!==la.bindMatrixInverse&&l.uniformMatrix4fv(la.bindMatrixInverse,!1,e.bindMatrixInverse.elements),ic&&e.skeleton&&e.skeleton.useVertexTexture){if(null!==
|
|
|
|
-la.boneTexture){var ab=D();l.uniform1i(la.boneTexture,ab);G.setTexture(e.skeleton.boneTexture,ab)}null!==la.boneTextureWidth&&l.uniform1i(la.boneTextureWidth,e.skeleton.boneTextureWidth);null!==la.boneTextureHeight&&l.uniform1i(la.boneTextureHeight,e.skeleton.boneTextureHeight)}else e.skeleton&&e.skeleton.boneMatrices&&null!==la.boneGlobalMatrices&&l.uniformMatrix4fv(la.boneGlobalMatrices,!1,e.skeleton.boneMatrices);if(ga){c&&d.fog&&(S.fogColor.value=c.color,c instanceof THREE.Fog?(S.fogNear.value=
|
|
|
|
-c.near,S.fogFar.value=c.far):c instanceof THREE.FogExp2&&(S.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(Ub){var pa=!0,ba,ha,Aa,va=0,xa=0,ya=0,ka,Ea,La,ta,Ra,Qa,Ia=kc,Pa=Ia.directional.colors,Va=Ia.directional.positions,Za=Ia.point.colors,ob=Ia.point.positions,sb=Ia.point.distances,pb=Ia.spot.colors,tb=Ia.spot.positions,Bb=Ia.spot.distances,jb=Ia.spot.directions,ub=Ia.spot.anglesCos,Eb=Ia.spot.exponents,Fb=Ia.hemi.skyColors,
|
|
|
|
-Gb=Ia.hemi.groundColors,qb=Ia.hemi.positions,Ya=0,kb=0,Wa=0,wa=0,Ma=0,O=0,$a=0,lb=0,Hb=0,Ib=0,db=0,Sa=0;ba=0;for(ha=b.length;ba<ha;ba++)Aa=b[ba],Aa.onlyShadow||(ka=Aa.color,ta=Aa.intensity,Qa=Aa.distance,Aa instanceof THREE.AmbientLight?Aa.visible&&(G.gammaInput?(va+=ka.r*ka.r,xa+=ka.g*ka.g,ya+=ka.b*ka.b):(va+=ka.r,xa+=ka.g,ya+=ka.b)):Aa instanceof THREE.DirectionalLight?(Ma+=1,Aa.visible&&(fa.setFromMatrixPosition(Aa.matrixWorld),oa.setFromMatrixPosition(Aa.target.matrixWorld),fa.sub(oa),fa.normalize(),
|
|
|
|
-Hb=3*Ya,Va[Hb]=fa.x,Va[Hb+1]=fa.y,Va[Hb+2]=fa.z,G.gammaInput?A(Pa,Hb,ka,ta*ta):N(Pa,Hb,ka,ta),Ya+=1)):Aa instanceof THREE.PointLight?(O+=1,Aa.visible&&(Ib=3*kb,G.gammaInput?A(Za,Ib,ka,ta*ta):N(Za,Ib,ka,ta),oa.setFromMatrixPosition(Aa.matrixWorld),ob[Ib]=oa.x,ob[Ib+1]=oa.y,ob[Ib+2]=oa.z,sb[kb]=Qa,kb+=1)):Aa instanceof THREE.SpotLight?($a+=1,Aa.visible&&(db=3*Wa,G.gammaInput?A(pb,db,ka,ta*ta):N(pb,db,ka,ta),fa.setFromMatrixPosition(Aa.matrixWorld),tb[db]=fa.x,tb[db+1]=fa.y,tb[db+2]=fa.z,Bb[Wa]=Qa,oa.setFromMatrixPosition(Aa.target.matrixWorld),
|
|
|
|
-fa.sub(oa),fa.normalize(),jb[db]=fa.x,jb[db+1]=fa.y,jb[db+2]=fa.z,ub[Wa]=Math.cos(Aa.angle),Eb[Wa]=Aa.exponent,Wa+=1)):Aa instanceof THREE.HemisphereLight&&(lb+=1,Aa.visible&&(fa.setFromMatrixPosition(Aa.matrixWorld),fa.normalize(),Sa=3*wa,qb[Sa]=fa.x,qb[Sa+1]=fa.y,qb[Sa+2]=fa.z,Ea=Aa.color,La=Aa.groundColor,G.gammaInput?(Ra=ta*ta,A(Fb,Sa,Ea,Ra),A(Gb,Sa,La,Ra)):(N(Fb,Sa,Ea,ta),N(Gb,Sa,La,ta)),wa+=1)));ba=3*Ya;for(ha=Math.max(Pa.length,3*Ma);ba<ha;ba++)Pa[ba]=0;ba=3*kb;for(ha=Math.max(Za.length,3*
|
|
|
|
-O);ba<ha;ba++)Za[ba]=0;ba=3*Wa;for(ha=Math.max(pb.length,3*$a);ba<ha;ba++)pb[ba]=0;ba=3*wa;for(ha=Math.max(Fb.length,3*lb);ba<ha;ba++)Fb[ba]=0;ba=3*wa;for(ha=Math.max(Gb.length,3*lb);ba<ha;ba++)Gb[ba]=0;Ia.directional.length=Ya;Ia.point.length=kb;Ia.spot.length=Wa;Ia.hemi.length=wa;Ia.ambient[0]=va;Ia.ambient[1]=xa;Ia.ambient[2]=ya;Ub=!1}if(pa){var Ja=kc;S.ambientLightColor.value=Ja.ambient;S.directionalLightColor.value=Ja.directional.colors;S.directionalLightDirection.value=Ja.directional.positions;
|
|
|
|
-S.pointLightColor.value=Ja.point.colors;S.pointLightPosition.value=Ja.point.positions;S.pointLightDistance.value=Ja.point.distances;S.spotLightColor.value=Ja.spot.colors;S.spotLightPosition.value=Ja.spot.positions;S.spotLightDistance.value=Ja.spot.distances;S.spotLightDirection.value=Ja.spot.directions;S.spotLightAngleCos.value=Ja.spot.anglesCos;S.spotLightExponent.value=Ja.spot.exponents;S.hemisphereLightSkyColor.value=Ja.hemi.skyColors;S.hemisphereLightGroundColor.value=Ja.hemi.groundColors;S.hemisphereLightDirection.value=
|
|
|
|
-Ja.hemi.positions;B(S,!0)}else B(S,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){S.opacity.value=d.opacity;G.gammaInput?S.diffuse.value.copyGammaToLinear(d.color):S.diffuse.value=d.color;S.map.value=d.map;S.lightMap.value=d.lightMap;S.specularMap.value=d.specularMap;S.alphaMap.value=d.alphaMap;d.bumpMap&&(S.bumpMap.value=d.bumpMap,S.bumpScale.value=d.bumpScale);d.normalMap&&(S.normalMap.value=d.normalMap,S.normalScale.value.copy(d.normalScale));
|
|
|
|
-var Ta;d.map?Ta=d.map:d.specularMap?Ta=d.specularMap:d.normalMap?Ta=d.normalMap:d.bumpMap?Ta=d.bumpMap:d.alphaMap&&(Ta=d.alphaMap);if(void 0!==Ta){var eb=Ta.offset,Ab=Ta.repeat;S.offsetRepeat.value.set(eb.x,eb.y,Ab.x,Ab.y)}S.envMap.value=d.envMap;S.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;S.reflectivity.value=d.reflectivity;S.refractionRatio.value=d.refractionRatio;S.combine.value=d.combine;S.useRefract.value=d.envMap&&d.envMap.mapping instanceof THREE.CubeRefractionMapping}d instanceof
|
|
|
|
-THREE.LineBasicMaterial?(S.diffuse.value=d.color,S.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(S.diffuse.value=d.color,S.opacity.value=d.opacity,S.dashSize.value=d.dashSize,S.totalSize.value=d.dashSize+d.gapSize,S.scale.value=d.scale):d instanceof THREE.PointCloudMaterial?(S.psColor.value=d.color,S.opacity.value=d.opacity,S.size.value=d.size,S.scale.value=V.height/2,S.map.value=d.map):d instanceof THREE.MeshPhongMaterial?(S.shininess.value=d.shininess,G.gammaInput?(S.ambient.value.copyGammaToLinear(d.ambient),
|
|
|
|
-S.emissive.value.copyGammaToLinear(d.emissive),S.specular.value.copyGammaToLinear(d.specular)):(S.ambient.value=d.ambient,S.emissive.value=d.emissive,S.specular.value=d.specular),d.wrapAround&&S.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(G.gammaInput?(S.ambient.value.copyGammaToLinear(d.ambient),S.emissive.value.copyGammaToLinear(d.emissive)):(S.ambient.value=d.ambient,S.emissive.value=d.emissive),d.wrapAround&&S.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?
|
|
|
|
-(S.mNear.value=a.near,S.mFar.value=a.far,S.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(S.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&S.shadowMatrix)for(var Ob=0,zb=0,F=b.length;zb<F;zb++){var rb=b[zb];rb.castShadow&&(rb instanceof THREE.SpotLight||rb instanceof THREE.DirectionalLight&&!rb.shadowCascade)&&(S.shadowMap.value[Ob]=rb.shadowMap,S.shadowMapSize.value[Ob]=rb.shadowMapSize,S.shadowMatrix.value[Ob]=rb.shadowMatrix,S.shadowDarkness.value[Ob]=rb.shadowDarkness,
|
|
|
|
-S.shadowBias.value[Ob]=rb.shadowBias,Ob++)}for(var Cb=d.uniformsList,Fa,Pb,mb,wb=0,Tb=Cb.length;wb<Tb;wb++){var ra=Cb[wb][0];if(!1!==ra.needsUpdate){var Mb=ra.type,X=ra.value,W=Cb[wb][1];switch(Mb){case "1i":l.uniform1i(W,X);break;case "1f":l.uniform1f(W,X);break;case "2f":l.uniform2f(W,X[0],X[1]);break;case "3f":l.uniform3f(W,X[0],X[1],X[2]);break;case "4f":l.uniform4f(W,X[0],X[1],X[2],X[3]);break;case "1iv":l.uniform1iv(W,X);break;case "3iv":l.uniform3iv(W,X);break;case "1fv":l.uniform1fv(W,X);
|
|
|
|
-break;case "2fv":l.uniform2fv(W,X);break;case "3fv":l.uniform3fv(W,X);break;case "4fv":l.uniform4fv(W,X);break;case "Matrix3fv":l.uniformMatrix3fv(W,!1,X);break;case "Matrix4fv":l.uniformMatrix4fv(W,!1,X);break;case "i":l.uniform1i(W,X);break;case "f":l.uniform1f(W,X);break;case "v2":l.uniform2f(W,X.x,X.y);break;case "v3":l.uniform3f(W,X.x,X.y,X.z);break;case "v4":l.uniform4f(W,X.x,X.y,X.z,X.w);break;case "c":l.uniform3f(W,X.r,X.g,X.b);break;case "iv1":l.uniform1iv(W,X);break;case "iv":l.uniform3iv(W,
|
|
|
|
-X);break;case "fv1":l.uniform1fv(W,X);break;case "fv":l.uniform3fv(W,X);break;case "v2v":void 0===ra._array&&(ra._array=new Float32Array(2*X.length));for(var ea=0,fb=X.length;ea<fb;ea++)mb=2*ea,ra._array[mb]=X[ea].x,ra._array[mb+1]=X[ea].y;l.uniform2fv(W,ra._array);break;case "v3v":void 0===ra._array&&(ra._array=new Float32Array(3*X.length));ea=0;for(fb=X.length;ea<fb;ea++)mb=3*ea,ra._array[mb]=X[ea].x,ra._array[mb+1]=X[ea].y,ra._array[mb+2]=X[ea].z;l.uniform3fv(W,ra._array);break;case "v4v":void 0===
|
|
|
|
-ra._array&&(ra._array=new Float32Array(4*X.length));ea=0;for(fb=X.length;ea<fb;ea++)mb=4*ea,ra._array[mb]=X[ea].x,ra._array[mb+1]=X[ea].y,ra._array[mb+2]=X[ea].z,ra._array[mb+3]=X[ea].w;l.uniform4fv(W,ra._array);break;case "m3":l.uniformMatrix3fv(W,!1,X.elements);break;case "m3v":void 0===ra._array&&(ra._array=new Float32Array(9*X.length));ea=0;for(fb=X.length;ea<fb;ea++)X[ea].flattenToArrayOffset(ra._array,9*ea);l.uniformMatrix3fv(W,!1,ra._array);break;case "m4":l.uniformMatrix4fv(W,!1,X.elements);
|
|
|
|
-break;case "m4v":void 0===ra._array&&(ra._array=new Float32Array(16*X.length));ea=0;for(fb=X.length;ea<fb;ea++)X[ea].flattenToArrayOffset(ra._array,16*ea);l.uniformMatrix4fv(W,!1,ra._array);break;case "t":Fa=X;Pb=D();l.uniform1i(W,Pb);if(!Fa)continue;if(Fa instanceof THREE.CubeTexture||Fa.image instanceof Array&&6===Fa.image.length){var Ua=Fa,Nb=Pb;if(6===Ua.image.length)if(Ua.needsUpdate){Ua.image.__webglTextureCube||(Ua.addEventListener("dispose",sc),Ua.image.__webglTextureCube=l.createTexture(),
|
|
|
|
-G.info.memory.textures++);l.activeTexture(l.TEXTURE0+Nb);l.bindTexture(l.TEXTURE_CUBE_MAP,Ua.image.__webglTextureCube);l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,Ua.flipY);for(var $b=Ua instanceof THREE.CompressedTexture,Qb=[],gb=0;6>gb;gb++)Qb[gb]=G.autoScaleCubemaps&&!$b?M(Ua.image[gb],Mc):Ua.image[gb];var Ba=Qb[0],ac=THREE.Math.isPowerOfTwo(Ba.width)&&THREE.Math.isPowerOfTwo(Ba.height),Db=L(Ua.format),Vb=L(Ua.type);R(l.TEXTURE_CUBE_MAP,Ua,ac);for(gb=0;6>gb;gb++)if($b)for(var vb,bc=Qb[gb].mipmaps,ua=0,
|
|
|
|
-fc=bc.length;ua<fc;ua++)vb=bc[ua],Ua.format!==THREE.RGBAFormat?l.compressedTexImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+gb,ua,Db,vb.width,vb.height,0,vb.data):l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+gb,ua,Db,vb.width,vb.height,0,Db,Vb,vb.data);else l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+gb,0,Db,Db,Vb,Qb[gb]);Ua.generateMipmaps&&ac&&l.generateMipmap(l.TEXTURE_CUBE_MAP);Ua.needsUpdate=!1;if(Ua.onUpdate)Ua.onUpdate()}else l.activeTexture(l.TEXTURE0+Nb),l.bindTexture(l.TEXTURE_CUBE_MAP,Ua.image.__webglTextureCube)}else if(Fa instanceof
|
|
|
|
-THREE.WebGLRenderTargetCube){var Zb=Fa;l.activeTexture(l.TEXTURE0+Pb);l.bindTexture(l.TEXTURE_CUBE_MAP,Zb.__webglTexture)}else G.setTexture(Fa,Pb);break;case "tv":void 0===ra._array&&(ra._array=[]);ea=0;for(fb=ra.value.length;ea<fb;ea++)ra._array[ea]=D();l.uniform1iv(W,ra._array);ea=0;for(fb=ra.value.length;ea<fb;ea++)Fa=ra.value[ea],Pb=ra._array[ea],Fa&&G.setTexture(Fa,Pb);break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+Mb)}}}}l.uniformMatrix4fv(la.modelViewMatrix,!1,e._modelViewMatrix.elements);
|
|
|
|
-la.normalMatrix&&l.uniformMatrix3fv(la.normalMatrix,!1,e._normalMatrix.elements);null!==la.modelMatrix&&l.uniformMatrix4fv(la.modelMatrix,!1,e.matrixWorld.elements);return na}function B(a,b){a.ambientLightColor.needsUpdate=b;a.directionalLightColor.needsUpdate=b;a.directionalLightDirection.needsUpdate=b;a.pointLightColor.needsUpdate=b;a.pointLightPosition.needsUpdate=b;a.pointLightDistance.needsUpdate=b;a.spotLightColor.needsUpdate=b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=
|
|
|
|
-b;a.spotLightDirection.needsUpdate=b;a.spotLightAngleCos.needsUpdate=b;a.spotLightExponent.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=b;a.hemisphereLightGroundColor.needsUpdate=b;a.hemisphereLightDirection.needsUpdate=b}function D(){var a=Ha;a>=xc&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+xc);Ha+=1;return a}function w(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getNormalMatrix(a._modelViewMatrix)}
|
|
|
|
-function A(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function N(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function P(a){a!==ha&&(l.lineWidth(a),ha=a)}function K(a,b,c){pb!==a&&(a?l.enable(l.POLYGON_OFFSET_FILL):l.disable(l.POLYGON_OFFSET_FILL),pb=a);!a||ta===b&&ka===c||(l.polygonOffset(b,c),ta=b,ka=c)}function R(a,b,c){c?(l.texParameteri(a,l.TEXTURE_WRAP_S,L(b.wrapS)),l.texParameteri(a,l.TEXTURE_WRAP_T,L(b.wrapT)),l.texParameteri(a,l.TEXTURE_MAG_FILTER,L(b.magFilter)),l.texParameteri(a,
|
|
|
|
-l.TEXTURE_MIN_FILTER,L(b.minFilter))):(l.texParameteri(a,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(a,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.texParameteri(a,l.TEXTURE_MAG_FILTER,T(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,T(b.minFilter)));zb&&b.type!==THREE.FloatType&&(1<b.anisotropy||b.__oldAnisotropy)&&(l.texParameterf(a,zb.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,yc)),b.__oldAnisotropy=b.anisotropy)}function M(a,b){if(a.width>b||a.height>b){var c=b/Math.max(a.width,a.height),
|
|
|
|
-d=document.createElement("canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);console.log("THREE.WebGLRenderer:",a,"is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height+".");return d}return a}function H(a,b){l.bindRenderbuffer(l.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH_COMPONENT16,b.width,b.height),l.framebufferRenderbuffer(l.FRAMEBUFFER,
|
|
|
|
-l.DEPTH_ATTACHMENT,l.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH_STENCIL,b.width,b.height),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,a)):l.renderbufferStorage(l.RENDERBUFFER,l.RGBA4,b.width,b.height)}function C(a){a instanceof THREE.WebGLRenderTargetCube?(l.bindTexture(l.TEXTURE_CUBE_MAP,a.__webglTexture),l.generateMipmap(l.TEXTURE_CUBE_MAP),l.bindTexture(l.TEXTURE_CUBE_MAP,null)):(l.bindTexture(l.TEXTURE_2D,
|
|
|
|
-a.__webglTexture),l.generateMipmap(l.TEXTURE_2D),l.bindTexture(l.TEXTURE_2D,null))}function T(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?l.NEAREST:l.LINEAR}function L(a){if(a===THREE.RepeatWrapping)return l.REPEAT;if(a===THREE.ClampToEdgeWrapping)return l.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return l.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return l.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return l.NEAREST_MIPMAP_NEAREST;
|
|
|
|
-if(a===THREE.NearestMipMapLinearFilter)return l.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return l.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return l.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return l.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return l.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return l.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return l.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return l.UNSIGNED_SHORT_5_6_5;
|
|
|
|
-if(a===THREE.ByteType)return l.BYTE;if(a===THREE.ShortType)return l.SHORT;if(a===THREE.UnsignedShortType)return l.UNSIGNED_SHORT;if(a===THREE.IntType)return l.INT;if(a===THREE.UnsignedIntType)return l.UNSIGNED_INT;if(a===THREE.FloatType)return l.FLOAT;if(a===THREE.AlphaFormat)return l.ALPHA;if(a===THREE.RGBFormat)return l.RGB;if(a===THREE.RGBAFormat)return l.RGBA;if(a===THREE.LuminanceFormat)return l.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return l.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return l.FUNC_ADD;
|
|
|
|
-if(a===THREE.SubtractEquation)return l.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return l.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return l.ZERO;if(a===THREE.OneFactor)return l.ONE;if(a===THREE.SrcColorFactor)return l.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return l.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return l.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return l.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return l.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return l.ONE_MINUS_DST_ALPHA;
|
|
|
|
-if(a===THREE.DstColorFactor)return l.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return l.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return l.SRC_ALPHA_SATURATE;if(void 0!==sb){if(a===THREE.RGB_S3TC_DXT1_Format)return sb.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return sb.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return sb.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return sb.COMPRESSED_RGBA_S3TC_DXT5_EXT}return 0}console.log("THREE.WebGLRenderer",
|
|
|
|
-THREE.REVISION);a=a||{};var V=void 0!==a.canvas?a.canvas:document.createElement("canvas"),J=void 0!==a.context?a.context:null,Y=void 0!==a.precision?a.precision:"highp",aa=void 0!==a.alpha?a.alpha:!1,na=void 0!==a.depth?a.depth:!0,I=void 0!==a.stencil?a.stencil:!0,ba=void 0!==a.antialias?a.antialias:!1,Q=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,ca=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,Ga=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,Da=new THREE.Color(0),
|
|
|
|
-Na=0,Oa=[],Ka={},la=[],ab=[],sa=[];this.domElement=V;this.context=null;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1;this.shadowMapAutoUpdate=!0;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=
|
|
|
|
-!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.renderPluginsPre=[];this.renderPluginsPost=[];this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var G=this,bb=[],nb=null,ob=null,qa=-1,pa=null,cb=null,Ha=0,Ea=-1,La=-1,va=-1,ya=-1,da=-1,xa=-1,Qa=-1,Va=-1,pb=null,ta=null,ka=null,ha=null,Pa=0,Tb=0,Mb=V.width,Nb=V.height,Zb=0,jc=0,tb=new Uint8Array(16),wb=new Uint8Array(16),zc=new THREE.Frustum,tc=new THREE.Matrix4,Ac=new THREE.Matrix4,
|
|
|
|
-oa=new THREE.Vector3,fa=new THREE.Vector3,Ub=!0,kc={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},l,Eb,Ab,zb,sb,Bb;(function(){try{var a={alpha:aa,depth:na,stencil:I,antialias:ba,premultipliedAlpha:Q,preserveDrawingBuffer:ca};l=J||V.getContext("webgl",a)||V.getContext("experimental-webgl",
|
|
|
|
|
|
+la,c=b.length-1;0<=c;c--)b[c].object===a&&b.splice(c,1);delete a.__webglInit;delete a._modelViewMatrix;delete a._normalMatrix;delete a.__webglActive}function z(a,b,c,d,e){var f,g,h,k;Ha=0;if(d.needsUpdate){d.program&&pc(d);d.addEventListener("dispose",qc);var m;d instanceof THREE.MeshDepthMaterial?m="depth":d instanceof THREE.MeshNormalMaterial?m="normal":d instanceof THREE.MeshBasicMaterial?m="basic":d instanceof THREE.MeshLambertMaterial?m="lambert":d instanceof THREE.MeshPhongMaterial?m="phong":
|
|
|
|
+d instanceof THREE.LineBasicMaterial?m="basic":d instanceof THREE.LineDashedMaterial?m="dashed":d instanceof THREE.PointCloudMaterial&&(m="particle_basic");if(m){var n=THREE.ShaderLib[m];d.__webglShader={uniforms:THREE.UniformsUtils.clone(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader}}else d.__webglShader={uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var p=0,r=0,s=0,q=0,t=0,u=b.length;t<u;t++){var v=b[t];v.onlyShadow||!1===v.visible||
|
|
|
|
+(v instanceof THREE.DirectionalLight&&p++,v instanceof THREE.PointLight&&r++,v instanceof THREE.SpotLight&&s++,v instanceof THREE.HemisphereLight&&q++)}f=p;g=r;h=s;k=q;for(var x,y=0,w=0,E=b.length;w<E;w++){var z=b[w];z.castShadow&&(z instanceof THREE.SpotLight&&y++,z instanceof THREE.DirectionalLight&&!z.shadowCascade&&y++)}x=y;var C;if(ic&&e&&e.skeleton&&e.skeleton.useVertexTexture)C=1024;else{var K=l.getParameter(l.MAX_VERTEX_UNIFORM_VECTORS),H=Math.floor((K-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&
|
|
|
|
+(H=Math.min(e.skeleton.bones.length,H),H<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+H+" (try OpenGL instead of ANGLE)"));C=H}var P={precision:Y,supportsVertexTextures:rc,map:!!d.map,envMap:!!d.envMap,lightMap:!!d.lightMap,bumpMap:!!d.bumpMap,normalMap:!!d.normalMap,specularMap:!!d.specularMap,alphaMap:!!d.alphaMap,vertexColors:d.vertexColors,fog:c,useFog:d.fog,fogExp:c instanceof THREE.FogExp2,sizeAttenuation:d.sizeAttenuation,
|
|
|
|
+logarithmicDepthBuffer:Ga,skinning:d.skinning,maxBones:C,useVertexTexture:ic&&e&&e.skeleton&&e.skeleton.useVertexTexture,morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:G.maxMorphTargets,maxMorphNormals:G.maxMorphNormals,maxDirLights:f,maxPointLights:g,maxSpotLights:h,maxHemiLights:k,maxShadows:x,shadowMapEnabled:G.shadowMapEnabled&&e.receiveShadow&&0<x,shadowMapType:G.shadowMapType,shadowMapDebug:G.shadowMapDebug,shadowMapCascade:G.shadowMapCascade,alphaTest:d.alphaTest,metal:d.metal,
|
|
|
|
+wrapAround:d.wrapAround,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},J=[];m?J.push(m):(J.push(d.fragmentShader),J.push(d.vertexShader));if(void 0!==d.defines)for(var I in d.defines)J.push(I),J.push(d.defines[I]);for(I in P)J.push(I),J.push(P[I]);for(var T=J.join(),Q,aa=0,Da=bb.length;aa<Da;aa++){var ca=bb[aa];if(ca.code===T){Q=ca;Q.usedTimes++;break}}void 0===Q&&(Q=new THREE.WebGLProgram(G,T,d,P),bb.push(Q),G.info.memory.programs=bb.length);d.program=Q;var Oa=Q.attributes;
|
|
|
|
+if(d.morphTargets){d.numSupportedMorphTargets=0;for(var da,Na="morphTarget",sa=0;sa<G.maxMorphTargets;sa++)da=Na+sa,0<=Oa[da]&&d.numSupportedMorphTargets++}if(d.morphNormals)for(d.numSupportedMorphNormals=0,Na="morphNormal",sa=0;sa<G.maxMorphNormals;sa++)da=Na+sa,0<=Oa[da]&&d.numSupportedMorphNormals++;d.uniformsList=[];for(var Ka in d.__webglShader.uniforms){var ia=d.program.uniforms[Ka];ia&&d.uniformsList.push([d.__webglShader.uniforms[Ka],ia])}d.needsUpdate=!1}d.morphTargets&&!e.__webglMorphTargetInfluences&&
|
|
|
|
+(e.__webglMorphTargetInfluences=new Float32Array(G.maxMorphTargets));var ja=!1,ga=!1,pa=!1,na=d.program,la=na.uniforms,S=d.__webglShader.uniforms;na.id!==nb&&(l.useProgram(na.program),nb=na.id,pa=ga=ja=!0);d.id!==qa&&(-1===qa&&(pa=!0),qa=d.id,ga=!0);if(ja||a!==cb)l.uniformMatrix4fv(la.projectionMatrix,!1,a.projectionMatrix.elements),Ga&&l.uniform1f(la.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==cb&&(cb=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==
|
|
|
|
+la.cameraPosition&&(oa.setFromMatrixPosition(a.matrixWorld),l.uniform3f(la.cameraPosition,oa.x,oa.y,oa.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==la.viewMatrix&&l.uniformMatrix4fv(la.viewMatrix,!1,a.matrixWorldInverse.elements);if(d.skinning)if(e.bindMatrix&&null!==la.bindMatrix&&l.uniformMatrix4fv(la.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&null!==la.bindMatrixInverse&&l.uniformMatrix4fv(la.bindMatrixInverse,
|
|
|
|
+!1,e.bindMatrixInverse.elements),ic&&e.skeleton&&e.skeleton.useVertexTexture){if(null!==la.boneTexture){var ab=D();l.uniform1i(la.boneTexture,ab);G.setTexture(e.skeleton.boneTexture,ab)}null!==la.boneTextureWidth&&l.uniform1i(la.boneTextureWidth,e.skeleton.boneTextureWidth);null!==la.boneTextureHeight&&l.uniform1i(la.boneTextureHeight,e.skeleton.boneTextureHeight)}else e.skeleton&&e.skeleton.boneMatrices&&null!==la.boneGlobalMatrices&&l.uniformMatrix4fv(la.boneGlobalMatrices,!1,e.skeleton.boneMatrices);
|
|
|
|
+if(ga){c&&d.fog&&(S.fogColor.value=c.color,c instanceof THREE.Fog?(S.fogNear.value=c.near,S.fogFar.value=c.far):c instanceof THREE.FogExp2&&(S.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(Ub){var pa=!0,ba,ha,Aa,va=0,xa=0,ya=0,ka,Ea,La,ta,Ra,Qa,Ia=kc,Pa=Ia.directional.colors,Va=Ia.directional.positions,Za=Ia.point.colors,ob=Ia.point.positions,sb=Ia.point.distances,pb=Ia.spot.colors,tb=Ia.spot.positions,Bb=Ia.spot.distances,
|
|
|
|
+jb=Ia.spot.directions,ub=Ia.spot.anglesCos,Eb=Ia.spot.exponents,Fb=Ia.hemi.skyColors,Gb=Ia.hemi.groundColors,qb=Ia.hemi.positions,Ya=0,kb=0,Wa=0,wa=0,Ma=0,O=0,$a=0,lb=0,Hb=0,Ib=0,db=0,Sa=0;ba=0;for(ha=b.length;ba<ha;ba++)Aa=b[ba],Aa.onlyShadow||(ka=Aa.color,ta=Aa.intensity,Qa=Aa.distance,Aa instanceof THREE.AmbientLight?Aa.visible&&(G.gammaInput?(va+=ka.r*ka.r,xa+=ka.g*ka.g,ya+=ka.b*ka.b):(va+=ka.r,xa+=ka.g,ya+=ka.b)):Aa instanceof THREE.DirectionalLight?(Ma+=1,Aa.visible&&(fa.setFromMatrixPosition(Aa.matrixWorld),
|
|
|
|
+oa.setFromMatrixPosition(Aa.target.matrixWorld),fa.sub(oa),fa.normalize(),Hb=3*Ya,Va[Hb]=fa.x,Va[Hb+1]=fa.y,Va[Hb+2]=fa.z,G.gammaInput?A(Pa,Hb,ka,ta*ta):N(Pa,Hb,ka,ta),Ya+=1)):Aa instanceof THREE.PointLight?(O+=1,Aa.visible&&(Ib=3*kb,G.gammaInput?A(Za,Ib,ka,ta*ta):N(Za,Ib,ka,ta),oa.setFromMatrixPosition(Aa.matrixWorld),ob[Ib]=oa.x,ob[Ib+1]=oa.y,ob[Ib+2]=oa.z,sb[kb]=Qa,kb+=1)):Aa instanceof THREE.SpotLight?($a+=1,Aa.visible&&(db=3*Wa,G.gammaInput?A(pb,db,ka,ta*ta):N(pb,db,ka,ta),fa.setFromMatrixPosition(Aa.matrixWorld),
|
|
|
|
+tb[db]=fa.x,tb[db+1]=fa.y,tb[db+2]=fa.z,Bb[Wa]=Qa,oa.setFromMatrixPosition(Aa.target.matrixWorld),fa.sub(oa),fa.normalize(),jb[db]=fa.x,jb[db+1]=fa.y,jb[db+2]=fa.z,ub[Wa]=Math.cos(Aa.angle),Eb[Wa]=Aa.exponent,Wa+=1)):Aa instanceof THREE.HemisphereLight&&(lb+=1,Aa.visible&&(fa.setFromMatrixPosition(Aa.matrixWorld),fa.normalize(),Sa=3*wa,qb[Sa]=fa.x,qb[Sa+1]=fa.y,qb[Sa+2]=fa.z,Ea=Aa.color,La=Aa.groundColor,G.gammaInput?(Ra=ta*ta,A(Fb,Sa,Ea,Ra),A(Gb,Sa,La,Ra)):(N(Fb,Sa,Ea,ta),N(Gb,Sa,La,ta)),wa+=1)));
|
|
|
|
+ba=3*Ya;for(ha=Math.max(Pa.length,3*Ma);ba<ha;ba++)Pa[ba]=0;ba=3*kb;for(ha=Math.max(Za.length,3*O);ba<ha;ba++)Za[ba]=0;ba=3*Wa;for(ha=Math.max(pb.length,3*$a);ba<ha;ba++)pb[ba]=0;ba=3*wa;for(ha=Math.max(Fb.length,3*lb);ba<ha;ba++)Fb[ba]=0;ba=3*wa;for(ha=Math.max(Gb.length,3*lb);ba<ha;ba++)Gb[ba]=0;Ia.directional.length=Ya;Ia.point.length=kb;Ia.spot.length=Wa;Ia.hemi.length=wa;Ia.ambient[0]=va;Ia.ambient[1]=xa;Ia.ambient[2]=ya;Ub=!1}if(pa){var Ja=kc;S.ambientLightColor.value=Ja.ambient;S.directionalLightColor.value=
|
|
|
|
+Ja.directional.colors;S.directionalLightDirection.value=Ja.directional.positions;S.pointLightColor.value=Ja.point.colors;S.pointLightPosition.value=Ja.point.positions;S.pointLightDistance.value=Ja.point.distances;S.spotLightColor.value=Ja.spot.colors;S.spotLightPosition.value=Ja.spot.positions;S.spotLightDistance.value=Ja.spot.distances;S.spotLightDirection.value=Ja.spot.directions;S.spotLightAngleCos.value=Ja.spot.anglesCos;S.spotLightExponent.value=Ja.spot.exponents;S.hemisphereLightSkyColor.value=
|
|
|
|
+Ja.hemi.skyColors;S.hemisphereLightGroundColor.value=Ja.hemi.groundColors;S.hemisphereLightDirection.value=Ja.hemi.positions;B(S,!0)}else B(S,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){S.opacity.value=d.opacity;G.gammaInput?S.diffuse.value.copyGammaToLinear(d.color):S.diffuse.value=d.color;S.map.value=d.map;S.lightMap.value=d.lightMap;S.specularMap.value=d.specularMap;S.alphaMap.value=d.alphaMap;d.bumpMap&&(S.bumpMap.value=
|
|
|
|
+d.bumpMap,S.bumpScale.value=d.bumpScale);d.normalMap&&(S.normalMap.value=d.normalMap,S.normalScale.value.copy(d.normalScale));var Ta;d.map?Ta=d.map:d.specularMap?Ta=d.specularMap:d.normalMap?Ta=d.normalMap:d.bumpMap?Ta=d.bumpMap:d.alphaMap&&(Ta=d.alphaMap);if(void 0!==Ta){var eb=Ta.offset,Ab=Ta.repeat;S.offsetRepeat.value.set(eb.x,eb.y,Ab.x,Ab.y)}S.envMap.value=d.envMap;S.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;S.reflectivity.value=d.reflectivity;S.refractionRatio.value=
|
|
|
|
+d.refractionRatio;S.combine.value=d.combine;S.useRefract.value=d.envMap&&d.envMap.mapping instanceof THREE.CubeRefractionMapping}d instanceof THREE.LineBasicMaterial?(S.diffuse.value=d.color,S.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(S.diffuse.value=d.color,S.opacity.value=d.opacity,S.dashSize.value=d.dashSize,S.totalSize.value=d.dashSize+d.gapSize,S.scale.value=d.scale):d instanceof THREE.PointCloudMaterial?(S.psColor.value=d.color,S.opacity.value=d.opacity,S.size.value=d.size,
|
|
|
|
+S.scale.value=V.height/2,S.map.value=d.map):d instanceof THREE.MeshPhongMaterial?(S.shininess.value=d.shininess,G.gammaInput?(S.ambient.value.copyGammaToLinear(d.ambient),S.emissive.value.copyGammaToLinear(d.emissive),S.specular.value.copyGammaToLinear(d.specular)):(S.ambient.value=d.ambient,S.emissive.value=d.emissive,S.specular.value=d.specular),d.wrapAround&&S.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(G.gammaInput?(S.ambient.value.copyGammaToLinear(d.ambient),S.emissive.value.copyGammaToLinear(d.emissive)):
|
|
|
|
+(S.ambient.value=d.ambient,S.emissive.value=d.emissive),d.wrapAround&&S.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?(S.mNear.value=a.near,S.mFar.value=a.far,S.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(S.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&S.shadowMatrix)for(var Ob=0,zb=0,F=b.length;zb<F;zb++){var rb=b[zb];rb.castShadow&&(rb instanceof THREE.SpotLight||rb instanceof THREE.DirectionalLight&&!rb.shadowCascade)&&(S.shadowMap.value[Ob]=
|
|
|
|
+rb.shadowMap,S.shadowMapSize.value[Ob]=rb.shadowMapSize,S.shadowMatrix.value[Ob]=rb.shadowMatrix,S.shadowDarkness.value[Ob]=rb.shadowDarkness,S.shadowBias.value[Ob]=rb.shadowBias,Ob++)}for(var Cb=d.uniformsList,Fa,Pb,mb,wb=0,Tb=Cb.length;wb<Tb;wb++){var ra=Cb[wb][0];if(!1!==ra.needsUpdate){var Mb=ra.type,X=ra.value,W=Cb[wb][1];switch(Mb){case "1i":l.uniform1i(W,X);break;case "1f":l.uniform1f(W,X);break;case "2f":l.uniform2f(W,X[0],X[1]);break;case "3f":l.uniform3f(W,X[0],X[1],X[2]);break;case "4f":l.uniform4f(W,
|
|
|
|
+X[0],X[1],X[2],X[3]);break;case "1iv":l.uniform1iv(W,X);break;case "3iv":l.uniform3iv(W,X);break;case "1fv":l.uniform1fv(W,X);break;case "2fv":l.uniform2fv(W,X);break;case "3fv":l.uniform3fv(W,X);break;case "4fv":l.uniform4fv(W,X);break;case "Matrix3fv":l.uniformMatrix3fv(W,!1,X);break;case "Matrix4fv":l.uniformMatrix4fv(W,!1,X);break;case "i":l.uniform1i(W,X);break;case "f":l.uniform1f(W,X);break;case "v2":l.uniform2f(W,X.x,X.y);break;case "v3":l.uniform3f(W,X.x,X.y,X.z);break;case "v4":l.uniform4f(W,
|
|
|
|
+X.x,X.y,X.z,X.w);break;case "c":l.uniform3f(W,X.r,X.g,X.b);break;case "iv1":l.uniform1iv(W,X);break;case "iv":l.uniform3iv(W,X);break;case "fv1":l.uniform1fv(W,X);break;case "fv":l.uniform3fv(W,X);break;case "v2v":void 0===ra._array&&(ra._array=new Float32Array(2*X.length));for(var ea=0,fb=X.length;ea<fb;ea++)mb=2*ea,ra._array[mb]=X[ea].x,ra._array[mb+1]=X[ea].y;l.uniform2fv(W,ra._array);break;case "v3v":void 0===ra._array&&(ra._array=new Float32Array(3*X.length));ea=0;for(fb=X.length;ea<fb;ea++)mb=
|
|
|
|
+3*ea,ra._array[mb]=X[ea].x,ra._array[mb+1]=X[ea].y,ra._array[mb+2]=X[ea].z;l.uniform3fv(W,ra._array);break;case "v4v":void 0===ra._array&&(ra._array=new Float32Array(4*X.length));ea=0;for(fb=X.length;ea<fb;ea++)mb=4*ea,ra._array[mb]=X[ea].x,ra._array[mb+1]=X[ea].y,ra._array[mb+2]=X[ea].z,ra._array[mb+3]=X[ea].w;l.uniform4fv(W,ra._array);break;case "m3":l.uniformMatrix3fv(W,!1,X.elements);break;case "m3v":void 0===ra._array&&(ra._array=new Float32Array(9*X.length));ea=0;for(fb=X.length;ea<fb;ea++)X[ea].flattenToArrayOffset(ra._array,
|
|
|
|
+9*ea);l.uniformMatrix3fv(W,!1,ra._array);break;case "m4":l.uniformMatrix4fv(W,!1,X.elements);break;case "m4v":void 0===ra._array&&(ra._array=new Float32Array(16*X.length));ea=0;for(fb=X.length;ea<fb;ea++)X[ea].flattenToArrayOffset(ra._array,16*ea);l.uniformMatrix4fv(W,!1,ra._array);break;case "t":Fa=X;Pb=D();l.uniform1i(W,Pb);if(!Fa)continue;if(Fa instanceof THREE.CubeTexture||Fa.image instanceof Array&&6===Fa.image.length){var Ua=Fa,Nb=Pb;if(6===Ua.image.length)if(Ua.needsUpdate){Ua.image.__webglTextureCube||
|
|
|
|
+(Ua.addEventListener("dispose",sc),Ua.image.__webglTextureCube=l.createTexture(),G.info.memory.textures++);l.activeTexture(l.TEXTURE0+Nb);l.bindTexture(l.TEXTURE_CUBE_MAP,Ua.image.__webglTextureCube);l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,Ua.flipY);for(var $b=Ua instanceof THREE.CompressedTexture,Qb=[],gb=0;6>gb;gb++)Qb[gb]=G.autoScaleCubemaps&&!$b?M(Ua.image[gb],Mc):Ua.image[gb];var Ba=Qb[0],ac=THREE.Math.isPowerOfTwo(Ba.width)&&THREE.Math.isPowerOfTwo(Ba.height),Db=L(Ua.format),Vb=L(Ua.type);R(l.TEXTURE_CUBE_MAP,
|
|
|
|
+Ua,ac);for(gb=0;6>gb;gb++)if($b)for(var vb,bc=Qb[gb].mipmaps,ua=0,fc=bc.length;ua<fc;ua++)vb=bc[ua],Ua.format!==THREE.RGBAFormat?l.compressedTexImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+gb,ua,Db,vb.width,vb.height,0,vb.data):l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+gb,ua,Db,vb.width,vb.height,0,Db,Vb,vb.data);else l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+gb,0,Db,Db,Vb,Qb[gb]);Ua.generateMipmaps&&ac&&l.generateMipmap(l.TEXTURE_CUBE_MAP);Ua.needsUpdate=!1;if(Ua.onUpdate)Ua.onUpdate()}else l.activeTexture(l.TEXTURE0+
|
|
|
|
+Nb),l.bindTexture(l.TEXTURE_CUBE_MAP,Ua.image.__webglTextureCube)}else if(Fa instanceof THREE.WebGLRenderTargetCube){var Zb=Fa;l.activeTexture(l.TEXTURE0+Pb);l.bindTexture(l.TEXTURE_CUBE_MAP,Zb.__webglTexture)}else G.setTexture(Fa,Pb);break;case "tv":void 0===ra._array&&(ra._array=[]);ea=0;for(fb=ra.value.length;ea<fb;ea++)ra._array[ea]=D();l.uniform1iv(W,ra._array);ea=0;for(fb=ra.value.length;ea<fb;ea++)Fa=ra.value[ea],Pb=ra._array[ea],Fa&&G.setTexture(Fa,Pb);break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+
|
|
|
|
+Mb)}}}}l.uniformMatrix4fv(la.modelViewMatrix,!1,e._modelViewMatrix.elements);la.normalMatrix&&l.uniformMatrix3fv(la.normalMatrix,!1,e._normalMatrix.elements);null!==la.modelMatrix&&l.uniformMatrix4fv(la.modelMatrix,!1,e.matrixWorld.elements);return na}function B(a,b){a.ambientLightColor.needsUpdate=b;a.directionalLightColor.needsUpdate=b;a.directionalLightDirection.needsUpdate=b;a.pointLightColor.needsUpdate=b;a.pointLightPosition.needsUpdate=b;a.pointLightDistance.needsUpdate=b;a.spotLightColor.needsUpdate=
|
|
|
|
+b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=b;a.spotLightDirection.needsUpdate=b;a.spotLightAngleCos.needsUpdate=b;a.spotLightExponent.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=b;a.hemisphereLightGroundColor.needsUpdate=b;a.hemisphereLightDirection.needsUpdate=b}function D(){var a=Ha;a>=xc&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+xc);Ha+=1;return a}function w(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,
|
|
|
|
+a.matrixWorld);a._normalMatrix.getNormalMatrix(a._modelViewMatrix)}function A(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function N(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function P(a){a!==ha&&(l.lineWidth(a),ha=a)}function K(a,b,c){pb!==a&&(a?l.enable(l.POLYGON_OFFSET_FILL):l.disable(l.POLYGON_OFFSET_FILL),pb=a);!a||ta===b&&ka===c||(l.polygonOffset(b,c),ta=b,ka=c)}function R(a,b,c){c?(l.texParameteri(a,l.TEXTURE_WRAP_S,L(b.wrapS)),l.texParameteri(a,l.TEXTURE_WRAP_T,L(b.wrapT)),
|
|
|
|
+l.texParameteri(a,l.TEXTURE_MAG_FILTER,L(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,L(b.minFilter))):(l.texParameteri(a,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(a,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.texParameteri(a,l.TEXTURE_MAG_FILTER,T(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,T(b.minFilter)));zb&&b.type!==THREE.FloatType&&(1<b.anisotropy||b.__oldAnisotropy)&&(l.texParameterf(a,zb.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,yc)),b.__oldAnisotropy=b.anisotropy)}
|
|
|
|
+function M(a,b){if(a.width>b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);console.log("THREE.WebGLRenderer:",a,"is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height+".");return d}return a}function H(a,b){l.bindRenderbuffer(l.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(l.renderbufferStorage(l.RENDERBUFFER,
|
|
|
|
+l.DEPTH_COMPONENT16,b.width,b.height),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_ATTACHMENT,l.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH_STENCIL,b.width,b.height),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,a)):l.renderbufferStorage(l.RENDERBUFFER,l.RGBA4,b.width,b.height)}function C(a){a instanceof THREE.WebGLRenderTargetCube?(l.bindTexture(l.TEXTURE_CUBE_MAP,a.__webglTexture),l.generateMipmap(l.TEXTURE_CUBE_MAP),
|
|
|
|
+l.bindTexture(l.TEXTURE_CUBE_MAP,null)):(l.bindTexture(l.TEXTURE_2D,a.__webglTexture),l.generateMipmap(l.TEXTURE_2D),l.bindTexture(l.TEXTURE_2D,null))}function T(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?l.NEAREST:l.LINEAR}function L(a){if(a===THREE.RepeatWrapping)return l.REPEAT;if(a===THREE.ClampToEdgeWrapping)return l.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return l.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return l.NEAREST;
|
|
|
|
+if(a===THREE.NearestMipMapNearestFilter)return l.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return l.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return l.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return l.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return l.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return l.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return l.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return l.UNSIGNED_SHORT_5_5_5_1;
|
|
|
|
+if(a===THREE.UnsignedShort565Type)return l.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return l.BYTE;if(a===THREE.ShortType)return l.SHORT;if(a===THREE.UnsignedShortType)return l.UNSIGNED_SHORT;if(a===THREE.IntType)return l.INT;if(a===THREE.UnsignedIntType)return l.UNSIGNED_INT;if(a===THREE.FloatType)return l.FLOAT;if(a===THREE.AlphaFormat)return l.ALPHA;if(a===THREE.RGBFormat)return l.RGB;if(a===THREE.RGBAFormat)return l.RGBA;if(a===THREE.LuminanceFormat)return l.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return l.LUMINANCE_ALPHA;
|
|
|
|
+if(a===THREE.AddEquation)return l.FUNC_ADD;if(a===THREE.SubtractEquation)return l.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return l.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return l.ZERO;if(a===THREE.OneFactor)return l.ONE;if(a===THREE.SrcColorFactor)return l.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return l.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return l.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return l.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return l.DST_ALPHA;
|
|
|
|
+if(a===THREE.OneMinusDstAlphaFactor)return l.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return l.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return l.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return l.SRC_ALPHA_SATURATE;if(void 0!==sb){if(a===THREE.RGB_S3TC_DXT1_Format)return sb.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return sb.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return sb.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return sb.COMPRESSED_RGBA_S3TC_DXT5_EXT}return 0}
|
|
|
|
+console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var V=void 0!==a.canvas?a.canvas:document.createElement("canvas"),J=void 0!==a.context?a.context:null,Y=void 0!==a.precision?a.precision:"highp",aa=void 0!==a.alpha?a.alpha:!1,na=void 0!==a.depth?a.depth:!0,I=void 0!==a.stencil?a.stencil:!0,ba=void 0!==a.antialias?a.antialias:!1,Q=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,ca=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,Ga=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:
|
|
|
|
+!1,Da=new THREE.Color(0),Na=0,Oa=[],Ka={},la=[],ab=[],sa=[];this.domElement=V;this.context=null;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1;this.shadowMapAutoUpdate=!0;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=
|
|
|
|
+this.shadowMapDebug=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.renderPluginsPre=[];this.renderPluginsPost=[];this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var G=this,bb=[],nb=null,ob=null,qa=-1,pa=null,cb=null,Ha=0,Ea=-1,La=-1,va=-1,ya=-1,da=-1,xa=-1,Qa=-1,Va=-1,pb=null,ta=null,ka=null,ha=null,Pa=0,Tb=0,Mb=V.width,Nb=V.height,Zb=0,jc=0,tb=new Uint8Array(16),wb=new Uint8Array(16),zc=new THREE.Frustum,tc=new THREE.Matrix4,
|
|
|
|
+Ac=new THREE.Matrix4,oa=new THREE.Vector3,fa=new THREE.Vector3,Ub=!0,kc={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},l,Eb,Ab,zb,sb,Bb;(function(){try{var a={alpha:aa,depth:na,stencil:I,antialias:ba,premultipliedAlpha:Q,preserveDrawingBuffer:ca};l=J||V.getContext("webgl",a)||V.getContext("experimental-webgl",
|
|
a);if(null===l)throw"Error creating WebGL context.";}catch(b){console.error(b)}Eb=l.getExtension("OES_texture_float");l.getExtension("OES_texture_float_linear");Ab=l.getExtension("OES_standard_derivatives");zb=l.getExtension("EXT_texture_filter_anisotropic")||l.getExtension("MOZ_EXT_texture_filter_anisotropic")||l.getExtension("WEBKIT_EXT_texture_filter_anisotropic");sb=l.getExtension("WEBGL_compressed_texture_s3tc")||l.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||l.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
|
|
a);if(null===l)throw"Error creating WebGL context.";}catch(b){console.error(b)}Eb=l.getExtension("OES_texture_float");l.getExtension("OES_texture_float_linear");Ab=l.getExtension("OES_standard_derivatives");zb=l.getExtension("EXT_texture_filter_anisotropic")||l.getExtension("MOZ_EXT_texture_filter_anisotropic")||l.getExtension("WEBKIT_EXT_texture_filter_anisotropic");sb=l.getExtension("WEBGL_compressed_texture_s3tc")||l.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||l.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
|
|
Bb=l.getExtension("OES_element_index_uint");null===Eb&&console.log("THREE.WebGLRenderer: Float textures not supported.");null===Ab&&console.log("THREE.WebGLRenderer: Standard derivatives not supported.");null===zb&&console.log("THREE.WebGLRenderer: Anisotropic texture filtering not supported.");null===sb&&console.log("THREE.WebGLRenderer: S3TC compressed textures not supported.");null===Bb&&console.log("THREE.WebGLRenderer: elementindex as unsigned integer not supported.");void 0===l.getShaderPrecisionFormat&&
|
|
Bb=l.getExtension("OES_element_index_uint");null===Eb&&console.log("THREE.WebGLRenderer: Float textures not supported.");null===Ab&&console.log("THREE.WebGLRenderer: Standard derivatives not supported.");null===zb&&console.log("THREE.WebGLRenderer: Anisotropic texture filtering not supported.");null===sb&&console.log("THREE.WebGLRenderer: S3TC compressed textures not supported.");null===Bb&&console.log("THREE.WebGLRenderer: elementindex as unsigned integer not supported.");void 0===l.getShaderPrecisionFormat&&
|
|
(l.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});Ga&&l.getExtension("EXT_frag_depth")})();l.clearColor(0,0,0,1);l.clearDepth(1);l.clearStencil(0);l.enable(l.DEPTH_TEST);l.depthFunc(l.LEQUAL);l.frontFace(l.CCW);l.cullFace(l.BACK);l.enable(l.CULL_FACE);l.enable(l.BLEND);l.blendEquation(l.FUNC_ADD);l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA);l.viewport(Pa,Tb,Mb,Nb);l.clearColor(Da.r,Da.g,Da.b,Na);this.context=l;var xc=l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS),Nc=
|
|
(l.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});Ga&&l.getExtension("EXT_frag_depth")})();l.clearColor(0,0,0,1);l.clearDepth(1);l.clearStencil(0);l.enable(l.DEPTH_TEST);l.depthFunc(l.LEQUAL);l.frontFace(l.CCW);l.cullFace(l.BACK);l.enable(l.CULL_FACE);l.enable(l.BLEND);l.blendEquation(l.FUNC_ADD);l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA);l.viewport(Pa,Tb,Mb,Nb);l.clearColor(Da.r,Da.g,Da.b,Na);this.context=l;var xc=l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS),Nc=
|
|
@@ -555,7 +555,7 @@ Sc=l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.MEDIUM_FLOAT);l.getShaderPreci
|
|
function(){return l};this.supportsVertexTextures=function(){return rc};this.supportsFloatTextures=function(){return Eb};this.supportsStandardDerivatives=function(){return Ab};this.supportsCompressedTextureS3TC=function(){return sb};this.getMaxAnisotropy=function(){return yc};this.getPrecision=function(){return Y};this.setSize=function(a,b,c){V.width=a*this.devicePixelRatio;V.height=b*this.devicePixelRatio;!1!==c&&(V.style.width=a+"px",V.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=
|
|
function(){return l};this.supportsVertexTextures=function(){return rc};this.supportsFloatTextures=function(){return Eb};this.supportsStandardDerivatives=function(){return Ab};this.supportsCompressedTextureS3TC=function(){return sb};this.getMaxAnisotropy=function(){return yc};this.getPrecision=function(){return Y};this.setSize=function(a,b,c){V.width=a*this.devicePixelRatio;V.height=b*this.devicePixelRatio;!1!==c&&(V.style.width=a+"px",V.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=
|
|
function(a,b,c,d){Pa=a*this.devicePixelRatio;Tb=b*this.devicePixelRatio;Mb=c*this.devicePixelRatio;Nb=d*this.devicePixelRatio;l.viewport(Pa,Tb,Mb,Nb)};this.setScissor=function(a,b,c,d){l.scissor(a*this.devicePixelRatio,b*this.devicePixelRatio,c*this.devicePixelRatio,d*this.devicePixelRatio)};this.enableScissorTest=function(a){a?l.enable(l.SCISSOR_TEST):l.disable(l.SCISSOR_TEST)};this.setClearColor=function(a,b){Da.set(a);Na=void 0!==b?b:1;l.clearColor(Da.r,Da.g,Da.b,Na)};this.setClearColorHex=function(a,
|
|
function(a,b,c,d){Pa=a*this.devicePixelRatio;Tb=b*this.devicePixelRatio;Mb=c*this.devicePixelRatio;Nb=d*this.devicePixelRatio;l.viewport(Pa,Tb,Mb,Nb)};this.setScissor=function(a,b,c,d){l.scissor(a*this.devicePixelRatio,b*this.devicePixelRatio,c*this.devicePixelRatio,d*this.devicePixelRatio)};this.enableScissorTest=function(a){a?l.enable(l.SCISSOR_TEST):l.disable(l.SCISSOR_TEST)};this.setClearColor=function(a,b){Da.set(a);Na=void 0!==b?b:1;l.clearColor(Da.r,Da.g,Da.b,Na)};this.setClearColorHex=function(a,
|
|
b){console.warn("THREE.WebGLRenderer: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getClearColor=function(){return Da};this.getClearAlpha=function(){return Na};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=l.COLOR_BUFFER_BIT;if(void 0===b||b)d|=l.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=l.STENCIL_BUFFER_BIT;l.clear(d)};this.clearColor=function(){l.clear(l.COLOR_BUFFER_BIT)};this.clearDepth=function(){l.clear(l.DEPTH_BUFFER_BIT)};this.clearStencil=
|
|
b){console.warn("THREE.WebGLRenderer: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getClearColor=function(){return Da};this.getClearAlpha=function(){return Na};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=l.COLOR_BUFFER_BIT;if(void 0===b||b)d|=l.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=l.STENCIL_BUFFER_BIT;l.clear(d)};this.clearColor=function(){l.clear(l.COLOR_BUFFER_BIT)};this.clearDepth=function(){l.clear(l.DEPTH_BUFFER_BIT)};this.clearStencil=
|
|
-function(){l.clear(l.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.addPostPlugin=function(a){a.init(this,Oa,Ka,la);this.renderPluginsPost.push(a)};this.addPrePlugin=function(a){a.init(this,Oa,Ka,la);this.renderPluginsPre.push(a)};this.updateShadowMap=function(a,b){nb=null;qa=pa=Va=Qa=va=-1;Ub=!0;La=Ea=-1;this.shadowMapPlugin.update(a,b)};var Hc=function(a){a=a.target;a.removeEventListener("dispose",Hc);y(a)},Ic=function(a){a=a.target;a.removeEventListener("dispose",
|
|
|
|
|
|
+function(){l.clear(l.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.addPostPlugin=function(a){a.init(this,Oa,Ka,la);this.renderPluginsPost.push(a)};this.addPrePlugin=function(a){a.init(this,Oa,Ka,la);this.renderPluginsPre.push(a)};this.updateShadowMap=function(a,b){nb=null;qa=pa=Va=Qa=va=-1;Ub=!0;La=Ea=-1;this.shadowMapPlugin.update(a,b)};var Hc=function(a){a=a.target;a.removeEventListener("removed",Hc);y(a)},Ic=function(a){a=a.target;a.removeEventListener("dispose",
|
|
Ic);a.__webglInit=void 0;if(a instanceof THREE.BufferGeometry){for(var b in a.attributes)void 0!==a.attributes[b].buffer&&l.deleteBuffer(a.attributes[b].buffer);G.info.memory.geometries--}else if(void 0!==a.geometryGroups){b=0;for(var c=a.geometryGroupsList.length;b<c;b++){var d=a.geometryGroupsList[b];if(void 0!==d.numMorphTargets)for(var e=0,f=d.numMorphTargets;e<f;e++)l.deleteBuffer(d.__webglMorphTargetsBuffers[e]);if(void 0!==d.numMorphNormals)for(e=0,f=d.numMorphNormals;e<f;e++)l.deleteBuffer(d.__webglMorphNormalsBuffers[e]);
|
|
Ic);a.__webglInit=void 0;if(a instanceof THREE.BufferGeometry){for(var b in a.attributes)void 0!==a.attributes[b].buffer&&l.deleteBuffer(a.attributes[b].buffer);G.info.memory.geometries--}else if(void 0!==a.geometryGroups){b=0;for(var c=a.geometryGroupsList.length;b<c;b++){var d=a.geometryGroupsList[b];if(void 0!==d.numMorphTargets)for(var e=0,f=d.numMorphTargets;e<f;e++)l.deleteBuffer(d.__webglMorphTargetsBuffers[e]);if(void 0!==d.numMorphNormals)for(e=0,f=d.numMorphNormals;e<f;e++)l.deleteBuffer(d.__webglMorphNormalsBuffers[e]);
|
|
Kc(d)}}else Kc(a)},sc=function(a){a=a.target;a.removeEventListener("dispose",sc);a.image&&a.image.__webglTextureCube?l.deleteTexture(a.image.__webglTextureCube):a.__webglInit&&(a.__webglInit=!1,l.deleteTexture(a.__webglTexture));G.info.memory.textures--},Lc=function(a){a=a.target;a.removeEventListener("dispose",Lc);if(a&&a.__webglTexture)if(l.deleteTexture(a.__webglTexture),a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)l.deleteFramebuffer(a.__webglFramebuffer[b]),l.deleteRenderbuffer(a.__webglRenderbuffer[b]);
|
|
Kc(d)}}else Kc(a)},sc=function(a){a=a.target;a.removeEventListener("dispose",sc);a.image&&a.image.__webglTextureCube?l.deleteTexture(a.image.__webglTextureCube):a.__webglInit&&(a.__webglInit=!1,l.deleteTexture(a.__webglTexture));G.info.memory.textures--},Lc=function(a){a=a.target;a.removeEventListener("dispose",Lc);if(a&&a.__webglTexture)if(l.deleteTexture(a.__webglTexture),a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)l.deleteFramebuffer(a.__webglFramebuffer[b]),l.deleteRenderbuffer(a.__webglRenderbuffer[b]);
|
|
else l.deleteFramebuffer(a.__webglFramebuffer),l.deleteRenderbuffer(a.__webglRenderbuffer);G.info.memory.textures--},qc=function(a){a=a.target;a.removeEventListener("dispose",qc);pc(a)},Kc=function(a){void 0!==a.__webglVertexBuffer&&l.deleteBuffer(a.__webglVertexBuffer);void 0!==a.__webglNormalBuffer&&l.deleteBuffer(a.__webglNormalBuffer);void 0!==a.__webglTangentBuffer&&l.deleteBuffer(a.__webglTangentBuffer);void 0!==a.__webglColorBuffer&&l.deleteBuffer(a.__webglColorBuffer);void 0!==a.__webglUVBuffer&&
|
|
else l.deleteFramebuffer(a.__webglFramebuffer),l.deleteRenderbuffer(a.__webglRenderbuffer);G.info.memory.textures--},qc=function(a){a=a.target;a.removeEventListener("dispose",qc);pc(a)},Kc=function(a){void 0!==a.__webglVertexBuffer&&l.deleteBuffer(a.__webglVertexBuffer);void 0!==a.__webglNormalBuffer&&l.deleteBuffer(a.__webglNormalBuffer);void 0!==a.__webglTangentBuffer&&l.deleteBuffer(a.__webglTangentBuffer);void 0!==a.__webglColorBuffer&&l.deleteBuffer(a.__webglColorBuffer);void 0!==a.__webglUVBuffer&&
|