提交 32ecf787 编写于 作者: M Mr.doob

Updated builds.

上级 0fd4d865
......@@ -16090,7 +16090,9 @@ THREE.CanvasRenderer = function ( parameters ) {
_canvasWidthHalf = Math.floor( _canvasWidth / 2 ),
_canvasHeightHalf = Math.floor( _canvasHeight / 2 ),
_context = _canvas.getContext( '2d' ),
_context = _canvas.getContext( '2d', {
alpha: parameters.alpha === true
} ),
_clearColor = new THREE.Color( 0x000000 ),
_clearAlpha = 0,
......
......@@ -321,11 +321,11 @@ function g(a,b,c,d,g,h,k,m,l,n,p,r,q){if(!(q instanceof THREE.DataTexture)){!1==
a-q*k-c*m,b=b-n*k-d*m,y.save(),y.transform(q,n,c,d,a,b),y.fill(),y.restore())}else v("rgba(0,0,0,1)"),y.fill()}}function h(a,b,c,d,e,f,g,h,k,m,l,n,p){var q,r;q=p.width-1;r=p.height-1;g*=q;h*=r;c-=a;d-=b;e-=a;f-=b;k=k*q-g;m=m*r-h;l=l*q-g;n=n*r-h;r=1/(k*n-l*m);q=(n*c-m*e)*r;m=(n*d-m*f)*r;c=(k*e-l*c)*r;d=(k*f-l*d)*r;a=a-q*g-c*h;b=b-m*g-d*h;y.save();y.transform(q,m,c,d,a,b);y.clip();y.drawImage(p,0,0);y.restore()}function k(a,b,c,d){qa[0]=255*a.r|0;qa[1]=255*a.g|0;qa[2]=255*a.b|0;qa[4]=255*b.r|0;qa[5]=
255*b.g|0;qa[6]=255*b.b|0;qa[8]=255*c.r|0;qa[9]=255*c.g|0;qa[10]=255*c.b|0;qa[12]=255*d.r|0;qa[13]=255*d.g|0;qa[14]=255*d.b|0;Ma.putImageData(Pa,0,0);qb.drawImage(Qa,0,0);return cb}function l(a,b,c){var d=b.x-a.x,e=b.y-a.y,f=d*d+e*e;0!==f&&(c/=Math.sqrt(f),d*=c,e*=c,b.x+=d,b.y+=e,a.x-=d,a.y-=e)}function n(a){A!==a&&(A=y.globalAlpha=a)}function s(a){L!==a&&(a===THREE.NormalBlending?y.globalCompositeOperation="source-over":a===THREE.AdditiveBlending?y.globalCompositeOperation="lighter":a===THREE.SubtractiveBlending&&
(y.globalCompositeOperation="darker"),L=a)}function r(a){R!==a&&(R=y.lineWidth=a)}function q(a){fa!==a&&(fa=y.lineCap=a)}function u(a){V!==a&&(V=y.lineJoin=a)}function p(a){Q!==a&&(Q=y.strokeStyle=a)}function v(a){Y!==a&&(Y=y.fillStyle=a)}function w(a,b){if(ga!==a||J!==b)y.setLineDash([a,b]),ga=a,J=b}console.log("THREE.CanvasRenderer",THREE.REVISION);var t=THREE.Math.smoothstep;a=a||{};var x=this,z,B,E,H=new THREE.Projector,D=void 0!==a.canvas?a.canvas:document.createElement("canvas"),G=D.width,I=
D.height,O=Math.floor(G/2),K=Math.floor(I/2),y=D.getContext("2d"),F=new THREE.Color(0),C=0,A=1,L=0,Q=null,Y=null,R=null,fa=null,V=null,ga=null,J=0,da,W,N,ca;new THREE.RenderableVertex;new THREE.RenderableVertex;var sa,T,Ja,S,$,Fa,ta=new THREE.Color,oa=new THREE.Color,za=new THREE.Color,Aa=new THREE.Color,Ua=new THREE.Color,Va=new THREE.Color,ka=new THREE.Color,Ka=new THREE.Color,la={},Ba,Ia,ma,Ca,ba,wa,xa,Da,Wa,La,Ea=new THREE.Box2,na=new THREE.Box2,Oa=new THREE.Box2,hb=new THREE.Color,ya=new THREE.Color,
ia=new THREE.Color,Na=new THREE.Vector3,ha=new THREE.Vector3,m=new THREE.Matrix3,Qa,Ma,Pa,qa,cb,qb,db=16;Qa=document.createElement("canvas");Qa.width=Qa.height=2;Ma=Qa.getContext("2d");Ma.fillStyle="rgba(0,0,0,1)";Ma.fillRect(0,0,2,2);Pa=Ma.getImageData(0,0,2,2);qa=Pa.data;cb=document.createElement("canvas");cb.width=cb.height=db;qb=cb.getContext("2d");qb.translate(-db/2,-db/2);qb.scale(db,db);db--;void 0===y.setLineDash&&(y.setLineDash=void 0!==y.mozDash?function(a){y.mozDash=null!==a[0]?a:null}:
function(){});this.domElement=D;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.supportsVertexTextures=function(){};this.setFaceCulling=function(){};this.setSize=function(a,b,c){G=a*this.devicePixelRatio;I=b*this.devicePixelRatio;O=Math.floor(G/2);K=Math.floor(I/2);D.width=G;D.height=I;1!==this.devicePixelRatio&&!1!==c&&(D.style.width=
a+"px",D.style.height=b+"px");Ea.min.set(-O,-K);Ea.max.set(O,K);na.min.set(-O,-K);na.max.set(O,K);A=1;L=0;V=fa=R=Y=Q=null};this.setClearColor=function(a,b){F.set(a);C=void 0!==b?b:1;na.min.set(-O,-K);na.max.set(O,K)};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getMaxAnisotropy=function(){return 0};this.clear=function(){y.setTransform(1,0,0,-1,O,K);!1===na.empty()&&(na.intersect(Ea),
na.expandByScalar(2),1>C&&y.clearRect(na.min.x|0,na.min.y|0,na.max.x-na.min.x|0,na.max.y-na.min.y|0),0<C&&(s(THREE.NormalBlending),n(1),v("rgba("+Math.floor(255*F.r)+","+Math.floor(255*F.g)+","+Math.floor(255*F.b)+","+C+")"),y.fillRect(na.min.x|0,na.min.y|0,na.max.x-na.min.x|0,na.max.y-na.min.y|0)),na.makeEmpty())};this.clearColor=function(){};this.clearDepth=function(){};this.clearStencil=function(){};this.render=function(a,D){if(!1===D instanceof THREE.Camera)console.error("THREE.CanvasRenderer.render: camera is not an instance of THREE.Camera.");
D.height,O=Math.floor(G/2),K=Math.floor(I/2),y=D.getContext("2d",{alpha:!0===a.alpha}),F=new THREE.Color(0),C=0,A=1,L=0,Q=null,Y=null,R=null,fa=null,V=null,ga=null,J=0,da,W,N,ca;new THREE.RenderableVertex;new THREE.RenderableVertex;var sa,T,Ja,S,$,Fa,ta=new THREE.Color,oa=new THREE.Color,za=new THREE.Color,Aa=new THREE.Color,Ua=new THREE.Color,Va=new THREE.Color,ka=new THREE.Color,Ka=new THREE.Color,la={},Ba,Ia,ma,Ca,ba,wa,xa,Da,Wa,La,Ea=new THREE.Box2,na=new THREE.Box2,Oa=new THREE.Box2,hb=new THREE.Color,
ya=new THREE.Color,ia=new THREE.Color,Na=new THREE.Vector3,ha=new THREE.Vector3,m=new THREE.Matrix3,Qa,Ma,Pa,qa,cb,qb,db=16;Qa=document.createElement("canvas");Qa.width=Qa.height=2;Ma=Qa.getContext("2d");Ma.fillStyle="rgba(0,0,0,1)";Ma.fillRect(0,0,2,2);Pa=Ma.getImageData(0,0,2,2);qa=Pa.data;cb=document.createElement("canvas");cb.width=cb.height=db;qb=cb.getContext("2d");qb.translate(-db/2,-db/2);qb.scale(db,db);db--;void 0===y.setLineDash&&(y.setLineDash=void 0!==y.mozDash?function(a){y.mozDash=
null!==a[0]?a:null}:function(){});this.domElement=D;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.supportsVertexTextures=function(){};this.setFaceCulling=function(){};this.setSize=function(a,b,c){G=a*this.devicePixelRatio;I=b*this.devicePixelRatio;O=Math.floor(G/2);K=Math.floor(I/2);D.width=G;D.height=I;1!==this.devicePixelRatio&&
!1!==c&&(D.style.width=a+"px",D.style.height=b+"px");Ea.min.set(-O,-K);Ea.max.set(O,K);na.min.set(-O,-K);na.max.set(O,K);A=1;L=0;V=fa=R=Y=Q=null};this.setClearColor=function(a,b){F.set(a);C=void 0!==b?b:1;na.min.set(-O,-K);na.max.set(O,K)};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getMaxAnisotropy=function(){return 0};this.clear=function(){y.setTransform(1,0,0,-1,O,K);!1===na.empty()&&
(na.intersect(Ea),na.expandByScalar(2),1>C&&y.clearRect(na.min.x|0,na.min.y|0,na.max.x-na.min.x|0,na.max.y-na.min.y|0),0<C&&(s(THREE.NormalBlending),n(1),v("rgba("+Math.floor(255*F.r)+","+Math.floor(255*F.g)+","+Math.floor(255*F.b)+","+C+")"),y.fillRect(na.min.x|0,na.min.y|0,na.max.x-na.min.x|0,na.max.y-na.min.y|0)),na.makeEmpty())};this.clearColor=function(){};this.clearDepth=function(){};this.clearStencil=function(){};this.render=function(a,D){if(!1===D instanceof THREE.Camera)console.error("THREE.CanvasRenderer.render: camera is not an instance of THREE.Camera.");
else{!0===this.autoClear&&this.clear();y.setTransform(1,0,0,-1,O,K);x.info.render.vertices=0;x.info.render.faces=0;z=H.projectScene(a,D,this.sortObjects,this.sortElements);B=z.elements;E=z.lights;da=D;m.getNormalMatrix(D.matrixWorldInverse);hb.setRGB(0,0,0);ya.setRGB(0,0,0);ia.setRGB(0,0,0);for(var I=0,L=E.length;I<L;I++){var C=E[I],G=C.color;C instanceof THREE.AmbientLight?hb.add(G):C instanceof THREE.DirectionalLight?ya.add(G):C instanceof THREE.PointLight&&ia.add(G)}I=0;for(L=B.length;I<L;I++){var A=
B[I],F=A.material;if(void 0!==F&&!1!==F.visible){Oa.makeEmpty();if(A instanceof THREE.RenderableSprite){W=A;W.x*=O;W.y*=K;C=W;G=F;n(G.opacity);s(G.blending);var J=A.scale.x*O,A=A.scale.y*K,F=0.5*Math.sqrt(J*J+A*A);Oa.min.set(C.x-F,C.y-F);Oa.max.set(C.x+F,C.y+F);if(G instanceof THREE.SpriteMaterial||G instanceof THREE.ParticleSystemMaterial){var Q=G.map;if(null!==Q){!1===Q.hasEventListener("update",e)&&(void 0!==Q.image&&0<Q.image.width&&f(Q),Q.addEventListener("update",e));F=la[Q.id];void 0!==F?v(F):
v("rgba( 0, 0, 0, 1 )");var R=Q.image,F=R.width*Q.offset.x,Y=R.height*Q.offset.y,V=R.width*Q.repeat.x,Q=R.height*Q.repeat.y,R=J/V,fa=A/Q;y.save();y.translate(C.x,C.y);0!==G.rotation&&y.rotate(G.rotation);y.translate(-J/2,-A/2);y.scale(R,fa);y.translate(-F,-Y);y.fillRect(F,Y,V,Q)}else v(G.color.getStyle()),y.save(),y.translate(C.x,C.y),0!==G.rotation&&y.rotate(G.rotation),y.scale(J,-A),y.fillRect(-0.5,-0.5,1,1);y.restore()}else G instanceof THREE.SpriteCanvasMaterial&&(p(G.color.getStyle()),v(G.color.getStyle()),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册