|
@@ -377,13 +377,13 @@ i.__webglNormalBuffer=k.createBuffer();i.__webglTangentBuffer=k.createBuffer();i
|
|
|
[];j=0;for(q=i.numMorphNormals;j<q;j++)i.__webglMorphNormalsBuffers.push(k.createBuffer())}M.info.memory.geometries++;d(g,a);f.verticesNeedUpdate=!0;f.morphTargetsNeedUpdate=!0;f.elementsNeedUpdate=!0;f.uvsNeedUpdate=!0;f.normalsNeedUpdate=!0;f.tangentsNeedUpdate=!0;f.colorsNeedUpdate=!0}}else a instanceof THREE.Ribbon?f.__webglVertexBuffer||(g=f,g.__webglVertexBuffer=k.createBuffer(),g.__webglColorBuffer=k.createBuffer(),g.__webglNormalBuffer=k.createBuffer(),M.info.memory.geometries++,g=f,i=g.vertices.length,
|
|
|
g.__vertexArray=new Float32Array(3*i),g.__colorArray=new Float32Array(3*i),g.__normalArray=new Float32Array(3*i),g.__webglVertexCount=i,c(g,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=!0,f.normalsNeedUpdate=!0):a instanceof THREE.Line?f.__webglVertexBuffer||(g=f,g.__webglVertexBuffer=k.createBuffer(),g.__webglColorBuffer=k.createBuffer(),g.__webglLineDistanceBuffer=k.createBuffer(),M.info.memory.geometries++,g=f,i=g.vertices.length,g.__vertexArray=new Float32Array(3*i),g.__colorArray=new Float32Array(3*
|
|
|
i),g.__lineDistanceArray=new Float32Array(1*i),g.__webglLineCount=i,c(g,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=!0,f.lineDistancesNeedUpdate=!0):a instanceof THREE.ParticleSystem&&!f.__webglVertexBuffer&&(g=f,g.__webglVertexBuffer=k.createBuffer(),g.__webglColorBuffer=k.createBuffer(),M.info.memory.geometries++,g=f,i=g.vertices.length,g.__vertexArray=new Float32Array(3*i),g.__colorArray=new Float32Array(3*i),g.__sortArray=[],g.__webglParticleCount=i,c(g,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=
|
|
|
-!0);if(void 0===a.__webglActive){if(a instanceof THREE.Mesh)if(f=a.geometry,f instanceof THREE.BufferGeometry)n(b.__webglObjects,f,a);else{if(f instanceof THREE.Geometry)for(e in f.geometryGroups)g=f.geometryGroups[e],n(b.__webglObjects,g,a)}else a instanceof THREE.Ribbon||a instanceof THREE.Line||a instanceof THREE.ParticleSystem?(f=a.geometry,n(b.__webglObjects,f,a)):a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback?b.__webglObjectsImmediate.push({object:a,opaque:null,transparent:null}):
|
|
|
-a instanceof THREE.Sprite?b.__webglSprites.push(a):a instanceof THREE.LensFlare&&b.__webglFlares.push(a);a.__webglActive=!0}}function n(a,b,c){a.push({buffer:b,object:c,opaque:null,transparent:null})}function s(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function q(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function w(a,b){a instanceof THREE.Mesh||a instanceof THREE.ParticleSystem||a instanceof THREE.Ribbon||a instanceof THREE.Line?y(b.__webglObjects,
|
|
|
-a):a instanceof THREE.Sprite?D(b.__webglSprites,a):a instanceof THREE.LensFlare?D(b.__webglFlares,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&y(b.__webglObjectsImmediate,a);delete a.__webglActive}function y(a,b){for(var c=a.length-1;0<=c;c--)a[c].object===b&&a.splice(c,1)}function D(a,b){for(var c=a.length-1;0<=c;c--)a[c]===b&&a.splice(c,1)}function F(a,b,c,d,e){fa=0;d.needsUpdate&&(d.program&&vc(d),M.initMaterial(d,b,c,e),d.needsUpdate=!1);d.morphTargets&&!e.__webglMorphTargetInfluences&&
|
|
|
-(e.__webglMorphTargetInfluences=new Float32Array(M.maxMorphTargets));var f=!1,h=d.program,g=h.uniforms,i=d.uniforms;h!==pa&&(k.useProgram(h),pa=h,f=!0);d.id!==pb&&(pb=d.id,f=!0);if(f||a!==ya)k.uniformMatrix4fv(g.projectionMatrix,!1,a.projectionMatrix.elements),a!==ya&&(ya=a);if(d.skinning)if(Bb&&e.useVertexTexture){if(null!==g.boneTexture){var j=H();k.uniform1i(g.boneTexture,j);M.setTexture(e.boneTexture,j)}}else null!==g.boneGlobalMatrices&&k.uniformMatrix4fv(g.boneGlobalMatrices,!1,e.boneMatrices);
|
|
|
-if(f){c&&d.fog&&(i.fogColor.value=c.color,c instanceof THREE.Fog?(i.fogNear.value=c.near,i.fogFar.value=c.far):c instanceof THREE.FogExp2&&(i.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(yb){for(var p,l=j=0,m=0,n,r,s,q=Ib,t=q.directional.colors,w=q.directional.positions,y=q.point.colors,z=q.point.positions,A=q.point.distances,B=q.spot.colors,F=q.spot.positions,D=q.spot.distances,E=q.spot.directions,J=q.spot.anglesCos,K=
|
|
|
-q.spot.exponents,V=q.hemi.skyColors,L=q.hemi.groundColors,C=q.hemi.positions,O=0,ea=0,T=0,aa=0,da=0,R=0,S=0,P=0,ba=p=0,c=s=ba=0,f=b.length;c<f;c++)p=b[c],p.onlyShadow||(n=p.color,r=p.intensity,s=p.distance,p instanceof THREE.AmbientLight?p.visible&&(M.gammaInput?(j+=n.r*n.r,l+=n.g*n.g,m+=n.b*n.b):(j+=n.r,l+=n.g,m+=n.b)):p instanceof THREE.DirectionalLight?(da+=1,p.visible&&(Ca.getPositionFromMatrix(p.matrixWorld),Ga.getPositionFromMatrix(p.target.matrixWorld),Ca.sub(Ga),Ca.normalize(),0===Ca.x&&0===
|
|
|
-Ca.y&&0===Ca.z||(p=3*O,w[p]=Ca.x,w[p+1]=Ca.y,w[p+2]=Ca.z,M.gammaInput?I(t,p,n,r*r):G(t,p,n,r),O+=1))):p instanceof THREE.PointLight?(R+=1,p.visible&&(ba=3*ea,M.gammaInput?I(y,ba,n,r*r):G(y,ba,n,r),Ga.getPositionFromMatrix(p.matrixWorld),z[ba]=Ga.x,z[ba+1]=Ga.y,z[ba+2]=Ga.z,A[ea]=s,ea+=1)):p instanceof THREE.SpotLight?(S+=1,p.visible&&(ba=3*T,M.gammaInput?I(B,ba,n,r*r):G(B,ba,n,r),Ga.getPositionFromMatrix(p.matrixWorld),F[ba]=Ga.x,F[ba+1]=Ga.y,F[ba+2]=Ga.z,D[T]=s,Ca.copy(Ga),Ga.getPositionFromMatrix(p.target.matrixWorld),
|
|
|
+!0);if(void 0===a.__webglActive){if(a instanceof THREE.Mesh)if(f=a.geometry,f instanceof THREE.BufferGeometry)n(b.__webglObjects,f,a);else{if(f instanceof THREE.Geometry)for(e in f.geometryGroups)g=f.geometryGroups[e],n(b.__webglObjects,g,a)}else a instanceof THREE.Ribbon||a instanceof THREE.Line||a instanceof THREE.ParticleSystem?(f=a.geometry,n(b.__webglObjects,f,a)):a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback?b.__webglObjectsImmediate.push({id:null,object:a,opaque:null,
|
|
|
+transparent:null,z:0}):a instanceof THREE.Sprite?b.__webglSprites.push(a):a instanceof THREE.LensFlare&&b.__webglFlares.push(a);a.__webglActive=!0}}function n(a,b,c){a.push({id:null,buffer:b,object:c,opaque:null,transparent:null,z:0})}function s(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function q(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function w(a,b){a instanceof THREE.Mesh||a instanceof THREE.ParticleSystem||a instanceof THREE.Ribbon||a instanceof
|
|
|
+THREE.Line?y(b.__webglObjects,a):a instanceof THREE.Sprite?D(b.__webglSprites,a):a instanceof THREE.LensFlare?D(b.__webglFlares,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&y(b.__webglObjectsImmediate,a);delete a.__webglActive}function y(a,b){for(var c=a.length-1;0<=c;c--)a[c].object===b&&a.splice(c,1)}function D(a,b){for(var c=a.length-1;0<=c;c--)a[c]===b&&a.splice(c,1)}function F(a,b,c,d,e){fa=0;d.needsUpdate&&(d.program&&vc(d),M.initMaterial(d,b,c,e),d.needsUpdate=
|
|
|
+!1);d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(M.maxMorphTargets));var f=!1,h=d.program,g=h.uniforms,i=d.uniforms;h!==pa&&(k.useProgram(h),pa=h,f=!0);d.id!==pb&&(pb=d.id,f=!0);if(f||a!==ya)k.uniformMatrix4fv(g.projectionMatrix,!1,a.projectionMatrix.elements),a!==ya&&(ya=a);if(d.skinning)if(Bb&&e.useVertexTexture){if(null!==g.boneTexture){var j=H();k.uniform1i(g.boneTexture,j);M.setTexture(e.boneTexture,j)}}else null!==g.boneGlobalMatrices&&k.uniformMatrix4fv(g.boneGlobalMatrices,
|
|
|
+!1,e.boneMatrices);if(f){c&&d.fog&&(i.fogColor.value=c.color,c instanceof THREE.Fog?(i.fogNear.value=c.near,i.fogFar.value=c.far):c instanceof THREE.FogExp2&&(i.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(yb){for(var p,l=j=0,m=0,n,r,s,q=Ib,t=q.directional.colors,w=q.directional.positions,y=q.point.colors,z=q.point.positions,A=q.point.distances,B=q.spot.colors,F=q.spot.positions,D=q.spot.distances,E=q.spot.directions,J=
|
|
|
+q.spot.anglesCos,K=q.spot.exponents,V=q.hemi.skyColors,L=q.hemi.groundColors,C=q.hemi.positions,O=0,ea=0,T=0,aa=0,da=0,R=0,S=0,P=0,ba=p=0,c=s=ba=0,f=b.length;c<f;c++)p=b[c],p.onlyShadow||(n=p.color,r=p.intensity,s=p.distance,p instanceof THREE.AmbientLight?p.visible&&(M.gammaInput?(j+=n.r*n.r,l+=n.g*n.g,m+=n.b*n.b):(j+=n.r,l+=n.g,m+=n.b)):p instanceof THREE.DirectionalLight?(da+=1,p.visible&&(Ca.getPositionFromMatrix(p.matrixWorld),Ga.getPositionFromMatrix(p.target.matrixWorld),Ca.sub(Ga),Ca.normalize(),
|
|
|
+0===Ca.x&&0===Ca.y&&0===Ca.z||(p=3*O,w[p]=Ca.x,w[p+1]=Ca.y,w[p+2]=Ca.z,M.gammaInput?I(t,p,n,r*r):G(t,p,n,r),O+=1))):p instanceof THREE.PointLight?(R+=1,p.visible&&(ba=3*ea,M.gammaInput?I(y,ba,n,r*r):G(y,ba,n,r),Ga.getPositionFromMatrix(p.matrixWorld),z[ba]=Ga.x,z[ba+1]=Ga.y,z[ba+2]=Ga.z,A[ea]=s,ea+=1)):p instanceof THREE.SpotLight?(S+=1,p.visible&&(ba=3*T,M.gammaInput?I(B,ba,n,r*r):G(B,ba,n,r),Ga.getPositionFromMatrix(p.matrixWorld),F[ba]=Ga.x,F[ba+1]=Ga.y,F[ba+2]=Ga.z,D[T]=s,Ca.copy(Ga),Ga.getPositionFromMatrix(p.target.matrixWorld),
|
|
|
Ca.sub(Ga),Ca.normalize(),E[ba]=Ca.x,E[ba+1]=Ca.y,E[ba+2]=Ca.z,J[T]=Math.cos(p.angle),K[T]=p.exponent,T+=1)):p instanceof THREE.HemisphereLight&&(P+=1,p.visible&&(Ca.getPositionFromMatrix(p.matrixWorld),Ca.normalize(),0===Ca.x&&0===Ca.y&&0===Ca.z||(s=3*aa,C[s]=Ca.x,C[s+1]=Ca.y,C[s+2]=Ca.z,n=p.color,p=p.groundColor,M.gammaInput?(r*=r,I(V,s,n,r),I(L,s,p,r)):(G(V,s,n,r),G(L,s,p,r)),aa+=1))));c=3*O;for(f=Math.max(t.length,3*da);c<f;c++)t[c]=0;c=3*ea;for(f=Math.max(y.length,3*R);c<f;c++)y[c]=0;c=3*T;for(f=
|
|
|
Math.max(B.length,3*S);c<f;c++)B[c]=0;c=3*aa;for(f=Math.max(V.length,3*P);c<f;c++)V[c]=0;c=3*aa;for(f=Math.max(L.length,3*P);c<f;c++)L[c]=0;q.directional.length=O;q.point.length=ea;q.spot.length=T;q.hemi.length=aa;q.ambient[0]=j;q.ambient[1]=l;q.ambient[2]=m;yb=!1}c=Ib;i.ambientLightColor.value=c.ambient;i.directionalLightColor.value=c.directional.colors;i.directionalLightDirection.value=c.directional.positions;i.pointLightColor.value=c.point.colors;i.pointLightPosition.value=c.point.positions;i.pointLightDistance.value=
|
|
|
c.point.distances;i.spotLightColor.value=c.spot.colors;i.spotLightPosition.value=c.spot.positions;i.spotLightDistance.value=c.spot.distances;i.spotLightDirection.value=c.spot.directions;i.spotLightAngleCos.value=c.spot.anglesCos;i.spotLightExponent.value=c.spot.exponents;i.hemisphereLightSkyColor.value=c.hemi.skyColors;i.hemisphereLightGroundColor.value=c.hemi.groundColors;i.hemisphereLightDirection.value=c.hemi.positions}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||
|