Browse Source

Updated builds.

Mr.doob 14 years ago
parent
commit
b476481c54
2 changed files with 8 additions and 8 deletions
  1. 4 4
      build/Three.js
  2. 4 4
      build/custom/ThreeWebGL.js

+ 4 - 4
build/Three.js

@@ -135,9 +135,9 @@ for(k=0;k<o;k++)p=b[j[t[k]]],c.push(new THREE.Vertex(p.position.clone()))}for(g=
 THREE.ShadowVolume.prototype.facesShareEdge=function(b,c,d){var e,f,g,j,k,m,o,p,t,n,u,v,y,B=0,z=["a","b","c","d"];e=c instanceof THREE.Face4?4:3;f=d instanceof THREE.Face4?4:3;for(v=0;v<e;v++){g=c[z[v]];k=b[g];for(y=0;y<f;y++)if(j=d[z[y]],m=b[j],Math.abs(k.position.x-m.position.x)<1.0E-4&&Math.abs(k.position.y-m.position.y)<1.0E-4&&Math.abs(k.position.z-m.position.z)<1.0E-4&&(B++,B===1&&(o=k,p=m,t=g,n=j,u=z[v]),B===2))return u+=z[v],u==="ad"||u==="ac"?{faces:[c,d],vertices:[o,p,m,k],indices:[t,n,
 THREE.ShadowVolume.prototype.facesShareEdge=function(b,c,d){var e,f,g,j,k,m,o,p,t,n,u,v,y,B=0,z=["a","b","c","d"];e=c instanceof THREE.Face4?4:3;f=d instanceof THREE.Face4?4:3;for(v=0;v<e;v++){g=c[z[v]];k=b[g];for(y=0;y<f;y++)if(j=d[z[y]],m=b[j],Math.abs(k.position.x-m.position.x)<1.0E-4&&Math.abs(k.position.y-m.position.y)<1.0E-4&&Math.abs(k.position.z-m.position.z)<1.0E-4&&(B++,B===1&&(o=k,p=m,t=g,n=j,u=z[v]),B===2))return u+=z[v],u==="ad"||u==="ac"?{faces:[c,d],vertices:[o,p,m,k],indices:[t,n,
 j,g],vertexTypes:[1,2,2,1],extrudable:!0}:{faces:[c,d],vertices:[o,k,m,p],indices:[t,g,j,n],vertexTypes:[1,1,2,2],extrudable:!0}}};
 j,g],vertexTypes:[1,2,2,1],extrudable:!0}:{faces:[c,d],vertices:[o,k,m,p],indices:[t,g,j,n],vertexTypes:[1,1,2,2],extrudable:!0}}};
 THREE.Sprite=function(b){THREE.Object3D.call(this);if(b.material!==void 0)this.material=b.material,this.map=void 0,this.blending=material.blending;else if(b.map!==void 0)this.map=b.map instanceof THREE.Texture?b.map:THREE.ImageUtils.loadTexture(b.map),this.material=void 0,this.blending=b.blending!==void 0?b.blending:THREE.NormalBlending;this.useScreenCoordinates=b.useScreenCoordinates!==void 0?b.useScreenCoordinates:!0;this.mergeWith3D=b.mergeWith3D!==void 0?b.mergeWith3D:!this.useScreenCoordinates;
 THREE.Sprite=function(b){THREE.Object3D.call(this);if(b.material!==void 0)this.material=b.material,this.map=void 0,this.blending=material.blending;else if(b.map!==void 0)this.map=b.map instanceof THREE.Texture?b.map:THREE.ImageUtils.loadTexture(b.map),this.material=void 0,this.blending=b.blending!==void 0?b.blending:THREE.NormalBlending;this.useScreenCoordinates=b.useScreenCoordinates!==void 0?b.useScreenCoordinates:!0;this.mergeWith3D=b.mergeWith3D!==void 0?b.mergeWith3D:!this.useScreenCoordinates;
-this.affectedByDistance=b.affectedByDistance!==void 0?b.affectedByDistance:!this.useScreenCoordinates;this.alignment=b.alignment instanceof THREE.Vector2?b.alignment:THREE.SpriteAlignment.center;this.rotation3d=this.rotation;this.rotation=0;this.opacity=1;this.uvOffset=new THREE.Vector2(0,0);this.uvScale=new THREE.Vector2(1,1)};THREE.Sprite.prototype=new THREE.Object3D;THREE.Sprite.prototype.constructor=THREE.Sprite;THREE.Sprite.prototype.supr=THREE.Object3D.prototype;
-THREE.Sprite.prototype.updateMatrix=function(){this.matrix.setPosition(this.position);this.rotation3d.set(0,0,this.rotation);this.matrix.setRotationFromEuler(this.rotation3d);if(this.scale.x!==1||this.scale.y!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,this.scale.y);this.matrixWorldNeedsUpdate=!0};THREE.SpriteAlignment={};THREE.SpriteAlignment.topLeft=new THREE.Vector2(1,-1);THREE.SpriteAlignment.topCenter=new THREE.Vector2(0,-1);
-THREE.SpriteAlignment.topRight=new THREE.Vector2(-1,-1);THREE.SpriteAlignment.centerLeft=new THREE.Vector2(1,0);THREE.SpriteAlignment.center=new THREE.Vector2(0,0);THREE.SpriteAlignment.centerRight=new THREE.Vector2(-1,0);THREE.SpriteAlignment.bottomLeft=new THREE.Vector2(1,1);THREE.SpriteAlignment.bottomCenter=new THREE.Vector2(0,1);THREE.SpriteAlignment.bottomRight=new THREE.Vector2(-1,1);
+this.affectedByDistance=b.affectedByDistance!==void 0?b.affectedByDistance:!this.useScreenCoordinates;this.scaleByViewport=b.scaleByViewport!==void 0?b.scaleByViewport:!this.affectedByDistance;this.alignment=b.alignment instanceof THREE.Vector2?b.alignment:THREE.SpriteAlignment.center;this.rotation3d=this.rotation;this.rotation=0;this.opacity=1;this.uvOffset=new THREE.Vector2(0,0);this.uvScale=new THREE.Vector2(1,1)};THREE.Sprite.prototype=new THREE.Object3D;THREE.Sprite.prototype.constructor=THREE.Sprite;
+THREE.Sprite.prototype.supr=THREE.Object3D.prototype;THREE.Sprite.prototype.updateMatrix=function(){this.matrix.setPosition(this.position);this.rotation3d.set(0,0,this.rotation);this.matrix.setRotationFromEuler(this.rotation3d);if(this.scale.x!==1||this.scale.y!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,this.scale.y);this.matrixWorldNeedsUpdate=!0};THREE.SpriteAlignment={};THREE.SpriteAlignment.topLeft=new THREE.Vector2(1,-1);
+THREE.SpriteAlignment.topCenter=new THREE.Vector2(0,-1);THREE.SpriteAlignment.topRight=new THREE.Vector2(-1,-1);THREE.SpriteAlignment.centerLeft=new THREE.Vector2(1,0);THREE.SpriteAlignment.center=new THREE.Vector2(0,0);THREE.SpriteAlignment.centerRight=new THREE.Vector2(-1,0);THREE.SpriteAlignment.bottomLeft=new THREE.Vector2(1,1);THREE.SpriteAlignment.bottomCenter=new THREE.Vector2(0,1);THREE.SpriteAlignment.bottomRight=new THREE.Vector2(-1,1);
 THREE.Scene=function(){THREE.Object3D.call(this);this.matrixAutoUpdate=!1;this.collisions=this.fog=null;this.objects=[];this.lights=[];this.sounds=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=new THREE.Object3D;THREE.Scene.prototype.constructor=THREE.Scene;THREE.Scene.prototype.supr=THREE.Object3D.prototype;THREE.Scene.prototype.addChild=function(b){this.supr.addChild.call(this,b);this.addChildRecurse(b)};
 THREE.Scene=function(){THREE.Object3D.call(this);this.matrixAutoUpdate=!1;this.collisions=this.fog=null;this.objects=[];this.lights=[];this.sounds=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=new THREE.Object3D;THREE.Scene.prototype.constructor=THREE.Scene;THREE.Scene.prototype.supr=THREE.Object3D.prototype;THREE.Scene.prototype.addChild=function(b){this.supr.addChild.call(this,b);this.addChildRecurse(b)};
 THREE.Scene.prototype.addChildRecurse=function(b){if(b instanceof THREE.Light)this.lights.indexOf(b)===-1&&this.lights.push(b);else if(b instanceof THREE.Sound)this.sounds.indexOf(b)===-1&&this.sounds.push(b);else if(!(b instanceof THREE.Camera||b instanceof THREE.Bone)&&this.objects.indexOf(b)===-1)this.objects.push(b),this.__objectsAdded.push(b);for(var c=0;c<b.children.length;c++)this.addChildRecurse(b.children[c])};
 THREE.Scene.prototype.addChildRecurse=function(b){if(b instanceof THREE.Light)this.lights.indexOf(b)===-1&&this.lights.push(b);else if(b instanceof THREE.Sound)this.sounds.indexOf(b)===-1&&this.sounds.push(b);else if(!(b instanceof THREE.Camera||b instanceof THREE.Bone)&&this.objects.indexOf(b)===-1)this.objects.push(b),this.__objectsAdded.push(b);for(var c=0;c<b.children.length;c++)this.addChildRecurse(b.children[c])};
 THREE.Scene.prototype.removeChild=function(b){this.supr.removeChild.call(this,b);this.removeChildRecurse(b)};THREE.Scene.prototype.removeChildRecurse=function(b){if(b instanceof THREE.Light){var c=this.lights.indexOf(b);c!==-1&&this.lights.splice(c,1)}else b instanceof THREE.Sound?(c=this.sounds.indexOf(b),c!==-1&&this.sounds.splice(c,1)):b instanceof THREE.Camera||(c=this.objects.indexOf(b),c!==-1&&(this.objects.splice(c,1),this.__objectsRemoved.push(b)));for(c=0;c<b.children.length;c++)this.removeChildRecurse(b.children[c])};
 THREE.Scene.prototype.removeChild=function(b){this.supr.removeChild.call(this,b);this.removeChildRecurse(b)};THREE.Scene.prototype.removeChildRecurse=function(b){if(b instanceof THREE.Light){var c=this.lights.indexOf(b);c!==-1&&this.lights.splice(c,1)}else b instanceof THREE.Sound?(c=this.sounds.indexOf(b),c!==-1&&this.sounds.splice(c,1)):b instanceof THREE.Camera||(c=this.objects.indexOf(b),c!==-1&&(this.objects.splice(c,1),this.__objectsRemoved.push(b)));for(c=0;c<b.children.length;c++)this.removeChildRecurse(b.children[c])};
@@ -253,7 +253,7 @@ j.__webglNormalBuffer),h.vertexAttribPointer(o.normal,3,h.FLOAT,!1,0,0),h.bindBu
 !1,_projectionMatrixArray);h.uniform1f(D.darknessLocation,D.darkness);h.bindBuffer(h.ARRAY_BUFFER,D.vertexBuffer);h.vertexAttribPointer(D.vertexLocation,3,h.FLOAT,!1,0,0);h.enableVertexAttribArray(D.vertexLocation);h.blendFunc(h.ONE,h.ONE_MINUS_SRC_ALPHA);h.blendEquation(h.FUNC_ADD);h.bindBuffer(h.ELEMENT_ARRAY_BUFFER,D.elementBuffer);h.drawElements(h.TRIANGLES,6,h.UNSIGNED_SHORT,0);h.disable(h.STENCIL_TEST);h.enable(h.DEPTH_TEST);h.depthMask(T)}function y(b,d){var c,e,f;c=_sprite.attributes;var g=
 !1,_projectionMatrixArray);h.uniform1f(D.darknessLocation,D.darkness);h.bindBuffer(h.ARRAY_BUFFER,D.vertexBuffer);h.vertexAttribPointer(D.vertexLocation,3,h.FLOAT,!1,0,0);h.enableVertexAttribArray(D.vertexLocation);h.blendFunc(h.ONE,h.ONE_MINUS_SRC_ALPHA);h.blendEquation(h.FUNC_ADD);h.bindBuffer(h.ELEMENT_ARRAY_BUFFER,D.elementBuffer);h.drawElements(h.TRIANGLES,6,h.UNSIGNED_SHORT,0);h.disable(h.STENCIL_TEST);h.enable(h.DEPTH_TEST);h.depthMask(T)}function y(b,d){var c,e,f;c=_sprite.attributes;var g=
 _sprite.uniforms,j=_viewportHeight/_viewportWidth,k,m=[],o=_viewportWidth*0.5,p=_viewportHeight*0.5,n=!0;h.useProgram(_sprite.program);L=_sprite.program;V=-1;ca||(h.enableVertexAttribArray(_sprite.attributes.position),h.enableVertexAttribArray(_sprite.attributes.uv),ca=!0);h.disable(h.CULL_FACE);h.enable(h.BLEND);h.depthMask(!0);h.bindBuffer(h.ARRAY_BUFFER,_sprite.vertexBuffer);h.vertexAttribPointer(c.position,2,h.FLOAT,!1,16,0);h.vertexAttribPointer(c.uv,2,h.FLOAT,!1,16,8);h.bindBuffer(h.ELEMENT_ARRAY_BUFFER,
 _sprite.uniforms,j=_viewportHeight/_viewportWidth,k,m=[],o=_viewportWidth*0.5,p=_viewportHeight*0.5,n=!0;h.useProgram(_sprite.program);L=_sprite.program;V=-1;ca||(h.enableVertexAttribArray(_sprite.attributes.position),h.enableVertexAttribArray(_sprite.attributes.uv),ca=!0);h.disable(h.CULL_FACE);h.enable(h.BLEND);h.depthMask(!0);h.bindBuffer(h.ARRAY_BUFFER,_sprite.vertexBuffer);h.vertexAttribPointer(c.position,2,h.FLOAT,!1,16,0);h.vertexAttribPointer(c.uv,2,h.FLOAT,!1,16,8);h.bindBuffer(h.ELEMENT_ARRAY_BUFFER,
 _sprite.elementBuffer);h.uniformMatrix4fv(g.projectionMatrix,!1,_projectionMatrixArray);h.activeTexture(h.TEXTURE0);h.uniform1i(g.map,0);c=0;for(e=b.__webglSprites.length;c<e;c++)f=b.__webglSprites[c],f.useScreenCoordinates?f.z=-f.position.z:(f._modelViewMatrix.multiplyToArray(d.matrixWorldInverse,f.matrixWorld,f._modelViewMatrixArray),f.z=-f._modelViewMatrix.n34);b.__webglSprites.sort(u);c=0;for(e=b.__webglSprites.length;c<e;c++)f=b.__webglSprites[c],f.material===void 0&&f.map&&f.map.image&&f.map.image.width&&
 _sprite.elementBuffer);h.uniformMatrix4fv(g.projectionMatrix,!1,_projectionMatrixArray);h.activeTexture(h.TEXTURE0);h.uniform1i(g.map,0);c=0;for(e=b.__webglSprites.length;c<e;c++)f=b.__webglSprites[c],f.useScreenCoordinates?f.z=-f.position.z:(f._modelViewMatrix.multiplyToArray(d.matrixWorldInverse,f.matrixWorld,f._modelViewMatrixArray),f.z=-f._modelViewMatrix.n34);b.__webglSprites.sort(u);c=0;for(e=b.__webglSprites.length;c<e;c++)f=b.__webglSprites[c],f.material===void 0&&f.map&&f.map.image&&f.map.image.width&&
-(f.useScreenCoordinates?(h.uniform1i(g.useScreenCoordinates,1),h.uniform3f(g.screenPosition,(f.position.x-o)/o,(p-f.position.y)/p,Math.max(0,Math.min(1,f.position.z)))):(h.uniform1i(g.useScreenCoordinates,0),h.uniform1i(g.affectedByDistance,f.affectedByDistance?1:0),h.uniformMatrix4fv(g.modelViewMatrix,!1,f._modelViewMatrixArray)),k=f.map.image.width/(f.affectedByDistance?1:_viewportHeight),m[0]=k*j*f.scale.x,m[1]=k*f.scale.y,h.uniform2f(g.uvScale,f.uvScale.x,f.uvScale.y),h.uniform2f(g.uvOffset,f.uvOffset.x,
+(f.useScreenCoordinates?(h.uniform1i(g.useScreenCoordinates,1),h.uniform3f(g.screenPosition,(f.position.x-o)/o,(p-f.position.y)/p,Math.max(0,Math.min(1,f.position.z)))):(h.uniform1i(g.useScreenCoordinates,0),h.uniform1i(g.affectedByDistance,f.affectedByDistance?1:0),h.uniformMatrix4fv(g.modelViewMatrix,!1,f._modelViewMatrixArray)),k=f.map.image.width/(f.scaleByViewport?_viewportHeight:1),m[0]=k*j*f.scale.x,m[1]=k*f.scale.y,h.uniform2f(g.uvScale,f.uvScale.x,f.uvScale.y),h.uniform2f(g.uvOffset,f.uvOffset.x,
 f.uvOffset.y),h.uniform2f(g.alignment,f.alignment.x,f.alignment.y),h.uniform1f(g.opacity,f.opacity),h.uniform1f(g.rotation,f.rotation),h.uniform2fv(g.scale,m),f.mergeWith3D&&!n?(h.enable(h.DEPTH_TEST),n=!0):!f.mergeWith3D&&n&&(h.disable(h.DEPTH_TEST),n=!1),C(f.blending),J(f.map,0),h.drawElements(h.TRIANGLES,6,h.UNSIGNED_SHORT,0));h.enable(h.CULL_FACE);h.enable(h.DEPTH_TEST);h.depthMask(T)}function B(b,d){var c,e,f=b.__webglLensFlares.length,g,j,k,m=new THREE.Vector3,o=_viewportHeight/_viewportWidth,
 f.uvOffset.y),h.uniform2f(g.alignment,f.alignment.x,f.alignment.y),h.uniform1f(g.opacity,f.opacity),h.uniform1f(g.rotation,f.rotation),h.uniform2fv(g.scale,m),f.mergeWith3D&&!n?(h.enable(h.DEPTH_TEST),n=!0):!f.mergeWith3D&&n&&(h.disable(h.DEPTH_TEST),n=!1),C(f.blending),J(f.map,0),h.drawElements(h.TRIANGLES,6,h.UNSIGNED_SHORT,0));h.enable(h.CULL_FACE);h.enable(h.DEPTH_TEST);h.depthMask(T)}function B(b,d){var c,e,f=b.__webglLensFlares.length,g,j,k,m=new THREE.Vector3,o=_viewportHeight/_viewportWidth,
 p=_viewportWidth*0.5,n=_viewportHeight*0.5,t=16/_viewportHeight,u=[t*o,t],v=[1,1,0],z=[1,1],y=H.uniforms;c=H.attributes;h.useProgram(H.program);L=H.program;V=-1;$||(h.enableVertexAttribArray(H.attributes.vertex),h.enableVertexAttribArray(H.attributes.uv),$=!0);h.uniform1i(y.occlusionMap,0);h.uniform1i(y.map,1);h.bindBuffer(h.ARRAY_BUFFER,H.vertexBuffer);h.vertexAttribPointer(c.vertex,2,h.FLOAT,!1,16,0);h.vertexAttribPointer(c.uv,2,h.FLOAT,!1,16,8);h.bindBuffer(h.ELEMENT_ARRAY_BUFFER,H.elementBuffer);
 p=_viewportWidth*0.5,n=_viewportHeight*0.5,t=16/_viewportHeight,u=[t*o,t],v=[1,1,0],z=[1,1],y=H.uniforms;c=H.attributes;h.useProgram(H.program);L=H.program;V=-1;$||(h.enableVertexAttribArray(H.attributes.vertex),h.enableVertexAttribArray(H.attributes.uv),$=!0);h.uniform1i(y.occlusionMap,0);h.uniform1i(y.map,1);h.bindBuffer(h.ARRAY_BUFFER,H.vertexBuffer);h.vertexAttribPointer(c.vertex,2,h.FLOAT,!1,16,0);h.vertexAttribPointer(c.uv,2,h.FLOAT,!1,16,8);h.bindBuffer(h.ELEMENT_ARRAY_BUFFER,H.elementBuffer);
 h.disable(h.CULL_FACE);h.depthMask(!1);h.activeTexture(h.TEXTURE0);h.bindTexture(h.TEXTURE_2D,H.occlusionTexture);h.activeTexture(h.TEXTURE1);for(e=0;e<f;e++)if(c=b.__webglLensFlares[e].object,m.set(c.matrixWorld.n14,c.matrixWorld.n24,c.matrixWorld.n34),d.matrixWorldInverse.multiplyVector3(m),d.projectionMatrix.multiplyVector3(m),v[0]=m.x,v[1]=m.y,v[2]=m.z,z[0]=v[0]*p+p,z[1]=v[1]*n+n,H.hasVertexTexture||z[0]>0&&z[0]<_viewportWidth&&z[1]>0&&z[1]<_viewportHeight){h.bindTexture(h.TEXTURE_2D,H.tempTexture);
 h.disable(h.CULL_FACE);h.depthMask(!1);h.activeTexture(h.TEXTURE0);h.bindTexture(h.TEXTURE_2D,H.occlusionTexture);h.activeTexture(h.TEXTURE1);for(e=0;e<f;e++)if(c=b.__webglLensFlares[e].object,m.set(c.matrixWorld.n14,c.matrixWorld.n24,c.matrixWorld.n34),d.matrixWorldInverse.multiplyVector3(m),d.projectionMatrix.multiplyVector3(m),v[0]=m.x,v[1]=m.y,v[2]=m.z,z[0]=v[0]*p+p,z[1]=v[1]*n+n,H.hasVertexTexture||z[0]>0&&z[0]<_viewportWidth&&z[1]>0&&z[1]<_viewportHeight){h.bindTexture(h.TEXTURE_2D,H.tempTexture);

+ 4 - 4
build/custom/ThreeWebGL.js

@@ -134,9 +134,9 @@ for(j=0;j<m;j++)n=b[h[q[j]]],d.push(new THREE.Vertex(n.position.clone()))}for(i=
 THREE.ShadowVolume.prototype.facesShareEdge=function(b,d,e){var f,g,i,h,j,o,m,n,q,t,r,D,x,z=0,B=["a","b","c","d"];f=d instanceof THREE.Face4?4:3;g=e instanceof THREE.Face4?4:3;for(D=0;D<f;D++){i=d[B[D]];j=b[i];for(x=0;x<g;x++)if(h=e[B[x]],o=b[h],Math.abs(j.position.x-o.position.x)<1.0E-4&&Math.abs(j.position.y-o.position.y)<1.0E-4&&Math.abs(j.position.z-o.position.z)<1.0E-4&&(z++,z===1&&(m=j,n=o,q=i,t=h,r=B[D]),z===2))return r+=B[D],r==="ad"||r==="ac"?{faces:[d,e],vertices:[m,n,o,j],indices:[q,t,
 THREE.ShadowVolume.prototype.facesShareEdge=function(b,d,e){var f,g,i,h,j,o,m,n,q,t,r,D,x,z=0,B=["a","b","c","d"];f=d instanceof THREE.Face4?4:3;g=e instanceof THREE.Face4?4:3;for(D=0;D<f;D++){i=d[B[D]];j=b[i];for(x=0;x<g;x++)if(h=e[B[x]],o=b[h],Math.abs(j.position.x-o.position.x)<1.0E-4&&Math.abs(j.position.y-o.position.y)<1.0E-4&&Math.abs(j.position.z-o.position.z)<1.0E-4&&(z++,z===1&&(m=j,n=o,q=i,t=h,r=B[D]),z===2))return r+=B[D],r==="ad"||r==="ac"?{faces:[d,e],vertices:[m,n,o,j],indices:[q,t,
 h,i],vertexTypes:[1,2,2,1],extrudable:!0}:{faces:[d,e],vertices:[m,j,o,n],indices:[q,i,h,t],vertexTypes:[1,1,2,2],extrudable:!0}}};
 h,i],vertexTypes:[1,2,2,1],extrudable:!0}:{faces:[d,e],vertices:[m,j,o,n],indices:[q,i,h,t],vertexTypes:[1,1,2,2],extrudable:!0}}};
 THREE.Sprite=function(b){THREE.Object3D.call(this);if(b.material!==void 0)this.material=b.material,this.map=void 0,this.blending=material.blending;else if(b.map!==void 0)this.map=b.map instanceof THREE.Texture?b.map:THREE.ImageUtils.loadTexture(b.map),this.material=void 0,this.blending=b.blending!==void 0?b.blending:THREE.NormalBlending;this.useScreenCoordinates=b.useScreenCoordinates!==void 0?b.useScreenCoordinates:!0;this.mergeWith3D=b.mergeWith3D!==void 0?b.mergeWith3D:!this.useScreenCoordinates;
 THREE.Sprite=function(b){THREE.Object3D.call(this);if(b.material!==void 0)this.material=b.material,this.map=void 0,this.blending=material.blending;else if(b.map!==void 0)this.map=b.map instanceof THREE.Texture?b.map:THREE.ImageUtils.loadTexture(b.map),this.material=void 0,this.blending=b.blending!==void 0?b.blending:THREE.NormalBlending;this.useScreenCoordinates=b.useScreenCoordinates!==void 0?b.useScreenCoordinates:!0;this.mergeWith3D=b.mergeWith3D!==void 0?b.mergeWith3D:!this.useScreenCoordinates;
-this.affectedByDistance=b.affectedByDistance!==void 0?b.affectedByDistance:!this.useScreenCoordinates;this.alignment=b.alignment instanceof THREE.Vector2?b.alignment:THREE.SpriteAlignment.center;this.rotation3d=this.rotation;this.rotation=0;this.opacity=1;this.uvOffset=new THREE.Vector2(0,0);this.uvScale=new THREE.Vector2(1,1)};THREE.Sprite.prototype=new THREE.Object3D;THREE.Sprite.prototype.constructor=THREE.Sprite;THREE.Sprite.prototype.supr=THREE.Object3D.prototype;
-THREE.Sprite.prototype.updateMatrix=function(){this.matrix.setPosition(this.position);this.rotation3d.set(0,0,this.rotation);this.matrix.setRotationFromEuler(this.rotation3d);if(this.scale.x!==1||this.scale.y!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,this.scale.y);this.matrixWorldNeedsUpdate=!0};THREE.SpriteAlignment={};THREE.SpriteAlignment.topLeft=new THREE.Vector2(1,-1);THREE.SpriteAlignment.topCenter=new THREE.Vector2(0,-1);
-THREE.SpriteAlignment.topRight=new THREE.Vector2(-1,-1);THREE.SpriteAlignment.centerLeft=new THREE.Vector2(1,0);THREE.SpriteAlignment.center=new THREE.Vector2(0,0);THREE.SpriteAlignment.centerRight=new THREE.Vector2(-1,0);THREE.SpriteAlignment.bottomLeft=new THREE.Vector2(1,1);THREE.SpriteAlignment.bottomCenter=new THREE.Vector2(0,1);THREE.SpriteAlignment.bottomRight=new THREE.Vector2(-1,1);
+this.affectedByDistance=b.affectedByDistance!==void 0?b.affectedByDistance:!this.useScreenCoordinates;this.scaleByViewport=b.scaleByViewport!==void 0?b.scaleByViewport:!this.affectedByDistance;this.alignment=b.alignment instanceof THREE.Vector2?b.alignment:THREE.SpriteAlignment.center;this.rotation3d=this.rotation;this.rotation=0;this.opacity=1;this.uvOffset=new THREE.Vector2(0,0);this.uvScale=new THREE.Vector2(1,1)};THREE.Sprite.prototype=new THREE.Object3D;THREE.Sprite.prototype.constructor=THREE.Sprite;
+THREE.Sprite.prototype.supr=THREE.Object3D.prototype;THREE.Sprite.prototype.updateMatrix=function(){this.matrix.setPosition(this.position);this.rotation3d.set(0,0,this.rotation);this.matrix.setRotationFromEuler(this.rotation3d);if(this.scale.x!==1||this.scale.y!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,this.scale.y);this.matrixWorldNeedsUpdate=!0};THREE.SpriteAlignment={};THREE.SpriteAlignment.topLeft=new THREE.Vector2(1,-1);
+THREE.SpriteAlignment.topCenter=new THREE.Vector2(0,-1);THREE.SpriteAlignment.topRight=new THREE.Vector2(-1,-1);THREE.SpriteAlignment.centerLeft=new THREE.Vector2(1,0);THREE.SpriteAlignment.center=new THREE.Vector2(0,0);THREE.SpriteAlignment.centerRight=new THREE.Vector2(-1,0);THREE.SpriteAlignment.bottomLeft=new THREE.Vector2(1,1);THREE.SpriteAlignment.bottomCenter=new THREE.Vector2(0,1);THREE.SpriteAlignment.bottomRight=new THREE.Vector2(-1,1);
 THREE.Scene=function(){THREE.Object3D.call(this);this.matrixAutoUpdate=!1;this.collisions=this.fog=null;this.objects=[];this.lights=[];this.sounds=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=new THREE.Object3D;THREE.Scene.prototype.constructor=THREE.Scene;THREE.Scene.prototype.supr=THREE.Object3D.prototype;THREE.Scene.prototype.addChild=function(b){this.supr.addChild.call(this,b);this.addChildRecurse(b)};
 THREE.Scene=function(){THREE.Object3D.call(this);this.matrixAutoUpdate=!1;this.collisions=this.fog=null;this.objects=[];this.lights=[];this.sounds=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=new THREE.Object3D;THREE.Scene.prototype.constructor=THREE.Scene;THREE.Scene.prototype.supr=THREE.Object3D.prototype;THREE.Scene.prototype.addChild=function(b){this.supr.addChild.call(this,b);this.addChildRecurse(b)};
 THREE.Scene.prototype.addChildRecurse=function(b){if(b instanceof THREE.Light)this.lights.indexOf(b)===-1&&this.lights.push(b);else if(b instanceof THREE.Sound)this.sounds.indexOf(b)===-1&&this.sounds.push(b);else if(!(b instanceof THREE.Camera||b instanceof THREE.Bone)&&this.objects.indexOf(b)===-1)this.objects.push(b),this.__objectsAdded.push(b);for(var d=0;d<b.children.length;d++)this.addChildRecurse(b.children[d])};
 THREE.Scene.prototype.addChildRecurse=function(b){if(b instanceof THREE.Light)this.lights.indexOf(b)===-1&&this.lights.push(b);else if(b instanceof THREE.Sound)this.sounds.indexOf(b)===-1&&this.sounds.push(b);else if(!(b instanceof THREE.Camera||b instanceof THREE.Bone)&&this.objects.indexOf(b)===-1)this.objects.push(b),this.__objectsAdded.push(b);for(var d=0;d<b.children.length;d++)this.addChildRecurse(b.children[d])};
 THREE.Scene.prototype.removeChild=function(b){this.supr.removeChild.call(this,b);this.removeChildRecurse(b)};THREE.Scene.prototype.removeChildRecurse=function(b){if(b instanceof THREE.Light){var d=this.lights.indexOf(b);d!==-1&&this.lights.splice(d,1)}else b instanceof THREE.Sound?(d=this.sounds.indexOf(b),d!==-1&&this.sounds.splice(d,1)):b instanceof THREE.Camera||(d=this.objects.indexOf(b),d!==-1&&(this.objects.splice(d,1),this.__objectsRemoved.push(b)));for(d=0;d<b.children.length;d++)this.removeChildRecurse(b.children[d])};
 THREE.Scene.prototype.removeChild=function(b){this.supr.removeChild.call(this,b);this.removeChildRecurse(b)};THREE.Scene.prototype.removeChildRecurse=function(b){if(b instanceof THREE.Light){var d=this.lights.indexOf(b);d!==-1&&this.lights.splice(d,1)}else b instanceof THREE.Sound?(d=this.sounds.indexOf(b),d!==-1&&this.sounds.splice(d,1)):b instanceof THREE.Camera||(d=this.objects.indexOf(b),d!==-1&&(this.objects.splice(d,1),this.__objectsRemoved.push(b)));for(d=0;d<b.children.length;d++)this.removeChildRecurse(b.children[d])};
@@ -214,7 +214,7 @@ c.bindBuffer(c.ARRAY_BUFFER,i.__webglNormalBuffer),c.vertexAttribPointer(o.norma
 c.uniformMatrix4fv(v.projectionLocation,!1,_projectionMatrixArray);c.uniform1f(v.darknessLocation,v.darkness);c.bindBuffer(c.ARRAY_BUFFER,v.vertexBuffer);c.vertexAttribPointer(v.vertexLocation,3,c.FLOAT,!1,0,0);c.enableVertexAttribArray(v.vertexLocation);c.blendFunc(c.ONE,c.ONE_MINUS_SRC_ALPHA);c.blendEquation(c.FUNC_ADD);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,v.elementBuffer);c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0);c.disable(c.STENCIL_TEST);c.enable(c.DEPTH_TEST);c.depthMask(O)}function x(b,
 c.uniformMatrix4fv(v.projectionLocation,!1,_projectionMatrixArray);c.uniform1f(v.darknessLocation,v.darkness);c.bindBuffer(c.ARRAY_BUFFER,v.vertexBuffer);c.vertexAttribPointer(v.vertexLocation,3,c.FLOAT,!1,0,0);c.enableVertexAttribArray(v.vertexLocation);c.blendFunc(c.ONE,c.ONE_MINUS_SRC_ALPHA);c.blendEquation(c.FUNC_ADD);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,v.elementBuffer);c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0);c.disable(c.STENCIL_TEST);c.enable(c.DEPTH_TEST);c.depthMask(O)}function x(b,
 d){var e,f,h;e=_sprite.attributes;var g=_sprite.uniforms,i=_viewportHeight/_viewportWidth,j,m=[],o=_viewportWidth*0.5,p=_viewportHeight*0.5,n=!0;c.useProgram(_sprite.program);ia=_sprite.program;E=-1;ra||(c.enableVertexAttribArray(_sprite.attributes.position),c.enableVertexAttribArray(_sprite.attributes.uv),ra=!0);c.disable(c.CULL_FACE);c.enable(c.BLEND);c.depthMask(!0);c.bindBuffer(c.ARRAY_BUFFER,_sprite.vertexBuffer);c.vertexAttribPointer(e.position,2,c.FLOAT,!1,16,0);c.vertexAttribPointer(e.uv,
 d){var e,f,h;e=_sprite.attributes;var g=_sprite.uniforms,i=_viewportHeight/_viewportWidth,j,m=[],o=_viewportWidth*0.5,p=_viewportHeight*0.5,n=!0;c.useProgram(_sprite.program);ia=_sprite.program;E=-1;ra||(c.enableVertexAttribArray(_sprite.attributes.position),c.enableVertexAttribArray(_sprite.attributes.uv),ra=!0);c.disable(c.CULL_FACE);c.enable(c.BLEND);c.depthMask(!0);c.bindBuffer(c.ARRAY_BUFFER,_sprite.vertexBuffer);c.vertexAttribPointer(e.position,2,c.FLOAT,!1,16,0);c.vertexAttribPointer(e.uv,
 2,c.FLOAT,!1,16,8);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,_sprite.elementBuffer);c.uniformMatrix4fv(g.projectionMatrix,!1,_projectionMatrixArray);c.activeTexture(c.TEXTURE0);c.uniform1i(g.map,0);e=0;for(f=b.__webglSprites.length;e<f;e++)h=b.__webglSprites[e],h.useScreenCoordinates?h.z=-h.position.z:(h._modelViewMatrix.multiplyToArray(d.matrixWorldInverse,h.matrixWorld,h._modelViewMatrixArray),h.z=-h._modelViewMatrix.n34);b.__webglSprites.sort(r);e=0;for(f=b.__webglSprites.length;e<f;e++)h=b.__webglSprites[e],
 2,c.FLOAT,!1,16,8);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,_sprite.elementBuffer);c.uniformMatrix4fv(g.projectionMatrix,!1,_projectionMatrixArray);c.activeTexture(c.TEXTURE0);c.uniform1i(g.map,0);e=0;for(f=b.__webglSprites.length;e<f;e++)h=b.__webglSprites[e],h.useScreenCoordinates?h.z=-h.position.z:(h._modelViewMatrix.multiplyToArray(d.matrixWorldInverse,h.matrixWorld,h._modelViewMatrixArray),h.z=-h._modelViewMatrix.n34);b.__webglSprites.sort(r);e=0;for(f=b.__webglSprites.length;e<f;e++)h=b.__webglSprites[e],
