Mr.doob 5 éve
szülő
commit
02455cf513
3 módosított fájl, 30 hozzáadás és 28 törlés
  1. 8 7
      build/three.js
  2. 14 14
      build/three.min.js
  3. 8 7
      build/three.module.js

+ 8 - 7
build/three.js

@@ -18687,7 +18687,7 @@
 
 		if ( parameters.isWebGL2 && ! parameters.isRawShaderMaterial ) {
 
-			// overwrite GLSL version for built-in materials
+			// GLSL 3.0 conversion for built-in materials and ShaderMaterial
 
 			versionString = '#version 300 es\n';
 
@@ -25956,11 +25956,7 @@
 
 			if ( material.version === materialProperties.__version ) {
 
-				if ( materialProperties.program === undefined ) {
-
-					initMaterial( material, scene, object );
-
-				} else if ( material.fog && materialProperties.fog !== fog ) {
+				if ( material.fog && materialProperties.fog !== fog ) {
 
 					initMaterial( material, scene, object );
 
@@ -42603,6 +42599,7 @@
 
 			this._startedAt = 0;
 			this._progress = 0;
+			this._connected = false;
 
 			this.filters = [];
 
@@ -42773,6 +42770,8 @@
 
 			}
 
+			this._connected = true;
+
 			return this;
 
 		};
@@ -42797,6 +42796,8 @@
 
 			}
 
+			this._connected = false;
+
 			return this;
 
 		};
@@ -42811,7 +42812,7 @@
 
 			if ( ! value ) { value = []; }
 
