Quellcode durchsuchen

Updated builds.

Mr.doob vor 5 Jahren
Ursprung
Commit
3c13d929f8
3 geänderte Dateien mit 41 neuen und 41 gelöschten Zeilen
  1. 1 1
      build/three.js
  2. 39 39
      build/three.min.js
  3. 1 1
      build/three.module.js

+ 1 - 1
build/three.js

@@ -24831,7 +24831,6 @@
 
 				materialProperties.program = program;
 				materialProperties.uniforms = parameters.uniforms;
-				materialProperties.environment = material.isMeshStandardMaterial ? scene.environment : null;
 				materialProperties.outputEncoding = _this.outputEncoding;
 				material.program = program;
 
@@ -24883,6 +24882,7 @@
 
 			}
 
+			materialProperties.environment = material.isMeshStandardMaterial ? scene.environment : null;
 			materialProperties.fog = scene.fog;
 
 			// store the light setup it was created for

+ 39 - 39
build/three.min.js

@@ -177,45 +177,45 @@ a.autoUpdate&&a.update(b);else if(a.isLight)A.pushLight(a),a.castShadow&&A.pushS
 (a.skeleton.update(),a.skeleton.frame=ea.render.frame),!a.frustumCulled||gg.intersectsObject(a))if(d&&Gb.setFromMatrixPosition(a.matrixWorld).applyMatrix4(Jd),e=sa.update(a),f=a.material,Array.isArray(f))for(var g=e.groups,h=0,m=g.length;h<m;h++){var p=g[h],k=f[p.materialIndex];k&&k.visible&&C.push(a,e,k,c,Gb.z,p)}else f.visible&&C.push(a,e,f,c,Gb.z,null);a=a.children;h=0;for(m=a.length;h<m;h++)l(a[h],b,c,d)}}function m(a,b,c,d){for(var e=0,f=a.length;e<f;e++){var g=a[e],h=g.object,l=g.geometry,m=
 void 0===d?g.material:d;g=g.group;if(c.isArrayCamera){T=c;for(var p=c.cameras,u=0,q=p.length;u<q;u++){var x=p[u];h.layers.test(x.layers)&&(X.viewport(Z.copy(x.viewport)),A.setupLights(x),k(h,b,x,l,m,g))}}else T=null,k(h,b,c,l,m,g)}}function k(a,c,d,e,f,g){a.onBeforeRender(H,c,d,e,f,g);A=va.get(c,T||d);a.modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,a.matrixWorld);a.normalMatrix.getNormalMatrix(a.modelViewMatrix);if(a.isImmediateRenderObject){var l=x(d,c,f,a);X.setMaterial(f);da=b=null;Le=
 !1;h(a,l)}else H.renderBufferDirect(d,c,e,f,a,g);a.onAfterRender(H,c,d,e,f,g);A=va.get(c,T||d)}function p(a,b,c){var d=Y.get(a),e=A.state.lights,h=e.state.version;c=ua.getParameters(a,e.state,A.state.shadowsArray,b,Ua.numPlanes,Ua.numIntersection,c);var l=ua.getProgramCacheKey(c),m=d.program,p=!0;if(void 0===m)a.addEventListener("dispose",f);else if(m.cacheKey!==l)g(a);else{if(d.lightsStateVersion!==h)d.lightsStateVersion=h;else if(void 0!==c.shaderID)return;p=!1}p&&(m=ua.acquireProgram(c,l),d.program=
-m,d.uniforms=c.uniforms,d.environment=a.isMeshStandardMaterial?b.environment:null,d.outputEncoding=H.outputEncoding,a.program=m);c=m.getAttributes();if(a.morphTargets)for(l=a.numSupportedMorphTargets=0;l<H.maxMorphTargets;l++)0<=c["morphTarget"+l]&&a.numSupportedMorphTargets++;if(a.morphNormals)for(l=a.numSupportedMorphNormals=0;l<H.maxMorphNormals;l++)0<=c["morphNormal"+l]&&a.numSupportedMorphNormals++;c=d.uniforms;if(!a.isShaderMaterial&&!a.isRawShaderMaterial||!0===a.clipping)d.numClippingPlanes=
-Ua.numPlanes,d.numIntersection=Ua.numIntersection,c.clippingPlanes=Ua.uniform;d.fog=b.fog;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.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=Db.seqWithValue(a.seq,c);d.uniformsList=a}function x(a,b,c,d){aa.resetTextureUnits();var e=b.fog,f=c.isMeshStandardMaterial?b.environment:null,g=Y.get(c),h=A.state.lights;ma&&(hg||a!==V)&&Ua.setState(c.clippingPlanes,c.clipIntersection,c.clipShadows,a,g,a===V&&c.id===Ke);c.version===g.__version?void 0===g.program?p(c,b,d):c.fog&&g.fog!==e?p(c,b,d):g.environment!==f?p(c,b,d):g.needsLights&&g.lightsStateVersion!==h.state.version?p(c,b,d):void 0===g.numClippingPlanes||g.numClippingPlanes===
-Ua.numPlanes&&g.numIntersection===Ua.numIntersection?g.outputEncoding!==H.outputEncoding&&p(c,b,d):p(c,b,d):(p(c,b,d),g.__version=c.version);var l=!1,m=!1,k=!1;b=g.program;h=b.getUniforms();var u=g.uniforms;X.useProgram(b.program)&&(k=m=l=!0);c.id!==Ke&&(Ke=c.id,m=!0);if(l||V!==a){h.setValue(I,"projectionMatrix",a.projectionMatrix);Fa.logarithmicDepthBuffer&&h.setValue(I,"logDepthBufFC",2/(Math.log(a.far+1)/Math.LN2));V!==a&&(V=a,k=m=!0);if(c.isShaderMaterial||c.isMeshPhongMaterial||c.isMeshToonMaterial||
-c.isMeshStandardMaterial||c.envMap)l=h.map.cameraPosition,void 0!==l&&l.setValue(I,Gb.setFromMatrixPosition(a.matrixWorld));(c.isMeshPhongMaterial||c.isMeshToonMaterial||c.isMeshLambertMaterial||c.isMeshBasicMaterial||c.isMeshStandardMaterial||c.isShaderMaterial)&&h.setValue(I,"isOrthographic",!0===a.isOrthographicCamera);(c.isMeshPhongMaterial||c.isMeshToonMaterial||c.isMeshLambertMaterial||c.isMeshBasicMaterial||c.isMeshStandardMaterial||c.isShaderMaterial||c.skinning)&&h.setValue(I,"viewMatrix",
-a.matrixWorldInverse)}if(c.skinning&&(h.setOptional(I,d,"bindMatrix"),h.setOptional(I,d,"bindMatrixInverse"),a=d.skeleton))if(l=a.bones,Fa.floatVertexTextures){if(void 0===a.boneTexture){l=Math.sqrt(4*l.length);l=L.ceilPowerOfTwo(l);l=Math.max(l,4);var x=new Float32Array(l*l*4);x.set(a.boneMatrices);var v=new Yb(x,l,l,1023,1015);a.boneMatrices=x;a.boneTexture=v;a.boneTextureSize=l}h.setValue(I,"boneTexture",a.boneTexture,aa);h.setValue(I,"boneTextureSize",a.boneTextureSize)}else h.setOptional(I,a,
-"boneMatrices");if(m||g.receiveShadow!==d.receiveShadow)g.receiveShadow=d.receiveShadow,h.setValue(I,"receiveShadow",d.receiveShadow);if(m){h.setValue(I,"toneMappingExposure",H.toneMappingExposure);h.setValue(I,"toneMappingWhitePoint",H.toneMappingWhitePoint);g.needsLights&&(m=k,u.ambientLightColor.needsUpdate=m,u.lightProbe.needsUpdate=m,u.directionalLights.needsUpdate=m,u.directionalLightShadows.needsUpdate=m,u.pointLights.needsUpdate=m,u.pointLightShadows.needsUpdate=m,u.spotLights.needsUpdate=
-m,u.spotLightShadows.needsUpdate=m,u.rectAreaLights.needsUpdate=m,u.hemisphereLights.needsUpdate=m);e&&c.fog&&(u.fogColor.value.copy(e.color),e.isFog?(u.fogNear.value=e.near,u.fogFar.value=e.far):e.isFogExp2&&(u.fogDensity.value=e.density));if(c.isMeshBasicMaterial)r(u,c);else if(c.isMeshLambertMaterial)r(u,c),c.emissiveMap&&(u.emissiveMap.value=c.emissiveMap);else if(c.isMeshToonMaterial)r(u,c),u.specular.value.copy(c.specular),u.shininess.value=Math.max(c.shininess,1E-4),c.gradientMap&&(u.gradientMap.value=
-c.gradientMap),c.emissiveMap&&(u.emissiveMap.value=c.emissiveMap),c.bumpMap&&(u.bumpMap.value=c.bumpMap,u.bumpScale.value=c.bumpScale,1===c.side&&(u.bumpScale.value*=-1)),c.normalMap&&(u.normalMap.value=c.normalMap,u.normalScale.value.copy(c.normalScale),1===c.side&&u.normalScale.value.negate()),c.displacementMap&&(u.displacementMap.value=c.displacementMap,u.displacementScale.value=c.displacementScale,u.displacementBias.value=c.displacementBias);else if(c.isMeshPhongMaterial)r(u,c),u.specular.value.copy(c.specular),
-u.shininess.value=Math.max(c.shininess,1E-4),c.emissiveMap&&(u.emissiveMap.value=c.emissiveMap),c.bumpMap&&(u.bumpMap.value=c.bumpMap,u.bumpScale.value=c.bumpScale,1===c.side&&(u.bumpScale.value*=-1)),c.normalMap&&(u.normalMap.value=c.normalMap,u.normalScale.value.copy(c.normalScale),1===c.side&&u.normalScale.value.negate()),c.displacementMap&&(u.displacementMap.value=c.displacementMap,u.displacementScale.value=c.displacementScale,u.displacementBias.value=c.displacementBias);else if(c.isMeshStandardMaterial)r(u,
-c,f),c.isMeshPhysicalMaterial?(q(u,c,f),u.reflectivity.value=c.reflectivity,u.clearcoat.value=c.clearcoat,u.clearcoatRoughness.value=c.clearcoatRoughness,c.sheen&&u.sheen.value.copy(c.sheen),c.clearcoatMap&&(u.clearcoatMap.value=c.clearcoatMap),c.clearcoatRoughnessMap&&(u.clearcoatRoughnessMap.value=c.clearcoatRoughnessMap),c.clearcoatNormalMap&&(u.clearcoatNormalScale.value.copy(c.clearcoatNormalScale),u.clearcoatNormalMap.value=c.clearcoatNormalMap,1===c.side&&u.clearcoatNormalScale.value.negate()),
-u.transparency.value=c.transparency):q(u,c,f);else if(c.isMeshMatcapMaterial)r(u,c),c.matcap&&(u.matcap.value=c.matcap),c.bumpMap&&(u.bumpMap.value=c.bumpMap,u.bumpScale.value=c.bumpScale,1===c.side&&(u.bumpScale.value*=-1)),c.normalMap&&(u.normalMap.value=c.normalMap,u.normalScale.value.copy(c.normalScale),1===c.side&&u.normalScale.value.negate()),c.displacementMap&&(u.displacementMap.value=c.displacementMap,u.displacementScale.value=c.displacementScale,u.displacementBias.value=c.displacementBias);
-else if(c.isMeshDepthMaterial)r(u,c),c.displacementMap&&(u.displacementMap.value=c.displacementMap,u.displacementScale.value=c.displacementScale,u.displacementBias.value=c.displacementBias);else if(c.isMeshDistanceMaterial)r(u,c),c.displacementMap&&(u.displacementMap.value=c.displacementMap,u.displacementScale.value=c.displacementScale,u.displacementBias.value=c.displacementBias),u.referencePosition.value.copy(c.referencePosition),u.nearDistance.value=c.nearDistance,u.farDistance.value=c.farDistance;
-else if(c.isMeshNormalMaterial)r(u,c),c.bumpMap&&(u.bumpMap.value=c.bumpMap,u.bumpScale.value=c.bumpScale,1===c.side&&(u.bumpScale.value*=-1)),c.normalMap&&(u.normalMap.value=c.normalMap,u.normalScale.value.copy(c.normalScale),1===c.side&&u.normalScale.value.negate()),c.displacementMap&&(u.displacementMap.value=c.displacementMap,u.displacementScale.value=c.displacementScale,u.displacementBias.value=c.displacementBias);else if(c.isLineBasicMaterial)u.diffuse.value.copy(c.color),u.opacity.value=c.opacity,
-c.isLineDashedMaterial&&(u.dashSize.value=c.dashSize,u.totalSize.value=c.dashSize+c.gapSize,u.scale.value=c.scale);else if(c.isPointsMaterial){u.diffuse.value.copy(c.color);u.opacity.value=c.opacity;u.size.value=c.size*Q;u.scale.value=.5*J;c.map&&(u.map.value=c.map);c.alphaMap&&(u.alphaMap.value=c.alphaMap);if(c.map)var n=c.map;else c.alphaMap&&(n=c.alphaMap);void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),u.uvTransform.value.copy(n.matrix))}else if(c.isSpriteMaterial){u.diffuse.value.copy(c.color);
-u.opacity.value=c.opacity;u.rotation.value=c.rotation;c.map&&(u.map.value=c.map);c.alphaMap&&(u.alphaMap.value=c.alphaMap);if(c.map)var w=c.map;else c.alphaMap&&(w=c.alphaMap);void 0!==w&&(!0===w.matrixAutoUpdate&&w.updateMatrix(),u.uvTransform.value.copy(w.matrix))}else c.isShadowMaterial&&(u.color.value.copy(c.color),u.opacity.value=c.opacity);void 0!==u.ltc_1&&(u.ltc_1.value=D.LTC_1);void 0!==u.ltc_2&&(u.ltc_2.value=D.LTC_2);Db.upload(I,g.uniformsList,u,aa);c.isShaderMaterial&&(c.uniformsNeedUpdate=
-!1)}c.isShaderMaterial&&!0===c.uniformsNeedUpdate&&(Db.upload(I,g.uniformsList,u,aa),c.uniformsNeedUpdate=!1);c.isSpriteMaterial&&h.setValue(I,"center",d.center);h.setValue(I,"modelViewMatrix",d.modelViewMatrix);h.setValue(I,"normalMatrix",d.normalMatrix);h.setValue(I,"modelMatrix",d.matrixWorld);return b}function r(a,b,c){a.opacity.value=b.opacity;b.color&&a.diffuse.value.copy(b.color);b.emissive&&a.emissive.value.copy(b.emissive).multiplyScalar(b.emissiveIntensity);b.map&&(a.map.value=b.map);b.alphaMap&&
-(a.alphaMap.value=b.alphaMap);b.specularMap&&(a.specularMap.value=b.specularMap);if(c=b.envMap||c)a.envMap.value=c,a.flipEnvMap.value=c.isCubeTexture?-1:1,a.reflectivity.value=b.reflectivity,a.refractionRatio.value=b.refractionRatio,a.maxMipLevel.value=Y.get(c).__maxMipLevel;b.lightMap&&(a.lightMap.value=b.lightMap,a.lightMapIntensity.value=b.lightMapIntensity);b.aoMap&&(a.aoMap.value=b.aoMap,a.aoMapIntensity.value=b.aoMapIntensity);if(b.map)var d=b.map;else b.specularMap?d=b.specularMap:b.displacementMap?
-d=b.displacementMap:b.normalMap?d=b.normalMap:b.bumpMap?d=b.bumpMap:b.roughnessMap?d=b.roughnessMap:b.metalnessMap?d=b.metalnessMap:b.alphaMap?d=b.alphaMap:b.emissiveMap&&(d=b.emissiveMap);void 0!==d&&(d.isWebGLRenderTarget&&(d=d.texture),!0===d.matrixAutoUpdate&&d.updateMatrix(),a.uvTransform.value.copy(d.matrix));if(b.aoMap)var e=b.aoMap;else b.lightMap&&(e=b.lightMap);void 0!==e&&(e.isWebGLRenderTarget&&(e=e.texture),!0===e.matrixAutoUpdate&&e.updateMatrix(),a.uv2Transform.value.copy(e.matrix))}
-function q(a,b,c){a.roughness.value=b.roughness;a.metalness.value=b.metalness;b.roughnessMap&&(a.roughnessMap.value=b.roughnessMap);b.metalnessMap&&(a.metalnessMap.value=b.metalnessMap);b.emissiveMap&&(a.emissiveMap.value=b.emissiveMap);b.bumpMap&&(a.bumpMap.value=b.bumpMap,a.bumpScale.value=b.bumpScale,1===b.side&&(a.bumpScale.value*=-1));b.normalMap&&(a.normalMap.value=b.normalMap,a.normalScale.value.copy(b.normalScale),1===b.side&&a.normalScale.value.negate());b.displacementMap&&(a.displacementMap.value=
-b.displacementMap,a.displacementScale.value=b.displacementScale,a.displacementBias.value=b.displacementBias);if(b.envMap||c)a.envMapIntensity.value=b.envMapIntensity}a=a||{};var v=void 0!==a.canvas?a.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),E=void 0!==a.context?a.context:null,w=void 0!==a.alpha?a.alpha:!1,z=void 0!==a.depth?a.depth:!0,ha=void 0!==a.stencil?a.stencil:!0,U=void 0!==a.antialias?a.antialias:!1,ba=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,B=
-void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,y=void 0!==a.powerPreference?a.powerPreference:"default",F=void 0!==a.failIfMajorPerformanceCaveat?a.failIfMajorPerformanceCaveat:!1,C=null,A=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.toneMappingWhitePoint=
-this.toneMappingExposure=this.toneMapping=1;this.maxMorphTargets=8;this.maxMorphNormals=4;var H=this,G=!1,M=null,N=0,K=0,O=null,W=null,Ke=-1;var da=b=null;var Le=!1;var V=null,T=null,Z=new R,S=new R,ja=null,ca=v.width,J=v.height,Q=1,la=null,na=null,fa=new R(0,0,ca,J),ka=new R(0,0,ca,J),fg=!1,gg=new Ec,Ua=new nj,ma=!1,hg=!1,Jd=new P,Gb=new n;try{w={alpha:w,depth:z,stencil:ha,antialias:U,premultipliedAlpha:ba,preserveDrawingBuffer:B,powerPreference:y,failIfMajorPerformanceCaveat:F,xrCompatible:!0};
-v.addEventListener("webglcontextlost",d,!1);v.addEventListener("webglcontextrestored",e,!1);var I=E||v.getContext("webgl",w)||v.getContext("experimental-webgl",w);if(null===I){if(null!==v.getContext("webgl"))throw Error("Error creating WebGL context with your selected attributes.");throw Error("Error creating WebGL context.");}void 0===I.getShaderPrecisionFormat&&(I.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(Vh){throw console.error("THREE.WebGLRenderer: "+
-Vh.message),Vh;}var qa,Fa,X,ea,Y,aa,ra,xa,sa,ua,wa,va,oa,za,Aa,Ca,pa;c();var ta=new Uh(H,I);this.xr=ta;var Ea=new Rh(H,sa,Fa.maxTextureSize);this.shadowMap=Ea;this.getContext=function(){return I};this.getContextAttributes=function(){return I.getContextAttributes()};this.forceContextLoss=function(){var a=qa.get("WEBGL_lose_context");a&&a.loseContext()};this.forceContextRestore=function(){var a=qa.get("WEBGL_lose_context");a&&a.restoreContext()};this.getPixelRatio=function(){return Q};this.setPixelRatio=
-function(a){void 0!==a&&(Q=a,this.setSize(ca,J,!1))};this.getSize=function(a){void 0===a&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),a=new t);return a.set(ca,J)};this.setSize=function(a,b,c){ta.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(ca=a,J=b,v.width=Math.floor(a*Q),v.height=Math.floor(b*Q),!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 t);return a.set(ca*Q,J*Q).floor()};this.setDrawingBufferSize=function(a,b,c){ca=a;J=b;Q=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 R);return a.copy(Z)};this.getViewport=function(a){return a.copy(fa)};this.setViewport=
-function(a,b,c,d){a.isVector4?fa.set(a.x,a.y,a.z,a.w):fa.set(a,b,c,d);X.viewport(Z.copy(fa).multiplyScalar(Q).floor())};this.getScissor=function(a){return a.copy(ka)};this.setScissor=function(a,b,c,d){a.isVector4?ka.set(a.x,a.y,a.z,a.w):ka.set(a,b,c,d);X.scissor(S.copy(ka).multiplyScalar(Q).floor())};this.getScissorTest=function(){return fg};this.setScissorTest=function(a){X.setScissorTest(fg=a)};this.setOpaqueSort=function(a){la=a};this.setTransparentSort=function(a){na=a};this.getClearColor=function(){return oa.getClearColor()};
-this.setClearColor=function(){oa.setClearColor.apply(oa,arguments)};this.getClearAlpha=function(){return oa.getClearAlpha()};this.setClearAlpha=function(){oa.setClearAlpha.apply(oa,arguments)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=16384;if(void 0===b||b)d|=256;if(void 0===c||c)d|=1024;I.clear(d)};this.clearColor=function(){this.clear(!0,!1,!1)};this.clearDepth=function(){this.clear(!1,!0,!1)};this.clearStencil=function(){this.clear(!1,!1,!0)};this.dispose=function(){v.removeEventListener("webglcontextlost",
-d,!1);v.removeEventListener("webglcontextrestored",e,!1);wa.dispose();va.dispose();Y.dispose();sa.dispose();ta.dispose();ya.stop()};this.renderBufferImmediate=function(a,b){X.initAttributes();var c=Y.get(a);a.hasPositions&&!c.position&&(c.position=I.createBuffer());a.hasNormals&&!c.normal&&(c.normal=I.createBuffer());a.hasUvs&&!c.uv&&(c.uv=I.createBuffer());a.hasColors&&!c.color&&(c.color=I.createBuffer());b=b.getAttributes();a.hasPositions&&(I.bindBuffer(34962,c.position),I.bufferData(34962,a.positionArray,
-35048),X.enableAttribute(b.position),I.vertexAttribPointer(b.position,3,5126,!1,0,0));a.hasNormals&&(I.bindBuffer(34962,c.normal),I.bufferData(34962,a.normalArray,35048),X.enableAttribute(b.normal),I.vertexAttribPointer(b.normal,3,5126,!1,0,0));a.hasUvs&&(I.bindBuffer(34962,c.uv),I.bufferData(34962,a.uvArray,35048),X.enableAttribute(b.uv),I.vertexAttribPointer(b.uv,2,5126,!1,0,0));a.hasColors&&(I.bindBuffer(34962,c.color),I.bufferData(34962,a.colorArray,35048),X.enableAttribute(b.color),I.vertexAttribPointer(b.color,
-3,5126,!1,0,0));X.disableUnusedAttributes();I.drawArrays(4,0,a.count);a.count=0};var Ga=new nb;this.renderBufferDirect=function(a,c,d,e,f,g){null===c&&(c=Ga);var h=f.isMesh&&0>f.matrixWorld.determinant(),l=x(a,c,e,f);X.setMaterial(e,h);var m=!1;if(b!==d.id||da!==l.id||Le!==(!0===e.wireframe))b=d.id,da=l.id,Le=!0===e.wireframe,m=!0;if(e.morphTargets||e.morphNormals)za.update(f,d,e,l),m=!0;a=d.index;c=d.attributes.position;if(null===a){if(void 0===c||0===c.count)return}else if(0===a.count)return;var u=
-1;!0===e.wireframe&&(a=xa.getWireframeAttribute(d),u=2);h=Aa;if(null!==a){var p=ra.get(a);h=Ca;h.setIndex(p)}if(m){if(!1!==Fa.isWebGL2||!f.isInstancedMesh&&!d.isInstancedBufferGeometry||null!==qa.get("ANGLE_instanced_arrays")){X.initAttributes();m=d.attributes;l=l.getAttributes();var k=e.defaultAttributeValues;for(ha in l){var q=l[ha];if(0<=q){var r=m[ha];if(void 0!==r){var v=r.normalized,n=r.itemSize,w=ra.get(r);if(void 0!==w){var E=w.buffer,z=w.type;w=w.bytesPerElement;if(r.isInterleavedBufferAttribute){var B=
-r.data,t=B.stride;r=r.offset;B&&B.isInstancedInterleavedBuffer?(X.enableAttributeAndDivisor(q,B.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=B.meshPerAttribute*B.count)):X.enableAttribute(q);I.bindBuffer(34962,E);X.vertexAttribPointer(q,n,z,v,t*w,r*w)}else r.isInstancedBufferAttribute?(X.enableAttributeAndDivisor(q,r.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=r.meshPerAttribute*r.count)):X.enableAttribute(q),I.bindBuffer(34962,E),X.vertexAttribPointer(q,
-n,z,v,0,0)}}else if("instanceMatrix"===ha)w=ra.get(f.instanceMatrix),void 0!==w&&(E=w.buffer,z=w.type,X.enableAttributeAndDivisor(q+0,1),X.enableAttributeAndDivisor(q+1,1),X.enableAttributeAndDivisor(q+2,1),X.enableAttributeAndDivisor(q+3,1),I.bindBuffer(34962,E),I.vertexAttribPointer(q+0,4,z,!1,64,0),I.vertexAttribPointer(q+1,4,z,!1,64,16),I.vertexAttribPointer(q+2,4,z,!1,64,32),I.vertexAttribPointer(q+3,4,z,!1,64,48));else if(void 0!==k&&(v=k[ha],void 0!==v))switch(v.length){case 2:I.vertexAttrib2fv(q,
-v);break;case 3:I.vertexAttrib3fv(q,v);break;case 4:I.vertexAttrib4fv(q,v);break;default:I.vertexAttrib1fv(q,v)}}}X.disableUnusedAttributes()}null!==a&&I.bindBuffer(34963,p.buffer)}var ha=d.drawRange.start*u;m=null!==g?g.start*u:0;p=Math.max(ha,m);g=Math.max(0,Math.min(null!==a?a.count:c.count,ha+d.drawRange.count*u,m+(null!==g?g.count*u:Infinity))-1-p+1);0!==g&&(f.isMesh?!0===e.wireframe?(X.setLineWidth(e.wireframeLinewidth*(null===O?Q:1)),h.setMode(1)):h.setMode(4):f.isLine?(e=e.linewidth,void 0===
-e&&(e=1),X.setLineWidth(e*(null===O?Q:1)),f.isLineSegments?h.setMode(1):f.isLineLoop?h.setMode(2):h.setMode(3)):f.isPoints?h.setMode(0):f.isSprite&&h.setMode(4),f.isInstancedMesh?h.renderInstances(d,p,g,f.count):d.isInstancedBufferGeometry?h.renderInstances(d,p,g,d.maxInstancedCount):h.render(p,g))};this.compile=function(a,b){A=va.get(a,b);A.init();a.traverse(function(a){a.isLight&&(A.pushLight(a),a.castShadow&&A.pushShadow(a))});A.setupLights(b);var c={};a.traverse(function(b){if(b.material)if(Array.isArray(b.material))for(var d=
-0;d<b.material.length;d++)!1===b.material[d].uuid in c&&(p(b.material[d],a,b),c[b.material[d].uuid]=!0);else!1===b.material.uuid in c&&(p(b.material,a,b),c[b.material.uuid]=!0)})};var Da=null,ya=new uh;ya.setAnimationLoop(function(a){ta.isPresenting||Da&&Da(a)});"undefined"!==typeof window&&ya.setContext(window);this.setAnimationLoop=function(a){Da=a;ta.setAnimationLoop(a);ya.start()};this.render=function(a,c,d,e){if(void 0!==d){console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead.");
+m,d.uniforms=c.uniforms,d.outputEncoding=H.outputEncoding,a.program=m);c=m.getAttributes();if(a.morphTargets)for(l=a.numSupportedMorphTargets=0;l<H.maxMorphTargets;l++)0<=c["morphTarget"+l]&&a.numSupportedMorphTargets++;if(a.morphNormals)for(l=a.numSupportedMorphNormals=0;l<H.maxMorphNormals;l++)0<=c["morphNormal"+l]&&a.numSupportedMorphNormals++;c=d.uniforms;if(!a.isShaderMaterial&&!a.isRawShaderMaterial||!0===a.clipping)d.numClippingPlanes=Ua.numPlanes,d.numIntersection=Ua.numIntersection,c.clippingPlanes=
+Ua.uniform;d.environment=a.isMeshStandardMaterial?b.environment:null;d.fog=b.fog;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.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=Db.seqWithValue(a.seq,c);d.uniformsList=a}function x(a,b,c,d){aa.resetTextureUnits();var e=b.fog,f=c.isMeshStandardMaterial?b.environment:null,g=Y.get(c),h=A.state.lights;ma&&(hg||a!==V)&&Ua.setState(c.clippingPlanes,c.clipIntersection,c.clipShadows,a,g,a===V&&c.id===Ke);c.version===g.__version?void 0===g.program?p(c,b,d):c.fog&&g.fog!==e?p(c,b,d):g.environment!==f?p(c,b,d):g.needsLights&&g.lightsStateVersion!==h.state.version?p(c,b,d):void 0===g.numClippingPlanes||g.numClippingPlanes===Ua.numPlanes&&
+g.numIntersection===Ua.numIntersection?g.outputEncoding!==H.outputEncoding&&p(c,b,d):p(c,b,d):(p(c,b,d),g.__version=c.version);var l=!1,m=!1,k=!1;b=g.program;h=b.getUniforms();var u=g.uniforms;X.useProgram(b.program)&&(k=m=l=!0);c.id!==Ke&&(Ke=c.id,m=!0);if(l||V!==a){h.setValue(I,"projectionMatrix",a.projectionMatrix);Fa.logarithmicDepthBuffer&&h.setValue(I,"logDepthBufFC",2/(Math.log(a.far+1)/Math.LN2));V!==a&&(V=a,k=m=!0);if(c.isShaderMaterial||c.isMeshPhongMaterial||c.isMeshToonMaterial||c.isMeshStandardMaterial||
+c.envMap)l=h.map.cameraPosition,void 0!==l&&l.setValue(I,Gb.setFromMatrixPosition(a.matrixWorld));(c.isMeshPhongMaterial||c.isMeshToonMaterial||c.isMeshLambertMaterial||c.isMeshBasicMaterial||c.isMeshStandardMaterial||c.isShaderMaterial)&&h.setValue(I,"isOrthographic",!0===a.isOrthographicCamera);(c.isMeshPhongMaterial||c.isMeshToonMaterial||c.isMeshLambertMaterial||c.isMeshBasicMaterial||c.isMeshStandardMaterial||c.isShaderMaterial||c.skinning)&&h.setValue(I,"viewMatrix",a.matrixWorldInverse)}if(c.skinning&&
+(h.setOptional(I,d,"bindMatrix"),h.setOptional(I,d,"bindMatrixInverse"),a=d.skeleton))if(l=a.bones,Fa.floatVertexTextures){if(void 0===a.boneTexture){l=Math.sqrt(4*l.length);l=L.ceilPowerOfTwo(l);l=Math.max(l,4);var x=new Float32Array(l*l*4);x.set(a.boneMatrices);var v=new Yb(x,l,l,1023,1015);a.boneMatrices=x;a.boneTexture=v;a.boneTextureSize=l}h.setValue(I,"boneTexture",a.boneTexture,aa);h.setValue(I,"boneTextureSize",a.boneTextureSize)}else h.setOptional(I,a,"boneMatrices");if(m||g.receiveShadow!==
+d.receiveShadow)g.receiveShadow=d.receiveShadow,h.setValue(I,"receiveShadow",d.receiveShadow);if(m){h.setValue(I,"toneMappingExposure",H.toneMappingExposure);h.setValue(I,"toneMappingWhitePoint",H.toneMappingWhitePoint);g.needsLights&&(m=k,u.ambientLightColor.needsUpdate=m,u.lightProbe.needsUpdate=m,u.directionalLights.needsUpdate=m,u.directionalLightShadows.needsUpdate=m,u.pointLights.needsUpdate=m,u.pointLightShadows.needsUpdate=m,u.spotLights.needsUpdate=m,u.spotLightShadows.needsUpdate=m,u.rectAreaLights.needsUpdate=
+m,u.hemisphereLights.needsUpdate=m);e&&c.fog&&(u.fogColor.value.copy(e.color),e.isFog?(u.fogNear.value=e.near,u.fogFar.value=e.far):e.isFogExp2&&(u.fogDensity.value=e.density));if(c.isMeshBasicMaterial)r(u,c);else if(c.isMeshLambertMaterial)r(u,c),c.emissiveMap&&(u.emissiveMap.value=c.emissiveMap);else if(c.isMeshToonMaterial)r(u,c),u.specular.value.copy(c.specular),u.shininess.value=Math.max(c.shininess,1E-4),c.gradientMap&&(u.gradientMap.value=c.gradientMap),c.emissiveMap&&(u.emissiveMap.value=
+c.emissiveMap),c.bumpMap&&(u.bumpMap.value=c.bumpMap,u.bumpScale.value=c.bumpScale,1===c.side&&(u.bumpScale.value*=-1)),c.normalMap&&(u.normalMap.value=c.normalMap,u.normalScale.value.copy(c.normalScale),1===c.side&&u.normalScale.value.negate()),c.displacementMap&&(u.displacementMap.value=c.displacementMap,u.displacementScale.value=c.displacementScale,u.displacementBias.value=c.displacementBias);else if(c.isMeshPhongMaterial)r(u,c),u.specular.value.copy(c.specular),u.shininess.value=Math.max(c.shininess,
+1E-4),c.emissiveMap&&(u.emissiveMap.value=c.emissiveMap),c.bumpMap&&(u.bumpMap.value=c.bumpMap,u.bumpScale.value=c.bumpScale,1===c.side&&(u.bumpScale.value*=-1)),c.normalMap&&(u.normalMap.value=c.normalMap,u.normalScale.value.copy(c.normalScale),1===c.side&&u.normalScale.value.negate()),c.displacementMap&&(u.displacementMap.value=c.displacementMap,u.displacementScale.value=c.displacementScale,u.displacementBias.value=c.displacementBias);else if(c.isMeshStandardMaterial)r(u,c,f),c.isMeshPhysicalMaterial?
+(q(u,c,f),u.reflectivity.value=c.reflectivity,u.clearcoat.value=c.clearcoat,u.clearcoatRoughness.value=c.clearcoatRoughness,c.sheen&&u.sheen.value.copy(c.sheen),c.clearcoatMap&&(u.clearcoatMap.value=c.clearcoatMap),c.clearcoatRoughnessMap&&(u.clearcoatRoughnessMap.value=c.clearcoatRoughnessMap),c.clearcoatNormalMap&&(u.clearcoatNormalScale.value.copy(c.clearcoatNormalScale),u.clearcoatNormalMap.value=c.clearcoatNormalMap,1===c.side&&u.clearcoatNormalScale.value.negate()),u.transparency.value=c.transparency):
+q(u,c,f);else if(c.isMeshMatcapMaterial)r(u,c),c.matcap&&(u.matcap.value=c.matcap),c.bumpMap&&(u.bumpMap.value=c.bumpMap,u.bumpScale.value=c.bumpScale,1===c.side&&(u.bumpScale.value*=-1)),c.normalMap&&(u.normalMap.value=c.normalMap,u.normalScale.value.copy(c.normalScale),1===c.side&&u.normalScale.value.negate()),c.displacementMap&&(u.displacementMap.value=c.displacementMap,u.displacementScale.value=c.displacementScale,u.displacementBias.value=c.displacementBias);else if(c.isMeshDepthMaterial)r(u,
+c),c.displacementMap&&(u.displacementMap.value=c.displacementMap,u.displacementScale.value=c.displacementScale,u.displacementBias.value=c.displacementBias);else if(c.isMeshDistanceMaterial)r(u,c),c.displacementMap&&(u.displacementMap.value=c.displacementMap,u.displacementScale.value=c.displacementScale,u.displacementBias.value=c.displacementBias),u.referencePosition.value.copy(c.referencePosition),u.nearDistance.value=c.nearDistance,u.farDistance.value=c.farDistance;else if(c.isMeshNormalMaterial)r(u,
+c),c.bumpMap&&(u.bumpMap.value=c.bumpMap,u.bumpScale.value=c.bumpScale,1===c.side&&(u.bumpScale.value*=-1)),c.normalMap&&(u.normalMap.value=c.normalMap,u.normalScale.value.copy(c.normalScale),1===c.side&&u.normalScale.value.negate()),c.displacementMap&&(u.displacementMap.value=c.displacementMap,u.displacementScale.value=c.displacementScale,u.displacementBias.value=c.displacementBias);else if(c.isLineBasicMaterial)u.diffuse.value.copy(c.color),u.opacity.value=c.opacity,c.isLineDashedMaterial&&(u.dashSize.value=
+c.dashSize,u.totalSize.value=c.dashSize+c.gapSize,u.scale.value=c.scale);else if(c.isPointsMaterial){u.diffuse.value.copy(c.color);u.opacity.value=c.opacity;u.size.value=c.size*Q;u.scale.value=.5*J;c.map&&(u.map.value=c.map);c.alphaMap&&(u.alphaMap.value=c.alphaMap);if(c.map)var n=c.map;else c.alphaMap&&(n=c.alphaMap);void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),u.uvTransform.value.copy(n.matrix))}else if(c.isSpriteMaterial){u.diffuse.value.copy(c.color);u.opacity.value=c.opacity;u.rotation.value=
+c.rotation;c.map&&(u.map.value=c.map);c.alphaMap&&(u.alphaMap.value=c.alphaMap);if(c.map)var w=c.map;else c.alphaMap&&(w=c.alphaMap);void 0!==w&&(!0===w.matrixAutoUpdate&&w.updateMatrix(),u.uvTransform.value.copy(w.matrix))}else c.isShadowMaterial&&(u.color.value.copy(c.color),u.opacity.value=c.opacity);void 0!==u.ltc_1&&(u.ltc_1.value=D.LTC_1);void 0!==u.ltc_2&&(u.ltc_2.value=D.LTC_2);Db.upload(I,g.uniformsList,u,aa);c.isShaderMaterial&&(c.uniformsNeedUpdate=!1)}c.isShaderMaterial&&!0===c.uniformsNeedUpdate&&
+(Db.upload(I,g.uniformsList,u,aa),c.uniformsNeedUpdate=!1);c.isSpriteMaterial&&h.setValue(I,"center",d.center);h.setValue(I,"modelViewMatrix",d.modelViewMatrix);h.setValue(I,"normalMatrix",d.normalMatrix);h.setValue(I,"modelMatrix",d.matrixWorld);return b}function r(a,b,c){a.opacity.value=b.opacity;b.color&&a.diffuse.value.copy(b.color);b.emissive&&a.emissive.value.copy(b.emissive).multiplyScalar(b.emissiveIntensity);b.map&&(a.map.value=b.map);b.alphaMap&&(a.alphaMap.value=b.alphaMap);b.specularMap&&
+(a.specularMap.value=b.specularMap);if(c=b.envMap||c)a.envMap.value=c,a.flipEnvMap.value=c.isCubeTexture?-1:1,a.reflectivity.value=b.reflectivity,a.refractionRatio.value=b.refractionRatio,a.maxMipLevel.value=Y.get(c).__maxMipLevel;b.lightMap&&(a.lightMap.value=b.lightMap,a.lightMapIntensity.value=b.lightMapIntensity);b.aoMap&&(a.aoMap.value=b.aoMap,a.aoMapIntensity.value=b.aoMapIntensity);if(b.map)var d=b.map;else b.specularMap?d=b.specularMap:b.displacementMap?d=b.displacementMap:b.normalMap?d=b.normalMap:
+b.bumpMap?d=b.bumpMap:b.roughnessMap?d=b.roughnessMap:b.metalnessMap?d=b.metalnessMap:b.alphaMap?d=b.alphaMap:b.emissiveMap&&(d=b.emissiveMap);void 0!==d&&(d.isWebGLRenderTarget&&(d=d.texture),!0===d.matrixAutoUpdate&&d.updateMatrix(),a.uvTransform.value.copy(d.matrix));if(b.aoMap)var e=b.aoMap;else b.lightMap&&(e=b.lightMap);void 0!==e&&(e.isWebGLRenderTarget&&(e=e.texture),!0===e.matrixAutoUpdate&&e.updateMatrix(),a.uv2Transform.value.copy(e.matrix))}function q(a,b,c){a.roughness.value=b.roughness;
+a.metalness.value=b.metalness;b.roughnessMap&&(a.roughnessMap.value=b.roughnessMap);b.metalnessMap&&(a.metalnessMap.value=b.metalnessMap);b.emissiveMap&&(a.emissiveMap.value=b.emissiveMap);b.bumpMap&&(a.bumpMap.value=b.bumpMap,a.bumpScale.value=b.bumpScale,1===b.side&&(a.bumpScale.value*=-1));b.normalMap&&(a.normalMap.value=b.normalMap,a.normalScale.value.copy(b.normalScale),1===b.side&&a.normalScale.value.negate());b.displacementMap&&(a.displacementMap.value=b.displacementMap,a.displacementScale.value=
+b.displacementScale,a.displacementBias.value=b.displacementBias);if(b.envMap||c)a.envMapIntensity.value=b.envMapIntensity}a=a||{};var v=void 0!==a.canvas?a.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),E=void 0!==a.context?a.context:null,w=void 0!==a.alpha?a.alpha:!1,z=void 0!==a.depth?a.depth:!0,ha=void 0!==a.stencil?a.stencil:!0,U=void 0!==a.antialias?a.antialias:!1,ba=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,B=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:
+!1,y=void 0!==a.powerPreference?a.powerPreference:"default",F=void 0!==a.failIfMajorPerformanceCaveat?a.failIfMajorPerformanceCaveat:!1,C=null,A=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.toneMappingWhitePoint=this.toneMappingExposure=this.toneMapping=1;this.maxMorphTargets=
+8;this.maxMorphNormals=4;var H=this,G=!1,M=null,N=0,K=0,O=null,W=null,Ke=-1;var da=b=null;var Le=!1;var V=null,T=null,Z=new R,S=new R,ja=null,ca=v.width,J=v.height,Q=1,la=null,na=null,fa=new R(0,0,ca,J),ka=new R(0,0,ca,J),fg=!1,gg=new Ec,Ua=new nj,ma=!1,hg=!1,Jd=new P,Gb=new n;try{w={alpha:w,depth:z,stencil:ha,antialias:U,premultipliedAlpha:ba,preserveDrawingBuffer:B,powerPreference:y,failIfMajorPerformanceCaveat:F,xrCompatible:!0};v.addEventListener("webglcontextlost",d,!1);v.addEventListener("webglcontextrestored",
+e,!1);var I=E||v.getContext("webgl",w)||v.getContext("experimental-webgl",w);if(null===I){if(null!==v.getContext("webgl"))throw Error("Error creating WebGL context with your selected attributes.");throw Error("Error creating WebGL context.");}void 0===I.getShaderPrecisionFormat&&(I.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(Vh){throw console.error("THREE.WebGLRenderer: "+Vh.message),Vh;}var qa,Fa,X,ea,Y,aa,ra,xa,sa,ua,wa,va,oa,za,Aa,Ca,pa;c();var ta=new Uh(H,
+I);this.xr=ta;var Ea=new Rh(H,sa,Fa.maxTextureSize);this.shadowMap=Ea;this.getContext=function(){return I};this.getContextAttributes=function(){return I.getContextAttributes()};this.forceContextLoss=function(){var a=qa.get("WEBGL_lose_context");a&&a.loseContext()};this.forceContextRestore=function(){var a=qa.get("WEBGL_lose_context");a&&a.restoreContext()};this.getPixelRatio=function(){return Q};this.setPixelRatio=function(a){void 0!==a&&(Q=a,this.setSize(ca,J,!1))};this.getSize=function(a){void 0===
+a&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),a=new t);return a.set(ca,J)};this.setSize=function(a,b,c){ta.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(ca=a,J=b,v.width=Math.floor(a*Q),v.height=Math.floor(b*Q),!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 t);return a.set(ca*Q,J*Q).floor()};this.setDrawingBufferSize=function(a,b,c){ca=a;J=b;Q=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 R);return a.copy(Z)};this.getViewport=function(a){return a.copy(fa)};this.setViewport=function(a,b,c,d){a.isVector4?fa.set(a.x,a.y,a.z,a.w):fa.set(a,b,c,d);X.viewport(Z.copy(fa).multiplyScalar(Q).floor())};
+this.getScissor=function(a){return a.copy(ka)};this.setScissor=function(a,b,c,d){a.isVector4?ka.set(a.x,a.y,a.z,a.w):ka.set(a,b,c,d);X.scissor(S.copy(ka).multiplyScalar(Q).floor())};this.getScissorTest=function(){return fg};this.setScissorTest=function(a){X.setScissorTest(fg=a)};this.setOpaqueSort=function(a){la=a};this.setTransparentSort=function(a){na=a};this.getClearColor=function(){return oa.getClearColor()};this.setClearColor=function(){oa.setClearColor.apply(oa,arguments)};this.getClearAlpha=
+function(){return oa.getClearAlpha()};this.setClearAlpha=function(){oa.setClearAlpha.apply(oa,arguments)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=16384;if(void 0===b||b)d|=256;if(void 0===c||c)d|=1024;I.clear(d)};this.clearColor=function(){this.clear(!0,!1,!1)};this.clearDepth=function(){this.clear(!1,!0,!1)};this.clearStencil=function(){this.clear(!1,!1,!0)};this.dispose=function(){v.removeEventListener("webglcontextlost",d,!1);v.removeEventListener("webglcontextrestored",e,!1);wa.dispose();
+va.dispose();Y.dispose();sa.dispose();ta.dispose();ya.stop()};this.renderBufferImmediate=function(a,b){X.initAttributes();var c=Y.get(a);a.hasPositions&&!c.position&&(c.position=I.createBuffer());a.hasNormals&&!c.normal&&(c.normal=I.createBuffer());a.hasUvs&&!c.uv&&(c.uv=I.createBuffer());a.hasColors&&!c.color&&(c.color=I.createBuffer());b=b.getAttributes();a.hasPositions&&(I.bindBuffer(34962,c.position),I.bufferData(34962,a.positionArray,35048),X.enableAttribute(b.position),I.vertexAttribPointer(b.position,
+3,5126,!1,0,0));a.hasNormals&&(I.bindBuffer(34962,c.normal),I.bufferData(34962,a.normalArray,35048),X.enableAttribute(b.normal),I.vertexAttribPointer(b.normal,3,5126,!1,0,0));a.hasUvs&&(I.bindBuffer(34962,c.uv),I.bufferData(34962,a.uvArray,35048),X.enableAttribute(b.uv),I.vertexAttribPointer(b.uv,2,5126,!1,0,0));a.hasColors&&(I.bindBuffer(34962,c.color),I.bufferData(34962,a.colorArray,35048),X.enableAttribute(b.color),I.vertexAttribPointer(b.color,3,5126,!1,0,0));X.disableUnusedAttributes();I.drawArrays(4,
+0,a.count);a.count=0};var Ga=new nb;this.renderBufferDirect=function(a,c,d,e,f,g){null===c&&(c=Ga);var h=f.isMesh&&0>f.matrixWorld.determinant(),l=x(a,c,e,f);X.setMaterial(e,h);var m=!1;if(b!==d.id||da!==l.id||Le!==(!0===e.wireframe))b=d.id,da=l.id,Le=!0===e.wireframe,m=!0;if(e.morphTargets||e.morphNormals)za.update(f,d,e,l),m=!0;a=d.index;c=d.attributes.position;if(null===a){if(void 0===c||0===c.count)return}else if(0===a.count)return;var u=1;!0===e.wireframe&&(a=xa.getWireframeAttribute(d),u=2);
+h=Aa;if(null!==a){var p=ra.get(a);h=Ca;h.setIndex(p)}if(m){if(!1!==Fa.isWebGL2||!f.isInstancedMesh&&!d.isInstancedBufferGeometry||null!==qa.get("ANGLE_instanced_arrays")){X.initAttributes();m=d.attributes;l=l.getAttributes();var k=e.defaultAttributeValues;for(ha in l){var q=l[ha];if(0<=q){var r=m[ha];if(void 0!==r){var v=r.normalized,n=r.itemSize,w=ra.get(r);if(void 0!==w){var E=w.buffer,z=w.type;w=w.bytesPerElement;if(r.isInterleavedBufferAttribute){var B=r.data,t=B.stride;r=r.offset;B&&B.isInstancedInterleavedBuffer?
+(X.enableAttributeAndDivisor(q,B.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=B.meshPerAttribute*B.count)):X.enableAttribute(q);I.bindBuffer(34962,E);X.vertexAttribPointer(q,n,z,v,t*w,r*w)}else r.isInstancedBufferAttribute?(X.enableAttributeAndDivisor(q,r.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=r.meshPerAttribute*r.count)):X.enableAttribute(q),I.bindBuffer(34962,E),X.vertexAttribPointer(q,n,z,v,0,0)}}else if("instanceMatrix"===ha)w=ra.get(f.instanceMatrix),
+void 0!==w&&(E=w.buffer,z=w.type,X.enableAttributeAndDivisor(q+0,1),X.enableAttributeAndDivisor(q+1,1),X.enableAttributeAndDivisor(q+2,1),X.enableAttributeAndDivisor(q+3,1),I.bindBuffer(34962,E),I.vertexAttribPointer(q+0,4,z,!1,64,0),I.vertexAttribPointer(q+1,4,z,!1,64,16),I.vertexAttribPointer(q+2,4,z,!1,64,32),I.vertexAttribPointer(q+3,4,z,!1,64,48));else if(void 0!==k&&(v=k[ha],void 0!==v))switch(v.length){case 2:I.vertexAttrib2fv(q,v);break;case 3:I.vertexAttrib3fv(q,v);break;case 4:I.vertexAttrib4fv(q,
+v);break;default:I.vertexAttrib1fv(q,v)}}}X.disableUnusedAttributes()}null!==a&&I.bindBuffer(34963,p.buffer)}var ha=d.drawRange.start*u;m=null!==g?g.start*u:0;p=Math.max(ha,m);g=Math.max(0,Math.min(null!==a?a.count:c.count,ha+d.drawRange.count*u,m+(null!==g?g.count*u:Infinity))-1-p+1);0!==g&&(f.isMesh?!0===e.wireframe?(X.setLineWidth(e.wireframeLinewidth*(null===O?Q:1)),h.setMode(1)):h.setMode(4):f.isLine?(e=e.linewidth,void 0===e&&(e=1),X.setLineWidth(e*(null===O?Q:1)),f.isLineSegments?h.setMode(1):
+f.isLineLoop?h.setMode(2):h.setMode(3)):f.isPoints?h.setMode(0):f.isSprite&&h.setMode(4),f.isInstancedMesh?h.renderInstances(d,p,g,f.count):d.isInstancedBufferGeometry?h.renderInstances(d,p,g,d.maxInstancedCount):h.render(p,g))};this.compile=function(a,b){A=va.get(a,b);A.init();a.traverse(function(a){a.isLight&&(A.pushLight(a),a.castShadow&&A.pushShadow(a))});A.setupLights(b);var c={};a.traverse(function(b){if(b.material)if(Array.isArray(b.material))for(var d=0;d<b.material.length;d++)!1===b.material[d].uuid in
+c&&(p(b.material[d],a,b),c[b.material[d].uuid]=!0);else!1===b.material.uuid in c&&(p(b.material,a,b),c[b.material.uuid]=!0)})};var Da=null,ya=new uh;ya.setAnimationLoop(function(a){ta.isPresenting||Da&&Da(a)});"undefined"!==typeof window&&ya.setContext(window);this.setAnimationLoop=function(a){Da=a;ta.setAnimationLoop(a);ya.start()};this.render=function(a,c,d,e){if(void 0!==d){console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead.");
 var f=d}if(void 0!==e){console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead.");var g=e}c&&c.isCamera?G||(da=b=null,Le=!1,Ke=-1,V=null,!0===a.autoUpdate&&a.updateMatrixWorld(),null===c.parent&&c.updateMatrixWorld(),ta.enabled&&ta.isPresenting&&(c=ta.getCamera(c)),a.onBeforeRender(H,a,c,f||O),A=va.get(a,c),A.init(),Jd.multiplyMatrices(c.projectionMatrix,c.matrixWorldInverse),gg.setFromProjectionMatrix(Jd),hg=this.localClippingEnabled,ma=Ua.init(this.clippingPlanes,
 hg,c),C=wa.get(a,c),C.init(),l(a,c,0,H.sortObjects),C.finish(),!0===H.sortObjects&&C.sort(la,na),ma&&Ua.beginShadows(),Ea.render(A.state.shadowsArray,a,c),A.setupLights(c),ma&&Ua.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==f&&this.setRenderTarget(f),oa.render(C,a,c,g),d=C.opaque,e=C.transparent,a.overrideMaterial?(f=a.overrideMaterial,d.length&&m(d,a,c,f),e.length&&m(e,a,c,f)):(d.length&&m(d,a,c),e.length&&m(e,a,c)),a.onAfterRender(H,a,c),null!==O&&(aa.updateRenderTargetMipmap(O),
 aa.updateMultisampleRenderTarget(O)),X.buffers.depth.setTest(!0),X.buffers.depth.setMask(!0),X.buffers.color.setMask(!0),X.setPolygonOffset(!1),A=C=null):console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")};this.setFramebuffer=function(a){M!==a&&null===O&&I.bindFramebuffer(36160,a);M=a};this.getActiveCubeFace=function(){return N};this.getActiveMipmapLevel=function(){return K};this.getRenderTarget=function(){return O};this.setRenderTarget=function(a,b,c){O=a;N=b;

+ 1 - 1
build/three.module.js

@@ -24823,7 +24823,6 @@ function WebGLRenderer( parameters ) {
 
 			materialProperties.program = program;
 			materialProperties.uniforms = parameters.uniforms;
-			materialProperties.environment = material.isMeshStandardMaterial ? scene.environment : null;
 			materialProperties.outputEncoding = _this.outputEncoding;
 			material.program = program;
 
@@ -24875,6 +24874,7 @@ function WebGLRenderer( parameters ) {
 
 		}
 
+		materialProperties.environment = material.isMeshStandardMaterial ? scene.environment : null;
 		materialProperties.fog = scene.fog;
 
 		// store the light setup it was created for