-h.material===void 0&&h.map&&h.map.image&&h.map.image.width&&(h.useScreenCoordinates?(c.uniform1i(g.useScreenCoordinates,1),c.uniform3f(g.screenPosition,(h.position.x-o)/o,(p-h.position.y)/p,Math.max(0,Math.min(1,h.position.z)))):(c.uniform1i(g.useScreenCoordinates,0),c.uniform1i(g.affectedByDistance,h.affectedByDistance?1:0),c.uniformMatrix4fv(g.modelViewMatrix,!1,h._modelViewMatrixArray)),j=h.map.image.width/(h.affectedByDistance?1:_viewportHeight),m[0]=j*i*h.scale.x,m[1]=j*h.scale.y,c.uniform2f(g.uvScale,
+h.material===void 0&&h.map&&h.map.image&&h.map.image.width&&(h.useScreenCoordinates?(c.uniform1i(g.useScreenCoordinates,1),c.uniform3f(g.screenPosition,(h.position.x-o)/o,(p-h.position.y)/p,Math.max(0,Math.min(1,h.position.z)))):(c.uniform1i(g.useScreenCoordinates,0),c.uniform1i(g.affectedByDistance,h.affectedByDistance?1:0),c.uniformMatrix4fv(g.modelViewMatrix,!1,h._modelViewMatrixArray)),j=h.map.image.width/(h.scaleByViewport?_viewportHeight:1),m[0]=j*i*h.scale.x,m[1]=j*h.scale.y,c.uniform2f(g.uvScale,
 h.uvScale.x,h.uvScale.y),c.uniform2f(g.uvOffset,h.uvOffset.x,h.uvOffset.y),c.uniform2f(g.alignment,h.alignment.x,h.alignment.y),c.uniform1f(g.opacity,h.opacity),c.uniform1f(g.rotation,h.rotation),c.uniform2fv(g.scale,m),h.mergeWith3D&&!n?(c.enable(c.DEPTH_TEST),n=!0):!h.mergeWith3D&&n&&(c.disable(c.DEPTH_TEST),n=!1),y(h.blending),C(h.map,0),c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0));c.enable(c.CULL_FACE);c.enable(c.DEPTH_TEST);c.depthMask(O)}function z(b,d){var e,f,h=b.__webglLensFlares.length,
 h.uvScale.x,h.uvScale.y),c.uniform2f(g.uvOffset,h.uvOffset.x,h.uvOffset.y),c.uniform2f(g.alignment,h.alignment.x,h.alignment.y),c.uniform1f(g.opacity,h.opacity),c.uniform1f(g.rotation,h.rotation),c.uniform2fv(g.scale,m),h.mergeWith3D&&!n?(c.enable(c.DEPTH_TEST),n=!0):!h.mergeWith3D&&n&&(c.disable(c.DEPTH_TEST),n=!1),y(h.blending),C(h.map,0),c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0));c.enable(c.CULL_FACE);c.enable(c.DEPTH_TEST);c.depthMask(O)}function z(b,d){var e,f,h=b.__webglLensFlares.length,
 g,i,j,m=new THREE.Vector3,o=_viewportHeight/_viewportWidth,p=_viewportWidth*0.5,n=_viewportHeight*0.5,q=16/_viewportHeight,t=[q*o,q],r=[1,1,0],v=[1,1],B=u.uniforms;e=u.attributes;c.useProgram(u.program);ia=u.program;E=-1;pa||(c.enableVertexAttribArray(u.attributes.vertex),c.enableVertexAttribArray(u.attributes.uv),pa=!0);c.uniform1i(B.occlusionMap,0);c.uniform1i(B.map,1);c.bindBuffer(c.ARRAY_BUFFER,u.vertexBuffer);c.vertexAttribPointer(e.vertex,2,c.FLOAT,!1,16,0);c.vertexAttribPointer(e.uv,2,c.FLOAT,
 g,i,j,m=new THREE.Vector3,o=_viewportHeight/_viewportWidth,p=_viewportWidth*0.5,n=_viewportHeight*0.5,q=16/_viewportHeight,t=[q*o,q],r=[1,1,0],v=[1,1],B=u.uniforms;e=u.attributes;c.useProgram(u.program);ia=u.program;E=-1;pa||(c.enableVertexAttribArray(u.attributes.vertex),c.enableVertexAttribArray(u.attributes.uv),pa=!0);c.uniform1i(B.occlusionMap,0);c.uniform1i(B.map,1);c.bindBuffer(c.ARRAY_BUFFER,u.vertexBuffer);c.vertexAttribPointer(e.vertex,2,c.FLOAT,!1,16,0);c.vertexAttribPointer(e.uv,2,c.FLOAT,
 !1,16,8);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,u.elementBuffer);c.disable(c.CULL_FACE);c.depthMask(!1);c.activeTexture(c.TEXTURE0);c.bindTexture(c.TEXTURE_2D,u.occlusionTexture);c.activeTexture(c.TEXTURE1);for(f=0;f<h;f++)if(e=b.__webglLensFlares[f].object,m.set(e.matrixWorld.n14,e.matrixWorld.n24,e.matrixWorld.n34),d.matrixWorldInverse.multiplyVector3(m),d.projectionMatrix.multiplyVector3(m),r[0]=m.x,r[1]=m.y,r[2]=m.z,v[0]=r[0]*p+p,v[1]=r[1]*n+n,u.hasVertexTexture||v[0]>0&&v[0]<_viewportWidth&&v[1]>
 !1,16,8);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,u.elementBuffer);c.disable(c.CULL_FACE);c.depthMask(!1);c.activeTexture(c.TEXTURE0);c.bindTexture(c.TEXTURE_2D,u.occlusionTexture);c.activeTexture(c.TEXTURE1);for(f=0;f<h;f++)if(e=b.__webglLensFlares[f].object,m.set(e.matrixWorld.n14,e.matrixWorld.n24,e.matrixWorld.n34),d.matrixWorldInverse.multiplyVector3(m),d.projectionMatrix.multiplyVector3(m),r[0]=m.x,r[1]=m.y,r[2]=m.z,v[0]=r[0]*p+p,v[1]=r[1]*n+n,u.hasVertexTexture||v[0]>0&&v[0]<_viewportWidth&&v[1]>