-			if ( this.isPlaying === true ) {
+			if ( this._connected === true ) {
 
 				this.disconnect();
 				this.filters = value;

+ 14 - 14
build/three.min.js

@@ -200,15 +200,15 @@ b.environment:null;d.envMap=ha.get(a.envMap||b);return}r=!1}r&&(c.uniforms=ka.ge
 if(!a.isShaderMaterial&&!a.isRawShaderMaterial||!0===a.clipping)d.numClippingPlanes=ia.numPlanes,d.numIntersection=ia.numIntersection,c.clippingPlanes=ia.uniform;d.environment=a.isMeshStandardMaterial?b.environment:null;d.fog=b.fog;d.envMap=ha.get(a.envMap||d.environment);d.needsLights=a.isMeshLambertMaterial||a.isMeshToonMaterial||a.isMeshPhongMaterial||a.isMeshStandardMaterial||a.isShadowMaterial||a.isShaderMaterial&&!0===a.lights;d.lightsStateVersion=h;d.needsLights&&(c.ambientLightColor.value=
 e.state.ambient,c.lightProbe.value=e.state.probe,c.directionalLights.value=e.state.directional,c.directionalLightShadows.value=e.state.directionalShadow,c.spotLights.value=e.state.spot,c.spotLightShadows.value=e.state.spotShadow,c.rectAreaLights.value=e.state.rectArea,c.ltc_1.value=e.state.rectAreaLTC1,c.ltc_2.value=e.state.rectAreaLTC2,c.pointLights.value=e.state.point,c.pointLightShadows.value=e.state.pointShadow,c.hemisphereLights.value=e.state.hemi,c.directionalShadowMap.value=e.state.directionalShadowMap,
 c.directionalShadowMatrix.value=e.state.directionalShadowMatrix,c.spotShadowMap.value=e.state.spotShadowMap,c.spotShadowMatrix.value=e.state.spotShadowMatrix,c.pointShadowMap.value=e.state.pointShadowMap,c.pointShadowMatrix.value=e.state.pointShadowMatrix);a=d.program.getUniforms();a=Rb.seqWithValue(a.seq,c);d.uniformsList=a}function k(a,b,c,d){!0!==b.isScene&&(b=xg);Z.resetTextureUnits();var e=b.fog,f=c.isMeshStandardMaterial?b.environment:null,g=null===K?ca.outputEncoding:K.texture.encoding,h=ha.get(c.envMap||
-f),l=aa.get(c),n=Q.state.lights;!0!==la||!0!==qa&&a===P||ia.setState(c,a,a===P&&c.id===L);c.version===l.__version?void 0===l.program?u(c,b,d):c.fog&&l.fog!==e?u(c,b,d):l.environment!==f?u(c,b,d):l.needsLights&&l.lightsStateVersion!==n.state.version?u(c,b,d):void 0===l.numClippingPlanes||l.numClippingPlanes===ia.numPlanes&&l.numIntersection===ia.numIntersection?l.outputEncoding!==g?u(c,b,d):l.envMap!==h&&u(c,b,d):u(c,b,d):(u(c,b,d),l.__version=c.version);var r=!1;n=h=!1;b=l.program;f=b.getUniforms();
-g=l.uniforms;ya.useProgram(b.program)&&(n=h=r=!0);c.id!==L&&(L=c.id,h=!0);if(r||P!==a){f.setValue(R,"projectionMatrix",a.projectionMatrix);Ha.logarithmicDepthBuffer&&f.setValue(R,"logDepthBufFC",2/(Math.log(a.far+1)/Math.LN2));P!==a&&(P=a,n=h=!0);if(c.isShaderMaterial||c.isMeshPhongMaterial||c.isMeshToonMaterial||c.isMeshStandardMaterial||c.envMap)r=f.map.cameraPosition,void 0!==r&&r.setValue(R,Ub.setFromMatrixPosition(a.matrixWorld));(c.isMeshPhongMaterial||c.isMeshToonMaterial||c.isMeshLambertMaterial||
-c.isMeshBasicMaterial||c.isMeshStandardMaterial||c.isShaderMaterial)&&f.setValue(R,"isOrthographic",!0===a.isOrthographicCamera);(c.isMeshPhongMaterial||c.isMeshToonMaterial||c.isMeshLambertMaterial||c.isMeshBasicMaterial||c.isMeshStandardMaterial||c.isShaderMaterial||c.isShadowMaterial||c.skinning)&&f.setValue(R,"viewMatrix",a.matrixWorldInverse)}if(c.skinning&&(f.setOptional(R,d,"bindMatrix"),f.setOptional(R,d,"bindMatrixInverse"),a=d.skeleton))if(r=a.bones,Ha.floatVertexTextures){if(void 0===a.boneTexture){r=
-Math.sqrt(4*r.length);r=T.ceilPowerOfTwo(r);r=Math.max(r,4);var k=new Float32Array(r*r*4);k.set(a.boneMatrices);var q=new nc(k,r,r,1023,1015);a.boneMatrices=k;a.boneTexture=q;a.boneTextureSize=r}f.setValue(R,"boneTexture",a.boneTexture,Z);f.setValue(R,"boneTextureSize",a.boneTextureSize)}else f.setOptional(R,a,"boneMatrices");if(h||l.receiveShadow!==d.receiveShadow)l.receiveShadow=d.receiveShadow,f.setValue(R,"receiveShadow",d.receiveShadow);h&&(f.setValue(R,"toneMappingExposure",ca.toneMappingExposure),
-l.needsLights&&(a=n,g.ambientLightColor.needsUpdate=a,g.lightProbe.needsUpdate=a,g.directionalLights.needsUpdate=a,g.directionalLightShadows.needsUpdate=a,g.pointLights.needsUpdate=a,g.pointLightShadows.needsUpdate=a,g.spotLights.needsUpdate=a,g.spotLightShadows.needsUpdate=a,g.rectAreaLights.needsUpdate=a,g.hemisphereLights.needsUpdate=a),e&&c.fog&&wa.refreshFogUniforms(g,e),wa.refreshMaterialUniforms(g,c,Y,Ua),Rb.upload(R,l.uniformsList,g,Z));c.isShaderMaterial&&!0===c.uniformsNeedUpdate&&(Rb.upload(R,
-l.uniformsList,g,Z),c.uniformsNeedUpdate=!1);c.isSpriteMaterial&&f.setValue(R,"center",d.center);f.setValue(R,"modelViewMatrix",d.modelViewMatrix);f.setValue(R,"normalMatrix",d.normalMatrix);f.setValue(R,"modelMatrix",d.matrixWorld);return b}c=c||{};var v=void 0!==c.canvas?c.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),t=void 0!==c.context?c.context:null,w=void 0!==c.alpha?c.alpha:!1,C=void 0!==c.depth?c.depth:!0,y=void 0!==c.stencil?c.stencil:!0,E=void 0!==c.antialias?
-c.antialias:!1,D=void 0!==c.premultipliedAlpha?c.premultipliedAlpha:!0,x=void 0!==c.preserveDrawingBuffer?c.preserveDrawingBuffer:!1,H=void 0!==c.powerPreference?c.powerPreference:"default",A=void 0!==c.failIfMajorPerformanceCaveat?c.failIfMajorPerformanceCaveat:!1,M=null,Q=null;this.domElement=v;this.debug={checkShaderErrors:!0};this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.clippingPlanes=[];this.localClippingEnabled=!1;this.gammaFactor=2;this.outputEncoding=
-3E3;this.physicallyCorrectLights=!1;this.toneMapping=0;this.toneMappingExposure=1;this.maxMorphTargets=8;this.maxMorphNormals=4;var ca=this,J=!1,I=null,F=0,G=0,K=null,N=null,L=-1,P=null,O=null,V=new B,X=new B,U=null,S=v.width,Ua=v.height,Y=1,da=null,ea=null,W=new B(0,0,S,Ua),ba=new B(0,0,S,Ua),fa=!1,na=new Ma,la=!1,qa=!1,Xd=new z,Ub=new m,xg={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},R=t;try{t={alpha:w,depth:C,stencil:y,antialias:E,premultipliedAlpha:D,preserveDrawingBuffer:x,
-powerPreference:H,failIfMajorPerformanceCaveat:A};v.addEventListener("webglcontextlost",d,!1);v.addEventListener("webglcontextrestored",e,!1);if(null===R&&(w=["webgl2","webgl","experimental-webgl"],!0===ca.isWebGL1Renderer&&w.shift(),R=a(w,t),null===R)){if(a(w))throw Error("Error creating WebGL context with your selected attributes.");throw Error("Error creating WebGL context.");}void 0===R.getShaderPrecisionFormat&&(R.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch($h){throw console.error("THREE.WebGLRenderer: "+
+f),l=aa.get(c),n=Q.state.lights;!0!==la||!0!==qa&&a===P||ia.setState(c,a,a===P&&c.id===L);c.version===l.__version?c.fog&&l.fog!==e?u(c,b,d):l.environment!==f?u(c,b,d):l.needsLights&&l.lightsStateVersion!==n.state.version?u(c,b,d):void 0===l.numClippingPlanes||l.numClippingPlanes===ia.numPlanes&&l.numIntersection===ia.numIntersection?l.outputEncoding!==g?u(c,b,d):l.envMap!==h&&u(c,b,d):u(c,b,d):(u(c,b,d),l.__version=c.version);var r=!1;n=h=!1;b=l.program;f=b.getUniforms();g=l.uniforms;ya.useProgram(b.program)&&
+(n=h=r=!0);c.id!==L&&(L=c.id,h=!0);if(r||P!==a){f.setValue(R,"projectionMatrix",a.projectionMatrix);Ha.logarithmicDepthBuffer&&f.setValue(R,"logDepthBufFC",2/(Math.log(a.far+1)/Math.LN2));P!==a&&(P=a,n=h=!0);if(c.isShaderMaterial||c.isMeshPhongMaterial||c.isMeshToonMaterial||c.isMeshStandardMaterial||c.envMap)r=f.map.cameraPosition,void 0!==r&&r.setValue(R,Ub.setFromMatrixPosition(a.matrixWorld));(c.isMeshPhongMaterial||c.isMeshToonMaterial||c.isMeshLambertMaterial||c.isMeshBasicMaterial||c.isMeshStandardMaterial||
+c.isShaderMaterial)&&f.setValue(R,"isOrthographic",!0===a.isOrthographicCamera);(c.isMeshPhongMaterial||c.isMeshToonMaterial||c.isMeshLambertMaterial||c.isMeshBasicMaterial||c.isMeshStandardMaterial||c.isShaderMaterial||c.isShadowMaterial||c.skinning)&&f.setValue(R,"viewMatrix",a.matrixWorldInverse)}if(c.skinning&&(f.setOptional(R,d,"bindMatrix"),f.setOptional(R,d,"bindMatrixInverse"),a=d.skeleton))if(r=a.bones,Ha.floatVertexTextures){if(void 0===a.boneTexture){r=Math.sqrt(4*r.length);r=T.ceilPowerOfTwo(r);
+r=Math.max(r,4);var k=new Float32Array(r*r*4);k.set(a.boneMatrices);var q=new nc(k,r,r,1023,1015);a.boneMatrices=k;a.boneTexture=q;a.boneTextureSize=r}f.setValue(R,"boneTexture",a.boneTexture,Z);f.setValue(R,"boneTextureSize",a.boneTextureSize)}else f.setOptional(R,a,"boneMatrices");if(h||l.receiveShadow!==d.receiveShadow)l.receiveShadow=d.receiveShadow,f.setValue(R,"receiveShadow",d.receiveShadow);h&&(f.setValue(R,"toneMappingExposure",ca.toneMappingExposure),l.needsLights&&(a=n,g.ambientLightColor.needsUpdate=
+a,g.lightProbe.needsUpdate=a,g.directionalLights.needsUpdate=a,g.directionalLightShadows.needsUpdate=a,g.pointLights.needsUpdate=a,g.pointLightShadows.needsUpdate=a,g.spotLights.needsUpdate=a,g.spotLightShadows.needsUpdate=a,g.rectAreaLights.needsUpdate=a,g.hemisphereLights.needsUpdate=a),e&&c.fog&&wa.refreshFogUniforms(g,e),wa.refreshMaterialUniforms(g,c,Y,Ua),Rb.upload(R,l.uniformsList,g,Z));c.isShaderMaterial&&!0===c.uniformsNeedUpdate&&(Rb.upload(R,l.uniformsList,g,Z),c.uniformsNeedUpdate=!1);
+c.isSpriteMaterial&&f.setValue(R,"center",d.center);f.setValue(R,"modelViewMatrix",d.modelViewMatrix);f.setValue(R,"normalMatrix",d.normalMatrix);f.setValue(R,"modelMatrix",d.matrixWorld);return b}c=c||{};var v=void 0!==c.canvas?c.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),t=void 0!==c.context?c.context:null,w=void 0!==c.alpha?c.alpha:!1,C=void 0!==c.depth?c.depth:!0,y=void 0!==c.stencil?c.stencil:!0,E=void 0!==c.antialias?c.antialias:!1,D=void 0!==c.premultipliedAlpha?
+c.premultipliedAlpha:!0,x=void 0!==c.preserveDrawingBuffer?c.preserveDrawingBuffer:!1,H=void 0!==c.powerPreference?c.powerPreference:"default",A=void 0!==c.failIfMajorPerformanceCaveat?c.failIfMajorPerformanceCaveat:!1,M=null,Q=null;this.domElement=v;this.debug={checkShaderErrors:!0};this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.clippingPlanes=[];this.localClippingEnabled=!1;this.gammaFactor=2;this.outputEncoding=3E3;this.physicallyCorrectLights=
+!1;this.toneMapping=0;this.toneMappingExposure=1;this.maxMorphTargets=8;this.maxMorphNormals=4;var ca=this,J=!1,I=null,F=0,G=0,K=null,N=null,L=-1,P=null,O=null,V=new B,X=new B,U=null,S=v.width,Ua=v.height,Y=1,da=null,ea=null,W=new B(0,0,S,Ua),ba=new B(0,0,S,Ua),fa=!1,na=new Ma,la=!1,qa=!1,Xd=new z,Ub=new m,xg={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},R=t;try{t={alpha:w,depth:C,stencil:y,antialias:E,premultipliedAlpha:D,preserveDrawingBuffer:x,powerPreference:H,failIfMajorPerformanceCaveat:A};
+v.addEventListener("webglcontextlost",d,!1);v.addEventListener("webglcontextrestored",e,!1);if(null===R&&(w=["webgl2","webgl","experimental-webgl"],!0===ca.isWebGL1Renderer&&w.shift(),R=a(w,t),null===R)){if(a(w))throw Error("Error creating WebGL context with your selected attributes.");throw Error("Error creating WebGL context.");}void 0===R.getShaderPrecisionFormat&&(R.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch($h){throw console.error("THREE.WebGLRenderer: "+
 $h.message),$h;}var xa,Ha,ya,pb,aa,Z,ha,pa,sa,ma,ka,wa,va,ta,ia,ra,Ba,Ca,Da,ua,oa;b();var za=new Zh(ca,R);this.xr=za;var Fa=new Xh(ca,ma,Ha.maxTextureSize);this.shadowMap=Fa;this.getContext=function(){return R};this.getContextAttributes=function(){return R.getContextAttributes()};this.forceContextLoss=function(){var a=xa.get("WEBGL_lose_context");a&&a.loseContext()};this.forceContextRestore=function(){var a=xa.get("WEBGL_lose_context");a&&a.restoreContext()};this.getPixelRatio=function(){return Y};
 this.setPixelRatio=function(a){void 0!==a&&(Y=a,this.setSize(S,Ua,!1))};this.getSize=function(a){void 0===a&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),a=new p);return a.set(S,Ua)};this.setSize=function(a,b,c){za.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(S=a,Ua=b,v.width=Math.floor(a*Y),v.height=Math.floor(b*Y),!1!==c&&(v.style.width=a+"px",v.style.height=b+"px"),this.setViewport(0,0,a,b))};this.getDrawingBufferSize=
 function(a){void 0===a&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),a=new p);return a.set(S*Y,Ua*Y).floor()};this.setDrawingBufferSize=function(a,b,c){S=a;Ua=b;Y=c;v.width=Math.floor(a*c);v.height=Math.floor(b*c);this.setViewport(0,0,a,b)};this.getCurrentViewport=function(a){void 0===a&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),a=new B);return a.copy(V)};this.getViewport=function(a){return a.copy(W)};
