|
@@ -720,7 +720,7 @@ THREE.WebGLShadowMap=function(a,b,c){function d(a,b,c,d){var e=a.geometry,f=null
|
|
|
new THREE.Vector3(0,0,1),new THREE.Vector3(0,0,-1),new THREE.Vector3(0,1,0),new THREE.Vector3(0,-1,0)],u=[new THREE.Vector3(0,1,0),new THREE.Vector3(0,1,0),new THREE.Vector3(0,1,0),new THREE.Vector3(0,1,0),new THREE.Vector3(0,0,1),new THREE.Vector3(0,0,-1)],s=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],w=THREE.ShaderLib.depthRGBA,v=THREE.UniformsUtils.clone(w.uniforms),C=THREE.ShaderLib.distanceRGBA,x=THREE.UniformsUtils.clone(C.uniforms),
|
|
|
D=0;4!==D;++D){var A=0!==(D&1),B=0!==(D&2),y=new THREE.ShaderMaterial({uniforms:v,vertexShader:w.vertexShader,fragmentShader:w.fragmentShader,morphTargets:A,skinning:B});y._shadowPass=!0;l[D]=y;A=new THREE.ShaderMaterial({uniforms:x,vertexShader:C.vertexShader,fragmentShader:C.fragmentShader,morphTargets:A,skinning:B});A._shadowPass=!0;q[D]=A}var I=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;this.render=function(l,q){var w,
|
|
|
v;if(!1!==I.enabled&&(!1!==I.autoUpdate||!1!==I.needsUpdate)){g.clearColor(1,1,1,1);g.disable(f.BLEND);g.enable(f.CULL_FACE);f.frontFace(f.CCW);f.cullFace(I.cullFace===THREE.CullFaceFront?f.FRONT:f.BACK);g.setDepthTest(!0);g.setScissorTest(!1);for(var x=b.shadows,C=0,B=x.length;C<B;C++){var A=x[C],D=A.shadow,y=D.camera,R=D.mapSize;if(A instanceof THREE.PointLight){w=6;v=!0;var M=R.x/4,E=R.y/2;s[0].set(2*M,E,M,E);s[1].set(0,E,M,E);s[2].set(3*M,E,M,E);s[3].set(M,E,M,E);s[4].set(3*M,0,M,E);s[5].set(M,
|
|
|
-0,M,E)}else w=1,v=!1;null===D.map&&(D.map=new THREE.WebGLRenderTarget(R.x,R.y,{minFilter:THREE.NearestFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat}),A instanceof THREE.SpotLight&&(y.aspect=R.x/R.y),y.updateProjectionMatrix());R=D.map;D=D.matrix;n.setFromMatrixPosition(A.matrixWorld);y.position.copy(n);a.setRenderTarget(R);a.clear();for(R=0;R<w;R++)for(v?(m.copy(y.position),m.add(t[R]),y.up.copy(u[R]),y.lookAt(m),g.viewport(s[R])):(m.setFromMatrixPosition(A.target.matrixWorld),y.lookAt(m)),
|
|
|
+0,M,E)}else w=1,v=!1;null===D.map&&(D.map=new THREE.WebGLRenderTarget(R.x,R.y,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat}),A instanceof THREE.SpotLight&&(y.aspect=R.x/R.y),y.updateProjectionMatrix());R=D.map;D=D.matrix;n.setFromMatrixPosition(A.matrixWorld);y.position.copy(n);a.setRenderTarget(R);a.clear();for(R=0;R<w;R++)for(v?(m.copy(y.position),m.add(t[R]),y.up.copy(u[R]),y.lookAt(m),g.viewport(s[R])):(m.setFromMatrixPosition(A.target.matrixWorld),y.lookAt(m)),
|
|
|
y.updateMatrixWorld(),y.matrixWorldInverse.getInverse(y.matrixWorld),D.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),D.multiply(y.projectionMatrix),D.multiply(y.matrixWorldInverse),k.multiplyMatrices(y.projectionMatrix,y.matrixWorldInverse),h.setFromMatrix(k),p.length=0,e(l,q,y),M=0,E=p.length;M<E;M++){var V=p[M],W=c.update(V),Z=V.material;if(Z instanceof THREE.MultiMaterial)for(var ia=W.groups,Z=Z.materials,da=0,Y=ia.length;da<Y;da++){var ga=ia[da],ba=Z[ga.materialIndex];!0===ba.visible&&(ba=d(V,ba,
|
|
|
v,n),a.renderBufferDirect(y,null,W,ba,V,ga))}else ba=d(V,Z,v,n),a.renderBufferDirect(y,null,W,ba,V,null)}a.resetGLState()}w=a.getClearColor();v=a.getClearAlpha();a.setClearColor(w,v);g.enable(f.BLEND);I.cullFace===THREE.CullFaceFront&&f.cullFace(f.BACK);a.resetGLState();I.needsUpdate=!1}}};
|
|
|
THREE.WebGLState=function(a,b,c){var d=this,e=new THREE.Vector4,f=new Uint8Array(16),g=new Uint8Array(16),h=new Uint8Array(16),k={},m=null,n=null,p=null,l=null,q=null,t=null,u=null,s=null,w=null,v=null,C=null,x=null,D=null,A=null,B=null,y=null,I=null,F=null,z=null,J=null,P=null,N=null,K=null,G=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),L=void 0,Q={},O=new THREE.Vector4,R=null,M=null,E=new THREE.Vector4,V=new THREE.Vector4;this.init=function(){this.clearColor(0,0,0,1);this.clearDepth(1);this.clearStencil(0);
|