From e09bf29da604ba8619323368b4f5a45c615fb2c3 Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Wed, 30 Sep 2015 17:27:47 -0400 Subject: [PATCH] Updated builds. --- build/three.js | 291 ++++++++++++++++++++++++++++++++++----------- build/three.min.js | 227 ++++++++++++++++++----------------- 2 files changed, 339 insertions(+), 179 deletions(-) diff --git a/build/three.js b/build/three.js index df7a6bc89a..653cb45476 100644 --- a/build/three.js +++ b/build/three.js @@ -7820,17 +7820,17 @@ THREE.Object3D = function () { var quaternion = new THREE.Quaternion(); var scale = new THREE.Vector3( 1, 1, 1 ); - var onRotationChange = function () { + function onRotationChange() { quaternion.setFromEuler( rotation, false ); - }; + } - var onQuaternionChange = function () { + function onQuaternionChange() { rotation.setFromQuaternion( quaternion, undefined, false ); - }; + } rotation.onChange( onRotationChange ); quaternion.onChange( onQuaternionChange ); @@ -7889,7 +7889,7 @@ THREE.Object3D.prototype = { get eulerOrder () { - console.warn( 'THREE.Object3D: .eulerOrder has been moved to .rotation.order.' ); + console.warn( 'THREE.Object3D: .eulerOrder is now .rotation.order.' ); return this.rotation.order; @@ -7897,7 +7897,7 @@ THREE.Object3D.prototype = { set eulerOrder ( value ) { - console.warn( 'THREE.Object3D: .eulerOrder has been moved to .rotation.order.' ); + console.warn( 'THREE.Object3D: .eulerOrder is now .rotation.order.' ); this.rotation.order = value; @@ -7921,6 +7921,8 @@ THREE.Object3D.prototype = { }, + // + applyMatrix: function ( matrix ) { this.matrix.multiplyMatrices( matrix, this.matrix ); @@ -21482,9 +21484,9 @@ THREE.WebGLRenderer = function ( parameters ) { var lights = []; var opaqueObjects = []; - var opaqueObjectsLastIndex = -1; + var opaqueObjectsLastIndex = - 1; var transparentObjects = []; - var transparentObjectsLastIndex = -1; + var transparentObjectsLastIndex = - 1; var morphInfluences = new Float32Array( 8 ); @@ -22008,10 +22010,11 @@ THREE.WebGLRenderer = function ( parameters ) { function deallocateRenderTarget( renderTarget ) { var renderTargetProperties = properties.get( renderTarget ); + var textureProperties = properties.get( renderTarget.texture ); - if ( ! renderTarget || renderTargetProperties.__webglTexture === undefined ) return; + if ( ! renderTarget || textureProperties.__webglTexture === undefined ) return; - _gl.deleteTexture( renderTargetProperties.__webglTexture ); + _gl.deleteTexture( textureProperties.__webglTexture ); if ( renderTarget instanceof THREE.WebGLRenderTargetCube ) { @@ -22029,6 +22032,7 @@ THREE.WebGLRenderer = function ( parameters ) { } + properties.delete( renderTarget.texture ); properties.delete( renderTarget ); } @@ -22051,6 +22055,7 @@ THREE.WebGLRenderer = function ( parameters ) { if ( programInfo !== undefined ) { programCache.releaseProgram( programInfo ); + } } @@ -22541,8 +22546,8 @@ THREE.WebGLRenderer = function ( parameters ) { lights.length = 0; - opaqueObjectsLastIndex = -1; - transparentObjectsLastIndex = -1; + opaqueObjectsLastIndex = - 1; + transparentObjectsLastIndex = - 1; sprites.length = 0; lensFlares.length = 0; @@ -22607,9 +22612,15 @@ THREE.WebGLRenderer = function ( parameters ) { // Generate mipmap if we're using any kind of mipmap filtering - if ( renderTarget && renderTarget.generateMipmaps && renderTarget.minFilter !== THREE.NearestFilter && renderTarget.minFilter !== THREE.LinearFilter ) { + if ( renderTarget ) { + + var texture = renderTarget.texture; + var isTargetPowerOfTwo = THREE.Math.isPowerOfTwo( renderTarget.width ) && THREE.Math.isPowerOfTwo( renderTarget.height ); + if ( texture.generateMipmaps && isTargetPowerOfTwo && texture.minFilter !== THREE.NearestFilter && texture.minFilter !== THREE.LinearFilter ) { - updateRenderTargetMipmap( renderTarget ); + updateRenderTargetMipmap( renderTarget ); + + } } @@ -22778,17 +22789,17 @@ THREE.WebGLRenderer = function ( parameters ) { if ( object instanceof THREE.ImmediateRenderObject ) { - setMaterial( material ); + setMaterial( material ); - var program = setProgram( camera, lights, fog, material, object ); + var program = setProgram( camera, lights, fog, material, object ); - _currentGeometryProgram = ''; + _currentGeometryProgram = ''; - object.render( function ( object ) { + object.render( function ( object ) { - _this.renderBufferImmediate( object, program, material ); + _this.renderBufferImmediate( object, program, material ); - } ); + } ); } else { @@ -23250,6 +23261,7 @@ THREE.WebGLRenderer = function ( parameters ) { if ( uvScaleMap !== undefined ) { + if ( uvScaleMap instanceof THREE.WebGLRenderTarget ) uvScaleMap = uvScaleMap.texture; var offset = uvScaleMap.offset; var repeat = uvScaleMap.repeat; @@ -23764,7 +23776,11 @@ THREE.WebGLRenderer = function ( parameters ) { } else if ( texture instanceof THREE.WebGLRenderTargetCube ) { - setCubeTextureDynamic( texture, textureUnit ); + setCubeTextureDynamic( texture.texture, textureUnit ); + + } else if ( texture instanceof THREE.WebGLRenderTarget ) { + + _this.setTexture( texture.texture, textureUnit ); } else { @@ -23806,9 +23822,13 @@ THREE.WebGLRenderer = function ( parameters ) { setCubeTexture( texture, textureUnit ); + } else if ( texture instanceof THREE.WebGLRenderTarget ) { + + _this.setTexture( texture.texture, textureUnit ); + } else if ( texture instanceof THREE.WebGLRenderTargetCube ) { - setCubeTextureDynamic( texture, textureUnit ); + setCubeTextureDynamic( texture.texture, textureUnit ); } else { @@ -24425,7 +24445,7 @@ THREE.WebGLRenderer = function ( parameters ) { function setupFrameBuffer ( framebuffer, renderTarget, textureTarget ) { _gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer ); - _gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, textureTarget, properties.get( renderTarget ).__webglTexture, 0 ); + _gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, textureTarget, properties.get( renderTarget.texture ).__webglTexture, 0 ); } @@ -24465,30 +24485,31 @@ THREE.WebGLRenderer = function ( parameters ) { if ( renderTarget && properties.get( renderTarget ).__webglFramebuffer === undefined ) { var renderTargetProperties = properties.get( renderTarget ); + var textureProperties = properties.get( renderTarget.texture ); if ( renderTarget.depthBuffer === undefined ) renderTarget.depthBuffer = true; if ( renderTarget.stencilBuffer === undefined ) renderTarget.stencilBuffer = true; renderTarget.addEventListener( 'dispose', onRenderTargetDispose ); - renderTargetProperties.__webglTexture = _gl.createTexture(); + textureProperties.__webglTexture = _gl.createTexture(); _infoMemory.textures ++; // Setup texture, create render and frame buffers var isTargetPowerOfTwo = THREE.Math.isPowerOfTwo( renderTarget.width ) && THREE.Math.isPowerOfTwo( renderTarget.height ), - glFormat = paramThreeToGL( renderTarget.format ), - glType = paramThreeToGL( renderTarget.type ); + glFormat = paramThreeToGL( renderTarget.texture.format ), + glType = paramThreeToGL( renderTarget.texture.type ); if ( isCube ) { renderTargetProperties.__webglFramebuffer = []; renderTargetProperties.__webglRenderbuffer = []; - state.bindTexture( _gl.TEXTURE_CUBE_MAP, renderTargetProperties.__webglTexture ); + state.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture ); - setTextureParameters( _gl.TEXTURE_CUBE_MAP, renderTarget, isTargetPowerOfTwo ); + setTextureParameters( _gl.TEXTURE_CUBE_MAP, renderTarget.texture, isTargetPowerOfTwo ); for ( var i = 0; i < 6; i ++ ) { @@ -24501,7 +24522,7 @@ THREE.WebGLRenderer = function ( parameters ) { } - if ( renderTarget.generateMipmaps && isTargetPowerOfTwo ) _gl.generateMipmap( _gl.TEXTURE_CUBE_MAP ); + if ( renderTarget.texture.generateMipmaps && isTargetPowerOfTwo ) _gl.generateMipmap( _gl.TEXTURE_CUBE_MAP ); } else { @@ -24517,8 +24538,8 @@ THREE.WebGLRenderer = function ( parameters ) { } - state.bindTexture( _gl.TEXTURE_2D, renderTargetProperties.__webglTexture ); - setTextureParameters( _gl.TEXTURE_2D, renderTarget, isTargetPowerOfTwo ); + state.bindTexture( _gl.TEXTURE_2D, textureProperties.__webglTexture ); + setTextureParameters( _gl.TEXTURE_2D, renderTarget.texture, isTargetPowerOfTwo ); state.texImage2D( _gl.TEXTURE_2D, 0, glFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, null ); @@ -24542,7 +24563,7 @@ THREE.WebGLRenderer = function ( parameters ) { } - if ( renderTarget.generateMipmaps && isTargetPowerOfTwo ) _gl.generateMipmap( _gl.TEXTURE_2D ); + if ( renderTarget.texture.generateMipmaps && isTargetPowerOfTwo ) _gl.generateMipmap( _gl.TEXTURE_2D ); } @@ -24608,8 +24629,8 @@ THREE.WebGLRenderer = function ( parameters ) { if ( isCube ) { - var renderTargetProperties = properties.get( renderTarget ); - _gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + renderTarget.activeCubeFace, renderTargetProperties.__webglTexture, 0 ); + var textureProperties = properties.get( renderTarget.texture ); + _gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + renderTarget.activeCubeFace, textureProperties.__webglTexture, 0 ); } @@ -24639,14 +24660,14 @@ THREE.WebGLRenderer = function ( parameters ) { } - if ( renderTarget.format !== THREE.RGBAFormat && paramThreeToGL( renderTarget.format ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_FORMAT ) ) { + if ( renderTarget.texture.format !== THREE.RGBAFormat && paramThreeToGL( renderTarget.texture.format ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_FORMAT ) ) { console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.' ); return; } - if ( renderTarget.type !== THREE.UnsignedByteType && paramThreeToGL( renderTarget.type ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_TYPE ) ) { + if ( renderTarget.texture.type !== THREE.UnsignedByteType && paramThreeToGL( renderTarget.texture.type ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_TYPE ) ) { console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.' ); return; @@ -24655,7 +24676,7 @@ THREE.WebGLRenderer = function ( parameters ) { if ( _gl.checkFramebufferStatus( _gl.FRAMEBUFFER ) === _gl.FRAMEBUFFER_COMPLETE ) { - _gl.readPixels( x, y, width, height, paramThreeToGL( renderTarget.format ), paramThreeToGL( renderTarget.type ), buffer ); + _gl.readPixels( x, y, width, height, paramThreeToGL( renderTarget.texture.format ), paramThreeToGL( renderTarget.texture.type ), buffer ); } else { @@ -24676,7 +24697,7 @@ THREE.WebGLRenderer = function ( parameters ) { function updateRenderTargetMipmap( renderTarget ) { var target = renderTarget instanceof THREE.WebGLRenderTargetCube ? _gl.TEXTURE_CUBE_MAP : _gl.TEXTURE_2D; - var texture = properties.get( renderTarget ).__webglTexture; + var texture = properties.get( renderTarget.texture ).__webglTexture; state.bindTexture( target, texture ); _gl.generateMipmap( target ); @@ -24950,25 +24971,13 @@ THREE.WebGLRenderTarget = function ( width, height, options ) { options = options || {}; - this.wrapS = options.wrapS !== undefined ? options.wrapS : THREE.ClampToEdgeWrapping; - this.wrapT = options.wrapT !== undefined ? options.wrapT : THREE.ClampToEdgeWrapping; - - this.magFilter = options.magFilter !== undefined ? options.magFilter : THREE.LinearFilter; - this.minFilter = options.minFilter !== undefined ? options.minFilter : THREE.LinearMipMapLinearFilter; - - this.anisotropy = options.anisotropy !== undefined ? options.anisotropy : 1; + if ( options.minFilter === undefined ) options.minFilter = THREE.LinearFilter; - this.offset = new THREE.Vector2( 0, 0 ); - this.repeat = new THREE.Vector2( 1, 1 ); - - this.format = options.format !== undefined ? options.format : THREE.RGBAFormat; - this.type = options.type !== undefined ? options.type : THREE.UnsignedByteType; + this.texture = new THREE.Texture( undefined, undefined, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy ); this.depthBuffer = options.depthBuffer !== undefined ? options.depthBuffer : true; this.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : true; - this.generateMipmaps = true; - this.shareDepthFrom = options.shareDepthFrom !== undefined ? options.shareDepthFrom : null; }; @@ -24977,6 +24986,168 @@ THREE.WebGLRenderTarget.prototype = { constructor: THREE.WebGLRenderTarget, + get wrapS() { + + console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' ); + + return this.texture.wrapS; + + }, + + set wrapS( value ) { + + console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' ); + + this.texture.wrapS = value; + + }, + + get wrapT() { + + console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' ); + + return this.texture.wrapT; + + }, + + set wrapT( value ) { + + console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' ); + + this.texture.wrapT = value; + + }, + + get magFilter() { + + console.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' ); + + return this.texture.magFilter; + + }, + + set magFilter( value ) { + + console.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' ); + + this.texture.magFilter = value; + + }, + + get minFilter() { + + console.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' ); + + return this.texture.minFilter; + + }, + + set minFilter( value ) { + + console.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' ); + + this.texture.minFilter = value; + + }, + + get anisotropy() { + + console.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' ); + + return this.texture.anisotropy; + + }, + + set anisotropy( value ) { + + console.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' ); + + this.texture.anisotropy = value; + + }, + + get offset() { + + console.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' ); + + return this.texture.offset; + + }, + + set offset( value ) { + + console.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' ); + + this.texture.offset = value; + + }, + + get repeat() { + + console.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' ); + + return this.texture.repeat; + + }, + + set repeat( value ) { + + console.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' ); + + this.texture.repeat = value; + + }, + + get format() { + + console.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' ); + + return this.texture.format; + + }, + + set format( value ) { + + console.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' ); + + this.texture.format = value; + + }, + + get type() { + + console.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' ); + + return this.texture.type; + + }, + + set type( value ) { + + console.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' ); + + this.texture.type = value; + + }, + + get generateMipmaps() { + + console.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' ); + + return this.texture.generateMipmaps; + + }, + + set generateMipmaps( value ) { + + console.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' ); + + this.texture.generateMipmaps = value; + + }, + + // + setSize: function ( width, height ) { if ( this.width !== width || this.height !== height ) { @@ -25001,25 +25172,11 @@ THREE.WebGLRenderTarget.prototype = { this.width = source.width; this.height = source.height; - this.wrapS = source.wrapS; - this.wrapT = source.wrapT; - - this.magFilter = source.magFilter; - this.minFilter = source.minFilter; - - this.anisotropy = source.anisotropy; - - this.offset.copy( source.offset ); - this.repeat.copy( source.repeat ); - - this.format = source.format; - this.type = source.type; + this.texture = source.texture.clone(); this.depthBuffer = source.depthBuffer; this.stencilBuffer = source.stencilBuffer; - this.generateMipmaps = source.generateMipmaps; - this.shareDepthFrom = source.shareDepthFrom; return this; diff --git a/build/three.min.js b/build/three.min.js index 08b8c5f3e8..43dee786a9 100644 --- a/build/three.min.js +++ b/build/three.min.js @@ -106,8 +106,8 @@ e=Math.sin(e);if("XYZ"===a.order){a=g*h;var l=g*e,k=c*h,n=c*e;b[0]=f*h;b[4]=-f*e n*d+a,b[9]=l*d-k,b[2]=-d,b[6]=c*f,b[10]=g*f):"YZX"===a.order?(a=g*f,l=g*d,k=c*f,n=c*d,b[0]=f*h,b[4]=n-a*e,b[8]=k*e+l,b[1]=e,b[5]=g*h,b[9]=-c*h,b[2]=-d*h,b[6]=l*e+k,b[10]=a-n*e):"XZY"===a.order&&(a=g*f,l=g*d,k=c*f,n=c*d,b[0]=f*h,b[4]=-e,b[8]=d*h,b[1]=a*e+n,b[5]=g*h,b[9]=l*e-k,b[2]=k*e-l,b[6]=c*h,b[10]=n*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},setRotationFromQuaternion:function(a){console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."); return this.makeRotationFromQuaternion(a)},makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,g=a.w,f=c+c,h=d+d,l=e+e;a=c*f;var k=c*h,c=c*l,n=d*h,d=d*l,e=e*l,f=g*f,h=g*h,g=g*l;b[0]=1-(n+e);b[4]=k-g;b[8]=c+h;b[1]=k+g;b[5]=1-(a+e);b[9]=d-f;b[2]=c-h;b[6]=d+f;b[10]=1-(a+n);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,g){void 0===a&&(a=new THREE.Vector3);void 0===b&&(b=new THREE.Vector3);void 0===c&&(c=new THREE.Vector3); var f=this.elements;c.subVectors(d,e).normalize();0===c.length()&&(c.z=1);a.crossVectors(g,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(g,c).normalize());b.crossVectors(c,a);f[0]=a.x;f[4]=b.x;f[8]=c.x;f[1]=a.y;f[5]=b.y;f[9]=c.y;f[2]=a.z;f[6]=b.z;f[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,g=c[0],f=c[4],h=c[8],l=c[12],k=c[1],n=c[5],p=c[9],m=c[13],q=c[2],s=c[6],t=c[10],v=c[14],x=c[3],u=c[7],B=c[11],c=c[15],w=d[0],C=d[4],E=d[8],z=d[12],D=d[1],G=d[5],K=d[9],A=d[13],I=d[2],M=d[6],N=d[10],H=d[14],y=d[3],L=d[7],O=d[11],d=d[15];e[0]=g*w+f*D+h*I+l*y;e[4]=g*C+f*G+h*M+l*L;e[8]=g*E+f*K+h*N+l*O;e[12]=g*z+f*A+h*H+l*d;e[1]=k*w+n*D+p*I+m*y;e[5]=k*C+n*G+p*M+m*L;e[9]=k*E+n*K+p*N+m*O;e[13]=k*z+n*A+p*H+m*d;e[2]=q*w+s*D+t*I+v*y;e[6]=q*C+s*G+t*M+v*L;e[10]= -q*E+s*K+t*N+v*O;e[14]=q*z+s*A+t*H+v*d;e[3]=x*w+u*D+B*I+c*y;e[7]=x*C+u*G+B*M+c*L;e[11]=x*E+u*K+B*N+c*O;e[15]=x*z+u*A+B*H+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]*= +b){var c=a.elements,d=b.elements,e=this.elements,g=c[0],f=c[4],h=c[8],l=c[12],k=c[1],n=c[5],p=c[9],m=c[13],q=c[2],s=c[6],t=c[10],v=c[14],x=c[3],u=c[7],B=c[11],c=c[15],w=d[0],C=d[4],E=d[8],z=d[12],D=d[1],G=d[5],K=d[9],A=d[13],I=d[2],M=d[6],O=d[10],H=d[14],y=d[3],L=d[7],P=d[11],d=d[15];e[0]=g*w+f*D+h*I+l*y;e[4]=g*C+f*G+h*M+l*L;e[8]=g*E+f*K+h*O+l*P;e[12]=g*z+f*A+h*H+l*d;e[1]=k*w+n*D+p*I+m*y;e[5]=k*C+n*G+p*M+m*L;e[9]=k*E+n*K+p*O+m*P;e[13]=k*z+n*A+p*H+m*d;e[2]=q*w+s*D+t*I+v*y;e[6]=q*C+s*G+t*M+v*L;e[10]= +q*E+s*K+t*O+v*P;e[14]=q*z+s*A+t*H+v*d;e[3]=x*w+u*D+B*I+c*y;e[7]=x*C+u*G+B*M+c*L;e[11]=x*E+u*K+B*O+c*P;e[15]=x*z+u*A+B*H+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},multiplyVector3:function(a){console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");return a.applyProjection(this)},multiplyVector4:function(a){console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(a){console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."); return this.applyToVector3Array(a)},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;eq.far)){var I;void 0!==u.uv&&(I=u.uv.array,n.fromArray(I,2*w),p.fromArray(I,2*C),m.fromArray(I,2*E),I=a(s,e,g,f,n,p,m));x.push({distance:A,point:t.clone(),uv:I,face:new THREE.Face3(w, C,E,THREE.Triangle.normal(e,g,f)),faceIndex:Math.floor(G/3),object:this})}}else for(D=u.position.array,G=0,K=D.length;Gq.far||(void 0!==u.uv&&(I=u.uv.array,n.fromArray(I,G),p.fromArray(I,G+2),m.fromArray(I, -G+4),I=a(s,e,g,f,n,p,m)),w=G/3,C=w+1,E=w+2,x.push({distance:A,point:t.clone(),uv:I,face:new THREE.Face3(w,C,E,THREE.Triangle.normal(e,g,f)),index:w,object:this}))}else if(u instanceof THREE.Geometry)for(var z=B instanceof THREE.MeshFaceMaterial,D=!0===z?B.materials:null,G=u.vertices,K=u.faces,M=0,N=K.length;Mq.far|| +G+4),I=a(s,e,g,f,n,p,m)),w=G/3,C=w+1,E=w+2,x.push({distance:A,point:t.clone(),uv:I,face:new THREE.Face3(w,C,E,THREE.Triangle.normal(e,g,f)),index:w,object:this}))}else if(u instanceof THREE.Geometry)for(var z=B instanceof THREE.MeshFaceMaterial,D=!0===z?B.materials:null,G=u.vertices,K=u.faces,M=0,O=K.length;Mq.far|| (0c;c++)r.deleteFramebuffer(b.__webglFramebuffer[c]),r.deleteRenderbuffer(b.__webglRenderbuffer[c]);else r.deleteFramebuffer(b.__webglFramebuffer),r.deleteRenderbuffer(b.__webglRenderbuffer);X.delete(a)}la.textures--}function h(a){a=a.target;a.removeEventListener("dispose",h);l(a);X.delete(a)}function l(a){var b= -X.get(a).program;a.program=void 0;void 0!==b&&ua.releaseProgram(b)}function k(a,b){return b[0]-a[0]}function n(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 m(a,b,c,d,e){var f;c.transparent?(d=ca,f=++$):(d=ea,f=++fa); -f=d[f];void 0!==f?(f.id=a.id,f.object=a,f.geometry=b,f.material=c,f.z=W.z,f.group=e):(f={id:a.id,object:a,geometry:b,material:c,z:W.z,group:e},d.push(f))}function q(a){if(!1!==a.visible){if(a instanceof THREE.Light)Y.push(a);else if(a instanceof THREE.Sprite)ja.push(a);else if(a instanceof THREE.LensFlare)ba.push(a);else if(a instanceof THREE.ImmediateRenderObject)!0===da.sortObjects&&(W.setFromMatrixPosition(a.matrixWorld),W.applyProjection(xa)),m(a,null,a.material,W.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===Aa.intersectsObject(a)){var b=a.material;if(!0===b.visible){!0===da.sortObjects&&(W.setFromMatrixPosition(a.matrixWorld),W.applyProjection(xa));var c=va.update(a);if(b instanceof THREE.MeshFaceMaterial)for(var d=c.groups,e=b.materials,b=0,f=d.length;bc;c++)r.deleteFramebuffer(b.__webglFramebuffer[c]),r.deleteRenderbuffer(b.__webglRenderbuffer[c]);else r.deleteFramebuffer(b.__webglFramebuffer),r.deleteRenderbuffer(b.__webglRenderbuffer);V.delete(a.texture);V.delete(a)}la.textures--}function h(a){a=a.target;a.removeEventListener("dispose", +h);l(a);V.delete(a)}function l(a){var b=V.get(a).program;a.program=void 0;void 0!==b&&ua.releaseProgram(b)}function k(a,b){return b[0]-a[0]}function n(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 m(a,b,c,d,e){var f;c.transparent? +(d=da,f=++$):(d=ea,f=++fa);f=d[f];void 0!==f?(f.id=a.id,f.object=a,f.geometry=b,f.material=c,f.z=X.z,f.group=e):(f={id:a.id,object:a,geometry:b,material:c,z:X.z,group:e},d.push(f))}function q(a){if(!1!==a.visible){if(a instanceof THREE.Light)Y.push(a);else if(a instanceof THREE.Sprite)ja.push(a);else if(a instanceof THREE.LensFlare)ca.push(a);else if(a instanceof THREE.ImmediateRenderObject)!0===aa.sortObjects&&(X.setFromMatrixPosition(a.matrixWorld),X.applyProjection(xa)),m(a,null,a.material,X.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===Aa.intersectsObject(a)){var b=a.material;if(!0===b.visible){!0===aa.sortObjects&&(X.setFromMatrixPosition(a.matrixWorld),X.applyProjection(xa));var c=va.update(a);if(b instanceof THREE.MeshFaceMaterial)for(var d=c.groups,e=b.materials,b=0,f=d.length;b=ga.maxTextures&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+ga.maxTextures); -ya+=1;return a}function B(a,b,c,d){a[b+0]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function w(a,b,c){c?(r.texParameteri(a,r.TEXTURE_WRAP_S,A(b.wrapS)),r.texParameteri(a,r.TEXTURE_WRAP_T,A(b.wrapT)),r.texParameteri(a,r.TEXTURE_MAG_FILTER,A(b.magFilter)),r.texParameteri(a,r.TEXTURE_MIN_FILTER,A(b.minFilter))):(r.texParameteri(a,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(a,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+ -b.sourceFile+" )"),r.texParameteri(a,r.TEXTURE_MAG_FILTER,K(b.magFilter)),r.texParameteri(a,r.TEXTURE_MIN_FILTER,K(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+b.sourceFile+" )"));!(c=S.get("EXT_texture_filter_anisotropic"))||b.type===THREE.FloatType&&null===S.get("OES_texture_float_linear")||b.type===THREE.HalfFloatType&& -null===S.get("OES_texture_half_float_linear")||!(1b||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 E(a,b){var c=X.get(a);if(6===a.image.length)if(0h;h++)f[h]=!da.autoScaleCubemaps||d||e?e?a.image[h].image:a.image[h]:C(a.image[h],ga.maxCubemapSize);var h=f[0],k=THREE.Math.isPowerOfTwo(h.width)&&THREE.Math.isPowerOfTwo(h.height),l=A(a.format),m=A(a.type);w(r.TEXTURE_CUBE_MAP,a,k);for(h=0;6>h;h++)if(d)for(var n,q=f[h].mipmaps,p=0,s=q.length;ph;h++)c.__webglFramebuffer[h]=r.createFramebuffer(),c.__webglRenderbuffer[h]=r.createRenderbuffer(),J.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,e,a.width,a.height,0,e,g,null),D(c.__webglFramebuffer[h],a,r.TEXTURE_CUBE_MAP_POSITIVE_X+h),G(c.__webglRenderbuffer[h],a);a.generateMipmaps&&d&&r.generateMipmap(r.TEXTURE_CUBE_MAP)}else c.__webglFramebuffer=r.createFramebuffer(),c.__webglRenderbuffer=a.shareDepthFrom? -a.shareDepthFrom.__webglRenderbuffer:r.createRenderbuffer(),J.bindTexture(r.TEXTURE_2D,c.__webglTexture),w(r.TEXTURE_2D,a,d),J.texImage2D(r.TEXTURE_2D,0,e,a.width,a.height,0,e,g,null),D(c.__webglFramebuffer,a,r.TEXTURE_2D),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,c.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,c.__webglRenderbuffer): -G(c.__webglRenderbuffer,a),a.generateMipmaps&&d&&r.generateMipmap(r.TEXTURE_2D);b?J.bindTexture(r.TEXTURE_CUBE_MAP,null):J.bindTexture(r.TEXTURE_2D,null);r.bindRenderbuffer(r.RENDERBUFFER,null);r.bindFramebuffer(r.FRAMEBUFFER,null)}a?(c=X.get(a),c=b?c.__webglFramebuffer[a.activeCubeFace]:c.__webglFramebuffer,d=a.width,e=a.height,h=g=0):(c=null,d=pa,e=qa,g=na,h=oa);c!==ia&&(r.bindFramebuffer(r.FRAMEBUFFER,c),r.viewport(g,h,d,e),ia=c);b&&(c=X.get(a),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0, -r.TEXTURE_CUBE_MAP_POSITIVE_X+a.activeCubeFace,c.__webglTexture,0));Ca=d;Da=e};this.readRenderTargetPixels=function(a,b,c,d,e,f){if(!(a instanceof THREE.WebGLRenderTarget))console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");else if(X.get(a).__webglFramebuffer){var g=!1;X.get(a).__webglFramebuffer!==ia&&(r.bindFramebuffer(r.FRAMEBUFFER,X.get(a).__webglFramebuffer),g=!0);a.format!==THREE.RGBAFormat&&A(a.format)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT)? -console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."):a.type!==THREE.UnsignedByteType&&A(a.type)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type."):(r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE?r.readPixels(b,c,d,e,A(a.format),A(a.type),f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."), -g&&r.bindFramebuffer(r.FRAMEBUFFER,ia))}};this.supportsFloatTextures=function(){console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' ).");return S.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' ).");return S.get("OES_texture_half_float")};this.supportsStandardDerivatives=function(){console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."); +d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){k.opacity.value=d.opacity;k.diffuse.value=d.color;d.emissive&&(k.emissive.value=d.emissive);k.map.value=d.map;k.specularMap.value=d.specularMap;k.alphaMap.value=d.alphaMap;d.aoMap&&(k.aoMap.value=d.aoMap,k.aoMapIntensity.value=d.aoMapIntensity);var N;d.map?N=d.map:d.specularMap?N=d.specularMap:d.displacementMap?N=d.displacementMap:d.normalMap?N=d.normalMap:d.bumpMap?N=d.bumpMap:d.alphaMap?N=d.alphaMap:d.emissiveMap&&(N= +d.emissiveMap);void 0!==N&&(N instanceof THREE.WebGLRenderTarget&&(N=N.texture),m=N.offset,N=N.repeat,k.offsetRepeat.value.set(m.x,m.y,N.x,N.y));k.envMap.value=d.envMap;k.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;k.reflectivity.value=d.reflectivity;k.refractionRatio.value=d.refractionRatio}d instanceof THREE.LineBasicMaterial?(k.diffuse.value=d.color,k.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(k.diffuse.value=d.color,k.opacity.value=d.opacity,k.dashSize.value= +d.dashSize,k.totalSize.value=d.dashSize+d.gapSize,k.scale.value=d.scale):d instanceof THREE.PointsMaterial?(k.psColor.value=d.color,k.opacity.value=d.opacity,k.size.value=d.size,k.scale.value=I.height/2,k.map.value=d.map,null!==d.map&&(a=d.map.offset,N=d.map.repeat,k.offsetRepeat.value.set(a.x,a.y,N.x,N.y))):d instanceof THREE.MeshPhongMaterial?(k.specular.value=d.specular,k.shininess.value=d.shininess,d.lightMap&&(k.lightMap.value=d.lightMap,k.lightMapIntensity.value=d.lightMapIntensity),d.emissiveMap&& +(k.emissiveMap.value=d.emissiveMap),d.bumpMap&&(k.bumpMap.value=d.bumpMap,k.bumpScale.value=d.bumpScale),d.normalMap&&(k.normalMap.value=d.normalMap,k.normalScale.value.copy(d.normalScale)),d.displacementMap&&(k.displacementMap.value=d.displacementMap,k.displacementScale.value=d.displacementScale,k.displacementBias.value=d.displacementBias)):d instanceof THREE.MeshDepthMaterial?(k.mNear.value=a.near,k.mFar.value=a.far,k.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(k.opacity.value= +d.opacity);if(e.receiveShadow&&!d._shadowPass&&k.shadowMatrix)for(a=d=0,N=b.length;a=ga.maxTextures&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+ga.maxTextures);ya+=1;return a}function B(a,b,c,d){a[b+0]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function w(a,b,c){c?(r.texParameteri(a,r.TEXTURE_WRAP_S,A(b.wrapS)),r.texParameteri(a,r.TEXTURE_WRAP_T,A(b.wrapT)),r.texParameteri(a,r.TEXTURE_MAG_FILTER,A(b.magFilter)),r.texParameteri(a,r.TEXTURE_MIN_FILTER,A(b.minFilter))):(r.texParameteri(a, +r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(a,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+b.sourceFile+" )"),r.texParameteri(a,r.TEXTURE_MAG_FILTER,K(b.magFilter)),r.texParameteri(a,r.TEXTURE_MIN_FILTER,K(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&& +console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+b.sourceFile+" )"));!(c=S.get("EXT_texture_filter_anisotropic"))||b.type===THREE.FloatType&&null===S.get("OES_texture_float_linear")||b.type===THREE.HalfFloatType&&null===S.get("OES_texture_half_float_linear")||!(1b||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 E(a,b){var c=V.get(a);if(6===a.image.length)if(0h;h++)f[h]=!aa.autoScaleCubemaps||d||e?e?a.image[h].image:a.image[h]:C(a.image[h],ga.maxCubemapSize);var h=f[0],k=THREE.Math.isPowerOfTwo(h.width)&&THREE.Math.isPowerOfTwo(h.height), +l=A(a.format),m=A(a.type);w(r.TEXTURE_CUBE_MAP,a,k);for(h=0;6>h;h++)if(d)for(var n,q=f[h].mipmaps,p=0,s=q.length;pd;d++)c.__webglFramebuffer[d]= +r.createFramebuffer(),c.__webglRenderbuffer[d]=r.createRenderbuffer(),J.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+d,0,g,a.width,a.height,0,g,h,null),D(c.__webglFramebuffer[d],a,r.TEXTURE_CUBE_MAP_POSITIVE_X+d),G(c.__webglRenderbuffer[d],a);a.texture.generateMipmaps&&e&&r.generateMipmap(r.TEXTURE_CUBE_MAP)}else c.__webglFramebuffer=r.createFramebuffer(),c.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:r.createRenderbuffer(),J.bindTexture(r.TEXTURE_2D,d.__webglTexture),w(r.TEXTURE_2D, +a.texture,e),J.texImage2D(r.TEXTURE_2D,0,g,a.width,a.height,0,g,h,null),D(c.__webglFramebuffer,a,r.TEXTURE_2D),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,c.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,c.__webglRenderbuffer):G(c.__webglRenderbuffer,a),a.texture.generateMipmaps&&e&&r.generateMipmap(r.TEXTURE_2D);b?J.bindTexture(r.TEXTURE_CUBE_MAP, +null):J.bindTexture(r.TEXTURE_2D,null);r.bindRenderbuffer(r.RENDERBUFFER,null);r.bindFramebuffer(r.FRAMEBUFFER,null)}a?(c=V.get(a),d=b?c.__webglFramebuffer[a.activeCubeFace]:c.__webglFramebuffer,c=a.width,e=a.height,h=g=0):(d=null,c=pa,e=qa,g=na,h=oa);d!==ia&&(r.bindFramebuffer(r.FRAMEBUFFER,d),r.viewport(g,h,c,e),ia=d);b&&(d=V.get(a.texture),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+a.activeCubeFace,d.__webglTexture,0));Ca=c;Da=e};this.readRenderTargetPixels= +function(a,b,c,d,e,f){if(!(a instanceof THREE.WebGLRenderTarget))console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");else if(V.get(a).__webglFramebuffer){var g=!1;V.get(a).__webglFramebuffer!==ia&&(r.bindFramebuffer(r.FRAMEBUFFER,V.get(a).__webglFramebuffer),g=!0);a.texture.format!==THREE.RGBAFormat&&A(a.texture.format)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."): +a.texture.type!==THREE.UnsignedByteType&&A(a.texture.type)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type."):(r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE?r.readPixels(b,c,d,e,A(a.texture.format),A(a.texture.type),f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."),g&&r.bindFramebuffer(r.FRAMEBUFFER, +ia))}};this.supportsFloatTextures=function(){console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' ).");return S.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' ).");return S.get("OES_texture_half_float")};this.supportsStandardDerivatives=function(){console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."); return S.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' ).");return S.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=function(){console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' ).");return S.get("WEBGL_compressed_texture_pvrtc")};this.supportsBlendMinMax= function(){console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' ).");return S.get("EXT_blend_minmax")};this.supportsVertexTextures=function(){return ga.vertexTextures};this.supportsInstancedArrays=function(){console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' ).");return S.get("ANGLE_instanced_arrays")};this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")}; this.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};this.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};this.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")};Object.defineProperties(this,{shadowMapEnabled:{get:function(){return ha.enabled},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.");ha.enabled= a}},shadowMapType:{get:function(){return ha.type},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.");ha.type=a}},shadowMapCullFace:{get:function(){return ha.cullFace},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.");ha.cullFace=a}},shadowMapDebug:{get:function(){return ha.debug},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapDebug is now .shadowMap.debug.");ha.debug=a}}})}; -THREE.WebGLRenderTarget=function(a,b,c){this.uuid=THREE.Math.generateUUID();this.width=a;this.height=b;c=c||{};this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter;this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==c.anisotropy?c.anisotropy:1;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1, -1);this.format=void 0!==c.format?c.format:THREE.RGBAFormat;this.type=void 0!==c.type?c.type:THREE.UnsignedByteType;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.generateMipmaps=!0;this.shareDepthFrom=void 0!==c.shareDepthFrom?c.shareDepthFrom:null}; -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()},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.width=a.width;this.height=a.height;this.wrapS=a.wrapS;this.wrapT=a.wrapT;this.magFilter=a.magFilter;this.minFilter=a.minFilter;this.anisotropy=a.anisotropy;this.offset.copy(a.offset);this.repeat.copy(a.repeat);this.format=a.format;this.type=a.type;this.depthBuffer= -a.depthBuffer;this.stencilBuffer=a.stencilBuffer;this.generateMipmaps=a.generateMipmaps;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; +THREE.WebGLRenderTarget=function(a,b,c){this.uuid=THREE.Math.generateUUID();this.width=a;this.height=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;this.shareDepthFrom=void 0!==c.shareDepthFrom?c.shareDepthFrom:null}; +THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,get wrapS(){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.");return this.texture.wrapS},set wrapS(a){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.");this.texture.wrapS=a},get wrapT(){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.");return this.texture.wrapT},set wrapT(a){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.");this.texture.wrapT=a}, +get magFilter(){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.");return this.texture.magFilter},set magFilter(a){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.");this.texture.magFilter=a},get minFilter(){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.");return this.texture.minFilter},set minFilter(a){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.");this.texture.minFilter=a},get anisotropy(){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."); +return this.texture.anisotropy},set anisotropy(a){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.");this.texture.anisotropy=a},get offset(){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset.");return this.texture.offset},set offset(a){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset.");this.texture.offset=a},get repeat(){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat.");return this.texture.repeat},set repeat(a){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."); +this.texture.repeat=a},get format(){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format.");return this.texture.format},set format(a){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format.");this.texture.format=a},get type(){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type.");return this.texture.type},set type(a){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type.");this.texture.type=a},get generateMipmaps(){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."); +return this.texture.generateMipmaps},set generateMipmaps(a){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.");this.texture.generateMipmaps=a},setSize:function(a,b){if(this.width!==a||this.height!==b)this.width=a,this.height=b,this.dispose()},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.width=a.width;this.height=a.height;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; THREE.WebGLBufferRenderer=function(a,b,c){var d;this.setMode=function(a){d=a};this.render=function(b,g){a.drawArrays(d,b,g);c.calls++;c.vertices+=g;d===a.TRIANGLES&&(c.faces+=g/3)};this.renderInstances=function(a){var c=b.get("ANGLE_instanced_arrays");if(null===c)console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");else{var f=a.attributes.position;f instanceof THREE.InterleavedBufferAttribute?c.drawArraysInstancedANGLE(d, 0,f.data.count,a.maxInstancedCount):c.drawArraysInstancedANGLE(d,0,f.count,a.maxInstancedCount)}}}; THREE.WebGLIndexedBufferRenderer=function(a,b,c){var d,e,g;this.setMode=function(a){d=a};this.setIndex=function(c){c.array instanceof Uint32Array&&b.get("OES_element_index_uint")?(e=a.UNSIGNED_INT,g=4):(e=a.UNSIGNED_SHORT,g=2)};this.render=function(b,h){a.drawElements(d,h,e,b*g);c.calls++;c.vertices+=h;d===a.TRIANGLES&&(c.faces+=h/3)};this.renderInstances=function(a){var c=b.get("ANGLE_instanced_arrays");null===c?console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."): @@ -661,8 +664,8 @@ u;if(!1!==K.enabled&&(!1!==K.autoUpdate||!1!==K.needsUpdate)){g.clearColor(1,1,1 1,u=!1;if(y.castShadow){y.shadowMap||(z=THREE.LinearFilter,K.type===THREE.PCFSoftShadowMap&&(z=THREE.NearestFilter),y.shadowMap=new THREE.WebGLRenderTarget(y.shadowMapWidth,y.shadowMapHeight,{minFilter:z,magFilter:z,format:THREE.RGBAFormat}),y.shadowMapSize=new THREE.Vector2(y.shadowMapWidth,y.shadowMapHeight),y.shadowMatrix=new THREE.Matrix4);y.shadowCamera||(y.shadowCamera=y instanceof THREE.SpotLight?new THREE.PerspectiveCamera(y.shadowCameraFov,y.shadowMapWidth/y.shadowMapHeight,y.shadowCameraNear, y.shadowCameraFar):y instanceof THREE.DirectionalLight?new THREE.OrthographicCamera(y.shadowCameraLeft,y.shadowCameraRight,y.shadowCameraTop,y.shadowCameraBottom,y.shadowCameraNear,y.shadowCameraFar):new THREE.PerspectiveCamera(y.shadowCameraFov,1,y.shadowCameraNear,y.shadowCameraFar),m.add(y.shadowCamera),!0===m.autoUpdate&&m.updateMatrixWorld());y.shadowCameraVisible&&!y.cameraHelper&&(y.cameraHelper=new THREE.CameraHelper(y.shadowCamera),m.add(y.cameraHelper));var D=y.shadowMap,z=y.shadowMatrix, C=y.shadowCamera;n.setFromMatrixPosition(y.matrixWorld);C.position.copy(n);a.setRenderTarget(D);a.clear();for(D=0;D 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")); w.compileShader(y);w.compileShader(L);w.attachShader(H,y);w.attachShader(H,L);w.linkProgram(H);D=H;x=w.getAttribLocation(D,"position");u=w.getAttribLocation(D,"uv");c=w.getUniformLocation(D,"uvOffset");d=w.getUniformLocation(D,"uvScale");e=w.getUniformLocation(D,"rotation");g=w.getUniformLocation(D,"scale");f=w.getUniformLocation(D,"color");h=w.getUniformLocation(D,"map");l=w.getUniformLocation(D,"opacity");k=w.getUniformLocation(D,"modelViewMatrix");n=w.getUniformLocation(D,"projectionMatrix");p= w.getUniformLocation(D,"fogType");m=w.getUniformLocation(D,"fogDensity");q=w.getUniformLocation(D,"fogNear");s=w.getUniformLocation(D,"fogFar");t=w.getUniformLocation(D,"fogColor");v=w.getUniformLocation(D,"alphaTest");H=document.createElement("canvas");H.width=8;H.height=8;y=H.getContext("2d");y.fillStyle="white";y.fillRect(0,0,8,8);G=new THREE.Texture(H);G.needsUpdate=!0}w.useProgram(D);C.initAttributes();C.enableAttribute(x);C.enableAttribute(u);C.disableUnusedAttributes();C.disable(w.CULL_FACE); -C.enable(w.BLEND);w.bindBuffer(w.ARRAY_BUFFER,E);w.vertexAttribPointer(x,2,w.FLOAT,!1,16,0);w.vertexAttribPointer(u,2,w.FLOAT,!1,16,8);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,z);w.uniformMatrix4fv(n,!1,N.projectionMatrix.elements);C.activeTexture(w.TEXTURE0);w.uniform1i(h,0);y=H=0;(L=M.fog)?(w.uniform3f(t,L.color.r,L.color.g,L.color.b),L instanceof THREE.Fog?(w.uniform1f(q,L.near),w.uniform1f(s,L.far),w.uniform1i(p,1),y=H=1):L instanceof THREE.FogExp2&&(w.uniform1f(m,L.density),w.uniform1i(p,2),y=H=2)): -(w.uniform1i(p,0),y=H=0);for(var L=0,O=b.length;Le)return null;var g=[],f=[],h=[],l,k,n;if(0=p--){console.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}l=k;e<=l&&(l=0);k=l+1;e<=k&&(k=0);n=k+1;e<=n&&(n=0);var m;a:{var q=m=void 0,s=void 0,t=void 0, -v=void 0,x=void 0,u=void 0,B=void 0,w=void 0,q=a[f[l]].x,s=a[f[l]].y,t=a[f[k]].x,v=a[f[k]].y,x=a[f[n]].x,u=a[f[n]].y;if(1E-10>(t-q)*(u-s)-(v-s)*(x-q))m=!1;else{var C=void 0,E=void 0,z=void 0,D=void 0,G=void 0,K=void 0,A=void 0,I=void 0,M=void 0,N=void 0,M=I=A=w=B=void 0,C=x-t,E=u-v,z=q-x,D=s-u,G=t-q,K=v-s;for(m=0;m(t-q)*(u-s)-(v-s)*(x-q))m=!1;else{var C=void 0,E=void 0,z=void 0,D=void 0,G=void 0,K=void 0,A=void 0,I=void 0,M=void 0,O=void 0,M=I=A=w=B=void 0,C=x-t,E=u-v,z=q-x,D=s-u,G=t-q,K=v-s;for(m=0;mD||D>z)return[];k=l*n-k*p;if(0>k||k>z)return[]}else{if(0d?[]: k===d?f?[]:[g]:a<=d?[g,h]:[g,l]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10f&&(f=d);var g=a+1;g>d&&(g= -0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;cN){console.log("Infinite Loop! Holes left:"+l.length+", Probably Hole outside Shape!");break}for(p=K;pf&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;cO){console.log("Infinite Loop! Holes left:"+l.length+", Probably Hole outside Shape!");break}for(p=K;ph;h++)k=l[h].x+":"+l[h].y,k=n[k],void 0!==k&&(l[h]=k);return p.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1- a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);b.multiplyScalar(a).add(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)}; THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()};THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve; @@ -787,9 +790,9 @@ THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||cons !0):-1E-10>d?-1E-10>f&&(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(F=a.length;0<=--F;){c=F;d=F-1;0>d&&(d=a.length-1);for(var e=0,f=q+2*n,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