|
@@ -173,11 +173,11 @@ a);return b.applyProjection(J)}}();this.pickingRay=function(a,b){a.z=-1;var c=ne
|
|
|
b,c){if(!0===a.visible||!0===b.visible||!0===c.visible)return!0;L[0]=a.positionScreen;L[1]=b.positionScreen;L[2]=c.positionScreen;return C.isIntersectionBox(T.setFromPoints(L))},r=function(a,b,c){return 0>(c.positionScreen.x-a.positionScreen.x)*(b.positionScreen.y-a.positionScreen.y)-(c.positionScreen.y-a.positionScreen.y)*(b.positionScreen.x-a.positionScreen.x)};return{setObject:function(a){g=a;f=g.material;h.getNormalMatrix(g.matrixWorld);d.length=0;e.length=0},projectVertex:k,checkTriangleVisibility:m,
|
|
|
checkBackfaceCulling:r,pushVertex:function(b,c,d){n=a();n.position.set(b,c,d);k(n)},pushNormal:function(a,b,c){d.push(a,b,c)},pushUv:function(a,b){e.push(a,b)},pushLine:function(a,b){var d=s[a],e=s[b];u=c();u.id=g.id;u.v1.copy(d);u.v2.copy(e);u.z=(d.positionScreen.z+e.positionScreen.z)/2;u.material=g.material;N.elements.push(u)},pushTriangle:function(a,c,k){var n=s[a],p=s[c],t=s[k];if(!1!==m(n,p,t)&&(f.side===THREE.DoubleSide||!0===r(n,p,t))){q=b();q.id=g.id;q.v1.copy(n);q.v2.copy(p);q.v3.copy(t);
|
|
|
q.z=(n.positionScreen.z+p.positionScreen.z+t.positionScreen.z)/3;for(n=0;3>n;n++)p=3*arguments[n],t=q.vertexNormalsModel[n],t.set(d[p],d[p+1],d[p+2]),t.applyMatrix3(h).normalize(),p=2*arguments[n],q.uvs[n].set(e[p],e[p+1]);q.vertexNormalsLength=3;q.material=g.material;N.elements.push(q)}}}};this.projectScene=function(n,t,v,x){D=E=p=0;N.elements.length=0;!0===n.autoUpdate&&n.updateMatrixWorld();void 0===t.parent&&t.updateMatrixWorld();V.copy(t.matrixWorldInverse.getInverse(t.matrixWorld));J.multiplyMatrices(t.projectionMatrix,
|
|
|
-V);I.setFromMatrix(J);h=0;N.objects.length=0;N.lights.length=0;n.traverseVisible(function(a){if(a instanceof THREE.Light)N.lights.push(a);else if(a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Sprite)if(!1===a.frustumCulled||!0===I.intersectsObject(a)){if(h===m){var b=new THREE.RenderableObject;k.push(b);m++;h++;f=b}else f=k[h++];f.id=a.id;f.object=a;null!==a.renderDepth?f.z=a.renderDepth:(M.setFromMatrixPosition(a.matrixWorld),M.applyProjection(J),f.z=M.z);N.objects.push(f)}});
|
|
|
-!0===v&&N.objects.sort(e);n=0;for(v=N.objects.length;n<v;n++){var y=N.objects[n].object,w=y.geometry;ca.setObject(y);Y=y.matrixWorld;r=0;if(y instanceof THREE.Mesh)if(w instanceof THREE.BufferGeometry){var z=w.attributes,y=w.offsets;if(void 0!==z.position){for(var A=z.position.array,w=0,G=A.length;w<G;w+=3)ca.pushVertex(A[w],A[w+1],A[w+2]);if(void 0!==z.normal)for(var L=z.normal.array,w=0,G=L.length;w<G;w+=3)ca.pushNormal(L[w],L[w+1],L[w+2]);if(void 0!==z.uv)for(L=z.uv.array,w=0,G=L.length;w<G;w+=
|
|
|
-2)ca.pushUv(L[w],L[w+1]);if(void 0!==z.index)if(z=z.index.array,0<y.length)for(n=0;n<y.length;n++)for(G=y[n],A=G.index,w=G.start,G=G.start+G.count;w<G;w+=3)ca.pushTriangle(z[w]+A,z[w+1]+A,z[w+2]+A);else for(w=0,G=z.length;w<G;w+=3)ca.pushTriangle(z[w],z[w+1],z[w+2]);else for(w=0,G=A.length/3;w<G;w+=3)ca.pushTriangle(w,w+1,w+2)}}else{if(w instanceof THREE.Geometry){var T=w.vertices,G=w.faces,z=w.faceVertexUvs[0];na.getNormalMatrix(Y);for(var A=y.material instanceof THREE.MeshFaceMaterial,L=!0===A?
|
|
|
-y.material:null,C=0,qa=T.length;C<qa;C++){var oa=T[C];ca.pushVertex(oa.x,oa.y,oa.z)}T=0;for(C=G.length;T<C;T++){var qa=G[T],Za=!0===A?L.materials[qa.materialIndex]:y.material;if(void 0!==Za){var Ha=Za.side,oa=s[qa.a],ya=s[qa.b],Ia=s[qa.c];if(!0===Za.morphTargets){var ua=w.morphTargets,ka=y.morphTargetInfluences,da=oa.position,xa=ya.position,ta=Ia.position;P.set(0,0,0);K.set(0,0,0);R.set(0,0,0);for(var Sa=0,pb=ua.length;Sa<pb;Sa++){var Na=ka[Sa];if(0!==Na){var Ca=ua[Sa].vertices;P.x+=(Ca[qa.a].x-da.x)*
|
|
|
-Na;P.y+=(Ca[qa.a].y-da.y)*Na;P.z+=(Ca[qa.a].z-da.z)*Na;K.x+=(Ca[qa.b].x-xa.x)*Na;K.y+=(Ca[qa.b].y-xa.y)*Na;K.z+=(Ca[qa.b].z-xa.z)*Na;R.x+=(Ca[qa.c].x-ta.x)*Na;R.y+=(Ca[qa.c].y-ta.y)*Na;R.z+=(Ca[qa.c].z-ta.z)*Na}}oa.position.add(P);ya.position.add(K);Ia.position.add(R);ca.projectVertex(oa);ca.projectVertex(ya);ca.projectVertex(Ia)}if(!1!==ca.checkTriangleVisibility(oa,ya,Ia)){ua=ca.checkBackfaceCulling(oa,ya,Ia);if(Ha!==THREE.DoubleSide){if(Ha===THREE.FrontSide&&!1===ua)continue;if(Ha===THREE.BackSide&&
|
|
|
+V);I.setFromMatrix(J);h=0;N.objects.length=0;N.lights.length=0;n.traverseVisible(function(a){if(a instanceof THREE.Light)N.lights.push(a);else if((a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Sprite)&&!1!==a.material.visible&&(!1===a.frustumCulled||!0===I.intersectsObject(a))){if(h===m){var b=new THREE.RenderableObject;k.push(b);m++;h++;f=b}else f=k[h++];f.id=a.id;f.object=a;null!==a.renderDepth?f.z=a.renderDepth:(M.setFromMatrixPosition(a.matrixWorld),M.applyProjection(J),
|
|
|
+f.z=M.z);N.objects.push(f)}});!0===v&&N.objects.sort(e);n=0;for(v=N.objects.length;n<v;n++){var y=N.objects[n].object,w=y.geometry;ca.setObject(y);Y=y.matrixWorld;r=0;if(y instanceof THREE.Mesh)if(w instanceof THREE.BufferGeometry){var z=w.attributes,y=w.offsets;if(void 0!==z.position){for(var A=z.position.array,w=0,G=A.length;w<G;w+=3)ca.pushVertex(A[w],A[w+1],A[w+2]);if(void 0!==z.normal)for(var L=z.normal.array,w=0,G=L.length;w<G;w+=3)ca.pushNormal(L[w],L[w+1],L[w+2]);if(void 0!==z.uv)for(L=z.uv.array,
|
|
|
+w=0,G=L.length;w<G;w+=2)ca.pushUv(L[w],L[w+1]);if(void 0!==z.index)if(z=z.index.array,0<y.length)for(n=0;n<y.length;n++)for(G=y[n],A=G.index,w=G.start,G=G.start+G.count;w<G;w+=3)ca.pushTriangle(z[w]+A,z[w+1]+A,z[w+2]+A);else for(w=0,G=z.length;w<G;w+=3)ca.pushTriangle(z[w],z[w+1],z[w+2]);else for(w=0,G=A.length/3;w<G;w+=3)ca.pushTriangle(w,w+1,w+2)}}else{if(w instanceof THREE.Geometry){var T=w.vertices,G=w.faces,z=w.faceVertexUvs[0];na.getNormalMatrix(Y);for(var A=y.material instanceof THREE.MeshFaceMaterial,
|
|
|
+L=!0===A?y.material:null,C=0,qa=T.length;C<qa;C++){var oa=T[C];ca.pushVertex(oa.x,oa.y,oa.z)}T=0;for(C=G.length;T<C;T++){var qa=G[T],Za=!0===A?L.materials[qa.materialIndex]:y.material;if(void 0!==Za){var Ha=Za.side,oa=s[qa.a],ya=s[qa.b],Ia=s[qa.c];if(!0===Za.morphTargets){var ua=w.morphTargets,ka=y.morphTargetInfluences,da=oa.position,xa=ya.position,ta=Ia.position;P.set(0,0,0);K.set(0,0,0);R.set(0,0,0);for(var Sa=0,pb=ua.length;Sa<pb;Sa++){var Na=ka[Sa];if(0!==Na){var Ca=ua[Sa].vertices;P.x+=(Ca[qa.a].x-
|
|
|
+da.x)*Na;P.y+=(Ca[qa.a].y-da.y)*Na;P.z+=(Ca[qa.a].z-da.z)*Na;K.x+=(Ca[qa.b].x-xa.x)*Na;K.y+=(Ca[qa.b].y-xa.y)*Na;K.z+=(Ca[qa.b].z-xa.z)*Na;R.x+=(Ca[qa.c].x-ta.x)*Na;R.y+=(Ca[qa.c].y-ta.y)*Na;R.z+=(Ca[qa.c].z-ta.z)*Na}}oa.position.add(P);ya.position.add(K);Ia.position.add(R);ca.projectVertex(oa);ca.projectVertex(ya);ca.projectVertex(Ia)}if(!1!==ca.checkTriangleVisibility(oa,ya,Ia)){ua=ca.checkBackfaceCulling(oa,ya,Ia);if(Ha!==THREE.DoubleSide){if(Ha===THREE.FrontSide&&!1===ua)continue;if(Ha===THREE.BackSide&&
|
|
|
!0===ua)continue}q=b();q.id=y.id;q.v1.copy(oa);q.v2.copy(ya);q.v3.copy(Ia);q.normalModel.copy(qa.normal);!1!==ua||Ha!==THREE.BackSide&&Ha!==THREE.DoubleSide||q.normalModel.negate();q.normalModel.applyMatrix3(na).normalize();ka=qa.vertexNormals;da=0;for(xa=Math.min(ka.length,3);da<xa;da++)ta=q.vertexNormalsModel[da],ta.copy(ka[da]),!1!==ua||Ha!==THREE.BackSide&&Ha!==THREE.DoubleSide||ta.negate(),ta.applyMatrix3(na).normalize();q.vertexNormalsLength=ka.length;Ha=z[T];if(void 0!==Ha)for(ua=0;3>ua;ua++)q.uvs[ua].copy(Ha[ua]);
|
|
|
q.color=qa.color;q.material=Za;q.z=(oa.positionScreen.z+ya.positionScreen.z+Ia.positionScreen.z)/3;N.elements.push(q)}}}}}else if(y instanceof THREE.Line)if(w instanceof THREE.BufferGeometry){if(z=w.attributes,void 0!==z.position){A=z.position.array;w=0;for(G=A.length;w<G;w+=3)ca.pushVertex(A[w],A[w+1],A[w+2]);if(void 0!==z.index)for(z=z.index.array,w=0,G=z.length;w<G;w+=2)ca.pushLine(z[w],z[w+1]);else for(z=y.type===THREE.LinePieces?2:1,w=0,G=A.length/3-1;w<G;w+=z)ca.pushLine(w,w+1)}}else{if(w instanceof
|
|
|
THREE.Geometry&&(aa.multiplyMatrices(J,Y),T=y.geometry.vertices,0!==T.length))for(oa=a(),oa.positionScreen.copy(T[0]).applyMatrix4(aa),z=y.type===THREE.LinePieces?2:1,C=1,qa=T.length;C<qa;C++)oa=a(),oa.positionScreen.copy(T[C]).applyMatrix4(aa),0<(C+1)%z||(ya=s[r-2],ba.copy(oa.positionScreen),Q.copy(ya.positionScreen),!0===g(ba,Q)&&(ba.multiplyScalar(1/ba.w),Q.multiplyScalar(1/Q.w),u=c(),u.id=y.id,u.v1.positionScreen.copy(ba),u.v2.positionScreen.copy(Q),u.z=Math.max(ba.z,Q.z),u.material=y.material,
|
|
@@ -293,13 +293,14 @@ b.aspect,b.near,b.far);break;case "OrthographicCamera":e=new THREE.OrthographicC
|
|
|
b.groundColor,b.intensity);break;case "Mesh":e=c[b.geometry];var g=d[b.material];void 0===e&&console.error("THREE.ObjectLoader: Undefined geometry "+b.geometry);void 0===g&&console.error("THREE.ObjectLoader: Undefined material "+b.material);e=new THREE.Mesh(e,g);break;case "Sprite":g=d[b.material];void 0===g&&console.error("THREE.ObjectLoader: Undefined material "+b.material);e=new THREE.Sprite(g);break;case "Group":e=new THREE.Group;break;default:e=new THREE.Object3D}e.uuid=b.uuid;void 0!==b.name&&
|
|
|
(e.name=b.name);void 0!==b.matrix?(a.fromArray(b.matrix),a.decompose(e.position,e.quaternion,e.scale)):(void 0!==b.position&&e.position.fromArray(b.position),void 0!==b.rotation&&e.rotation.fromArray(b.rotation),void 0!==b.scale&&e.scale.fromArray(b.scale));void 0!==b.visible&&(e.visible=b.visible);void 0!==b.userData&&(e.userData=b.userData);void 0!==b.script&&(e.script=new THREE.Script(b.script));if(void 0!==b.children)for(var f in b.children)e.add(this.parseObject(b.children[f],c,d));return e}}()};
|
|
|
THREE.TextureLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a,b,c,d){var e=new THREE.ImageLoader(this.manager);e.setCrossOrigin(this.crossOrigin);e.load(a,function(a){a=new THREE.Texture(a);a.needsUpdate=!0;void 0!==b&&b(a)},c,d)},setCrossOrigin:function(a){this.crossOrigin=a}};
|
|
|
-THREE.Material=function(){this.id=THREE.MaterialIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.type="Material";this.side=THREE.FrontSide;this.opacity=1;this.transparent=!1;this.blending=THREE.NormalBlending;this.blendSrc=THREE.SrcAlphaFactor;this.blendDst=THREE.OneMinusSrcAlphaFactor;this.blendEquation=THREE.AddEquation;this.depthWrite=this.depthTest=!0;this.polygonOffset=!1;this.overdraw=this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.needsUpdate=!0};
|
|
|
-THREE.Material.prototype={constructor:THREE.Material,setValues:function(a){if(void 0!==a)for(var b in a){var c=a[b];if(void 0===c)console.warn("THREE.Material: '"+b+"' parameter is undefined.");else if(b in this){var d=this[b];d instanceof THREE.Color?d.set(c):d instanceof THREE.Vector3&&c instanceof THREE.Vector3?d.copy(c):this[b]="overdraw"==b?Number(c):c}}},toJSON:function(){var a={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type};""!==this.name&&
|
|
|
-(a.name=this.name);this instanceof THREE.MeshBasicMaterial?(a.color=this.color.getHex(),this.vertexColors!==THREE.NoColors&&(a.vertexColors=this.vertexColors),this.blending!==THREE.NormalBlending&&(a.blending=this.blending),this.side!==THREE.FrontSide&&(a.side=this.side)):this instanceof THREE.MeshLambertMaterial?(a.color=this.color.getHex(),a.ambient=this.ambient.getHex(),a.emissive=this.emissive.getHex(),this.vertexColors!==THREE.NoColors&&(a.vertexColors=this.vertexColors),this.blending!==THREE.NormalBlending&&
|
|
|
+THREE.Material=function(){this.id=THREE.MaterialIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.type="Material";this.side=THREE.FrontSide;this.opacity=1;this.transparent=!1;this.blending=THREE.NormalBlending;this.blendSrc=THREE.SrcAlphaFactor;this.blendDst=THREE.OneMinusSrcAlphaFactor;this.blendEquation=THREE.AddEquation;this.depthWrite=this.depthTest=!0;this.polygonOffset=!1;this.overdraw=this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.needsUpdate=this.visible=
|
|
|
+!0};
|
|
|
+THREE.Material.prototype={constructor:THREE.Material,setValues:function(a){if(void 0!==a)for(var b in a){var c=a[b];if(void 0===c)console.warn("THREE.Material: '"+b+"' parameter is undefined.");else if(b in this){var d=this[b];d instanceof THREE.Color?d.set(c):d instanceof THREE.Vector3&&c instanceof THREE.Vector3?d.copy(c):this[b]="overdraw"==b?Number(c):c}}},toJSON:function(){var a={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type};""!==this.name&&(a.name=
|
|
|
+this.name);this instanceof THREE.MeshBasicMaterial?(a.color=this.color.getHex(),this.vertexColors!==THREE.NoColors&&(a.vertexColors=this.vertexColors),this.blending!==THREE.NormalBlending&&(a.blending=this.blending),this.side!==THREE.FrontSide&&(a.side=this.side)):this instanceof THREE.MeshLambertMaterial?(a.color=this.color.getHex(),a.ambient=this.ambient.getHex(),a.emissive=this.emissive.getHex(),this.vertexColors!==THREE.NoColors&&(a.vertexColors=this.vertexColors),this.blending!==THREE.NormalBlending&&
|
|
|
(a.blending=this.blending),this.side!==THREE.FrontSide&&(a.side=this.side)):this instanceof THREE.MeshPhongMaterial?(a.color=this.color.getHex(),a.ambient=this.ambient.getHex(),a.emissive=this.emissive.getHex(),a.specular=this.specular.getHex(),a.shininess=this.shininess,this.vertexColors!==THREE.NoColors&&(a.vertexColors=this.vertexColors),this.blending!==THREE.NormalBlending&&(a.blending=this.blending),this.side!==THREE.FrontSide&&(a.side=this.side)):this instanceof THREE.MeshNormalMaterial?(this.shading!==
|
|
|
THREE.FlatShading&&(a.shading=this.shading),this.blending!==THREE.NormalBlending&&(a.blending=this.blending),this.side!==THREE.FrontSide&&(a.side=this.side)):this instanceof THREE.MeshDepthMaterial?(this.blending!==THREE.NormalBlending&&(a.blending=this.blending),this.side!==THREE.FrontSide&&(a.side=this.side)):this instanceof THREE.ShaderMaterial?(a.uniforms=this.uniforms,a.vertexShader=this.vertexShader,a.fragmentShader=this.fragmentShader):this instanceof THREE.SpriteMaterial&&(a.color=this.color.getHex());
|
|
|
1>this.opacity&&(a.opacity=this.opacity);!1!==this.transparent&&(a.transparent=this.transparent);!1!==this.wireframe&&(a.wireframe=this.wireframe);return a},clone:function(a){void 0===a&&(a=new THREE.Material);a.name=this.name;a.side=this.side;a.opacity=this.opacity;a.transparent=this.transparent;a.blending=this.blending;a.blendSrc=this.blendSrc;a.blendDst=this.blendDst;a.blendEquation=this.blendEquation;a.depthTest=this.depthTest;a.depthWrite=this.depthWrite;a.polygonOffset=this.polygonOffset;a.polygonOffsetFactor=
|
|
|
-this.polygonOffsetFactor;a.polygonOffsetUnits=this.polygonOffsetUnits;a.alphaTest=this.alphaTest;a.overdraw=this.overdraw;return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Material.prototype);THREE.MaterialIdCount=0;
|
|
|
+this.polygonOffsetFactor;a.polygonOffsetUnits=this.polygonOffsetUnits;a.alphaTest=this.alphaTest;a.overdraw=this.overdraw;a.visible=this.visible;return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Material.prototype);THREE.MaterialIdCount=0;
|
|
|
THREE.LineBasicMaterial=function(a){THREE.Material.call(this);this.type="LineBasicMaterial";this.color=new THREE.Color(16777215);this.linewidth=1;this.linejoin=this.linecap="round";this.vertexColors=THREE.NoColors;this.fog=!0;this.setValues(a)};THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype);
|
|
|
THREE.LineBasicMaterial.prototype.clone=function(){var a=new THREE.LineBasicMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.linewidth=this.linewidth;a.linecap=this.linecap;a.linejoin=this.linejoin;a.vertexColors=this.vertexColors;a.fog=this.fog;return a};
|
|
|
THREE.LineDashedMaterial=function(a){THREE.Material.call(this);this.type="LineDashedMaterial";this.color=new THREE.Color(16777215);this.scale=this.linewidth=1;this.dashSize=3;this.gapSize=1;this.vertexColors=!1;this.fog=!0;this.setValues(a)};THREE.LineDashedMaterial.prototype=Object.create(THREE.Material.prototype);
|
|
@@ -562,25 +563,25 @@ l.deleteBuffer(a.__webglUVBuffer);void 0!==a.__webglUV2Buffer&&l.deleteBuffer(a.
|
|
|
G.info.memory.geometries--},pc=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=cb.length;a<c;a++)if(d=cb[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=cb.length;a<c;a++)d=cb[a],d.program!==b&&e.push(d);cb=e;l.deleteProgram(b);G.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){g();a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=l.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&
|
|
|
(a.__webglNormalBuffer=l.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=l.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=l.createBuffer());a.hasPositions&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglVertexBuffer),l.bufferData(l.ARRAY_BUFFER,a.positionArray,l.DYNAMIC_DRAW),f(b.attributes.position),l.vertexAttribPointer(b.attributes.position,3,l.FLOAT,!1,0,0));if(a.hasNormals){l.bindBuffer(l.ARRAY_BUFFER,a.__webglNormalBuffer);if(c.shading===THREE.FlatShading){var d,
|
|
|
e,k,m,n,p,q,s,r,t,u,v=3*a.count;for(u=0;u<v;u+=9)t=a.normalArray,d=t[u],e=t[u+1],k=t[u+2],m=t[u+3],p=t[u+4],s=t[u+5],n=t[u+6],q=t[u+7],r=t[u+8],d=(d+m+n)/3,e=(e+p+q)/3,k=(k+s+r)/3,t[u]=d,t[u+1]=e,t[u+2]=k,t[u+3]=d,t[u+4]=e,t[u+5]=k,t[u+6]=d,t[u+7]=e,t[u+8]=k}l.bufferData(l.ARRAY_BUFFER,a.normalArray,l.DYNAMIC_DRAW);f(b.attributes.normal);l.vertexAttribPointer(b.attributes.normal,3,l.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglUvBuffer),l.bufferData(l.ARRAY_BUFFER,a.uvArray,
|
|
|
-l.DYNAMIC_DRAW),f(b.attributes.uv),l.vertexAttribPointer(b.attributes.uv,2,l.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,a.colorArray,l.DYNAMIC_DRAW),f(b.attributes.color),l.vertexAttribPointer(b.attributes.color,3,l.FLOAT,!1,0,0));h();l.drawArrays(l.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,f,h){a=z(a,b,c,d,h);b=!1;c=16777215*f.id+2*a.id+(d.wireframe?1:0);c!==oa&&(oa=c,b=
|
|
|
-!0);b&&g();if(h instanceof THREE.Mesh)if(c=f.attributes.index){var k,m;c.array instanceof Uint32Array?(k=l.UNSIGNED_INT,m=4):(k=l.UNSIGNED_SHORT,m=2);var n=f.offsets;if(0===n.length)b&&(e(d,a,f,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(l.TRIANGLES,c.array.length,k,0),G.info.render.calls++,G.info.render.vertices+=c.array.length,G.info.render.faces+=c.array.length/3;else{b=!0;for(var p=0,q=n.length;p<q;p++){var s=n[p].index;b&&(e(d,a,f,s),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer));
|
|
|
-l.drawElements(l.TRIANGLES,n[p].count,k,n[p].start*m);G.info.render.calls++;G.info.render.vertices+=n[p].count;G.info.render.faces+=n[p].count/3}}}else b&&e(d,a,f,0),d=f.attributes.position,l.drawArrays(l.TRIANGLES,0,d.array.length/3),G.info.render.calls++,G.info.render.vertices+=d.array.length/3,G.info.render.faces+=d.array.length/9;else if(h instanceof THREE.PointCloud)b&&e(d,a,f,0),d=f.attributes.position,l.drawArrays(l.POINTS,0,d.array.length/3),G.info.render.calls++,G.info.render.points+=d.array.length/
|
|
|
-3;else if(h instanceof THREE.Line)if(h=h.type===THREE.LineStrip?l.LINE_STRIP:l.LINES,P(d.linewidth),c=f.attributes.index)if(c.array instanceof Uint32Array?(k=l.UNSIGNED_INT,m=4):(k=l.UNSIGNED_SHORT,m=2),n=f.offsets,0===n.length)b&&(e(d,a,f,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(h,c.array.length,k,0),G.info.render.calls++,G.info.render.vertices+=c.array.length;else for(1<n.length&&(b=!0),p=0,q=n.length;p<q;p++)s=n[p].index,b&&(e(d,a,f,s),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,
|
|
|
-c.buffer)),l.drawElements(h,n[p].count,k,n[p].start*m),G.info.render.calls++,G.info.render.vertices+=n[p].count;else b&&e(d,a,f,0),d=f.attributes.position,l.drawArrays(h,0,d.array.length/3),G.info.render.calls++,G.info.render.points+=d.array.length/3};this.renderBuffer=function(a,b,c,d,e,k){var m,p;c=z(a,b,c,d,k);b=c.attributes;a=!1;c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==oa&&(oa=c,a=!0);a&&g();if(!d.morphTargets&&0<=b.position)a&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglVertexBuffer),f(b.position),
|
|
|
-l.vertexAttribPointer(b.position,3,l.FLOAT,!1,0,0));else if(k.morphTargetBase){c=d.program.attributes;-1!==k.morphTargetBase&&0<=c.position?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[k.morphTargetBase]),f(c.position),l.vertexAttribPointer(c.position,3,l.FLOAT,!1,0,0)):0<=c.position&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglVertexBuffer),f(c.position),l.vertexAttribPointer(c.position,3,l.FLOAT,!1,0,0));if(k.morphTargetForcedOrder.length){var q=0;p=k.morphTargetForcedOrder;for(m=k.morphTargetInfluences;q<
|
|
|
-d.numSupportedMorphTargets&&q<p.length;)0<=c["morphTarget"+q]&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[p[q]]),f(c["morphTarget"+q]),l.vertexAttribPointer(c["morphTarget"+q],3,l.FLOAT,!1,0,0)),0<=c["morphNormal"+q]&&d.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[p[q]]),f(c["morphNormal"+q]),l.vertexAttribPointer(c["morphNormal"+q],3,l.FLOAT,!1,0,0)),k.__webglMorphTargetInfluences[q]=m[p[q]],q++}else{p=[];m=k.morphTargetInfluences;var s,t=m.length;for(s=
|
|
|
-0;s<t;s++)q=m[s],0<q&&p.push([q,s]);p.length>d.numSupportedMorphTargets?(p.sort(n),p.length=d.numSupportedMorphTargets):p.length>d.numSupportedMorphNormals?p.sort(n):0===p.length&&p.push([0,0]);for(q=0;q<d.numSupportedMorphTargets;)p[q]?(s=p[q][1],0<=c["morphTarget"+q]&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[s]),f(c["morphTarget"+q]),l.vertexAttribPointer(c["morphTarget"+q],3,l.FLOAT,!1,0,0)),0<=c["morphNormal"+q]&&d.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[s]),
|
|
|
-f(c["morphNormal"+q]),l.vertexAttribPointer(c["morphNormal"+q],3,l.FLOAT,!1,0,0)),k.__webglMorphTargetInfluences[q]=m[s]):k.__webglMorphTargetInfluences[q]=0,q++}null!==d.program.uniforms.morphTargetInfluences&&l.uniform1fv(d.program.uniforms.morphTargetInfluences,k.__webglMorphTargetInfluences)}if(a){if(e.__webglCustomAttributesList)for(m=0,p=e.__webglCustomAttributesList.length;m<p;m++)c=e.__webglCustomAttributesList[m],0<=b[c.buffer.belongsToAttribute]&&(l.bindBuffer(l.ARRAY_BUFFER,c.buffer),f(b[c.buffer.belongsToAttribute]),
|
|
|
-l.vertexAttribPointer(b[c.buffer.belongsToAttribute],c.size,l.FLOAT,!1,0,0));0<=b.color&&(0<k.geometry.colors.length||0<k.geometry.faces.length?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglColorBuffer),f(b.color),l.vertexAttribPointer(b.color,3,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib3fv(b.color,d.defaultAttributeValues.color));0<=b.normal&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglNormalBuffer),f(b.normal),l.vertexAttribPointer(b.normal,3,l.FLOAT,!1,0,0));0<=b.tangent&&(l.bindBuffer(l.ARRAY_BUFFER,
|
|
|
-e.__webglTangentBuffer),f(b.tangent),l.vertexAttribPointer(b.tangent,4,l.FLOAT,!1,0,0));0<=b.uv&&(k.geometry.faceVertexUvs[0]?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglUVBuffer),f(b.uv),l.vertexAttribPointer(b.uv,2,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib2fv(b.uv,d.defaultAttributeValues.uv));0<=b.uv2&&(k.geometry.faceVertexUvs[1]?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglUV2Buffer),f(b.uv2),l.vertexAttribPointer(b.uv2,2,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib2fv(b.uv2,
|
|
|
-d.defaultAttributeValues.uv2));d.skinning&&0<=b.skinIndex&&0<=b.skinWeight&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),f(b.skinIndex),l.vertexAttribPointer(b.skinIndex,4,l.FLOAT,!1,0,0),l.bindBuffer(l.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),f(b.skinWeight),l.vertexAttribPointer(b.skinWeight,4,l.FLOAT,!1,0,0));0<=b.lineDistance&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglLineDistanceBuffer),f(b.lineDistance),l.vertexAttribPointer(b.lineDistance,1,l.FLOAT,!1,0,0))}h();k instanceof THREE.Mesh?
|
|
|
-(k=e.__typeArray===Uint32Array?l.UNSIGNED_INT:l.UNSIGNED_SHORT,d.wireframe?(P(d.wireframeLinewidth),a&&l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),l.drawElements(l.LINES,e.__webglLineCount,k,0)):(a&&l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),l.drawElements(l.TRIANGLES,e.__webglFaceCount,k,0)),G.info.render.calls++,G.info.render.vertices+=e.__webglFaceCount,G.info.render.faces+=e.__webglFaceCount/3):k instanceof THREE.Line?(k=k.type===THREE.LineStrip?l.LINE_STRIP:l.LINES,
|
|
|
-P(d.linewidth),l.drawArrays(k,0,e.__webglLineCount),G.info.render.calls++):k instanceof THREE.PointCloud&&(l.drawArrays(l.POINTS,0,e.__webglParticleCount),G.info.render.calls++,G.info.render.points+=e.__webglParticleCount)};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e,f,g,h=a.fog;qa=-1;Za=null;Ub=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();
|
|
|
-a.traverse(function(a){a instanceof THREE.SkinnedMesh&&a.skeleton.update()});b.matrixWorldInverse.getInverse(b.matrixWorld);tc.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);zc.setFromMatrix(tc);Pa.length=0;bb.length=0;sa.length=0;r(a,a,b);!0===G.sortObjects&&(bb.sort(k),sa.sort(m));s(this.renderPluginsPre,a,b);G.info.render.calls=0;G.info.render.vertices=0;G.info.render.faces=0;G.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,
|
|
|
-this.autoClearStencil);d=0;for(e=la.length;d<e;d++)f=la[d],g=f.object,g.visible&&(w(g,b),p(f));a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,d.blendSrc,d.blendDst),this.setDepthTest(d.depthTest),this.setDepthWrite(d.depthWrite),K(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),t(bb,b,Pa,h,!0,d),t(sa,b,Pa,h,!0,d),q(la,"",b,Pa,h,!1,d)):(d=null,this.setBlending(THREE.NoBlending),t(bb,b,Pa,h,!1,d),q(la,"opaque",b,Pa,h,!1,d),t(sa,b,Pa,h,!0,d),q(la,"transparent",
|
|
|
-b,Pa,h,!0,d));s(this.renderPluginsPost,a,b);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&C(c);this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=z(a,b,c,d,e);oa=-1;G.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,l,zc):e.render(function(a){G.renderBufferImmediate(a,f,d)})};this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};this.setFaceCulling=
|
|
|
-function(a,b){a===THREE.CullFaceNone?l.disable(l.CULL_FACE):(b===THREE.FrontFaceDirectionCW?l.frontFace(l.CW):l.frontFace(l.CCW),a===THREE.CullFaceBack?l.cullFace(l.BACK):a===THREE.CullFaceFront?l.cullFace(l.FRONT):l.cullFace(l.FRONT_AND_BACK),l.enable(l.CULL_FACE))};this.setMaterialFaces=function(a){var b=a.side===THREE.DoubleSide;a=a.side===THREE.BackSide;ya!==b&&(b?l.disable(l.CULL_FACE):l.enable(l.CULL_FACE),ya=b);Ia!==a&&(a?l.frontFace(l.CW):l.frontFace(l.CCW),Ia=a)};this.setDepthTest=function(a){ta!==
|
|
|
-a&&(a?l.enable(l.DEPTH_TEST):l.disable(l.DEPTH_TEST),ta=a)};this.setDepthWrite=function(a){Sa!==a&&(l.depthMask(a),Sa=a)};this.setBlending=function(a,b,c,d){a!==ua&&(a===THREE.NoBlending?l.disable(l.BLEND):a===THREE.AdditiveBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),l.blendFunc(l.SRC_ALPHA,l.ONE)):a===THREE.SubtractiveBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),l.blendFunc(l.ZERO,l.ONE_MINUS_SRC_COLOR)):a===THREE.MultiplyBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),
|
|
|
+l.DYNAMIC_DRAW),f(b.attributes.uv),l.vertexAttribPointer(b.attributes.uv,2,l.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,a.colorArray,l.DYNAMIC_DRAW),f(b.attributes.color),l.vertexAttribPointer(b.attributes.color,3,l.FLOAT,!1,0,0));h();l.drawArrays(l.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,f,h){if(!1!==d.visible)if(a=z(a,b,c,d,h),b=!1,c=16777215*f.id+2*a.id+(d.wireframe?
|
|
|
+1:0),c!==oa&&(oa=c,b=!0),b&&g(),h instanceof THREE.Mesh)if(c=f.attributes.index){var k,m;c.array instanceof Uint32Array?(k=l.UNSIGNED_INT,m=4):(k=l.UNSIGNED_SHORT,m=2);var n=f.offsets;if(0===n.length)b&&(e(d,a,f,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(l.TRIANGLES,c.array.length,k,0),G.info.render.calls++,G.info.render.vertices+=c.array.length,G.info.render.faces+=c.array.length/3;else{b=!0;for(var p=0,q=n.length;p<q;p++){var s=n[p].index;b&&(e(d,a,f,s),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,
|
|
|
+c.buffer));l.drawElements(l.TRIANGLES,n[p].count,k,n[p].start*m);G.info.render.calls++;G.info.render.vertices+=n[p].count;G.info.render.faces+=n[p].count/3}}}else b&&e(d,a,f,0),d=f.attributes.position,l.drawArrays(l.TRIANGLES,0,d.array.length/3),G.info.render.calls++,G.info.render.vertices+=d.array.length/3,G.info.render.faces+=d.array.length/9;else if(h instanceof THREE.PointCloud)b&&e(d,a,f,0),d=f.attributes.position,l.drawArrays(l.POINTS,0,d.array.length/3),G.info.render.calls++,G.info.render.points+=
|
|
|
+d.array.length/3;else if(h instanceof THREE.Line)if(h=h.type===THREE.LineStrip?l.LINE_STRIP:l.LINES,P(d.linewidth),c=f.attributes.index)if(c.array instanceof Uint32Array?(k=l.UNSIGNED_INT,m=4):(k=l.UNSIGNED_SHORT,m=2),n=f.offsets,0===n.length)b&&(e(d,a,f,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(h,c.array.length,k,0),G.info.render.calls++,G.info.render.vertices+=c.array.length;else for(1<n.length&&(b=!0),p=0,q=n.length;p<q;p++)s=n[p].index,b&&(e(d,a,f,s),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,
|
|
|
+c.buffer)),l.drawElements(h,n[p].count,k,n[p].start*m),G.info.render.calls++,G.info.render.vertices+=n[p].count;else b&&e(d,a,f,0),d=f.attributes.position,l.drawArrays(h,0,d.array.length/3),G.info.render.calls++,G.info.render.points+=d.array.length/3};this.renderBuffer=function(a,b,c,d,e,k){if(!1!==d.visible){var m,p;c=z(a,b,c,d,k);b=c.attributes;a=!1;c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==oa&&(oa=c,a=!0);a&&g();if(!d.morphTargets&&0<=b.position)a&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglVertexBuffer),
|
|
|
+f(b.position),l.vertexAttribPointer(b.position,3,l.FLOAT,!1,0,0));else if(k.morphTargetBase){c=d.program.attributes;-1!==k.morphTargetBase&&0<=c.position?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[k.morphTargetBase]),f(c.position),l.vertexAttribPointer(c.position,3,l.FLOAT,!1,0,0)):0<=c.position&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglVertexBuffer),f(c.position),l.vertexAttribPointer(c.position,3,l.FLOAT,!1,0,0));if(k.morphTargetForcedOrder.length){var q=0;p=k.morphTargetForcedOrder;
|
|
|
+for(m=k.morphTargetInfluences;q<d.numSupportedMorphTargets&&q<p.length;)0<=c["morphTarget"+q]&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[p[q]]),f(c["morphTarget"+q]),l.vertexAttribPointer(c["morphTarget"+q],3,l.FLOAT,!1,0,0)),0<=c["morphNormal"+q]&&d.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[p[q]]),f(c["morphNormal"+q]),l.vertexAttribPointer(c["morphNormal"+q],3,l.FLOAT,!1,0,0)),k.__webglMorphTargetInfluences[q]=m[p[q]],q++}else{p=[];m=k.morphTargetInfluences;
|
|
|
+var s,t=m.length;for(s=0;s<t;s++)q=m[s],0<q&&p.push([q,s]);p.length>d.numSupportedMorphTargets?(p.sort(n),p.length=d.numSupportedMorphTargets):p.length>d.numSupportedMorphNormals?p.sort(n):0===p.length&&p.push([0,0]);for(q=0;q<d.numSupportedMorphTargets;)p[q]?(s=p[q][1],0<=c["morphTarget"+q]&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[s]),f(c["morphTarget"+q]),l.vertexAttribPointer(c["morphTarget"+q],3,l.FLOAT,!1,0,0)),0<=c["morphNormal"+q]&&d.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,
|
|
|
+e.__webglMorphNormalsBuffers[s]),f(c["morphNormal"+q]),l.vertexAttribPointer(c["morphNormal"+q],3,l.FLOAT,!1,0,0)),k.__webglMorphTargetInfluences[q]=m[s]):k.__webglMorphTargetInfluences[q]=0,q++}null!==d.program.uniforms.morphTargetInfluences&&l.uniform1fv(d.program.uniforms.morphTargetInfluences,k.__webglMorphTargetInfluences)}if(a){if(e.__webglCustomAttributesList)for(m=0,p=e.__webglCustomAttributesList.length;m<p;m++)c=e.__webglCustomAttributesList[m],0<=b[c.buffer.belongsToAttribute]&&(l.bindBuffer(l.ARRAY_BUFFER,
|
|
|
+c.buffer),f(b[c.buffer.belongsToAttribute]),l.vertexAttribPointer(b[c.buffer.belongsToAttribute],c.size,l.FLOAT,!1,0,0));0<=b.color&&(0<k.geometry.colors.length||0<k.geometry.faces.length?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglColorBuffer),f(b.color),l.vertexAttribPointer(b.color,3,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib3fv(b.color,d.defaultAttributeValues.color));0<=b.normal&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglNormalBuffer),f(b.normal),l.vertexAttribPointer(b.normal,
|
|
|
+3,l.FLOAT,!1,0,0));0<=b.tangent&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglTangentBuffer),f(b.tangent),l.vertexAttribPointer(b.tangent,4,l.FLOAT,!1,0,0));0<=b.uv&&(k.geometry.faceVertexUvs[0]?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglUVBuffer),f(b.uv),l.vertexAttribPointer(b.uv,2,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib2fv(b.uv,d.defaultAttributeValues.uv));0<=b.uv2&&(k.geometry.faceVertexUvs[1]?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglUV2Buffer),f(b.uv2),l.vertexAttribPointer(b.uv2,
|
|
|
+2,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib2fv(b.uv2,d.defaultAttributeValues.uv2));d.skinning&&0<=b.skinIndex&&0<=b.skinWeight&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),f(b.skinIndex),l.vertexAttribPointer(b.skinIndex,4,l.FLOAT,!1,0,0),l.bindBuffer(l.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),f(b.skinWeight),l.vertexAttribPointer(b.skinWeight,4,l.FLOAT,!1,0,0));0<=b.lineDistance&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglLineDistanceBuffer),f(b.lineDistance),l.vertexAttribPointer(b.lineDistance,
|
|
|
+1,l.FLOAT,!1,0,0))}h();k instanceof THREE.Mesh?(k=e.__typeArray===Uint32Array?l.UNSIGNED_INT:l.UNSIGNED_SHORT,d.wireframe?(P(d.wireframeLinewidth),a&&l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),l.drawElements(l.LINES,e.__webglLineCount,k,0)):(a&&l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),l.drawElements(l.TRIANGLES,e.__webglFaceCount,k,0)),G.info.render.calls++,G.info.render.vertices+=e.__webglFaceCount,G.info.render.faces+=e.__webglFaceCount/3):k instanceof THREE.Line?(k=
|
|
|
+k.type===THREE.LineStrip?l.LINE_STRIP:l.LINES,P(d.linewidth),l.drawArrays(k,0,e.__webglLineCount),G.info.render.calls++):k instanceof THREE.PointCloud&&(l.drawArrays(l.POINTS,0,e.__webglParticleCount),G.info.render.calls++,G.info.render.points+=e.__webglParticleCount)}};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e,f,g,h=a.fog;qa=-1;Za=null;Ub=!0;!0===a.autoUpdate&&a.updateMatrixWorld();
|
|
|
+void 0===b.parent&&b.updateMatrixWorld();a.traverse(function(a){a instanceof THREE.SkinnedMesh&&a.skeleton.update()});b.matrixWorldInverse.getInverse(b.matrixWorld);tc.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);zc.setFromMatrix(tc);Pa.length=0;bb.length=0;sa.length=0;r(a,a,b);!0===G.sortObjects&&(bb.sort(k),sa.sort(m));s(this.renderPluginsPre,a,b);G.info.render.calls=0;G.info.render.vertices=0;G.info.render.faces=0;G.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&
|
|
|
+this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);d=0;for(e=la.length;d<e;d++)f=la[d],g=f.object,g.visible&&(w(g,b),p(f));a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,d.blendSrc,d.blendDst),this.setDepthTest(d.depthTest),this.setDepthWrite(d.depthWrite),K(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),t(bb,b,Pa,h,!0,d),t(sa,b,Pa,h,!0,d),q(la,"",b,Pa,h,!1,d)):(d=null,this.setBlending(THREE.NoBlending),t(bb,b,Pa,h,!1,d),q(la,
|
|
|
+"opaque",b,Pa,h,!1,d),t(sa,b,Pa,h,!0,d),q(la,"transparent",b,Pa,h,!0,d));s(this.renderPluginsPost,a,b);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&C(c);this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=z(a,b,c,d,e);oa=-1;G.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,l,zc):e.render(function(a){G.renderBufferImmediate(a,f,d)})};this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};
|
|
|
+this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?l.disable(l.CULL_FACE):(b===THREE.FrontFaceDirectionCW?l.frontFace(l.CW):l.frontFace(l.CCW),a===THREE.CullFaceBack?l.cullFace(l.BACK):a===THREE.CullFaceFront?l.cullFace(l.FRONT):l.cullFace(l.FRONT_AND_BACK),l.enable(l.CULL_FACE))};this.setMaterialFaces=function(a){var b=a.side===THREE.DoubleSide;a=a.side===THREE.BackSide;ya!==b&&(b?l.disable(l.CULL_FACE):l.enable(l.CULL_FACE),ya=b);Ia!==a&&(a?l.frontFace(l.CW):l.frontFace(l.CCW),Ia=a)};this.setDepthTest=
|
|
|
+function(a){ta!==a&&(a?l.enable(l.DEPTH_TEST):l.disable(l.DEPTH_TEST),ta=a)};this.setDepthWrite=function(a){Sa!==a&&(l.depthMask(a),Sa=a)};this.setBlending=function(a,b,c,d){a!==ua&&(a===THREE.NoBlending?l.disable(l.BLEND):a===THREE.AdditiveBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),l.blendFunc(l.SRC_ALPHA,l.ONE)):a===THREE.SubtractiveBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),l.blendFunc(l.ZERO,l.ONE_MINUS_SRC_COLOR)):a===THREE.MultiplyBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),
|
|
|
l.blendFunc(l.ZERO,l.SRC_COLOR)):a===THREE.CustomBlending?l.enable(l.BLEND):(l.enable(l.BLEND),l.blendEquationSeparate(l.FUNC_ADD,l.FUNC_ADD),l.blendFuncSeparate(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA,l.ONE,l.ONE_MINUS_SRC_ALPHA)),ua=a);if(a===THREE.CustomBlending){if(b!==ka&&(l.blendEquation(L(b)),ka=b),c!==da||d!==xa)l.blendFunc(L(c),L(d)),da=c,xa=d}else xa=da=ka=null};this.uploadTexture=function(a){a.__webglInit||(a.__webglInit=!0,a.addEventListener("dispose",sc),a.__webglTexture=l.createTexture(),
|
|
|
G.info.memory.textures++);l.bindTexture(l.TEXTURE_2D,a.__webglTexture);l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,a.flipY);l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);l.pixelStorei(l.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=M(a.image,Oc);var b=a.image,c=THREE.Math.isPowerOfTwo(b.width)&&THREE.Math.isPowerOfTwo(b.height),d=L(a.format),e=L(a.type);R(l.TEXTURE_2D,a,c);var f=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<f.length&&c){for(var g=0,h=f.length;g<h;g++)b=f[g],l.texImage2D(l.TEXTURE_2D,
|
|
|
g,d,b.width,b.height,0,d,e,b.data);a.generateMipmaps=!1}else l.texImage2D(l.TEXTURE_2D,0,d,b.width,b.height,0,d,e,b.data);else if(a instanceof THREE.CompressedTexture)for(g=0,h=f.length;g<h;g++)b=f[g],a.format!==THREE.RGBAFormat?l.compressedTexImage2D(l.TEXTURE_2D,g,d,b.width,b.height,0,b.data):l.texImage2D(l.TEXTURE_2D,g,d,b.width,b.height,0,d,e,b.data);else if(0<f.length&&c){g=0;for(h=f.length;g<h;g++)b=f[g],l.texImage2D(l.TEXTURE_2D,g,d,d,e,b);a.generateMipmaps=!1}else l.texImage2D(l.TEXTURE_2D,
|