@@ -319,9 +319,9 @@ new wf}function yf(c,a){la.call(this,c,a);this.type="AmbientLight";this.castShad
 N.call(this,c,a,b);this.meshPerAttribute=d||1}function Cf(c){ba.call(this,c)}function Df(c){ba.call(this,c)}function Kg(c){"undefined"===typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported.");"undefined"===typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported.");ba.call(this,c);this.options={premultiplyAlpha:"none"}}function Lg(){this.type="ShapePath";this.color=new x;this.subPaths=[];this.currentPath=null}function Mg(c){this.type=
 "Font";this.data=c}function Ng(c){ba.call(this,c)}function Ef(c){ba.call(this,c)}function Og(c,a,b){cb.call(this,void 0,b);c=(new x).set(c);b=(new x).set(a);a=new m(c.r,c.g,c.b);c=new m(b.r,b.g,b.b);b=Math.sqrt(Math.PI);var d=b*Math.sqrt(.75);this.sh.coefficients[0].copy(a).add(c).multiplyScalar(b);this.sh.coefficients[1].copy(a).sub(c).multiplyScalar(d)}function Pg(c,a){cb.call(this,void 0,a);c=(new x).set(c);this.sh.coefficients[0].set(c.r,c.g,c.b).multiplyScalar(2*Math.sqrt(Math.PI))}function li(){this.type=
 "StereoCamera";this.aspect=1;this.eyeSep=.064;this.cameraL=new ta;this.cameraL.layers.enable(1);this.cameraL.matrixAutoUpdate=!1;this.cameraR=new ta;this.cameraR.layers.enable(2);this.cameraR.matrixAutoUpdate=!1;this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}function kb(){F.call(this);this.type="AudioListener";this.context=Qg.getContext();this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.filter=null;this.timeDelta=0;this._clock=
-new rd}function da(c){F.call(this);this.type="Audio";this.listener=c;this.context=c.context;this.gain=this.context.createGain();this.gain.connect(c.getInput());this.autoplay=!1;this.buffer=null;this.detune=0;this.loop=!1;this.offset=this.loopEnd=this.loopStart=0;this.duration=void 0;this.playbackRate=1;this.isPlaying=!1;this.hasPlaybackControl=!0;this.source=null;this.sourceType="empty";this._progress=this._startedAt=0;this.filters=[]}function Ia(c){da.call(this,c);this.panner=this.context.createPanner();
-this.panner.panningModel="HRTF";this.panner.connect(this.gain)}function Rg(c,a,b){this.binding=c;this.valueSize=b;switch(a){case "quaternion":c=this._slerp;a=this._slerpAdditive;var d=this._setAdditiveIdentityQuaternion;this.buffer=new Float64Array(6*b);this._workIndex=5;break;case "string":case "bool":a=c=this._select;d=this._setAdditiveIdentityOther;this.buffer=Array(5*b);break;default:c=this._lerp,a=this._lerpAdditive,d=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*b)}this._mixBufferRegion=
-c;this._mixBufferRegionAdditive=a;this._setIdentity=d;this._origIndex=3;this._addIndex=4;this.referenceCount=this.useCount=this.cumulativeWeightAdditive=this.cumulativeWeight=0}function mi(c,a,b){b=b||Fa.parseTrackName(a);this._targetGroup=c;this._bindings=c.subscribe_(a,b)}function Fa(c,a,b){this.path=a;this.parsedPath=b||Fa.parseTrackName(a);this.node=Fa.findNode(c,this.parsedPath.nodeName)||c;this.rootNode=c}function ni(){this.uuid=T.generateUUID();this._objects=Array.prototype.slice.call(arguments);
+new rd}function da(c){F.call(this);this.type="Audio";this.listener=c;this.context=c.context;this.gain=this.context.createGain();this.gain.connect(c.getInput());this.autoplay=!1;this.buffer=null;this.detune=0;this.loop=!1;this.offset=this.loopEnd=this.loopStart=0;this.duration=void 0;this.playbackRate=1;this.isPlaying=!1;this.hasPlaybackControl=!0;this.source=null;this.sourceType="empty";this._progress=this._startedAt=0;this._connected=!1;this.filters=[]}function Ia(c){da.call(this,c);this.panner=
+this.context.createPanner();this.panner.panningModel="HRTF";this.panner.connect(this.gain)}function Rg(c,a,b){this.binding=c;this.valueSize=b;switch(a){case "quaternion":c=this._slerp;a=this._slerpAdditive;var d=this._setAdditiveIdentityQuaternion;this.buffer=new Float64Array(6*b);this._workIndex=5;break;case "string":case "bool":a=c=this._select;d=this._setAdditiveIdentityOther;this.buffer=Array(5*b);break;default:c=this._lerp,a=this._lerpAdditive,d=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*
+b)}this._mixBufferRegion=c;this._mixBufferRegionAdditive=a;this._setIdentity=d;this._origIndex=3;this._addIndex=4;this.referenceCount=this.useCount=this.cumulativeWeightAdditive=this.cumulativeWeight=0}function mi(c,a,b){b=b||Fa.parseTrackName(a);this._targetGroup=c;this._bindings=c.subscribe_(a,b)}function Fa(c,a,b){this.path=a;this.parsedPath=b||Fa.parseTrackName(a);this.node=Fa.findNode(c,this.parsedPath.nodeName)||c;this.rootNode=c}function ni(){this.uuid=T.generateUUID();this._objects=Array.prototype.slice.call(arguments);
 this.nCachedObjects_=0;var c={};this._indicesByUUID=c;for(var a=0,b=arguments.length;a!==b;++a)c[arguments[a].uuid]=a;this._paths=[];this._parsedPaths=[];this._bindings=[];this._bindingsIndicesByPath={};var d=this;this.stats={objects:{get total(){return d._objects.length},get inUse(){return this.total-d.nCachedObjects_}},get bindingsPerObject(){return d._bindings.length}}}function Sg(c){this._root=c;this._initMemoryManager();this.time=this._accuIndex=0;this.timeScale=1}function Tg(c,a,b){Va.call(this,
 c,a);this.meshPerAttribute=b||1}function Ug(c,a,b,d,e){this.buffer=c;this.type=a;this.itemSize=b;this.elementSize=d;this.count=e;this.version=0}function Vg(c,a,b,d){this.ray=new qa(c,a);this.near=b||0;this.far=d||Infinity;this.camera=null;this.layers=new nb;this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}};Object.defineProperties(this.params,{PointCloud:{get:function(){console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points.");return this.Points}}})}
 function oi(c,a){return c.distance-a.distance}function Wg(c,a,b,d){c.layers.test(a.layers)&&c.raycast(a,b);if(!0===d){c=c.children;d=0;for(var e=c.length;d<e;d++)Wg(c[d],a,b,!0)}}function Ce(c){F.call(this);this.material=c;this.render=function(){};this.hasUvs=this.hasColors=this.hasNormals=this.hasPositions=!1;this.uvArray=this.colorArray=this.normalArray=this.positionArray=null;this.count=0}function sd(c,a){F.call(this);this.light=c;this.light.updateMatrixWorld();this.matrix=c.matrixWorld;this.matrixAutoUpdate=
@@ -904,8 +904,8 @@ b.x,b.y,b.z)};da.prototype=Object.create(F.prototype);da.prototype.constructor=d
 !1;this.sourceType="mediaStreamNode";this.source=this.context.createMediaStreamSource(a);this.connect();return this};da.prototype.setBuffer=function(a){this.buffer=a;this.sourceType="buffer";this.autoplay&&this.play();return this};da.prototype.play=function(a){void 0===a&&(a=0);if(!0===this.isPlaying)console.warn("THREE.Audio: Audio is already playing.");else if(!1===this.hasPlaybackControl)console.warn("THREE.Audio: this Audio has no playback control.");else return this._startedAt=this.context.currentTime+
 a,a=this.context.createBufferSource(),a.buffer=this.buffer,a.loop=this.loop,a.loopStart=this.loopStart,a.loopEnd=this.loopEnd,a.onended=this.onEnded.bind(this),a.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=a,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()};da.prototype.pause=function(){if(!1===this.hasPlaybackControl)console.warn("THREE.Audio: this Audio has no playback control.");else return!0===this.isPlaying&&
 (this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress%=this.duration||this.buffer.duration),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this};da.prototype.stop=function(){if(!1===this.hasPlaybackControl)console.warn("THREE.Audio: this Audio has no playback control.");else return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this};da.prototype.connect=function(){if(0<this.filters.length){this.source.connect(this.filters[0]);
-for(var a=1,b=this.filters.length;a<b;a++)this.filters[a-1].connect(this.filters[a]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this};da.prototype.disconnect=function(){if(0<this.filters.length){this.source.disconnect(this.filters[0]);for(var a=1,b=this.filters.length;a<b;a++)this.filters[a-1].disconnect(this.filters[a]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());
-return this};da.prototype.getFilters=function(){return this.filters};da.prototype.setFilters=function(a){a||(a=[]);!0===this.isPlaying?(this.disconnect(),this.filters=a,this.connect()):this.filters=a;return this};da.prototype.setDetune=function(a){this.detune=a;if(void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this};da.prototype.getDetune=function(){return this.detune};da.prototype.getFilter=function(){return this.getFilters()[0]};
+for(var a=1,b=this.filters.length;a<b;a++)this.filters[a-1].connect(this.filters[a]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());this._connected=!0;return this};da.prototype.disconnect=function(){if(0<this.filters.length){this.source.disconnect(this.filters[0]);for(var a=1,b=this.filters.length;a<b;a++)this.filters[a-1].disconnect(this.filters[a]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());
+this._connected=!1;return this};da.prototype.getFilters=function(){return this.filters};da.prototype.setFilters=function(a){a||(a=[]);!0===this._connected?(this.disconnect(),this.filters=a,this.connect()):this.filters=a;return this};da.prototype.setDetune=function(a){this.detune=a;if(void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this};da.prototype.getDetune=function(){return this.detune};da.prototype.getFilter=function(){return this.getFilters()[0]};
 da.prototype.setFilter=function(a){return this.setFilters(a?[a]:[])};da.prototype.setPlaybackRate=function(a){if(!1===this.hasPlaybackControl)console.warn("THREE.Audio: this Audio has no playback control.");else return this.playbackRate=a,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this};da.prototype.getPlaybackRate=function(){return this.playbackRate};da.prototype.onEnded=function(){this.isPlaying=!1};da.prototype.getLoop=function(){return!1===
 this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop};da.prototype.setLoop=function(a){if(!1===this.hasPlaybackControl)console.warn("THREE.Audio: this Audio has no playback control.");else return this.loop=a,!0===this.isPlaying&&(this.source.loop=this.loop),this};da.prototype.setLoopStart=function(a){this.loopStart=a;return this};da.prototype.setLoopEnd=function(a){this.loopEnd=a;return this};da.prototype.getVolume=function(){return this.gain.gain.value};
 da.prototype.setVolume=function(a){this.gain.gain.setTargetAtTime(a,this.context.currentTime,.01);return this};var Jc=new m,Ui=new O,$k=new m,Kc=new m;Ia.prototype=Object.create(da.prototype);Ia.prototype.constructor=Ia;Ia.prototype.getOutput=function(){return this.panner};Ia.prototype.getRefDistance=function(){return this.panner.refDistance};Ia.prototype.setRefDistance=function(a){this.panner.refDistance=a;return this};Ia.prototype.getRolloffFactor=function(){return this.panner.rolloffFactor};Ia.prototype.setRolloffFactor=

+ 8 - 7
build/three.module.js

@@ -18744,7 +18744,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
 
 	if ( parameters.isWebGL2 && ! parameters.isRawShaderMaterial ) {
 
-		// overwrite GLSL version for built-in materials
+		// GLSL 3.0 conversion for built-in materials and ShaderMaterial
 
 		versionString = '#version 300 es\n';
 
@@ -26018,11 +26018,7 @@ function WebGLRenderer( parameters ) {
 
 		if ( material.version === materialProperties.__version ) {
 
-			if ( materialProperties.program === undefined ) {
-
-				initMaterial( material, scene, object );
-
-			} else if ( material.fog && materialProperties.fog !== fog ) {
+			if ( material.fog && materialProperties.fog !== fog ) {
 
 				initMaterial( material, scene, object );
 
@@ -42719,6 +42715,7 @@ class Audio extends Object3D {
 
 		this._startedAt = 0;
 		this._progress = 0;
+		this._connected = false;
 
 		this.filters = [];
 
@@ -42886,6 +42883,8 @@ class Audio extends Object3D {
 
 		}
 
+		this._connected = true;
+
 		return this;
 
 	}
@@ -42910,6 +42909,8 @@ class Audio extends Object3D {
 
 		}
 
+		this._connected = false;
+
 		return this;
 
 	}
@@ -42924,7 +42925,7 @@ class Audio extends Object3D {
 
 		if ( ! value ) value = [];
 
-		if ( this.isPlaying === true ) {
+		if ( this._connected === true ) {
 
 			this.disconnect();
 			this.filters = value;