|
@@ -716,7 +716,7 @@ A=0;4!==A;++A){var z=0!==(A&1),y=0!==(A&2),H=new THREE.ShaderMaterial({uniforms:
|
|
|
x;if(!1!==G.enabled&&(!1!==G.autoUpdate||!1!==G.needsUpdate)){var C=g.getScissorTest();a.getViewport(w);f.clearColor(1,1,1,1);g.disable(f.BLEND);g.enable(f.CULL_FACE);f.frontFace(f.CCW);f.cullFace(G.cullFace===THREE.CullFaceFront?f.FRONT:f.BACK);g.setDepthTest(!0);g.setScissorTest(!1);for(var y=b.shadows,z=0,A=y.length;z<A;z++){var D=y[z],H=D.shadow,L=H.camera,F=H.mapSize;if(D instanceof THREE.PointLight){v=6;x=!0;var R=F.x/4,T=F.y/2;s[0].set(2*R,T,R,T);s[1].set(0,T,R,T);s[2].set(3*R,T,R,T);s[3].set(R,
|
|
|
T,R,T);s[4].set(3*R,0,R,T);s[5].set(R,0,R,T)}else v=1,x=!1;null===H.map&&(R=THREE.LinearFilter,G.type===THREE.PCFSoftShadowMap&&(R=THREE.NearestFilter),H.map=new THREE.WebGLRenderTarget(F.x,F.y,{minFilter:R,magFilter:R,format:THREE.RGBAFormat}),H.matrix=new THREE.Matrix4,D instanceof THREE.SpotLight&&(L.aspect=F.x/F.y),L.updateProjectionMatrix());F=H.map;H=H.matrix;m.setFromMatrixPosition(D.matrixWorld);L.position.copy(m);a.setRenderTarget(F);a.clear();for(F=0;F<v;F++)for(x?(l.copy(L.position),l.add(t[F]),
|
|
|
L.up.copy(u[F]),L.lookAt(l),R=s[F],a.setViewport(R.x,R.y,R.z,R.w)):(l.setFromMatrixPosition(D.target.matrixWorld),L.lookAt(l)),L.updateMatrixWorld(),L.matrixWorldInverse.getInverse(L.matrixWorld),H.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),H.multiply(L.projectionMatrix),H.multiply(L.matrixWorldInverse),k.multiplyMatrices(L.projectionMatrix,L.matrixWorldInverse),h.setFromMatrix(k),p.length=0,e(n,q,L),R=0,T=p.length;R<T;R++){var Y=p[R],aa=c.update(Y),ba=Y.material;if(ba instanceof THREE.MeshFaceMaterial)for(var da=
|
|
|
-aa.groups,ba=ba.materials,ea=0,ua=da.length;ea<ua;ea++){var ha=da[ea],$=ba[ha.materialIndex];!0===$.visible&&($=d(Y,$,x,m),a.renderBufferDirect(L,null,aa,$,Y,ha))}else $=d(Y,ba,x,m),a.renderBufferDirect(L,null,aa,$,Y,null)}a.resetGLState()}a.setViewport(w.x,w.y,w.z,w.w);v=a.getClearColor();x=a.getClearAlpha();a.setClearColor(v,x);g.enable(f.BLEND);!0===C&&g.setScissorTest(!0);G.cullFace===THREE.CullFaceFront&&f.cullFace(f.BACK);a.resetGLState();G.needsUpdate=!1}}};
|
|
|
+aa.groups,ba=ba.materials,ea=0,ua=da.length;ea<ua;ea++){var ha=da[ea],$=ba[ha.materialIndex];!0===$.visible&&($=d(Y,$,x,m),a.renderBufferDirect(L,null,aa,$,Y,ha))}else $=d(Y,ba,x,m),a.renderBufferDirect(L,null,aa,$,Y,null)}a.resetGLState()}a.setRenderTarget(null);a.setViewport(w.x,w.y,w.z,w.w);v=a.getClearColor();x=a.getClearAlpha();a.setClearColor(v,x);g.enable(f.BLEND);!0===C&&g.setScissorTest(!0);G.cullFace===THREE.CullFaceFront&&f.cullFace(f.BACK);a.resetGLState();G.needsUpdate=!1}}};
|
|
|
THREE.WebGLState=function(a,b,c){var d=this,e=new Uint8Array(16),f=new Uint8Array(16),g=new Uint8Array(16),h={},k=null,l=null,m=null,p=null,n=null,q=null,t=null,u=null,s=null,w=null,v=null,C=null,x=null,D=null,A=null,z=null,y=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),H=void 0,G={};this.init=function(){a.clearColor(0,0,0,1);a.clearDepth(1);a.clearStencil(0);this.enable(a.DEPTH_TEST);a.depthFunc(a.LEQUAL);a.frontFace(a.CCW);a.cullFace(a.BACK);this.enable(a.CULL_FACE);this.enable(a.BLEND);a.blendEquation(a.FUNC_ADD);
|
|
|
a.blendFunc(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA)};this.initAttributes=function(){for(var a=0,b=e.length;a<b;a++)e[a]=0};this.enableAttribute=function(c){e[c]=1;0===f[c]&&(a.enableVertexAttribArray(c),f[c]=1);0!==g[c]&&(b.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(c,0),g[c]=0)};this.enableAttributeAndDivisor=function(b,c,d){e[b]=1;0===f[b]&&(a.enableVertexAttribArray(b),f[b]=1);g[b]!==c&&(d.vertexAttribDivisorANGLE(b,c),g[b]=c)};this.disableUnusedAttributes=function(){for(var b=0,c=f.length;b<
|
|
|
c;b++)f[b]!==e[b]&&(a.disableVertexAttribArray(b),f[b]=0)};this.enable=function(b){!0!==h[b]&&(a.enable(b),h[b]=!0)};this.disable=function(b){!1!==h[b]&&(a.disable(b),h[b]=!1)};this.getCompressedTextureFormats=function(){if(null===k&&(k=[],b.get("WEBGL_compressed_texture_pvrtc")||b.get("WEBGL_compressed_texture_s3tc")))for(var c=a.getParameter(a.COMPRESSED_TEXTURE_FORMATS),d=0;d<c.length;d++)k.push(c[d]);return k};this.setBlending=function(b,d,e,f,g,h,k){b!==l&&(b===THREE.NoBlending?this.disable(a.BLEND):
|