| 102 | h.copy(k.mapSize);h.min(l);if(ha){var y=h.x,x=h.y;z[0].set(2*y,x,y,x);z[1].set(0,x,y,x);z[2].set(3*y,x,y,x);z[3].set(y,x,y,x);z[4].set(3*y,0,y,x);z[5].set(y,0,y,x);h.x*=4;h.y*=2}null===k.map&&(k.map=new Sa(h.x,h.y,{minFilter:1003,magFilter:1003,format:1023}),k.map.texture.name=n.name+".shadowMap",S.updateProjectionMatrix());k.isSpotLightShadow&&k.update(n);y=k.map;x=k.matrix;q.setFromMatrixPosition(n.matrixWorld);S.position.copy(q);ha?(k=6,x.makeTranslation(-q.x,-q.y,-q.z)):(k=1,m.setFromMatrixPosition(n.target.matrixWorld), |
| 103 | S.lookAt(m),S.updateMatrixWorld(),x.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),x.multiply(S.projectionMatrix),x.multiply(S.matrixWorldInverse));a.setRenderTarget(y);a.clear();for(n=0;n<k;n++)ha&&(m.copy(S.position),m.add(u[n]),S.up.copy(w[n]),S.lookAt(m),S.updateMatrixWorld(),v.viewport(z[n])),g.multiplyMatrices(S.projectionMatrix,S.matrixWorldInverse),f.setFromMatrix(g),e(c,d,S,ha)}}G.needsUpdate=!1;a.setRenderTarget(p)}}}function eh(a,b,c,d){function e(b,c,d){var e=new Uint8Array(4),f=a.createTexture(); |
| 104 | a.bindTexture(b,f);a.texParameteri(b,10241,9728);a.texParameteri(b,10240,9728);for(b=0;b<d;b++)a.texImage2D(c+b,0,6408,1,1,0,6408,5121,e);return f}function f(c,e){z[c]=1;0===x[c]&&(a.enableVertexAttribArray(c),x[c]=1);y[c]!==e&&((d.isWebGL2?a:b.get("ANGLE_instanced_arrays"))[d.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](c,e),y[c]=e)}function g(b){!0!==F[b]&&(a.enable(b),F[b]=!0)}function h(b){!1!==F[b]&&(a.disable(b),F[b]=!1)}function l(b,d,e,f,l,m,q,p){if(0===b)pa&&(h(3042),pa=!1); |
| 105 | else if(pa||(g(3042),pa=!0),5!==b){if(b!==I||p!==ha){if(100!==C||100!==D)a.blendEquation(32774),D=C=100;if(p)switch(b){case 1:a.blendFuncSeparate(1,771,1,771);break;case 2:a.blendFunc(1,1);break;case 3:a.blendFuncSeparate(0,0,769,771);break;case 4:a.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",b)}else switch(b){case 1:a.blendFuncSeparate(770,771,1,771);break;case 2:a.blendFunc(770,1);break;case 3:a.blendFunc(0,769);break;case 4:a.blendFunc(0,768); |
| 106 | break;default:console.error("THREE.WebGLState: Invalid blending: ",b)}J=B=fe=E=null;I=b;ha=p}}else{l=l||d;m=m||e;q=q||f;if(d!==C||l!==D)a.blendEquationSeparate(c.convert(d),c.convert(l)),C=d,D=l;if(e!==E||f!==fe||m!==B||q!==J)a.blendFuncSeparate(c.convert(e),c.convert(f),c.convert(m),c.convert(q)),E=e,fe=f,B=m,J=q;I=b;ha=null}}function m(b){S!==b&&(b?a.frontFace(2304):a.frontFace(2305),S=b)}function q(b){0!==b?(g(2884),b!==ge&&(1===b?a.cullFace(1029):2===b?a.cullFace(1028):a.cullFace(1032))):h(2884); |
| 107 | ge=b}function p(b,c,d){if(b){if(g(32823),bb!==c||sf!==d)a.polygonOffset(c,d),bb=c,sf=d}else h(32823)}function v(b){void 0===b&&(b=33984+A-1);P!==b&&(a.activeTexture(b),P=b)}var k=new function(){var b=!1,c=new W,d=null,e=new W(0,0,0,0);return{setMask:function(c){d===c||b||(a.colorMask(c,c,c,c),d=c)},setLocked:function(a){b=a},setClear:function(b,d,f,g,h){!0===h&&(b*=g,d*=g,f*=g);c.set(b,d,f,g);!1===e.equals(c)&&(a.clearColor(b,d,f,g),e.copy(c))},reset:function(){b=!1;d=null;e.set(-1,0,0,0)}}},r=new function(){var b= |
| 108 | !1,c=null,d=null,e=null;return{setTest:function(a){a?g(2929):h(2929)},setMask:function(d){c===d||b||(a.depthMask(d),c=d)},setFunc:function(b){if(d!==b){if(b)switch(b){case 0:a.depthFunc(512);break;case 1:a.depthFunc(519);break;case 2:a.depthFunc(513);break;case 3:a.depthFunc(515);break;case 4:a.depthFunc(514);break;case 5:a.depthFunc(518);break;case 6:a.depthFunc(516);break;case 7:a.depthFunc(517);break;default:a.depthFunc(515)}else a.depthFunc(515);d=b}},setLocked:function(a){b=a},setClear:function(b){e!== |
| 109 | b&&(a.clearDepth(b),e=b)},reset:function(){b=!1;e=d=c=null}}},u=new function(){var b=!1,c=null,d=null,e=null,f=null,l=null,m=null,q=null,p=null;return{setTest:function(a){a?g(2960):h(2960)},setMask:function(d){c===d||b||(a.stencilMask(d),c=d)},setFunc:function(b,c,g){if(d!==b||e!==c||f!==g)a.stencilFunc(b,c,g),d=b,e=c,f=g},setOp:function(b,c,d){if(l!==b||m!==c||q!==d)a.stencilOp(b,c,d),l=b,m=c,q=d},setLocked:function(a){b=a},setClear:function(b){p!==b&&(a.clearStencil(b),p=b)},reset:function(){b= |