diff --git a/build/three.js b/build/three.js index 18834902169e904288db88d24b6491b2afd96700..6ea30057fa5edfaad5f54dd44c2783a96400c417 100644 --- a/build/three.js +++ b/build/three.js @@ -17708,8 +17708,6 @@ THREE.Loader.prototype = { break; case 'depthTest': case 'depthWrite': - case 'stencilTest': - case 'stencilWrite': case 'colorWrite': case 'opacity': case 'reflectivity': @@ -18828,8 +18826,6 @@ THREE.MaterialLoader.prototype = { if ( json.alphaTest !== undefined ) material.alphaTest = json.alphaTest; if ( json.depthTest !== undefined ) material.depthTest = json.depthTest; if ( json.depthWrite !== undefined ) material.depthWrite = json.depthWrite; - if ( json.stencilTest !== undefined ) material.stencilTest = json.stencilTest; - if ( json.stencilWrite !== undefined ) material.stencilWrite = json.stencilWrite; if ( json.colorWrite !== undefined ) material.colorWrite = json.colorWrite; if ( json.wireframe !== undefined ) material.wireframe = json.wireframe; if ( json.wireframeLinewidth !== undefined ) material.wireframeLinewidth = json.wireframeLinewidth; @@ -18877,7 +18873,7 @@ THREE.MaterialLoader.prototype = { if ( json.metalnessMap !== undefined ) material.metalnessMap = this.getTexture( json.metalnessMap ); if ( json.emissiveMap !== undefined ) material.emissiveMap = this.getTexture( json.emissiveMap ); - if ( json.emissiveMapIntensity !== undefined ) material.emissiveMapIntensity = json.emissiveMapIntensity; + if ( json.emissiveIntensity !== undefined ) material.emissiveIntensity = json.emissiveIntensity; if ( json.specularMap !== undefined ) material.specularMap = this.getTexture( json.specularMap ); @@ -19932,9 +19928,6 @@ THREE.Material = function () { this.depthTest = true; this.depthWrite = true; - this.stencilTest = false; - this.stencilWrite = false; - this.colorWrite = true; this.precision = null; // override the renderer's default precision for this material @@ -20162,9 +20155,6 @@ THREE.Material.prototype = { this.depthTest = source.depthTest; this.depthWrite = source.depthWrite; - this.stencilTest = source.stencilTest; - this.stencilWrite = source.stencilWrite; - this.colorWrite = source.colorWrite; this.precision = source.precision; @@ -20465,7 +20455,6 @@ THREE.MeshBasicMaterial.prototype.copy = function ( source ) { * * parameters = { * color: , - * emissive: , * opacity: , * * map: new THREE.Texture( ), @@ -20476,8 +20465,9 @@ THREE.MeshBasicMaterial.prototype.copy = function ( source ) { * aoMap: new THREE.Texture( ), * aoMapIntensity: * + * emissive: , + * emissiveIntensity: * emissiveMap: new THREE.Texture( ), - * emissiveMapIntensity: * * specularMap: new THREE.Texture( ), * @@ -20512,7 +20502,6 @@ THREE.MeshLambertMaterial = function ( parameters ) { this.type = 'MeshLambertMaterial'; this.color = new THREE.Color( 0xffffff ); // diffuse - this.emissive = new THREE.Color( 0x000000 ); this.map = null; @@ -20522,8 +20511,9 @@ THREE.MeshLambertMaterial = function ( parameters ) { this.aoMap = null; this.aoMapIntensity = 1.0; + this.emissive = new THREE.Color( 0x000000 ); + this.emissiveIntensity = 1.0; this.emissiveMap = null; - this.emissiveMapIntensity = 1.0; this.specularMap = null; @@ -20559,7 +20549,6 @@ THREE.MeshLambertMaterial.prototype.copy = function ( source ) { THREE.Material.prototype.copy.call( this, source ); this.color.copy( source.color ); - this.emissive.copy( source.emissive ); this.map = source.map; @@ -20569,8 +20558,9 @@ THREE.MeshLambertMaterial.prototype.copy = function ( source ) { this.aoMap = source.aoMap; this.aoMapIntensity = source.aoMapIntensity; + this.emissive.copy( source.emissive ); this.emissiveMap = source.emissiveMap; - this.emissiveMapIntensity = source.emissiveMapIntensity; + this.emissiveIntensity = source.emissiveIntensity; this.specularMap = source.specularMap; @@ -20606,7 +20596,6 @@ THREE.MeshLambertMaterial.prototype.copy = function ( source ) { * * parameters = { * color: , - * emissive: , * specular: , * shininess: , * opacity: , @@ -20619,8 +20608,9 @@ THREE.MeshLambertMaterial.prototype.copy = function ( source ) { * aoMap: new THREE.Texture( ), * aoMapIntensity: * + * emissive: , + * emissiveIntensity: * emissiveMap: new THREE.Texture( ), - * emissiveMapIntensity: * * bumpMap: new THREE.Texture( ), * bumpScale: , @@ -20666,7 +20656,6 @@ THREE.MeshPhongMaterial = function ( parameters ) { this.type = 'MeshPhongMaterial'; this.color = new THREE.Color( 0xffffff ); // diffuse - this.emissive = new THREE.Color( 0x000000 ); this.specular = new THREE.Color( 0x111111 ); this.shininess = 30; @@ -20678,8 +20667,9 @@ THREE.MeshPhongMaterial = function ( parameters ) { this.aoMap = null; this.aoMapIntensity = 1.0; + this.emissive = new THREE.Color( 0x000000 ); + this.emissiveIntensity = 1.0; this.emissiveMap = null; - this.emissiveMapIntensity = 1.0; this.bumpMap = null; this.bumpScale = 1; @@ -20727,7 +20717,6 @@ THREE.MeshPhongMaterial.prototype.copy = function ( source ) { THREE.Material.prototype.copy.call( this, source ); this.color.copy( source.color ); - this.emissive.copy( source.emissive ); this.specular.copy( source.specular ); this.shininess = source.shininess; @@ -20739,8 +20728,9 @@ THREE.MeshPhongMaterial.prototype.copy = function ( source ) { this.aoMap = source.aoMap; this.aoMapIntensity = source.aoMapIntensity; + this.emissive.copy( source.emissive ); this.emissiveMap = source.emissiveMap; - this.emissiveMapIntensity = source.emissiveMapIntensity; + this.emissiveIntensity = source.emissiveIntensity; this.bumpMap = source.bumpMap; this.bumpScale = source.bumpScale; @@ -20789,8 +20779,6 @@ THREE.MeshPhongMaterial.prototype.copy = function ( source ) { * color: , * roughness: , * metalness: , - - * emissive: , * opacity: , * * map: new THREE.Texture( ), @@ -20801,8 +20789,9 @@ THREE.MeshPhongMaterial.prototype.copy = function ( source ) { * aoMap: new THREE.Texture( ), * aoMapIntensity: * + * emissive: , + * emissiveIntensity: * emissiveMap: new THREE.Texture( ), - * emissiveMapIntensity: * * bumpMap: new THREE.Texture( ), * bumpScale: , @@ -20853,8 +20842,6 @@ THREE.MeshStandardMaterial = function ( parameters ) { this.roughness = 0.5; this.metalness = 0.5; - this.emissive = new THREE.Color( 0x000000 ); - this.map = null; this.lightMap = null; @@ -20863,8 +20850,9 @@ THREE.MeshStandardMaterial = function ( parameters ) { this.aoMap = null; this.aoMapIntensity = 1.0; + this.emissive = new THREE.Color( 0x000000 ); + this.emissiveIntensity = 1.0; this.emissiveMap = null; - this.emissiveMapIntensity = 1.0; this.bumpMap = null; this.bumpScale = 1; @@ -20917,8 +20905,6 @@ THREE.MeshStandardMaterial.prototype.copy = function ( source ) { this.roughness = source.roughness; this.metalness = source.metalness; - this.emissive.copy( source.emissive ); - this.map = source.map; this.lightMap = source.lightMap; @@ -20927,8 +20913,9 @@ THREE.MeshStandardMaterial.prototype.copy = function ( source ) { this.aoMap = source.aoMap; this.aoMapIntensity = source.aoMapIntensity; + this.emissive.copy( source.emissive ); this.emissiveMap = source.emissiveMap; - this.emissiveMapIntensity = source.emissiveMapIntensity; + this.emissiveIntensity = source.emissiveIntensity; this.bumpMap = source.bumpMap; this.bumpScale = source.bumpScale; @@ -23416,11 +23403,11 @@ THREE.ShaderChunk[ 'displacementmap_pars_vertex' ] = "#ifdef USE_DISPLACEMENTMAP // File:src/renderers/shaders/ShaderChunk/emissivemap_fragment.glsl -THREE.ShaderChunk[ 'emissivemap_fragment' ] = "#ifdef USE_EMISSIVEMAP\n vec4 emissiveColor = texture2D( emissiveMap, vUv );\n emissiveColor.rgb = inputToLinear( emissiveColor.rgb );\n totalEmissiveLight *= emissiveColor.rgb * emissiveMapIntensity;\n#endif\n"; +THREE.ShaderChunk[ 'emissivemap_fragment' ] = "#ifdef USE_EMISSIVEMAP\n vec4 emissiveColor = texture2D( emissiveMap, vUv );\n emissiveColor.rgb = inputToLinear( emissiveColor.rgb );\n totalEmissiveLight *= emissiveColor.rgb;\n#endif\n"; // File:src/renderers/shaders/ShaderChunk/emissivemap_pars_fragment.glsl -THREE.ShaderChunk[ 'emissivemap_pars_fragment' ] = "#ifdef USE_EMISSIVEMAP\n uniform sampler2D emissiveMap;\n uniform float emissiveMapIntensity;\n#endif\n"; +THREE.ShaderChunk[ 'emissivemap_pars_fragment' ] = "#ifdef USE_EMISSIVEMAP\n uniform sampler2D emissiveMap;\n#endif\n"; // File:src/renderers/shaders/ShaderChunk/envmap_fragment.glsl @@ -23714,107 +23701,106 @@ THREE.UniformsLib = { common: { - "diffuse" : { type: "c", value: new THREE.Color( 0xeeeeee ) }, - "opacity" : { type: "f", value: 1.0 }, + "diffuse": { type: "c", value: new THREE.Color( 0xeeeeee ) }, + "opacity": { type: "f", value: 1.0 }, - "map" : { type: "t", value: null }, - "offsetRepeat" : { type: "v4", value: new THREE.Vector4( 0, 0, 1, 1 ) }, + "map": { type: "t", value: null }, + "offsetRepeat": { type: "v4", value: new THREE.Vector4( 0, 0, 1, 1 ) }, - "specularMap" : { type: "t", value: null }, - "alphaMap" : { type: "t", value: null }, + "specularMap": { type: "t", value: null }, + "alphaMap": { type: "t", value: null }, - "envMap" : { type: "t", value: null }, - "flipEnvMap" : { type: "f", value: - 1 }, - "reflectivity" : { type: "f", value: 1.0 }, - "refractionRatio" : { type: "f", value: 0.98 } + "envMap": { type: "t", value: null }, + "flipEnvMap": { type: "f", value: - 1 }, + "reflectivity": { type: "f", value: 1.0 }, + "refractionRatio": { type: "f", value: 0.98 } }, aomap: { - "aoMap" : { type: "t", value: null }, - "aoMapIntensity" : { type: "f", value: 1 }, + "aoMap": { type: "t", value: null }, + "aoMapIntensity": { type: "f", value: 1 } }, lightmap: { - "lightMap" : { type: "t", value: null }, - "lightMapIntensity" : { type: "f", value: 1 }, + "lightMap": { type: "t", value: null }, + "lightMapIntensity": { type: "f", value: 1 } }, emissivemap: { - "emissiveMap" : { type: "t", value: null }, - "emissiveMapIntensity" : { type: "f", value: 1 }, + "emissiveMap": { type: "t", value: null } }, bumpmap: { - "bumpMap" : { type: "t", value: null }, - "bumpScale" : { type: "f", value: 1 } + "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 ) } + "normalMap": { type: "t", value: null }, + "normalScale": { type: "v2", value: new THREE.Vector2( 1, 1 ) } }, displacementmap: { - "displacementMap" : { type: "t", value: null }, - "displacementScale" : { type: "f", value: 1 }, - "displacementBias" : { type: "f", value: 0 } + "displacementMap": { type: "t", value: null }, + "displacementScale": { type: "f", value: 1 }, + "displacementBias": { type: "f", value: 0 } }, roughnessmap: { - "roughnessMap" : { type: "t", value: null } + "roughnessMap": { type: "t", value: null } }, metalnessmap: { - "metalnessMap" : { type: "t", value: null } + "metalnessMap": { type: "t", value: null } }, fog: { - "fogDensity" : { type: "f", value: 0.00025 }, - "fogNear" : { type: "f", value: 1 }, - "fogFar" : { type: "f", value: 2000 }, - "fogColor" : { type: "c", value: new THREE.Color( 0xffffff ) } + "fogDensity": { type: "f", value: 0.00025 }, + "fogNear": { type: "f", value: 1 }, + "fogFar": { type: "f", value: 2000 }, + "fogColor": { type: "c", value: new THREE.Color( 0xffffff ) } }, ambient: { - "ambientLightColor" : { type: "fv", value: [] } + "ambientLightColor": { type: "fv", value: [] } }, lights: { - "directionalLights" : { type: "sa", value: [], properties: { + "directionalLights": { type: "sa", value: [], properties: { "direction": { type: "v3" }, "color": { type: "c" }, "shadow": { type: "i" } } }, - "hemisphereLights" : { type: "sa", value: [], properties: { + "hemisphereLights": { type: "sa", value: [], properties: { "direction": { type: "v3" }, "skyColor": { type: "c" }, "groundColor": { type: "c" } } }, - "pointLights" : { type: "sa", value: [], properties: { + "pointLights": { type: "sa", value: [], properties: { "color": { type: "c" }, "position": { type: "v3" }, "decay": { type: "f" }, @@ -23822,7 +23808,7 @@ THREE.UniformsLib = { "shadow": { type: "i" } } }, - "spotLights" : { type: "sa", value: [], properties: { + "spotLights": { type: "sa", value: [], properties: { "color": { type: "c" }, "position": { type: "v3" }, "direction": { type: "v3" }, @@ -23837,12 +23823,12 @@ THREE.UniformsLib = { points: { - "diffuse" : { type: "c", value: new THREE.Color( 0xeeeeee ) }, - "opacity" : { type: "f", value: 1.0 }, - "size" : { type: "f", value: 1.0 }, - "scale" : { type: "f", value: 1.0 }, - "map" : { type: "t", value: null }, - "offsetRepeat" : { type: "v4", value: new THREE.Vector4( 0, 0, 1, 1 ) } + "diffuse": { type: "c", value: new THREE.Color( 0xeeeeee ) }, + "opacity": { type: "f", value: 1.0 }, + "size": { type: "f", value: 1.0 }, + "scale": { type: "f", value: 1.0 }, + "map": { type: "t", value: null }, + "offsetRepeat": { type: "v4", value: new THREE.Vector4( 0, 0, 1, 1 ) } }, @@ -23851,10 +23837,10 @@ THREE.UniformsLib = { "shadowMap": { type: "tv", value: [] }, "shadowMapSize": { type: "v2v", value: [] }, - "shadowBias" : { type: "fv1", value: [] }, + "shadowBias": { type: "fv1", value: [] }, "shadowDarkness": { type: "fv1", value: [] }, - "shadowMatrix" : { type: "m4v", value: [] } + "shadowMatrix": { type: "m4v", value: [] } } @@ -26175,12 +26161,10 @@ THREE.WebGLRenderer = function ( parameters ) { } - // Ensure buffer writing is enabled so they can be cleared on next render + // Ensure depth buffer writing is enabled so it can be cleared on next render state.setDepthTest( true ); state.setDepthWrite( true ); - state.setStencilTest( true ); - state.setStencilWrite( true ); state.setColorWrite( true ); // _gl.finish(); @@ -26543,8 +26527,6 @@ THREE.WebGLRenderer = function ( parameters ) { state.setDepthFunc( material.depthFunc ); state.setDepthTest( material.depthTest ); state.setDepthWrite( material.depthWrite ); - state.setStencilTest( material.stencilTest ); - state.setStencilWrite( material.stencilWrite ); state.setColorWrite( material.colorWrite ); state.setPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits ); @@ -26863,7 +26845,7 @@ THREE.WebGLRenderer = function ( parameters ) { if ( material.emissive ) { - uniforms.emissive.value = material.emissive; + uniforms.emissive.value.copy( material.emissive ).multiplyScalar( material.emissiveIntensity ); } @@ -27013,7 +26995,6 @@ THREE.WebGLRenderer = function ( parameters ) { if ( material.emissiveMap ) { uniforms.emissiveMap.value = material.emissiveMap; - uniforms.emissiveMapIntensity.value = material.emissiveMapIntensity; } @@ -27034,7 +27015,6 @@ THREE.WebGLRenderer = function ( parameters ) { if ( material.emissiveMap ) { uniforms.emissiveMap.value = material.emissiveMap; - uniforms.emissiveMapIntensity.value = material.emissiveMapIntensity; } @@ -27089,7 +27069,6 @@ THREE.WebGLRenderer = function ( parameters ) { if ( material.emissiveMap ) { uniforms.emissiveMap.value = material.emissiveMap; - uniforms.emissiveMapIntensity.value = material.emissiveMapIntensity; } @@ -31386,7 +31365,6 @@ THREE.WebGLState = function ( gl, extensions, paramThreeToGL ) { currentBlending = null; currentDepthWrite = null; - currentStencilWrite = null; currentColorWrite = null; currentFlipSided = null; diff --git a/build/three.min.js b/build/three.min.js index 82b04ff8c068fdf853a95511fbb99247666a0e15..8ff601c3b43406508724680507aa467dca303092 100644 --- a/build/three.min.js +++ b/build/three.min.js @@ -108,7 +108,7 @@ d;b[1]=k+l*d;b[5]=a-m*d;b[9]=-c*g;b[2]=m-a*d;b[6]=l+k*d;b[10]=f*g}else"YXZ"===a. c*d,b[0]=g*h,b[4]=m-a*e,b[8]=l*e+k,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+l,b[10]=a-m*e):"XZY"===a.order&&(a=f*g,k=f*d,l=c*g,m=c*d,b[0]=g*h,b[4]=-e,b[8]=d*h,b[1]=a*e+m,b[5]=f*h,b[9]=k*e-l,b[2]=l*e-k,b[6]=c*h,b[10]=m*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,g=c+c,h=d+d,k=e+e;a=c*g;var l=c*h,c=c*k,m=d*h,d=d*k,e=e*k,g=f*g,h=f*h,f=f*k;b[0]=1-(m+e);b[4]=l-f;b[8]=c+h;b[1]=l+f;b[5]=1-(a+ e);b[9]=d-g;b[2]=c-h;b[6]=d+g;b[10]=1-(a+m);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a,b,c;return function(d,e,f){void 0===a&&(a=new THREE.Vector3);void 0===b&&(b=new THREE.Vector3);void 0===c&&(c=new THREE.Vector3);var g=this.elements;c.subVectors(d,e).normalize();0===c.lengthSq()&&(c.z=1);a.crossVectors(f,c).normalize();0===a.lengthSq()&&(c.x+=1E-4,a.crossVectors(f,c).normalize());b.crossVectors(c,a);g[0]=a.x;g[4]=b.x;g[8]=c.x;g[1]=a.y;g[5]=b.y;g[9]= c.y;g[2]=a.z;g[6]=b.z;g[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],k=c[12],l=c[1],m=c[5],p=c[9],n=c[13],q=c[2],s=c[6],u=c[10],t=c[14],w=c[3],v=c[7],C=c[11],c=c[15],x=d[0],B=d[4],z=d[8],A=d[12],y=d[1],J=d[5],E= -d[9],F=d[13],I=d[2],Q=d[6],N=d[10],L=d[14],H=d[3],M=d[7],R=d[11],d=d[15];e[0]=f*x+g*y+h*I+k*H;e[4]=f*B+g*J+h*Q+k*M;e[8]=f*z+g*E+h*N+k*R;e[12]=f*A+g*F+h*L+k*d;e[1]=l*x+m*y+p*I+n*H;e[5]=l*B+m*J+p*Q+n*M;e[9]=l*z+m*E+p*N+n*R;e[13]=l*A+m*F+p*L+n*d;e[2]=q*x+s*y+u*I+t*H;e[6]=q*B+s*J+u*Q+t*M;e[10]=q*z+s*E+u*N+t*R;e[14]=q*A+s*F+u*L+t*d;e[3]=w*x+v*y+C*I+c*H;e[7]=w*B+v*J+C*Q+c*M;e[11]=w*z+v*E+C*N+c*R;e[15]=w*A+v*F+C*L+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a, +d[9],F=d[13],I=d[2],Q=d[6],N=d[10],L=d[14],G=d[3],M=d[7],R=d[11],d=d[15];e[0]=f*x+g*y+h*I+k*G;e[4]=f*B+g*J+h*Q+k*M;e[8]=f*z+g*E+h*N+k*R;e[12]=f*A+g*F+h*L+k*d;e[1]=l*x+m*y+p*I+n*G;e[5]=l*B+m*J+p*Q+n*M;e[9]=l*z+m*E+p*N+n*R;e[13]=l*A+m*F+p*L+n*d;e[2]=q*x+s*y+u*I+t*G;e[6]=q*B+s*J+u*Q+t*M;e[10]=q*z+s*E+u*N+t*R;e[14]=q*A+s*F+u*L+t*d;e[3]=w*x+v*y+C*I+c*G;e[7]=w*B+v*J+C*Q+c*M;e[11]=w*z+v*E+C*N+c*R;e[15]=w*A+v*F+C*L+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a, b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},applyToVector3Array:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0=== d&&(d=b.length);for(var e=0;ek.opacity&&(k.transparent=!0);c.setTextures(h);return c.parse(k)}}()}; THREE.Loader.Handlers={handlers:[],add:function(a,b){this.handlers.push(a,b)},get:function(a){for(var b=this.handlers,c=0,d=b.length;cthis.opacity&&(d.opacity=this.opacity);!0===this.transparent&&(d.transparent=this.transparent);0b.far?null:{distance:c,point:w.clone(), object:a}}function c(c,d,e,f,l,m,p,w){g.fromArray(f,3*m);h.fromArray(f,3*p);k.fromArray(f,3*w);if(c=b(c,d,e,g,h,k,t))l&&(n.fromArray(l,2*m),q.fromArray(l,2*p),s.fromArray(l,2*w),c.uv=a(t,g,h,k,n,q,s)),c.face=new THREE.Face3(m,p,w,THREE.Triangle.normal(g,h,k)),c.faceIndex=m;return c}var d=new THREE.Matrix4,e=new THREE.Ray,f=new THREE.Sphere,g=new THREE.Vector3,h=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3,m=new THREE.Vector3,p=new THREE.Vector3,n=new THREE.Vector2,q=new THREE.Vector2, s=new THREE.Vector2,u=new THREE.Vector3,t=new THREE.Vector3,w=new THREE.Vector3;return function(w,u){var x=this.geometry,B=this.material,z=this.matrixWorld;if(void 0!==B&&(null===x.boundingSphere&&x.computeBoundingSphere(),f.copy(x.boundingSphere),f.applyMatrix4(z),!1!==w.ray.intersectsSphere(f)&&(d.getInverse(z),e.copy(w.ray).applyMatrix4(d),null===x.boundingBox||!1!==e.intersectsBox(x.boundingBox)))){var A,y;if(x instanceof THREE.BufferGeometry){var J,E,B=x.index,z=x.attributes,x=z.position.array; -void 0!==z.uv&&(A=z.uv.array);if(null!==B)for(var z=B.array,F=0,I=z.length;Fc;c++)r.deleteFramebuffer(b.__webglFramebuffer[c]),r.deleteRenderbuffer(b.__webglDepthbuffer[c]);else r.deleteFramebuffer(b.__webglFramebuffer),r.deleteRenderbuffer(b.__webglDepthbuffer);S.delete(a.texture);S.delete(a)}ea.textures--} function h(a){a=a.target;a.removeEventListener("dispose",h);k(a);S.delete(a)}function k(a){var b=S.get(a).program;a.program=void 0;void 0!==b&&ka.releaseProgram(b)}function l(a,b){return Math.abs(b[0])-Math.abs(a[0])}function m(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.material.id!==b.material.id?a.material.id-b.material.id:a.z!==b.z?a.z-b.z:a.id-b.id}function p(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder: a.z!==b.z?b.z-a.z:a.id-b.id}function n(a,b,c,d,e){var f;c.transparent?(d=ba,f=++ca):(d=W,f=++X);f=d[f];void 0!==f?(f.id=a.id,f.object=a,f.geometry=b,f.material=c,f.z=V.z,f.group=e):(f={id:a.id,object:a,geometry:b,material:c,z:V.z,group:e},d.push(f))}function q(a,b){if(!1!==a.visible){if(a.layers.test(b.layers))if(a instanceof THREE.Light)Y.push(a);else if(a instanceof THREE.Sprite)!1!==a.frustumCulled&&!0!==va.intersectsObject(a)||fa.push(a);else if(a instanceof THREE.LensFlare)$.push(a);else if(a instanceof THREE.ImmediateRenderObject)!0===Z.sortObjects&&(V.setFromMatrixPosition(a.matrixWorld),V.applyProjection(oa)),n(a,null,a.material,V.z,null);else if(a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Points)if(a instanceof THREE.SkinnedMesh&&a.skeleton.update(),!1===a.frustumCulled||!0===va.intersectsObject(a)){var c=a.material;if(!0===c.visible){!0===Z.sortObjects&&(V.setFromMatrixPosition(a.matrixWorld),V.applyProjection(oa));var d=la.update(a);if(c instanceof THREE.MultiMaterial)for(var e= d.groups,f=c.materials,c=0,g=e.length;c=aa.maxTextures&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+aa.maxTextures);pa+=1;return a}function v(a){for(var b,c,d=0,e=a.length;db||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.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height,a);return d}return a}function B(a){return THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height)}function z(a,b){var c=S.get(a);if(6===a.image.length)if(0h;h++)g[h]=!Z.autoScaleCubemaps||d||e?e?a.image[h].image:a.image[h]:x(a.image[h],aa.maxCubemapSize);var k=B(g[0]),l=F(a.format),n=F(a.type);C(r.TEXTURE_CUBE_MAP,a,k);for(h=0;6>h;h++)if(d)for(var m,p=g[h].mipmaps,q=0,s=p.length;q=aa.maxTextures&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+aa.maxTextures);pa+=1;return a}function v(a){for(var b,c,d=0,e=a.length;db||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.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+ +"). Resized to "+d.width+"x"+d.height,a);return d}return a}function B(a){return THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height)}function z(a,b){var c=S.get(a);if(6===a.image.length)if(0h;h++)g[h]=!Z.autoScaleCubemaps||d||e?e?a.image[h].image:a.image[h]:x(a.image[h],aa.maxCubemapSize);var k=B(g[0]),l=F(a.format),n=F(a.type);C(r.TEXTURE_CUBE_MAP,a,k);for(h=0;6>h;h++)if(d)for(var m,p=g[h].mipmaps,q=0,s=p.length;qf;f++)b.__webglFramebuffer[f]=r.createFramebuffer()}else b.__webglFramebuffer=r.createFramebuffer(); -if(d){G.bindTexture(r.TEXTURE_CUBE_MAP,c.__webglTexture);C(r.TEXTURE_CUBE_MAP,a.texture,e);for(f=0;6>f;f++)y(b.__webglFramebuffer[f],a,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+f);a.texture.generateMipmaps&&e&&r.generateMipmap(r.TEXTURE_CUBE_MAP);G.bindTexture(r.TEXTURE_CUBE_MAP,null)}else G.bindTexture(r.TEXTURE_2D,c.__webglTexture),C(r.TEXTURE_2D,a.texture,e),y(b.__webglFramebuffer,a,r.COLOR_ATTACHMENT0,r.TEXTURE_2D),a.texture.generateMipmaps&&e&&r.generateMipmap(r.TEXTURE_2D),G.bindTexture(r.TEXTURE_2D, -null);if(a.depthBuffer){b=S.get(a);if(a instanceof THREE.WebGLRenderTargetCube)for(b.__webglDepthbuffer=[],c=0;6>c;c++)r.bindFramebuffer(r.FRAMEBUFFER,b.__webglFramebuffer[c]),b.__webglDepthbuffer[c]=r.createRenderbuffer(),J(b.__webglDepthbuffer[c],a);else r.bindFramebuffer(r.FRAMEBUFFER,b.__webglFramebuffer),b.__webglDepthbuffer=r.createRenderbuffer(),J(b.__webglDepthbuffer,a);r.bindFramebuffer(r.FRAMEBUFFER,null)}}b=a instanceof THREE.WebGLRenderTargetCube;a?(c=S.get(a),c=b?c.__webglFramebuffer[a.activeCubeFace]: -c.__webglFramebuffer,ma.copy(a.scissor),ya=a.scissorTest,ga.copy(a.viewport)):(c=null,ma.copy(ta).multiplyScalar(D),ya=za,ga.copy(ha).multiplyScalar(D));ra!==c&&(r.bindFramebuffer(r.FRAMEBUFFER,c),ra=c);G.scissor(ma);G.setScissorTest(ya);G.viewport(ga);b&&(b=S.get(a.texture),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+a.activeCubeFace,b.__webglTexture,0))};this.readRenderTargetPixels=function(a,b,c,d,e,g){if(!1===a instanceof THREE.WebGLRenderTarget)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget."); -else{var f=S.get(a).__webglFramebuffer;if(f){var h=!1;f!==ra&&(r.bindFramebuffer(r.FRAMEBUFFER,f),h=!0);try{var k=a.texture;k.format!==THREE.RGBAFormat&&F(k.format)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."):k.type===THREE.UnsignedByteType||F(k.type)===r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)||k.type===THREE.FloatType&&U.get("WEBGL_color_buffer_float")||k.type=== -THREE.HalfFloatType&&U.get("EXT_color_buffer_half_float")?r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE?r.readPixels(b,c,d,e,F(k.format),F(k.type),g):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."):console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.")}finally{h&&r.bindFramebuffer(r.FRAMEBUFFER,ra)}}}}}; +(d=a.overrideMaterial,s(W,b,e,d),s(ba,b,e,d)):(H.setBlending(THREE.NoBlending),s(W,b,e),s(ba,b,e));Da.render(a,b);Ea.render(a,b,ga);c&&(a=c.texture,a.generateMipmaps&&B(c)&&a.minFilter!==THREE.NearestFilter&&a.minFilter!==THREE.LinearFilter&&(a=c instanceof THREE.WebGLRenderTargetCube?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,c=S.get(c.texture).__webglTexture,H.bindTexture(a,c),r.generateMipmap(a),H.bindTexture(a,null)));H.setDepthTest(!0);H.setDepthWrite(!0);H.setColorWrite(!0)}};this.setFaceCulling=function(a, +b){a===THREE.CullFaceNone?H.disable(r.CULL_FACE):(b===THREE.FrontFaceDirectionCW?r.frontFace(r.CW):r.frontFace(r.CCW),a===THREE.CullFaceBack?r.cullFace(r.BACK):a===THREE.CullFaceFront?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK),H.enable(r.CULL_FACE))};this.setTexture=function(a,b){var c=S.get(a);if(0f;f++)b.__webglFramebuffer[f]=r.createFramebuffer()}else b.__webglFramebuffer=r.createFramebuffer();if(d){H.bindTexture(r.TEXTURE_CUBE_MAP,c.__webglTexture);C(r.TEXTURE_CUBE_MAP,a.texture,e);for(f=0;6>f;f++)y(b.__webglFramebuffer[f],a,r.COLOR_ATTACHMENT0, +r.TEXTURE_CUBE_MAP_POSITIVE_X+f);a.texture.generateMipmaps&&e&&r.generateMipmap(r.TEXTURE_CUBE_MAP);H.bindTexture(r.TEXTURE_CUBE_MAP,null)}else H.bindTexture(r.TEXTURE_2D,c.__webglTexture),C(r.TEXTURE_2D,a.texture,e),y(b.__webglFramebuffer,a,r.COLOR_ATTACHMENT0,r.TEXTURE_2D),a.texture.generateMipmaps&&e&&r.generateMipmap(r.TEXTURE_2D),H.bindTexture(r.TEXTURE_2D,null);if(a.depthBuffer){b=S.get(a);if(a instanceof THREE.WebGLRenderTargetCube)for(b.__webglDepthbuffer=[],c=0;6>c;c++)r.bindFramebuffer(r.FRAMEBUFFER, +b.__webglFramebuffer[c]),b.__webglDepthbuffer[c]=r.createRenderbuffer(),J(b.__webglDepthbuffer[c],a);else r.bindFramebuffer(r.FRAMEBUFFER,b.__webglFramebuffer),b.__webglDepthbuffer=r.createRenderbuffer(),J(b.__webglDepthbuffer,a);r.bindFramebuffer(r.FRAMEBUFFER,null)}}b=a instanceof THREE.WebGLRenderTargetCube;a?(c=S.get(a),c=b?c.__webglFramebuffer[a.activeCubeFace]:c.__webglFramebuffer,ma.copy(a.scissor),ya=a.scissorTest,ga.copy(a.viewport)):(c=null,ma.copy(ta).multiplyScalar(D),ya=za,ga.copy(ha).multiplyScalar(D)); +ra!==c&&(r.bindFramebuffer(r.FRAMEBUFFER,c),ra=c);H.scissor(ma);H.setScissorTest(ya);H.viewport(ga);b&&(b=S.get(a.texture),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+a.activeCubeFace,b.__webglTexture,0))};this.readRenderTargetPixels=function(a,b,c,d,e,g){if(!1===a instanceof THREE.WebGLRenderTarget)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");else{var f=S.get(a).__webglFramebuffer;if(f){var h= +!1;f!==ra&&(r.bindFramebuffer(r.FRAMEBUFFER,f),h=!0);try{var k=a.texture;k.format!==THREE.RGBAFormat&&F(k.format)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."):k.type===THREE.UnsignedByteType||F(k.type)===r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)||k.type===THREE.FloatType&&U.get("WEBGL_color_buffer_float")||k.type===THREE.HalfFloatType&&U.get("EXT_color_buffer_half_float")? +r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE?r.readPixels(b,c,d,e,F(k.format),F(k.type),g):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."):console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.")}finally{h&&r.bindFramebuffer(r.FRAMEBUFFER,ra)}}}}}; THREE.WebGLRenderTarget=function(a,b,c){this.uuid=THREE.Math.generateUUID();this.width=a;this.height=b;this.scissor=new THREE.Vector4(0,0,a,b);this.scissorTest=!1;this.viewport=new THREE.Vector4(0,0,a,b);c=c||{};void 0===c.minFilter&&(c.minFilter=THREE.LinearFilter);this.texture=new THREE.Texture(void 0,void 0,c.wrapS,c.wrapT,c.magFilter,c.minFilter,c.format,c.type,c.anisotropy);this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0}; THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(a,b){if(this.width!==a||this.height!==b)this.width=a,this.height=b,this.dispose();this.viewport.set(0,0,a,b);this.scissor.set(0,0,a,b)},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.width=a.width;this.height=a.height;this.viewport.copy(a.viewport);this.texture=a.texture.clone();this.depthBuffer=a.depthBuffer;this.stencilBuffer=a.stencilBuffer;this.shareDepthFrom=a.shareDepthFrom; return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c);this.activeCubeFace=0};THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube; @@ -723,34 +722,34 @@ v;if(!1!==J.enabled&&(!1!==J.autoUpdate||!1!==J.needsUpdate)){g.clearColor(1,1,1 0,K,D)}else w=1,v=!1;null===A.map&&(K=THREE.LinearFilter,J.type===THREE.PCFSoftShadowMap&&(K=THREE.NearestFilter),A.map=new THREE.WebGLRenderTarget(O.x,O.y,{minFilter:K,magFilter:K,format:THREE.RGBAFormat}),A.matrix=new THREE.Matrix4,y instanceof THREE.SpotLight&&(B.aspect=O.x/O.y),B.updateProjectionMatrix());O=A.map;A=A.matrix;m.setFromMatrixPosition(y.matrixWorld);B.position.copy(m);a.setRenderTarget(O);a.clear();for(O=0;O 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n")); -x.compileShader(H);x.compileShader(M);x.attachShader(L,H);x.attachShader(L,M);x.linkProgram(L);y=L;w=x.getAttribLocation(y,"position");v=x.getAttribLocation(y,"uv");c=x.getUniformLocation(y,"uvOffset");d=x.getUniformLocation(y,"uvScale");e=x.getUniformLocation(y,"rotation");f=x.getUniformLocation(y,"scale");g=x.getUniformLocation(y,"color");h=x.getUniformLocation(y,"map");k=x.getUniformLocation(y,"opacity");l=x.getUniformLocation(y,"modelViewMatrix");m=x.getUniformLocation(y,"projectionMatrix");p= -x.getUniformLocation(y,"fogType");n=x.getUniformLocation(y,"fogDensity");q=x.getUniformLocation(y,"fogNear");s=x.getUniformLocation(y,"fogFar");u=x.getUniformLocation(y,"fogColor");t=x.getUniformLocation(y,"alphaTest");L=document.createElement("canvas");L.width=8;L.height=8;H=L.getContext("2d");H.fillStyle="white";H.fillRect(0,0,8,8);J=new THREE.Texture(L);J.needsUpdate=!0}x.useProgram(y);B.initAttributes();B.enableAttribute(w);B.enableAttribute(v);B.disableUnusedAttributes();B.disable(x.CULL_FACE); -B.enable(x.BLEND);x.bindBuffer(x.ARRAY_BUFFER,z);x.vertexAttribPointer(w,2,x.FLOAT,!1,16,0);x.vertexAttribPointer(v,2,x.FLOAT,!1,16,8);x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,A);x.uniformMatrix4fv(m,!1,N.projectionMatrix.elements);B.activeTexture(x.TEXTURE0);x.uniform1i(h,0);H=L=0;(M=Q.fog)?(x.uniform3f(u,M.color.r,M.color.g,M.color.b),M instanceof THREE.Fog?(x.uniform1f(q,M.near),x.uniform1f(s,M.far),x.uniform1i(p,1),H=L=1):M instanceof THREE.FogExp2&&(x.uniform1f(n,M.density),x.uniform1i(p,2),H=L=2)): -(x.uniform1i(p,0),H=L=0);for(var M=0,R=b.length;MNumber.EPSILON&&(a=!0):d<-Number.EPSILON?f<-Number.EPSILON&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(D=a.length;0<=--D;){c=D;d=D-1;0>d&&(d=a.length-1);for(var e=0,f=q+2*m,e=0;eMath.abs(b.y-c.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(c.x,1-c.z),new THREE.Vector2(d.x,1-d.z),new THREE.Vector2(e.x,1-e.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(c.y,1-c.z),new THREE.Vector2(d.y, 1-d.z),new THREE.Vector2(e.y,1-e.z)]}};THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);this.type="ShapeGeometry";!1===Array.isArray(a)&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry;THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c