|
@@ -144,28 +144,28 @@ m.bumpScale.value=c.bumpScale),c.normalMap&&(m.normalMap.value=c.normalMap,m.nor
|
|
|
c.displacementScale,m.displacementBias.value=c.displacementBias):c.isMeshNormalMaterial&&(m.opacity.value=c.opacity);Ta.upload(B,e.uniformsList,m,R)}l.set(B,d,"modelViewMatrix");l.set(B,d,"normalMatrix");l.setValue(B,"modelMatrix",d.matrixWorld);return k}function z(a,b){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.lightMap&&(a.lightMap.value=b.lightMap,a.lightMapIntensity.value=
|
|
|
b.lightMapIntensity);b.emissiveMap&&(a.emissiveMap.value=b.emissiveMap);b.bumpMap&&(a.bumpMap.value=b.bumpMap,a.bumpScale.value=b.bumpScale);b.normalMap&&(a.normalMap.value=b.normalMap,a.normalScale.value.copy(b.normalScale));b.displacementMap&&(a.displacementMap.value=b.displacementMap,a.displacementScale.value=b.displacementScale,a.displacementBias.value=b.displacementBias);b.envMap&&(a.envMapIntensity.value=b.envMapIntensity)}function v(a){var b;if(1E3===a)return B.REPEAT;if(1001===a)return B.CLAMP_TO_EDGE;
|
|
|
if(1002===a)return B.MIRRORED_REPEAT;if(1003===a)return B.NEAREST;if(1004===a)return B.NEAREST_MIPMAP_NEAREST;if(1005===a)return B.NEAREST_MIPMAP_LINEAR;if(1006===a)return B.LINEAR;if(1007===a)return B.LINEAR_MIPMAP_NEAREST;if(1008===a)return B.LINEAR_MIPMAP_LINEAR;if(1009===a)return B.UNSIGNED_BYTE;if(1017===a)return B.UNSIGNED_SHORT_4_4_4_4;if(1018===a)return B.UNSIGNED_SHORT_5_5_5_1;if(1019===a)return B.UNSIGNED_SHORT_5_6_5;if(1010===a)return B.BYTE;if(1011===a)return B.SHORT;if(1012===a)return B.UNSIGNED_SHORT;
|
|
|
-if(1013===a)return B.INT;if(1014===a)return B.UNSIGNED_INT;if(1015===a)return B.FLOAT;b=ia.get("OES_texture_half_float");if(null!==b&&1016===a)return b.HALF_FLOAT_OES;if(1021===a)return B.ALPHA;if(1022===a)return B.RGB;if(1023===a)return B.RGBA;if(1024===a)return B.LUMINANCE;if(1025===a)return B.LUMINANCE_ALPHA;if(1026===a)return B.DEPTH_COMPONENT;if(1027===a)return B.DEPTH_STENCIL;if(100===a)return B.FUNC_ADD;if(101===a)return B.FUNC_SUBTRACT;if(102===a)return B.FUNC_REVERSE_SUBTRACT;if(200===a)return B.ZERO;
|
|
|
-if(201===a)return B.ONE;if(202===a)return B.SRC_COLOR;if(203===a)return B.ONE_MINUS_SRC_COLOR;if(204===a)return B.SRC_ALPHA;if(205===a)return B.ONE_MINUS_SRC_ALPHA;if(206===a)return B.DST_ALPHA;if(207===a)return B.ONE_MINUS_DST_ALPHA;if(208===a)return B.DST_COLOR;if(209===a)return B.ONE_MINUS_DST_COLOR;if(210===a)return B.SRC_ALPHA_SATURATE;b=ia.get("WEBGL_compressed_texture_s3tc");if(null!==b){if(2001===a)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;if(2002===a)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(2003===
|
|
|
-a)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(2004===a)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}b=ia.get("WEBGL_compressed_texture_pvrtc");if(null!==b){if(2100===a)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(2101===a)return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(2102===a)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(2103===a)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}b=ia.get("WEBGL_compressed_texture_etc1");if(null!==b&&2151===a)return b.COMPRESSED_RGB_ETC1_WEBGL;b=ia.get("EXT_blend_minmax");if(null!==b){if(103===
|
|
|
-a)return b.MIN_EXT;if(104===a)return b.MAX_EXT}b=ia.get("WEBGL_depth_texture");return null!==b&&1020===a?b.UNSIGNED_INT_24_8_WEBGL:0}console.log("THREE.WebGLRenderer","82dev");a=a||{};var x=void 0!==a.canvas?a.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),J=void 0!==a.context?a.context:null,y=void 0!==a.alpha?a.alpha:!1,F=void 0!==a.depth?a.depth:!0,G=void 0!==a.stencil?a.stencil:!0,E=void 0!==a.antialias?a.antialias:!1,L=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:
|
|
|
-!0,D=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,T=[],fa=[],C=-1,A=[],Ea=-1,M=new Float32Array(8),O=[],P=[];this.domElement=x;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.clippingPlanes=[];this.localClippingEnabled=!1;this.gammaFactor=2;this.physicallyCorrectLights=this.gammaOutput=this.gammaInput=!1;this.toneMappingWhitePoint=this.toneMappingExposure=this.toneMapping=1;this.maxMorphTargets=8;this.maxMorphNormals=
|
|
|
-4;var R=this,Q=null,V=null,W=null,K=-1,S="",U=null,Z=new ea,bb=null,Va=new ea,ba=0,Ba=new N(0),Pa=0,Ma=x.width,gc=x.height,Na=1,ha=new ea(0,0,Ma,gc),ka=!1,ga=new ea(0,0,Ma,gc),na=new ec,ca=new rf,oa=!1,pa=!1,ma=new Aa,qa=new H,Y=new q,aa={hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],shadows:[]},la={calls:0,vertices:0,faces:0,points:0};this.info={render:la,
|
|
|
-memory:{geometries:0,textures:0},programs:null};var B;try{y={alpha:y,depth:F,stencil:G,antialias:E,premultipliedAlpha:L,preserveDrawingBuffer:D};B=J||x.getContext("webgl",y)||x.getContext("experimental-webgl",y);if(null===B){if(null!==x.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}void 0===B.getShaderPrecisionFormat&&(B.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});x.addEventListener("webglcontextlost",
|
|
|
-e,!1)}catch(sf){console.error("THREE.WebGLRenderer: "+sf)}var ia=new qf(B);ia.get("WEBGL_depth_texture");ia.get("OES_texture_float");ia.get("OES_texture_float_linear");ia.get("OES_texture_half_float");ia.get("OES_texture_half_float_linear");ia.get("OES_standard_derivatives");ia.get("ANGLE_instanced_arrays");ia.get("OES_element_index_uint")&&(I.MaxIndex=4294967296);var ja=new pf(B,ia,a),X=new of(B,ia,v),da=new nf,sa=new mf(B,ia,X,da,ja,v,this.info),ra=new lf(B,da,this.info),ta=new jf(this,ja),ya=new af;
|
|
|
-this.info.programs=ta.programs;var Fa=new $e(B,ia,la),Ga=new Ze(B,ia,la),Ia=new Db(-1,1,1,-1,0,1),wa=new Ca,za=new va(new eb(2,2),new Ha({depthTest:!1,depthWrite:!1,fog:!1}));a=Cb.cube;var ua=new va(new db(5,5,5),new Da({uniforms:a.uniforms,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1}));c();this.context=B;this.capabilities=ja;this.extensions=ia;this.properties=da;this.state=X;var Ja=new fe(this,aa,ra,ja);this.shadowMap=Ja;var Ka=new Ye(this,
|
|
|
-O),Oa=new We(this,P);this.getContext=function(){return B};this.getContextAttributes=function(){return B.getContextAttributes()};this.forceContextLoss=function(){ia.get("WEBGL_lose_context").loseContext()};this.getMaxAnisotropy=function(){return ja.getMaxAnisotropy()};this.getPrecision=function(){return ja.precision};this.getPixelRatio=function(){return Na};this.setPixelRatio=function(a){void 0!==a&&(Na=a,this.setSize(ga.z,ga.w,!1))};this.getSize=function(){return{width:Ma,height:gc}};this.setSize=
|
|
|
-function(a,b,c){Ma=a;gc=b;x.width=a*Na;x.height=b*Na;!1!==c&&(x.style.width=a+"px",x.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){X.viewport(ga.set(a,b,c,d))};this.setScissor=function(a,b,c,d){X.scissor(ha.set(a,b,c,d))};this.setScissorTest=function(a){X.setScissorTest(ka=a)};this.getClearColor=function(){return Ba};this.setClearColor=function(a,c){Ba.set(a);Pa=void 0!==c?c:1;b(Ba.r,Ba.g,Ba.b,Pa)};this.getClearAlpha=function(){return Pa};this.setClearAlpha=function(a){Pa=
|
|
|
-a;b(Ba.r,Ba.g,Ba.b,Pa)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=B.COLOR_BUFFER_BIT;if(void 0===b||b)d|=B.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=B.STENCIL_BUFFER_BIT;B.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.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=d;this.dispose=function(){A=[];Ea=-1;fa=[];C=-1;x.removeEventListener("webglcontextlost",
|
|
|
-e,!1)};this.renderBufferImmediate=function(a,b,c){X.initAttributes();var d=da.get(a);a.hasPositions&&!d.position&&(d.position=B.createBuffer());a.hasNormals&&!d.normal&&(d.normal=B.createBuffer());a.hasUvs&&!d.uv&&(d.uv=B.createBuffer());a.hasColors&&!d.color&&(d.color=B.createBuffer());b=b.getAttributes();a.hasPositions&&(B.bindBuffer(B.ARRAY_BUFFER,d.position),B.bufferData(B.ARRAY_BUFFER,a.positionArray,B.DYNAMIC_DRAW),X.enableAttribute(b.position),B.vertexAttribPointer(b.position,3,B.FLOAT,!1,
|
|
|
-0,0));if(a.hasNormals){B.bindBuffer(B.ARRAY_BUFFER,d.normal);if(!c.isMeshPhongMaterial&&!c.isMeshStandardMaterial&&1===c.shading)for(var e=0,f=3*a.count;e<f;e+=9){var g=a.normalArray,k=(g[e+0]+g[e+3]+g[e+6])/3,l=(g[e+1]+g[e+4]+g[e+7])/3,m=(g[e+2]+g[e+5]+g[e+8])/3;g[e+0]=k;g[e+1]=l;g[e+2]=m;g[e+3]=k;g[e+4]=l;g[e+5]=m;g[e+6]=k;g[e+7]=l;g[e+8]=m}B.bufferData(B.ARRAY_BUFFER,a.normalArray,B.DYNAMIC_DRAW);X.enableAttribute(b.normal);B.vertexAttribPointer(b.normal,3,B.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(B.bindBuffer(B.ARRAY_BUFFER,
|
|
|
-d.uv),B.bufferData(B.ARRAY_BUFFER,a.uvArray,B.DYNAMIC_DRAW),X.enableAttribute(b.uv),B.vertexAttribPointer(b.uv,2,B.FLOAT,!1,0,0));a.hasColors&&0!==c.vertexColors&&(B.bindBuffer(B.ARRAY_BUFFER,d.color),B.bufferData(B.ARRAY_BUFFER,a.colorArray,B.DYNAMIC_DRAW),X.enableAttribute(b.color),B.vertexAttribPointer(b.color,3,B.FLOAT,!1,0,0));X.disableUnusedAttributes();B.drawArrays(B.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){t(d);var g=w(a,b,d,e),l=!1;a=c.id+"_"+g.id+"_"+
|
|
|
-d.wireframe;a!==S&&(S=a,l=!0);b=e.morphTargetInfluences;if(void 0!==b){var m=[];a=0;for(var n=b.length;a<n;a++)l=b[a],m.push([l,a]);m.sort(k);8<m.length&&(m.length=8);var h=c.morphAttributes;a=0;for(n=m.length;a<n;a++)l=m[a],M[a]=l[0],0!==l[0]?(b=l[1],!0===d.morphTargets&&h.position&&c.addAttribute("morphTarget"+a,h.position[b]),!0===d.morphNormals&&h.normal&&c.addAttribute("morphNormal"+a,h.normal[b])):(!0===d.morphTargets&&c.removeAttribute("morphTarget"+a),!0===d.morphNormals&&c.removeAttribute("morphNormal"+
|
|
|
-a));a=m.length;for(b=M.length;a<b;a++)M[a]=0;g.getUniforms().setValue(B,"morphTargetInfluences",M);l=!0}b=c.index;n=c.attributes.position;m=1;!0===d.wireframe&&(b=ra.getWireframeAttribute(c),m=2);null!==b?(a=Ga,a.setIndex(b)):a=Fa;if(l){a:{var l=void 0,r;if(c&&c.isInstancedBufferGeometry&&(r=ia.get("ANGLE_instanced_arrays"),null===r)){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}void 0===
|
|
|
-l&&(l=0);X.initAttributes();var h=c.attributes,g=g.getAttributes(),p=d.defaultAttributeValues,u;for(u in g){var q=g[u];if(0<=q){var x=h[u];if(void 0!==x){var v=B.FLOAT,y=x.array,z=x.normalized;y instanceof Float32Array?v=B.FLOAT:y instanceof Float64Array?console.warn("Unsupported data buffer format: Float64Array"):y instanceof Uint16Array?v=B.UNSIGNED_SHORT:y instanceof Int16Array?v=B.SHORT:y instanceof Uint32Array?v=B.UNSIGNED_INT:y instanceof Int32Array?v=B.INT:y instanceof Int8Array?v=B.BYTE:y instanceof
|
|
|
-Uint8Array&&(v=B.UNSIGNED_BYTE);var y=x.itemSize,G=ra.getAttributeBuffer(x);if(x&&x.isInterleavedBufferAttribute){var E=x.data,J=E.stride,x=x.offset;E&&E.isInstancedInterleavedBuffer?(X.enableAttributeAndDivisor(q,E.meshPerAttribute,r),void 0===c.maxInstancedCount&&(c.maxInstancedCount=E.meshPerAttribute*E.count)):X.enableAttribute(q);B.bindBuffer(B.ARRAY_BUFFER,G);B.vertexAttribPointer(q,y,v,z,J*E.array.BYTES_PER_ELEMENT,(l*J+x)*E.array.BYTES_PER_ELEMENT)}else x&&x.isInstancedBufferAttribute?(X.enableAttributeAndDivisor(q,
|
|
|
-x.meshPerAttribute,r),void 0===c.maxInstancedCount&&(c.maxInstancedCount=x.meshPerAttribute*x.count)):X.enableAttribute(q),B.bindBuffer(B.ARRAY_BUFFER,G),B.vertexAttribPointer(q,y,v,z,0,l*y*x.array.BYTES_PER_ELEMENT)}else if(void 0!==p&&(v=p[u],void 0!==v))switch(v.length){case 2:B.vertexAttrib2fv(q,v);break;case 3:B.vertexAttrib3fv(q,v);break;case 4:B.vertexAttrib4fv(q,v);break;default:B.vertexAttrib1fv(q,v)}}}X.disableUnusedAttributes()}null!==b&&B.bindBuffer(B.ELEMENT_ARRAY_BUFFER,ra.getAttributeBuffer(b))}r=
|
|
|
-0;null!==b?r=b.count:void 0!==n&&(r=n.count);b=c.drawRange.start*m;n=null!==f?f.start*m:0;u=Math.max(b,n);f=Math.max(0,Math.min(r,b+c.drawRange.count*m,n+(null!==f?f.count*m:Infinity))-1-u+1);if(0!==f){if(e.isMesh)if(!0===d.wireframe)X.setLineWidth(d.wireframeLinewidth*(null===V?Na:1)),a.setMode(B.LINES);else switch(e.drawMode){case 0:a.setMode(B.TRIANGLES);break;case 1:a.setMode(B.TRIANGLE_STRIP);break;case 2:a.setMode(B.TRIANGLE_FAN)}else e.isLine?(d=d.linewidth,void 0===d&&(d=1),X.setLineWidth(d*
|
|
|
-(null===V?Na:1)),e.isLineSegments?a.setMode(B.LINES):a.setMode(B.LINE_STRIP)):e.isPoints&&a.setMode(B.POINTS);c&&c.isInstancedBufferGeometry?0<c.maxInstancedCount&&a.renderInstances(c,u,f):a.render(u,f)}};this.render=function(a,c,d,e){if(void 0!==c&&!0!==c.isCamera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{S="";K=-1;U=null;!0===a.autoUpdate&&a.updateMatrixWorld();null===c.parent&&c.updateMatrixWorld();c.matrixWorldInverse.getInverse(c.matrixWorld);
|
|
|
+if(1013===a)return B.INT;if(1014===a)return B.UNSIGNED_INT;if(1015===a)return B.FLOAT;if(1016===a&&(b=ia.get("OES_texture_half_float"),null!==b))return b.HALF_FLOAT_OES;if(1021===a)return B.ALPHA;if(1022===a)return B.RGB;if(1023===a)return B.RGBA;if(1024===a)return B.LUMINANCE;if(1025===a)return B.LUMINANCE_ALPHA;if(1026===a)return B.DEPTH_COMPONENT;if(1027===a)return B.DEPTH_STENCIL;if(100===a)return B.FUNC_ADD;if(101===a)return B.FUNC_SUBTRACT;if(102===a)return B.FUNC_REVERSE_SUBTRACT;if(200===
|
|
|
+a)return B.ZERO;if(201===a)return B.ONE;if(202===a)return B.SRC_COLOR;if(203===a)return B.ONE_MINUS_SRC_COLOR;if(204===a)return B.SRC_ALPHA;if(205===a)return B.ONE_MINUS_SRC_ALPHA;if(206===a)return B.DST_ALPHA;if(207===a)return B.ONE_MINUS_DST_ALPHA;if(208===a)return B.DST_COLOR;if(209===a)return B.ONE_MINUS_DST_COLOR;if(210===a)return B.SRC_ALPHA_SATURATE;if(2001===a||2002===a||2003===a||2004===a)if(b=ia.get("WEBGL_compressed_texture_s3tc"),null!==b){if(2001===a)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;
|
|
|
+if(2002===a)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(2003===a)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(2004===a)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(2100===a||2101===a||2102===a||2103===a)if(b=ia.get("WEBGL_compressed_texture_pvrtc"),null!==b){if(2100===a)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(2101===a)return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(2102===a)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(2103===a)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(2151===a&&(b=ia.get("WEBGL_compressed_texture_etc1"),
|
|
|
+null!==b))return b.COMPRESSED_RGB_ETC1_WEBGL;if(103===a||104===a)if(b=ia.get("EXT_blend_minmax"),null!==b){if(103===a)return b.MIN_EXT;if(104===a)return b.MAX_EXT}return 1020===a&&(b=ia.get("WEBGL_depth_texture"),null!==b)?b.UNSIGNED_INT_24_8_WEBGL:0}console.log("THREE.WebGLRenderer","82dev");a=a||{};var x=void 0!==a.canvas?a.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),J=void 0!==a.context?a.context:null,y=void 0!==a.alpha?a.alpha:!1,F=void 0!==a.depth?a.depth:!0,G=void 0!==
|
|
|
+a.stencil?a.stencil:!0,E=void 0!==a.antialias?a.antialias:!1,L=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,D=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,T=[],fa=[],C=-1,A=[],Ea=-1,M=new Float32Array(8),O=[],P=[];this.domElement=x;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.clippingPlanes=[];this.localClippingEnabled=!1;this.gammaFactor=2;this.physicallyCorrectLights=this.gammaOutput=this.gammaInput=
|
|
|
+!1;this.toneMappingWhitePoint=this.toneMappingExposure=this.toneMapping=1;this.maxMorphTargets=8;this.maxMorphNormals=4;var R=this,Q=null,V=null,W=null,K=-1,S="",U=null,Z=new ea,bb=null,Va=new ea,ba=0,Ba=new N(0),Pa=0,Ma=x.width,gc=x.height,Na=1,ha=new ea(0,0,Ma,gc),ka=!1,ga=new ea(0,0,Ma,gc),na=new ec,ca=new rf,oa=!1,pa=!1,ma=new Aa,qa=new H,Y=new q,aa={hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],point:[],
|
|
|
+pointShadowMap:[],pointShadowMatrix:[],hemi:[],shadows:[]},la={calls:0,vertices:0,faces:0,points:0};this.info={render:la,memory:{geometries:0,textures:0},programs:null};var B;try{y={alpha:y,depth:F,stencil:G,antialias:E,premultipliedAlpha:L,preserveDrawingBuffer:D};B=J||x.getContext("webgl",y)||x.getContext("experimental-webgl",y);if(null===B){if(null!==x.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}void 0===B.getShaderPrecisionFormat&&
|
|
|
+(B.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});x.addEventListener("webglcontextlost",e,!1)}catch(sf){console.error("THREE.WebGLRenderer: "+sf)}var ia=new qf(B);ia.get("WEBGL_depth_texture");ia.get("OES_texture_float");ia.get("OES_texture_float_linear");ia.get("OES_texture_half_float");ia.get("OES_texture_half_float_linear");ia.get("OES_standard_derivatives");ia.get("ANGLE_instanced_arrays");ia.get("OES_element_index_uint")&&(I.MaxIndex=4294967296);var ja=new pf(B,
|
|
|
+ia,a),X=new of(B,ia,v),da=new nf,sa=new mf(B,ia,X,da,ja,v,this.info),ra=new lf(B,da,this.info),ta=new jf(this,ja),ya=new af;this.info.programs=ta.programs;var Fa=new $e(B,ia,la),Ga=new Ze(B,ia,la),Ia=new Db(-1,1,1,-1,0,1),wa=new Ca,za=new va(new eb(2,2),new Ha({depthTest:!1,depthWrite:!1,fog:!1}));a=Cb.cube;var ua=new va(new db(5,5,5),new Da({uniforms:a.uniforms,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1}));c();this.context=B;this.capabilities=
|
|
|
+ja;this.extensions=ia;this.properties=da;this.state=X;var Ja=new fe(this,aa,ra,ja);this.shadowMap=Ja;var Ka=new Ye(this,O),Oa=new We(this,P);this.getContext=function(){return B};this.getContextAttributes=function(){return B.getContextAttributes()};this.forceContextLoss=function(){ia.get("WEBGL_lose_context").loseContext()};this.getMaxAnisotropy=function(){return ja.getMaxAnisotropy()};this.getPrecision=function(){return ja.precision};this.getPixelRatio=function(){return Na};this.setPixelRatio=function(a){void 0!==
|
|
|
+a&&(Na=a,this.setSize(ga.z,ga.w,!1))};this.getSize=function(){return{width:Ma,height:gc}};this.setSize=function(a,b,c){Ma=a;gc=b;x.width=a*Na;x.height=b*Na;!1!==c&&(x.style.width=a+"px",x.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){X.viewport(ga.set(a,b,c,d))};this.setScissor=function(a,b,c,d){X.scissor(ha.set(a,b,c,d))};this.setScissorTest=function(a){X.setScissorTest(ka=a)};this.getClearColor=function(){return Ba};this.setClearColor=function(a,c){Ba.set(a);
|
|
|
+Pa=void 0!==c?c:1;b(Ba.r,Ba.g,Ba.b,Pa)};this.getClearAlpha=function(){return Pa};this.setClearAlpha=function(a){Pa=a;b(Ba.r,Ba.g,Ba.b,Pa)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=B.COLOR_BUFFER_BIT;if(void 0===b||b)d|=B.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=B.STENCIL_BUFFER_BIT;B.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.clearTarget=function(a,b,c,d){this.setRenderTarget(a);
|
|
|
+this.clear(b,c,d)};this.resetGLState=d;this.dispose=function(){A=[];Ea=-1;fa=[];C=-1;x.removeEventListener("webglcontextlost",e,!1)};this.renderBufferImmediate=function(a,b,c){X.initAttributes();var d=da.get(a);a.hasPositions&&!d.position&&(d.position=B.createBuffer());a.hasNormals&&!d.normal&&(d.normal=B.createBuffer());a.hasUvs&&!d.uv&&(d.uv=B.createBuffer());a.hasColors&&!d.color&&(d.color=B.createBuffer());b=b.getAttributes();a.hasPositions&&(B.bindBuffer(B.ARRAY_BUFFER,d.position),B.bufferData(B.ARRAY_BUFFER,
|
|
|
+a.positionArray,B.DYNAMIC_DRAW),X.enableAttribute(b.position),B.vertexAttribPointer(b.position,3,B.FLOAT,!1,0,0));if(a.hasNormals){B.bindBuffer(B.ARRAY_BUFFER,d.normal);if(!c.isMeshPhongMaterial&&!c.isMeshStandardMaterial&&1===c.shading)for(var e=0,f=3*a.count;e<f;e+=9){var g=a.normalArray,k=(g[e+0]+g[e+3]+g[e+6])/3,l=(g[e+1]+g[e+4]+g[e+7])/3,m=(g[e+2]+g[e+5]+g[e+8])/3;g[e+0]=k;g[e+1]=l;g[e+2]=m;g[e+3]=k;g[e+4]=l;g[e+5]=m;g[e+6]=k;g[e+7]=l;g[e+8]=m}B.bufferData(B.ARRAY_BUFFER,a.normalArray,B.DYNAMIC_DRAW);
|
|
|
+X.enableAttribute(b.normal);B.vertexAttribPointer(b.normal,3,B.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(B.bindBuffer(B.ARRAY_BUFFER,d.uv),B.bufferData(B.ARRAY_BUFFER,a.uvArray,B.DYNAMIC_DRAW),X.enableAttribute(b.uv),B.vertexAttribPointer(b.uv,2,B.FLOAT,!1,0,0));a.hasColors&&0!==c.vertexColors&&(B.bindBuffer(B.ARRAY_BUFFER,d.color),B.bufferData(B.ARRAY_BUFFER,a.colorArray,B.DYNAMIC_DRAW),X.enableAttribute(b.color),B.vertexAttribPointer(b.color,3,B.FLOAT,!1,0,0));X.disableUnusedAttributes();B.drawArrays(B.TRIANGLES,
|
|
|
+0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){t(d);var g=w(a,b,d,e),l=!1;a=c.id+"_"+g.id+"_"+d.wireframe;a!==S&&(S=a,l=!0);b=e.morphTargetInfluences;if(void 0!==b){var m=[];a=0;for(var n=b.length;a<n;a++)l=b[a],m.push([l,a]);m.sort(k);8<m.length&&(m.length=8);var h=c.morphAttributes;a=0;for(n=m.length;a<n;a++)l=m[a],M[a]=l[0],0!==l[0]?(b=l[1],!0===d.morphTargets&&h.position&&c.addAttribute("morphTarget"+a,h.position[b]),!0===d.morphNormals&&h.normal&&c.addAttribute("morphNormal"+
|
|
|
+a,h.normal[b])):(!0===d.morphTargets&&c.removeAttribute("morphTarget"+a),!0===d.morphNormals&&c.removeAttribute("morphNormal"+a));a=m.length;for(b=M.length;a<b;a++)M[a]=0;g.getUniforms().setValue(B,"morphTargetInfluences",M);l=!0}b=c.index;n=c.attributes.position;m=1;!0===d.wireframe&&(b=ra.getWireframeAttribute(c),m=2);null!==b?(a=Ga,a.setIndex(b)):a=Fa;if(l){a:{var l=void 0,r;if(c&&c.isInstancedBufferGeometry&&(r=ia.get("ANGLE_instanced_arrays"),null===r)){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
|
|
|
+break a}void 0===l&&(l=0);X.initAttributes();var h=c.attributes,g=g.getAttributes(),p=d.defaultAttributeValues,u;for(u in g){var q=g[u];if(0<=q){var x=h[u];if(void 0!==x){var v=B.FLOAT,y=x.array,z=x.normalized;y instanceof Float32Array?v=B.FLOAT:y instanceof Float64Array?console.warn("Unsupported data buffer format: Float64Array"):y instanceof Uint16Array?v=B.UNSIGNED_SHORT:y instanceof Int16Array?v=B.SHORT:y instanceof Uint32Array?v=B.UNSIGNED_INT:y instanceof Int32Array?v=B.INT:y instanceof Int8Array?
|
|
|
+v=B.BYTE:y instanceof Uint8Array&&(v=B.UNSIGNED_BYTE);var y=x.itemSize,G=ra.getAttributeBuffer(x);if(x&&x.isInterleavedBufferAttribute){var E=x.data,J=E.stride,x=x.offset;E&&E.isInstancedInterleavedBuffer?(X.enableAttributeAndDivisor(q,E.meshPerAttribute,r),void 0===c.maxInstancedCount&&(c.maxInstancedCount=E.meshPerAttribute*E.count)):X.enableAttribute(q);B.bindBuffer(B.ARRAY_BUFFER,G);B.vertexAttribPointer(q,y,v,z,J*E.array.BYTES_PER_ELEMENT,(l*J+x)*E.array.BYTES_PER_ELEMENT)}else x&&x.isInstancedBufferAttribute?
|
|
|
+(X.enableAttributeAndDivisor(q,x.meshPerAttribute,r),void 0===c.maxInstancedCount&&(c.maxInstancedCount=x.meshPerAttribute*x.count)):X.enableAttribute(q),B.bindBuffer(B.ARRAY_BUFFER,G),B.vertexAttribPointer(q,y,v,z,0,l*y*x.array.BYTES_PER_ELEMENT)}else if(void 0!==p&&(v=p[u],void 0!==v))switch(v.length){case 2:B.vertexAttrib2fv(q,v);break;case 3:B.vertexAttrib3fv(q,v);break;case 4:B.vertexAttrib4fv(q,v);break;default:B.vertexAttrib1fv(q,v)}}}X.disableUnusedAttributes()}null!==b&&B.bindBuffer(B.ELEMENT_ARRAY_BUFFER,
|
|
|
+ra.getAttributeBuffer(b))}r=0;null!==b?r=b.count:void 0!==n&&(r=n.count);b=c.drawRange.start*m;n=null!==f?f.start*m:0;u=Math.max(b,n);f=Math.max(0,Math.min(r,b+c.drawRange.count*m,n+(null!==f?f.count*m:Infinity))-1-u+1);if(0!==f){if(e.isMesh)if(!0===d.wireframe)X.setLineWidth(d.wireframeLinewidth*(null===V?Na:1)),a.setMode(B.LINES);else switch(e.drawMode){case 0:a.setMode(B.TRIANGLES);break;case 1:a.setMode(B.TRIANGLE_STRIP);break;case 2:a.setMode(B.TRIANGLE_FAN)}else e.isLine?(d=d.linewidth,void 0===
|
|
|
+d&&(d=1),X.setLineWidth(d*(null===V?Na:1)),e.isLineSegments?a.setMode(B.LINES):a.setMode(B.LINE_STRIP)):e.isPoints&&a.setMode(B.POINTS);c&&c.isInstancedBufferGeometry?0<c.maxInstancedCount&&a.renderInstances(c,u,f):a.render(u,f)}};this.render=function(a,c,d,e){if(void 0!==c&&!0!==c.isCamera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{S="";K=-1;U=null;!0===a.autoUpdate&&a.updateMatrixWorld();null===c.parent&&c.updateMatrixWorld();c.matrixWorldInverse.getInverse(c.matrixWorld);
|
|
|
qa.multiplyMatrices(c.projectionMatrix,c.matrixWorldInverse);na.setFromMatrix(qa);T.length=0;Ea=C=-1;O.length=0;P.length=0;pa=this.localClippingEnabled;oa=ca.init(this.clippingPlanes,pa,c);n(a,c);fa.length=C+1;A.length=Ea+1;!0===R.sortObjects&&(fa.sort(l),A.sort(m));oa&&ca.beginShadows();for(var f=T,g=0,k=0,h=f.length;k<h;k++){var r=f[k];r.castShadow&&(aa.shadows[g++]=r)}aa.shadows.length=g;Ja.render(a,c);for(var f=T,p=r=0,t=0,w,x,q,v,y=c.matrixWorldInverse,z=0,G=0,E=0,J=0,g=0,k=f.length;g<k;g++)if(h=
|
|
|
f[g],w=h.color,x=h.intensity,q=h.distance,v=h.shadow&&h.shadow.map?h.shadow.map.texture:null,h.isAmbientLight)r+=w.r*x,p+=w.g*x,t+=w.b*x;else if(h.isDirectionalLight){var F=ya.get(h);F.color.copy(h.color).multiplyScalar(h.intensity);F.direction.setFromMatrixPosition(h.matrixWorld);Y.setFromMatrixPosition(h.target.matrixWorld);F.direction.sub(Y);F.direction.transformDirection(y);if(F.shadow=h.castShadow)F.shadowBias=h.shadow.bias,F.shadowRadius=h.shadow.radius,F.shadowMapSize=h.shadow.mapSize;aa.directionalShadowMap[z]=
|
|
|
v;aa.directionalShadowMatrix[z]=h.shadow.matrix;aa.directional[z++]=F}else if(h.isSpotLight){F=ya.get(h);F.position.setFromMatrixPosition(h.matrixWorld);F.position.applyMatrix4(y);F.color.copy(w).multiplyScalar(x);F.distance=q;F.direction.setFromMatrixPosition(h.matrixWorld);Y.setFromMatrixPosition(h.target.matrixWorld);F.direction.sub(Y);F.direction.transformDirection(y);F.coneCos=Math.cos(h.angle);F.penumbraCos=Math.cos(h.angle*(1-h.penumbra));F.decay=0===h.distance?0:h.decay;if(F.shadow=h.castShadow)F.shadowBias=
|