提交 70b9770b 编写于 作者: M Mr.doob

Updated builds.

上级 0f57208c
......@@ -30215,6 +30215,8 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
shadow.map = new THREE.WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y, pars );
shadowCamera.updateProjectionMatrix();
}
if ( shadow instanceof THREE.SpotLightShadow ) {
......
......@@ -721,7 +721,7 @@ THREE.WebGLShadowMap=function(a,b,c){function d(a,b,c,d){var e=a.geometry,f=null
new THREE.Vector3(-1,0,0),new THREE.Vector3(0,0,1),new THREE.Vector3(0,0,-1),new THREE.Vector3(0,1,0),new THREE.Vector3(0,-1,0)],s=[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)],w=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4];b=THREE.ShaderLib.depthRGBA;for(var C=THREE.UniformsUtils.clone(b.uniforms),x=THREE.ShaderLib.distanceRGBA,
B=THREE.UniformsUtils.clone(x.uniforms),A=0;4!==A;++A){var z=0!==(A&1),y=0!==(A&2),F=new THREE.ShaderMaterial({uniforms:C,vertexShader:b.vertexShader,fragmentShader:b.fragmentShader,morphTargets:z,skinning:y});u[A]=F;z=new THREE.ShaderMaterial({defines:{USE_SHADOWMAP:""},uniforms:B,vertexShader:x.vertexShader,fragmentShader:x.fragmentShader,morphTargets:z,skinning:y});v[A]=z}var E=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;
this.render=function(b,u){if(!1!==E.enabled&&(!1!==E.autoUpdate||!1!==E.needsUpdate)&&0!==l.length){g.clearColor(1,1,1,1);g.disable(f.BLEND);g.enable(f.CULL_FACE);f.frontFace(f.CCW);f.cullFace(E.cullFace===THREE.CullFaceFront?f.FRONT:f.BACK);g.setDepthTest(!0);g.setScissorTest(!1);for(var v,x,C=0,y=l.length;C<y;C++){var A=l[C],z=A.shadow,B=z.camera;n.copy(z.mapSize);if(A instanceof THREE.PointLight){v=6;x=!0;var F=n.x,L=n.y;w[0].set(2*F,L,F,L);w[1].set(0,L,F,L);w[2].set(3*F,L,F,L);w[3].set(F,L,F,
L);w[4].set(3*F,0,F,L);w[5].set(F,0,F,L);n.x*=4;n.y*=2}else v=1,x=!1;null===z.map&&(z.map=new THREE.WebGLRenderTarget(n.x,n.y,{minFilter:THREE.NearestFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat}));z instanceof THREE.SpotLightShadow&&z.update(A);F=z.map;z=z.matrix;m.setFromMatrixPosition(A.matrixWorld);B.position.copy(m);a.setRenderTarget(F);a.clear();for(F=0;F<v;F++){x?(p.copy(B.position),p.add(t[F]),B.up.copy(s[F]),B.lookAt(p),g.viewport(w[F])):(p.setFromMatrixPosition(A.target.matrixWorld),
L);w[4].set(3*F,0,F,L);w[5].set(F,0,F,L);n.x*=4;n.y*=2}else v=1,x=!1;null===z.map&&(z.map=new THREE.WebGLRenderTarget(n.x,n.y,{minFilter:THREE.NearestFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat}),B.updateProjectionMatrix());z instanceof THREE.SpotLightShadow&&z.update(A);F=z.map;z=z.matrix;m.setFromMatrixPosition(A.matrixWorld);B.position.copy(m);a.setRenderTarget(F);a.clear();for(F=0;F<v;F++){x?(p.copy(B.position),p.add(t[F]),B.up.copy(s[F]),B.lookAt(p),g.viewport(w[F])):(p.setFromMatrixPosition(A.target.matrixWorld),
B.lookAt(p));B.updateMatrixWorld();B.matrixWorldInverse.getInverse(B.matrixWorld);z.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);z.multiply(B.projectionMatrix);z.multiply(B.matrixWorldInverse);k.multiplyMatrices(B.projectionMatrix,B.matrixWorldInverse);h.setFromMatrix(k);q.length=0;e(b,u,B);for(var L=0,D=q.length;L<D;L++){var W=q[L],T=c.update(W),Z=W.material;if(Z instanceof THREE.MultiMaterial)for(var $=T.groups,Z=Z.materials,ea=0,na=$.length;ea<na;ea++){var Y=$[ea],ca=Z[Y.materialIndex];!0===ca.visible&&
(ca=d(W,ca,x,m),a.renderBufferDirect(B,null,T,ca,W,Y))}else ca=d(W,Z,x,m),a.renderBufferDirect(B,null,T,ca,W,null)}}}v=a.getClearColor();x=a.getClearAlpha();a.setClearColor(v,x);g.enable(f.BLEND);E.cullFace===THREE.CullFaceFront&&f.cullFace(f.BACK);E.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={},l=null,n=null,p=null,m=null,q=null,u=null,v=null,t=null,s=!1,w=null,C=null,x=null,B=null,A=null,z=null,y=null,F=null,E=null,H=null,K=null,G=null,P=null,I=null,M=null,N=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),O=void 0,R={},Q=new THREE.Vector4,L=null,D=null,W=new THREE.Vector4,T=new THREE.Vector4,Z=a.createTexture();a.bindTexture(a.TEXTURE_2D,Z);a.texParameteri(a.TEXTURE_2D,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册