|
@@ -177,7 +177,7 @@ THREE.ShaderChunk.lights_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderCh
|
|
|
"void main() {\ngl_FragColor = vec4( psColor, opacity );",THREE.ShaderChunk.map_particle_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:["uniform float size;\nuniform float scale;",THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {",THREE.ShaderChunk.color_vertex,"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n#ifdef USE_SIZEATTENUATION\ngl_PointSize = size * ( scale / length( mvPosition.xyz ) );\n#else\ngl_PointSize = size;\n#endif\ngl_Position = projectionMatrix * mvPosition;",
|
|
|
THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n")},depthRGBA:{uniforms:{},fragmentShader:"vec4 pack_depth( const in float depth ) {\nconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\nconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\nvec4 res = fract( depth * bit_shift );\nres -= res.xxyz * bit_mask;\nreturn res;\n}\nvoid main() {\ngl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n}",vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,
|
|
|
"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,"}"].join("\n")}};
|
|
|
-THREE.WebGLRenderer=function(b){function c(b,c,d){var f,j,h,k=b.vertices,m=k.length,H=b.colors,I=H.length,D=b.__vertexArray,p=b.__colorArray,r=b.__sortArray,n=b.__dirtyVertices,u=b.__dirtyColors,s=b.__webglCustomAttributes,w,q;if(s)for(w in s)s[w].offset=0;if(d.sortParticles){Aa.multiplySelf(d.matrixWorld);for(f=0;f<m;f++)j=k[f].position,Ia.copy(j),Aa.multiplyVector3(Ia),r[f]=[Ia.z,f];r.sort(function(b,c){return c[0]-b[0]});for(f=0;f<m;f++)j=k[r[f][1]].position,h=f*3,D[h]=j.x,D[h+1]=j.y,D[h+2]=j.z;
|
|
|
+THREE.WebGLRenderer=function(b){function c(b,c,d){var f,j,h,k=b.vertices,m=k.length,H=b.colors,I=H.length,D=b.__vertexArray,p=b.__colorArray,r=b.__sortArray,n=b.__dirtyVertices,u=b.__dirtyColors,s=b.__webglCustomAttributes,w,q;if(s)for(w in s)s[w].offset=0;if(d.sortParticles){Aa.multiplySelf(d.matrixWorld);for(f=0;f<m;f++)j=k[f].position,Ja.copy(j),Aa.multiplyVector3(Ja),r[f]=[Ja.z,f];r.sort(function(b,c){return c[0]-b[0]});for(f=0;f<m;f++)j=k[r[f][1]].position,h=f*3,D[h]=j.x,D[h+1]=j.y,D[h+2]=j.z;
|
|
|
for(f=0;f<I;f++)h=f*3,color=H[r[f][1]],p[h]=color.r,p[h+1]=color.g,p[h+2]=color.b;if(s)for(w in s){f=s[w];H=f.value.length;for(h=0;h<H;h++){index=r[h][1];I=f.offset;if(f.size===1){if(f.boundTo===void 0||f.boundTo==="vertices")f.array[I]=f.value[index]}else{if(f.boundTo===void 0||f.boundTo==="vertices")q=f.value[index];f.size===2?(f.array[I]=q.x,f.array[I+1]=q.y):f.size===3?f.type==="c"?(f.array[I]=q.r,f.array[I+1]=q.g,f.array[I+2]=q.b):(f.array[I]=q.x,f.array[I+1]=q.y,f.array[I+2]=q.z):(f.array[I]=
|
|
|
q.x,f.array[I+1]=q.y,f.array[I+2]=q.z,f.array[I+3]=q.w)}f.offset+=f.size}}}else{if(n)for(f=0;f<m;f++)j=k[f].position,h=f*3,D[h]=j.x,D[h+1]=j.y,D[h+2]=j.z;if(u)for(f=0;f<I;f++)color=H[f],h=f*3,p[h]=color.r,p[h+1]=color.g,p[h+2]=color.b;if(s)for(w in s)if(f=s[w],f.__original.needsUpdate){H=f.value.length;for(h=0;h<H;h++){I=f.offset;if(f.size===1){if(f.boundTo===void 0||f.boundTo==="vertices")f.array[I]=f.value[h]}else{if(f.boundTo===void 0||f.boundTo==="vertices")q=f.value[h];f.size===2?(f.array[I]=
|
|
|
q.x,f.array[I+1]=q.y):f.size===3?f.type==="c"?(f.array[I]=q.r,f.array[I+1]=q.g,f.array[I+2]=q.b):(f.array[I]=q.x,f.array[I+1]=q.y,f.array[I+2]=q.z):(f.array[I]=q.x,f.array[I+1]=q.y,f.array[I+2]=q.z,f.array[I+3]=q.w)}f.offset+=f.size}}}if(n||d.sortParticles)e.bindBuffer(e.ARRAY_BUFFER,b.__webglVertexBuffer),e.bufferData(e.ARRAY_BUFFER,D,c);if(u||d.sortParticles)e.bindBuffer(e.ARRAY_BUFFER,b.__webglColorBuffer),e.bufferData(e.ARRAY_BUFFER,p,c);if(s)for(w in s)if(f=s[w],f.__original.needsUpdate||d.sortParticles)e.bindBuffer(e.ARRAY_BUFFER,
|
|
@@ -186,7 +186,7 @@ f instanceof THREE.MeshPhongMaterial||f instanceof THREE.LineBasicMaterial||f in
|
|
|
E=0,F=0,d=p=v=0;for(H=c.length;d<H;d++)if(p=c[d],D=p.color,q=p.position,s=p.intensity,v=p.distance,p instanceof THREE.AmbientLight)r+=D.r,n+=D.g,u+=D.b;else if(p instanceof THREE.DirectionalLight)v=E*3,G[v]=D.r*s,G[v+1]=D.g*s,G[v+2]=D.b*s,K[v]=q.x,K[v+1]=q.y,K[v+2]=q.z,E+=1;else if(p instanceof THREE.SpotLight)v=E*3,G[v]=D.r*s,G[v+1]=D.g*s,G[v+2]=D.b*s,D=1/q.length(),K[v]=q.x*D,K[v+1]=q.y*D,K[v+2]=q.z*D,E+=1;else if(p instanceof THREE.PointLight)p=F*3,y[p]=D.r*s,y[p+1]=D.g*s,y[p+2]=D.b*s,A[p]=q.x,
|
|
|
A[p+1]=q.y,A[p+2]=q.z,C[F]=v,F+=1;for(d=E*3;d<G.length;d++)G[d]=0;for(d=F*3;d<y.length;d++)y[d]=0;B.point.length=F;B.directional.length=E;B.ambient[0]=r;B.ambient[1]=n;B.ambient[2]=u;c=Wa;m.enableLighting.value=c.directional.length+c.point.length;m.ambientLightColor.value=c.ambient;m.directionalLightColor.value=c.directional.colors;m.directionalLightDirection.value=c.directional.positions;m.pointLightColor.value=c.point.colors;m.pointLightPosition.value=c.point.positions;m.pointLightDistance.value=
|
|
|
c.point.distances}if(f instanceof THREE.MeshBasicMaterial||f instanceof THREE.MeshLambertMaterial||f instanceof THREE.MeshPhongMaterial)m.diffuse.value=f.color,m.opacity.value=f.opacity,(m.map.texture=f.map)&&m.offsetRepeat.value.set(f.map.offset.x,f.map.offset.y,f.map.repeat.x,f.map.repeat.y),m.lightMap.texture=f.lightMap,m.envMap.texture=f.envMap,m.reflectivity.value=f.reflectivity,m.refractionRatio.value=f.refractionRatio,m.combine.value=f.combine,m.useRefract.value=f.envMap&&f.envMap.mapping instanceof
|
|
|
-THREE.CubeRefractionMapping;if(f instanceof THREE.LineBasicMaterial)m.diffuse.value=f.color,m.opacity.value=f.opacity;else if(f instanceof THREE.ParticleBasicMaterial)m.psColor.value=f.color,m.opacity.value=f.opacity,m.size.value=f.size,m.scale.value=Ja.height/2,m.map.texture=f.map;else if(f instanceof THREE.MeshPhongMaterial)m.ambient.value=f.ambient,m.specular.value=f.specular,m.shininess.value=f.shininess;else if(f instanceof THREE.MeshDepthMaterial)m.mNear.value=b.near,m.mFar.value=b.far,m.opacity.value=
|
|
|
+THREE.CubeRefractionMapping;if(f instanceof THREE.LineBasicMaterial)m.diffuse.value=f.color,m.opacity.value=f.opacity;else if(f instanceof THREE.ParticleBasicMaterial)m.psColor.value=f.color,m.opacity.value=f.opacity,m.size.value=f.size,m.scale.value=Ka.height/2,m.map.texture=f.map;else if(f instanceof THREE.MeshPhongMaterial)m.ambient.value=f.ambient,m.specular.value=f.specular,m.shininess.value=f.shininess;else if(f instanceof THREE.MeshDepthMaterial)m.mNear.value=b.near,m.mFar.value=b.far,m.opacity.value=
|
|
|
f.opacity;else if(f instanceof THREE.MeshNormalMaterial)m.opacity.value=f.opacity;if(j.receiveShadow&&!f._shadowPass&&m.shadowMatrix){for(c=0;c<Sa.length;c++)m.shadowMatrix.value[c]=Sa[c],m.shadowMap.texture[c]=M.shadowMap[c];m.shadowDarkness.value=M.shadowMapDarkness;m.shadowBias.value=M.shadowMapBias}for(var N in m)if(H=h.uniforms[N])if(d=m[N],r=d.type,c=d.value,r=="i")e.uniform1i(H,c);else if(r=="f")e.uniform1f(H,c);else if(r=="v2")e.uniform2f(H,c.x,c.y);else if(r=="v3")e.uniform3f(H,c.x,c.y,c.z);
|
|
|
else if(r=="v4")e.uniform4f(H,c.x,c.y,c.z,c.w);else if(r=="c")e.uniform3f(H,c.r,c.g,c.b);else if(r=="fv1")e.uniform1fv(H,c);else if(r=="fv")e.uniform3fv(H,c);else if(r=="v3v"){if(!d._array)d._array=new Float32Array(3*c.length);r=0;for(n=c.length;r<n;r++)u=r*3,d._array[u]=c[r].x,d._array[u+1]=c[r].y,d._array[u+2]=c[r].z;e.uniform3fv(H,d._array)}else if(r=="m4"){if(!d._array)d._array=new Float32Array(16);c.flattenToArray(d._array);e.uniformMatrix4fv(H,!1,d._array)}else if(r=="m4v"){if(!d._array)d._array=
|
|
|
new Float32Array(16*c.length);r=0;for(n=c.length;r<n;r++)c[r].flattenToArrayOffset(d._array,r*16);e.uniformMatrix4fv(H,!1,d._array)}else if(r=="t"){if(e.uniform1i(H,c),H=d.texture)if(H.image instanceof Array&&H.image.length==6){if(d=H,d.image.length==6)if(d.needsUpdate){if(!d.image.__webglTextureCube)d.image.__webglTextureCube=e.createTexture();e.activeTexture(e.TEXTURE0+c);e.bindTexture(e.TEXTURE_CUBE_MAP,d.image.__webglTextureCube);for(c=0;c<6;c++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,
|
|
@@ -206,7 +206,7 @@ b&&(e.depthMask(b),S=b)}function r(b,c,d){V!=b&&(b?e.enable(e.POLYGON_OFFSET_FIL
|
|
|
b.n32,b.n43+b.n33,b.n44+b.n34);for(var c,b=0;b<6;b++)c=R[b],c.divideScalar(Math.sqrt(c.x*c.x+c.y*c.y+c.z*c.z))}function u(b){for(var c=b.matrixWorld,d=-b.geometry.boundingSphere.radius*Math.max(b.scale.x,Math.max(b.scale.y,b.scale.z)),e=0;e<6;e++)if(b=R[e].x*c.n14+R[e].y*c.n24+R[e].z*c.n34+R[e].w,b<=d)return!1;return!0}function n(b,c){b.list[b.count]=c;b.count+=1}function s(b){var c,e,d=b.object,f=b.opaque,h=b.transparent;h.count=0;b=f.count=0;for(c=d.materials.length;b<c;b++)e=d.materials[b],e.transparent?
|
|
|
n(h,e):n(f,e)}function v(b){var c,e,d,f,h=b.object,j=b.buffer,k=b.opaque,m=b.transparent;m.count=0;b=k.count=0;for(d=h.materials.length;b<d;b++)if(c=h.materials[b],c instanceof THREE.MeshFaceMaterial){c=0;for(e=j.materials.length;c<e;c++)(f=j.materials[c])&&(f.transparent?n(m,f):n(k,f))}else(f=c)&&(f.transparent?n(m,f):n(k,f))}function B(b,c){return c.z-b.z}function y(b,c){var m,r,Ma,q=0,n,s,H,I,D=b.lights;qa||(qa=new THREE.Camera(M.shadowCameraFov,c.aspect,M.shadowCameraNear,M.shadowCameraFar));
|
|
|
m=0;for(r=D.length;m<r;m++)if(Ma=D[m],Ma instanceof THREE.SpotLight&&Ma.castShadow){M.shadowMap[q]||(M.shadowMap[q]=new THREE.WebGLRenderTarget(M.shadowMapWidth,M.shadowMapHeight,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat}));Sa[q]||(Sa[q]=new THREE.Matrix4);n=M.shadowMap[q];s=Sa[q];qa.position.copy(Ma.position);qa.target.position.copy(Ma.target.position);qa.update(void 0,!0);b.update(void 0,!1,qa);s.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);s.multiplySelf(qa.projectionMatrix);
|
|
|
-s.multiplySelf(qa.matrixWorldInverse);qa.matrixWorldInverse.flattenToArray(Ta);qa.projectionMatrix.flattenToArray(Ca);Aa.multiply(qa.projectionMatrix,qa.matrixWorldInverse);p(Aa);M.initWebGLObjects(b);L(n);e.clearColor(1,1,1,1);M.clear();e.clearColor(ga.r,ga.g,ga.b,Ka);s=b.__webglObjects.length;Ma=b.__webglObjectsImmediate.length;for(n=0;n<s;n++)H=b.__webglObjects[n],I=H.object,I.visible&&I.castShadow?!(I instanceof THREE.Mesh)||!I.frustumCulled||u(I)?(I.matrixWorld.flattenToArray(I._objectMatrixArray),
|
|
|
+s.multiplySelf(qa.matrixWorldInverse);qa.matrixWorldInverse.flattenToArray(Ta);qa.projectionMatrix.flattenToArray(Ca);Aa.multiply(qa.projectionMatrix,qa.matrixWorldInverse);p(Aa);M.initWebGLObjects(b);L(n);e.clearColor(1,1,1,1);M.clear();e.clearColor(ga.r,ga.g,ga.b,Ha);s=b.__webglObjects.length;Ma=b.__webglObjectsImmediate.length;for(n=0;n<s;n++)H=b.__webglObjects[n],I=H.object,I.visible&&I.castShadow?!(I instanceof THREE.Mesh)||!I.frustumCulled||u(I)?(I.matrixWorld.flattenToArray(I._objectMatrixArray),
|
|
|
C(I,qa,!1),H.render=!0):H.render=!1:H.render=!1;k(!0);F(THREE.NormalBlending);for(n=0;n<s;n++)if(H=b.__webglObjects[n],H.render)I=H.object,buffer=H.buffer,h(I),H=I.customDepthMaterial?I.customDepthMaterial:I.geometry.morphTargets.length?Xa:Ua,f(qa,D,null,H,buffer,I);for(n=0;n<Ma;n++)H=b.__webglObjectsImmediate[n],I=H.object,I.visible&&I.castShadow&&(I.matrixAutoUpdate&&I.matrixWorld.flattenToArray(I._objectMatrixArray),C(I,qa,!1),h(I),program=d(qa,D,null,Ua,I),I.render(function(b){j(b,program,Ua.shading)}));
|
|
|
q++}}function E(b,c){var d,f,h;d=q.attributes;var j=q.uniforms,k=Ea/za,m,p=[],r=za*0.5,n=Ea*0.5,s=!0;e.useProgram(q.program);Va=q.program;W=J=-1;Ya||(e.enableVertexAttribArray(q.attributes.position),e.enableVertexAttribArray(q.attributes.uv),Ya=!0);e.disable(e.CULL_FACE);e.enable(e.BLEND);e.depthMask(!0);e.bindBuffer(e.ARRAY_BUFFER,q.vertexBuffer);e.vertexAttribPointer(d.position,2,e.FLOAT,!1,16,0);e.vertexAttribPointer(d.uv,2,e.FLOAT,!1,16,8);e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,q.elementBuffer);
|
|
|
e.uniformMatrix4fv(j.projectionMatrix,!1,Ca);e.activeTexture(e.TEXTURE0);e.uniform1i(j.map,0);d=0;for(f=b.__webglSprites.length;d<f;d++)h=b.__webglSprites[d],h.useScreenCoordinates?h.z=-h.position.z:(h._modelViewMatrix.multiplyToArray(c.matrixWorldInverse,h.matrixWorld,h._modelViewMatrixArray),h.z=-h._modelViewMatrix.n34);b.__webglSprites.sort(B);d=0;for(f=b.__webglSprites.length;d<f;d++)h=b.__webglSprites[d],h.material===void 0&&h.map&&h.map.image&&h.map.image.width&&(h.useScreenCoordinates?(e.uniform1i(j.useScreenCoordinates,
|
|
@@ -225,17 +225,17 @@ e.bindFramebuffer(e.FRAMEBUFFER,null)}var f,h;b?(c=c?b.__webglFramebuffer[b.acti
|
|
|
e.bindTexture(e.TEXTURE_2D,null))}function Y(b,c){var d;b=="fragment"?d=e.createShader(e.FRAGMENT_SHADER):b=="vertex"&&(d=e.createShader(e.VERTEX_SHADER));e.shaderSource(d,c);e.compileShader(d);if(!e.getShaderParameter(d,e.COMPILE_STATUS))return console.error(e.getShaderInfoLog(d)),console.error(c),null;return d}function ua(b){switch(b){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return e.NEAREST;default:return e.LINEAR}}function Q(b){switch(b){case THREE.RepeatWrapping:return e.REPEAT;
|
|
|
case THREE.ClampToEdgeWrapping:return e.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return e.MIRRORED_REPEAT;case THREE.NearestFilter:return e.NEAREST;case THREE.NearestMipMapNearestFilter:return e.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return e.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return e.LINEAR;case THREE.LinearMipMapNearestFilter:return e.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return e.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return e.BYTE;
|
|
|
case THREE.UnsignedByteType:return e.UNSIGNED_BYTE;case THREE.ShortType:return e.SHORT;case THREE.UnsignedShortType:return e.UNSIGNED_SHORT;case THREE.IntType:return e.INT;case THREE.UnsignedShortType:return e.UNSIGNED_INT;case THREE.FloatType:return e.FLOAT;case THREE.AlphaFormat:return e.ALPHA;case THREE.RGBFormat:return e.RGB;case THREE.RGBAFormat:return e.RGBA;case THREE.LuminanceFormat:return e.LUMINANCE;case THREE.LuminanceAlphaFormat:return e.LUMINANCE_ALPHA}return 0}var M=this,e,Da=[],Va=
|
|
|
-null,va=null,T=null,Z=null,J=null,W=null,S=null,V=null,wa=null,P=null,sa=0,Ga=0,za=0,Ea=0,R=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Aa=new THREE.Matrix4,Ca=new Float32Array(16),Ta=new Float32Array(16),Ia=new THREE.Vector4,Wa={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},b=b||{},Ja=b.canvas!==void 0?b.canvas:document.createElement("canvas"),ab=b.stencil!==void 0?
|
|
|
-b.stencil:!0,bb=b.preserveDrawingBuffer!==void 0?b.preserveDrawingBuffer:!1,cb=b.antialias!==void 0?b.antialias:!1,ga=b.clearColor!==void 0?new THREE.Color(b.clearColor):new THREE.Color(0),Ka=b.clearAlpha!==void 0?b.clearAlpha:0;_maxLights=b.maxLights!==void 0?b.maxLights:4;this.data={vertices:0,faces:0,drawCalls:0};this.maxMorphTargets=8;this.domElement=Ja;this.sortObjects=this.autoClear=!0;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=
|
|
|
-1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=!0;var qa,Sa=[],b=THREE.ShaderLib.depthRGBA,Za=THREE.UniformsUtils.clone(b.uniforms),Ua=new THREE.MeshShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:Za}),Xa=new THREE.MeshShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:Za,morphTargets:!0});Ua._shadowPass=!0;Xa._shadowPass=!0;try{if(!(e=Ja.getContext("experimental-webgl",
|
|
|
+null,va=null,T=null,Z=null,J=null,W=null,S=null,V=null,wa=null,P=null,sa=0,Ga=0,za=0,Ea=0,R=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Aa=new THREE.Matrix4,Ca=new Float32Array(16),Ta=new Float32Array(16),Ja=new THREE.Vector4,Wa={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},b=b||{},Ka=b.canvas!==void 0?b.canvas:document.createElement("canvas"),ab=b.stencil!==void 0?
|
|
|
+b.stencil:!0,bb=b.preserveDrawingBuffer!==void 0?b.preserveDrawingBuffer:!1,cb=b.antialias!==void 0?b.antialias:!1,ga=b.clearColor!==void 0?new THREE.Color(b.clearColor):new THREE.Color(0),Ha=b.clearAlpha!==void 0?b.clearAlpha:0;_maxLights=b.maxLights!==void 0?b.maxLights:4;this.data={vertices:0,faces:0,drawCalls:0};this.maxMorphTargets=8;this.domElement=Ka;this.sortObjects=this.autoClear=!0;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=
|
|
|
+1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=!0;var qa,Sa=[],b=THREE.ShaderLib.depthRGBA,Za=THREE.UniformsUtils.clone(b.uniforms),Ua=new THREE.MeshShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:Za}),Xa=new THREE.MeshShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:Za,morphTargets:!0});Ua._shadowPass=!0;Xa._shadowPass=!0;try{if(!(e=Ka.getContext("experimental-webgl",
|
|
|
{antialias:cb,stencil:ab,preserveDrawingBuffer:bb})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+e.getParameter(e.VERSION)+" | "+e.getParameter(e.VENDOR)+" | "+e.getParameter(e.RENDERER)+" | "+e.getParameter(e.SHADING_LANGUAGE_VERSION))}catch(db){console.error(db)}e.clearColor(0,0,0,1);e.clearDepth(1);e.clearStencil(0);e.enable(e.DEPTH_TEST);e.depthFunc(e.LEQUAL);e.frontFace(e.CCW);e.cullFace(e.BACK);e.enable(e.CULL_FACE);e.enable(e.BLEND);e.blendEquation(e.FUNC_ADD);
|
|
|
-e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA);e.clearColor(ga.r,ga.g,ga.b,Ka);this.context=e;var $a=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,q={};q.vertices=new Float32Array(16);q.faces=new Uint16Array(6);i=0;q.vertices[i++]=-1;q.vertices[i++]=-1;q.vertices[i++]=0;q.vertices[i++]=1;q.vertices[i++]=1;q.vertices[i++]=-1;q.vertices[i++]=1;q.vertices[i++]=1;q.vertices[i++]=1;q.vertices[i++]=1;q.vertices[i++]=1;q.vertices[i++]=0;q.vertices[i++]=-1;q.vertices[i++]=1;q.vertices[i++]=0;i=q.vertices[i++]=
|
|
|
+e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA);e.clearColor(ga.r,ga.g,ga.b,Ha);this.context=e;var $a=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,q={};q.vertices=new Float32Array(16);q.faces=new Uint16Array(6);i=0;q.vertices[i++]=-1;q.vertices[i++]=-1;q.vertices[i++]=0;q.vertices[i++]=1;q.vertices[i++]=1;q.vertices[i++]=-1;q.vertices[i++]=1;q.vertices[i++]=1;q.vertices[i++]=1;q.vertices[i++]=1;q.vertices[i++]=1;q.vertices[i++]=0;q.vertices[i++]=-1;q.vertices[i++]=1;q.vertices[i++]=0;i=q.vertices[i++]=
|
|
|
0;q.faces[i++]=0;q.faces[i++]=1;q.faces[i++]=2;q.faces[i++]=0;q.faces[i++]=2;q.faces[i++]=3;q.vertexBuffer=e.createBuffer();q.elementBuffer=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,q.vertexBuffer);e.bufferData(e.ARRAY_BUFFER,q.vertices,e.STATIC_DRAW);e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,q.elementBuffer);e.bufferData(e.ELEMENT_ARRAY_BUFFER,q.faces,e.STATIC_DRAW);q.program=e.createProgram();e.attachShader(q.program,Y("fragment",THREE.ShaderLib.sprite.fragmentShader));e.attachShader(q.program,Y("vertex",
|
|
|
THREE.ShaderLib.sprite.vertexShader));e.linkProgram(q.program);q.attributes={};q.uniforms={};q.attributes.position=e.getAttribLocation(q.program,"position");q.attributes.uv=e.getAttribLocation(q.program,"uv");q.uniforms.uvOffset=e.getUniformLocation(q.program,"uvOffset");q.uniforms.uvScale=e.getUniformLocation(q.program,"uvScale");q.uniforms.rotation=e.getUniformLocation(q.program,"rotation");q.uniforms.scale=e.getUniformLocation(q.program,"scale");q.uniforms.alignment=e.getUniformLocation(q.program,
|
|
|
"alignment");q.uniforms.map=e.getUniformLocation(q.program,"map");q.uniforms.opacity=e.getUniformLocation(q.program,"opacity");q.uniforms.useScreenCoordinates=e.getUniformLocation(q.program,"useScreenCoordinates");q.uniforms.affectedByDistance=e.getUniformLocation(q.program,"affectedByDistance");q.uniforms.screenPosition=e.getUniformLocation(q.program,"screenPosition");q.uniforms.modelViewMatrix=e.getUniformLocation(q.program,"modelViewMatrix");q.uniforms.projectionMatrix=e.getUniformLocation(q.program,
|
|
|
-"projectionMatrix");var Ya=!1;this.setSize=function(b,c){Ja.width=b;Ja.height=c;this.setViewport(0,0,Ja.width,Ja.height)};this.setViewport=function(b,c,d,f){sa=b;Ga=c;za=d;Ea=f;e.viewport(sa,Ga,za,Ea)};this.setScissor=function(b,c,d,f){e.scissor(b,c,d,f)};this.enableScissorTest=function(b){b?e.enable(e.SCISSOR_TEST):e.disable(e.SCISSOR_TEST)};this.setClearColorHex=function(b,c){ga.setHex(b);Ka=c;e.clearColor(ga.r,ga.g,ga.b,Ka)};this.setClearColor=function(b,c){ga.copy(b);Ka=c;e.clearColor(ga.r,ga.g,
|
|
|
-ga.b,Ka)};this.getClearColor=function(){return ga};this.clear=function(){e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT|e.STENCIL_BUFFER_BIT)};this.getContext=function(){return e};this.deallocateObject=function(b){if(b.__webglInit)if(b.__webglInit=!1,delete b._modelViewMatrix,delete b._normalMatrixArray,delete b._modelViewMatrixArray,delete b._objectMatrixArray,b instanceof THREE.Mesh)for(g in b.geometry.geometryGroups){var c=b.geometry.geometryGroups[g];e.deleteBuffer(c.__webglVertexBuffer);e.deleteBuffer(c.__webglNormalBuffer);
|
|
|
-e.deleteBuffer(c.__webglTangentBuffer);e.deleteBuffer(c.__webglColorBuffer);e.deleteBuffer(c.__webglUVBuffer);e.deleteBuffer(c.__webglUV2Buffer);e.deleteBuffer(c.__webglSkinVertexABuffer);e.deleteBuffer(c.__webglSkinVertexBBuffer);e.deleteBuffer(c.__webglSkinIndicesBuffer);e.deleteBuffer(c.__webglSkinWeightsBuffer);e.deleteBuffer(c.__webglFaceBuffer);e.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var d=0,f=c.numMorphTargets;d<f;d++)e.deleteBuffer(c.__webglMorphTargetsBuffers[d])}else if(b instanceof
|
|
|
+"projectionMatrix");var Ya=!1;this.setSize=function(b,c){Ka.width=b;Ka.height=c;this.setViewport(0,0,Ka.width,Ka.height)};this.setViewport=function(b,c,d,f){sa=b;Ga=c;za=d;Ea=f;e.viewport(sa,Ga,za,Ea)};this.setScissor=function(b,c,d,f){e.scissor(b,c,d,f)};this.enableScissorTest=function(b){b?e.enable(e.SCISSOR_TEST):e.disable(e.SCISSOR_TEST)};this.setClearColorHex=function(b,c){ga.setHex(b);Ha=c;e.clearColor(ga.r,ga.g,ga.b,Ha)};this.setClearColor=function(b,c){ga.copy(b);Ha=c;e.clearColor(ga.r,ga.g,
|
|
|
+ga.b,Ha)};this.getClearColor=function(){return ga};this.getClearAlpha=function(){return Ha};this.clear=function(){e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT|e.STENCIL_BUFFER_BIT)};this.getContext=function(){return e};this.deallocateObject=function(b){if(b.__webglInit)if(b.__webglInit=!1,delete b._modelViewMatrix,delete b._normalMatrixArray,delete b._modelViewMatrixArray,delete b._objectMatrixArray,b instanceof THREE.Mesh)for(g in b.geometry.geometryGroups){var c=b.geometry.geometryGroups[g];e.deleteBuffer(c.__webglVertexBuffer);
|
|
|
+e.deleteBuffer(c.__webglNormalBuffer);e.deleteBuffer(c.__webglTangentBuffer);e.deleteBuffer(c.__webglColorBuffer);e.deleteBuffer(c.__webglUVBuffer);e.deleteBuffer(c.__webglUV2Buffer);e.deleteBuffer(c.__webglSkinVertexABuffer);e.deleteBuffer(c.__webglSkinVertexBBuffer);e.deleteBuffer(c.__webglSkinIndicesBuffer);e.deleteBuffer(c.__webglSkinWeightsBuffer);e.deleteBuffer(c.__webglFaceBuffer);e.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var d=0,f=c.numMorphTargets;d<f;d++)e.deleteBuffer(c.__webglMorphTargetsBuffers[d])}else if(b instanceof
|
|
|
THREE.Ribbon)b=b.geometry,e.deleteBuffer(b.__webglVertexBuffer),e.deleteBuffer(b.__webglColorBuffer);else if(b instanceof THREE.Line)b=b.geometry,e.deleteBuffer(b.__webglVertexBuffer),e.deleteBuffer(b.__webglColorBuffer);else if(b instanceof THREE.ParticleSystem)b=b.geometry,e.deleteBuffer(b.__webglVertexBuffer),e.deleteBuffer(b.__webglColorBuffer)};this.deallocateTexture=function(b){if(b.__webglInit)b.__webglInit=!1,e.deleteTexture(b.__webglTexture)};this.initMaterial=function(b,c,d,f){var h,j,k;
|
|
|
b instanceof THREE.MeshDepthMaterial?k="depth":b instanceof THREE.MeshNormalMaterial?k="normal":b instanceof THREE.MeshBasicMaterial?k="basic":b instanceof THREE.MeshLambertMaterial?k="lambert":b instanceof THREE.MeshPhongMaterial?k="phong":b instanceof THREE.LineBasicMaterial?k="basic":b instanceof THREE.ParticleBasicMaterial&&(k="particle_basic");if(k){var m=THREE.ShaderLib[k];b.uniforms=THREE.UniformsUtils.clone(m.uniforms);b.vertexShader=m.vertexShader;b.fragmentShader=m.fragmentShader}var p,
|
|
|
r,n;p=n=m=0;for(r=c.length;p<r;p++)j=c[p],j instanceof THREE.SpotLight&&n++,j instanceof THREE.DirectionalLight&&n++,j instanceof THREE.PointLight&&m++;m+n<=_maxLights?p=n:(p=Math.ceil(_maxLights*n/(m+n)),m=_maxLights-p);j={directional:p,point:m};m=n=0;for(p=c.length;m<p;m++)r=c[m],r instanceof THREE.SpotLight&&r.castShadow&&n++;var q=50;if(f!==void 0&&f instanceof THREE.SkinnedMesh)q=f.bones.length;var s;a:{p=b.fragmentShader;r=b.vertexShader;var m=b.uniforms,c=b.attributes,d={map:!!b.map,envMap:!!b.envMap,
|
|
@@ -248,7 +248,7 @@ j=["#ifdef GL_ES\nprecision highp float;\n#endif","#define MAX_DIR_LIGHTS "+d.ma
|
|
|
s[v],u.attributes[d]=e.getAttribLocation(u,d);Da.push({program:u,code:k});s=u}b.program=s;s=b.program.attributes;s.position>=0&&e.enableVertexAttribArray(s.position);s.color>=0&&e.enableVertexAttribArray(s.color);s.normal>=0&&e.enableVertexAttribArray(s.normal);s.tangent>=0&&e.enableVertexAttribArray(s.tangent);b.skinning&&s.skinVertexA>=0&&s.skinVertexB>=0&&s.skinIndex>=0&&s.skinWeight>=0&&(e.enableVertexAttribArray(s.skinVertexA),e.enableVertexAttribArray(s.skinVertexB),e.enableVertexAttribArray(s.skinIndex),
|
|
|
e.enableVertexAttribArray(s.skinWeight));if(b.attributes)for(h in b.attributes)s[h]!==void 0&&s[h]>=0&&e.enableVertexAttribArray(s[h]);if(b.morphTargets)for(h=b.numSupportedMorphTargets=0;h<this.maxMorphTargets;h++)v="morphTarget"+h,s[v]>=0&&(e.enableVertexAttribArray(s[v]),b.numSupportedMorphTargets++)};this.clearTarget=function(b,c,d,f){L(b);b=0;c&&(b|=e.COLOR_BUFFER_BIT);d&&(b|=e.DEPTH_BUFFER_BIT);f&&(b|=e.STENCIL_BUFFER_BIT);e.clear(b)};this.render=function(b,c,e,n){var q,w,Fa,U,H,I,D,Qa,J=b.lights,
|
|
|
Ra=b.fog;this.shadowMapEnabled&&y(b,c);M.data.vertices=0;M.data.faces=0;M.data.drawCalls=0;c.matrixAutoUpdate&&c.update(void 0,!0);b.update(void 0,!1,c);c.matrixWorldInverse.flattenToArray(Ta);c.projectionMatrix.flattenToArray(Ca);Aa.multiply(c.projectionMatrix,c.matrixWorldInverse);p(Aa);this.initWebGLObjects(b);L(e);(this.autoClear||n)&&this.clear();H=b.__webglObjects.length;for(n=0;n<H;n++)if(q=b.__webglObjects[n],D=q.object,D.visible)if(!(D instanceof THREE.Mesh)||!D.frustumCulled||u(D)){if(D.matrixWorld.flattenToArray(D._objectMatrixArray),
|
|
|
-C(D,c,!0),v(q),q.render=!0,this.sortObjects)q.object.renderDepth?q.z=q.object.renderDepth:(Ia.copy(D.position),Aa.multiplyVector3(Ia),q.z=Ia.z)}else q.render=!1;else q.render=!1;this.sortObjects&&b.__webglObjects.sort(B);I=b.__webglObjectsImmediate.length;for(n=0;n<I;n++)q=b.__webglObjectsImmediate[n],D=q.object,D.visible&&(D.matrixAutoUpdate&&D.matrixWorld.flattenToArray(D._objectMatrixArray),C(D,c,!0),s(q));if(b.overrideMaterial){k(b.overrideMaterial.depthTest);F(b.overrideMaterial.blending);for(n=
|
|
|
+C(D,c,!0),v(q),q.render=!0,this.sortObjects)q.object.renderDepth?q.z=q.object.renderDepth:(Ja.copy(D.position),Aa.multiplyVector3(Ja),q.z=Ja.z)}else q.render=!1;else q.render=!1;this.sortObjects&&b.__webglObjects.sort(B);I=b.__webglObjectsImmediate.length;for(n=0;n<I;n++)q=b.__webglObjectsImmediate[n],D=q.object,D.visible&&(D.matrixAutoUpdate&&D.matrixWorld.flattenToArray(D._objectMatrixArray),C(D,c,!0),s(q));if(b.overrideMaterial){k(b.overrideMaterial.depthTest);F(b.overrideMaterial.blending);for(n=
|
|
|
0;n<H;n++)if(q=b.__webglObjects[n],q.render)D=q.object,Qa=q.buffer,h(D),f(c,J,Ra,b.overrideMaterial,Qa,D);for(n=0;n<I;n++)q=b.__webglObjectsImmediate[n],D=q.object,D.visible&&(h(D),w=d(c,J,Ra,b.overrideMaterial,D),D.render(function(c){j(c,w,b.overrideMaterial.shading)}))}else{F(THREE.NormalBlending);for(n=H-1;n>=0;n--)if(q=b.__webglObjects[n],q.render){D=q.object;Qa=q.buffer;Fa=q.opaque;h(D);for(q=0;q<Fa.count;q++)U=Fa.list[q],k(U.depthTest),m(U.depthWrite),r(U.polygonOffset,U.polygonOffsetFactor,
|
|
|
U.polygonOffsetUnits),f(c,J,Ra,U,Qa,D)}for(n=0;n<I;n++)if(q=b.__webglObjectsImmediate[n],D=q.object,D.visible){Fa=q.opaque;h(D);for(q=0;q<Fa.count;q++)U=Fa.list[q],k(U.depthTest),m(U.depthWrite),r(U.polygonOffset,U.polygonOffsetFactor,U.polygonOffsetUnits),w=d(c,J,Ra,U,D),D.render(function(b){j(b,w,U.shading)})}for(n=0;n<H;n++)if(q=b.__webglObjects[n],q.render){D=q.object;Qa=q.buffer;Fa=q.transparent;h(D);for(q=0;q<Fa.count;q++)U=Fa.list[q],F(U.blending),k(U.depthTest),m(U.depthWrite),r(U.polygonOffset,
|
|
|
U.polygonOffsetFactor,U.polygonOffsetUnits),f(c,J,Ra,U,Qa,D)}for(n=0;n<I;n++)if(q=b.__webglObjectsImmediate[n],D=q.object,D.visible){Fa=q.transparent;h(D);for(q=0;q<Fa.count;q++)U=Fa.list[q],F(U.blending),k(U.depthTest),m(U.depthWrite),r(U.polygonOffset,U.polygonOffsetFactor,U.polygonOffsetUnits),w=d(c,J,Ra,U,D),D.render(function(b){j(b,w,U.shading)})}}b.__webglSprites.length&&E(b,c);e&&e.minFilter!==THREE.NearestFilter&&e.minFilter!==THREE.LinearFilter&&ja(e)};this.initWebGLObjects=function(b){if(!b.__webglObjects)b.__webglObjects=
|
|
@@ -266,11 +266,11 @@ C.attributes[a];attribute={};for(property in originalAttribute)attribute[propert
|
|
|
originalAttribute;h.__webglCustomAttributes[a]=attribute}}j.__dirtyVertices=!0;j.__dirtyColors=!0}fa(f.__webglObjects,j,d)}else THREE.MarchingCubes!==void 0&&d instanceof THREE.MarchingCubes?f.__webglObjectsImmediate.push({object:d,opaque:{list:[],count:0},transparent:{list:[],count:0}}):d instanceof THREE.Sprite&&f.__webglSprites.push(d);b.__objectsAdded.splice(0,1)}for(;b.__objectsRemoved.length;){f=b.__objectsRemoved[0];d=b;if(f instanceof THREE.Mesh||f instanceof THREE.ParticleSystem||f instanceof
|
|
|
THREE.Ribbon||f instanceof THREE.Line)pa(d.__webglObjects,f);else if(f instanceof THREE.Sprite){d=d.__webglSprites;j=void 0;for(j=d.length-1;j>=0;j--)d[j]==f&&d.splice(j,1)}else f instanceof THREE.MarchingCubes&&pa(d.__webglObjectsImmediate,f);b.__objectsRemoved.splice(0,1)}d=0;for(f=b.__webglObjects.length;d<f;d++)if(h=b.__webglObjects[d].object,n=k=j=void 0,h instanceof THREE.Mesh){j=h.geometry;m=0;for(p=j.geometryGroupsList.length;m<p;m++)if(k=j.geometryGroupsList[m],n=xa(k),j.__dirtyVertices||
|
|
|
j.__dirtyMorphTargets||j.__dirtyElements||j.__dirtyUvs||j.__dirtyNormals||j.__dirtyColors||j.__dirtyTangents||n)if(n=k,C=e.DYNAMIC_DRAW,w=!j.dynamic,n.__inittedArrays){var E=u=B=void 0,A=void 0,J=E=void 0,F=void 0,M=void 0,N=void 0,O=K=G=s=y=v=r=q=void 0,L=void 0,t=A=N=A=M=F=void 0,o=void 0,z=o=t=F=void 0,P=void 0,S=z=o=t=E=E=J=N=A=z=o=t=P=z=o=t=P=z=o=t=void 0,ha=0,la=0,W=0,Y=0,T=0,Q=0,X=0,R=0,ka=0,x=0,ma=0,z=t=0,z=void 0,na=n.__vertexArray,ia=n.__uvArray,ja=n.__uv2Array,V=n.__normalArray,$=n.__tangentArray,
|
|
|
-oa=n.__colorArray,aa=n.__skinVertexAArray,ca=n.__skinVertexBArray,da=n.__skinIndexArray,ea=n.__skinWeightArray,qa=n.__morphTargetsArrays,Z=n.__webglCustomAttributes,o=void 0,ga=n.__faceArray,Ba=n.__lineArray,wa=n.__needsSmoothNormals,r=n.__vertexColorType,q=n.__uvType,v=n.__normalType,ta=h.geometry,ua=ta.__dirtyVertices,va=ta.__dirtyElements,sa=ta.__dirtyUvs,Aa=ta.__dirtyNormals,Ca=ta.__dirtyTangents,Da=ta.__dirtyColors,Ea=ta.__dirtyMorphTargets,za=ta.vertices,Ga=n.faces,Ja=ta.faces,Ia=ta.faceVertexUvs[0],
|
|
|
-Ka=ta.faceVertexUvs[1],Na=ta.skinVerticesA,Oa=ta.skinVerticesB,Pa=ta.skinIndices,La=ta.skinWeights,Ha=ta.morphTargets;if(Z)for(S in Z)Z[S].offset=0,Z[S].offsetSrc=0;B=0;for(u=Ga.length;B<u;B++)if(E=Ga[B],A=Ja[E],Ia&&(y=Ia[E]),Ka&&(s=Ka[E]),E=A.vertexNormals,J=A.normal,F=A.vertexColors,M=A.color,N=A.vertexTangents,A instanceof THREE.Face3){if(ua)G=za[A.a].position,K=za[A.b].position,O=za[A.c].position,na[la]=G.x,na[la+1]=G.y,na[la+2]=G.z,na[la+3]=K.x,na[la+4]=K.y,na[la+5]=K.z,na[la+6]=O.x,na[la+7]=
|
|
|
+oa=n.__colorArray,aa=n.__skinVertexAArray,ca=n.__skinVertexBArray,da=n.__skinIndexArray,ea=n.__skinWeightArray,qa=n.__morphTargetsArrays,Z=n.__webglCustomAttributes,o=void 0,ga=n.__faceArray,Ba=n.__lineArray,wa=n.__needsSmoothNormals,r=n.__vertexColorType,q=n.__uvType,v=n.__normalType,ta=h.geometry,ua=ta.__dirtyVertices,va=ta.__dirtyElements,sa=ta.__dirtyUvs,Aa=ta.__dirtyNormals,Ca=ta.__dirtyTangents,Da=ta.__dirtyColors,Ea=ta.__dirtyMorphTargets,za=ta.vertices,Ga=n.faces,Ka=ta.faces,Ha=ta.faceVertexUvs[0],
|
|
|
+Ja=ta.faceVertexUvs[1],Na=ta.skinVerticesA,Oa=ta.skinVerticesB,Pa=ta.skinIndices,La=ta.skinWeights,Ia=ta.morphTargets;if(Z)for(S in Z)Z[S].offset=0,Z[S].offsetSrc=0;B=0;for(u=Ga.length;B<u;B++)if(E=Ga[B],A=Ka[E],Ha&&(y=Ha[E]),Ja&&(s=Ja[E]),E=A.vertexNormals,J=A.normal,F=A.vertexColors,M=A.color,N=A.vertexTangents,A instanceof THREE.Face3){if(ua)G=za[A.a].position,K=za[A.b].position,O=za[A.c].position,na[la]=G.x,na[la+1]=G.y,na[la+2]=G.z,na[la+3]=K.x,na[la+4]=K.y,na[la+5]=K.z,na[la+6]=O.x,na[la+7]=
|
|
|
O.y,na[la+8]=O.z,la+=9;if(Z)for(S in Z)if(o=Z[S],o.__original.needsUpdate)t=o.offset,z=o.offsetSrc,o.size===1?(o.boundTo===void 0||o.boundTo==="vertices"?(o.array[t]=o.value[A.a],o.array[t+1]=o.value[A.b],o.array[t+2]=o.value[A.c]):o.boundTo==="faces"?(z=o.value[z],o.array[t]=z,o.array[t+1]=z,o.array[t+2]=z,o.offsetSrc++):o.boundTo==="faceVertices"&&(o.array[t]=o.value[z],o.array[t+1]=o.value[z+1],o.array[t+2]=o.value[z+2],o.offsetSrc+=3),o.offset+=3):(o.boundTo===void 0||o.boundTo==="vertices"?(G=
|
|
|
o.value[A.a],K=o.value[A.b],O=o.value[A.c]):o.boundTo==="faces"?(O=K=G=z=o.value[z],o.offsetSrc++):o.boundTo==="faceVertices"&&(G=o.value[z],K=o.value[z+1],O=o.value[z+2],o.offsetSrc+=3),o.size===2?(o.array[t]=G.x,o.array[t+1]=G.y,o.array[t+2]=K.x,o.array[t+3]=K.y,o.array[t+4]=O.x,o.array[t+5]=O.y,o.offset+=6):o.size===3?(o.type==="c"?(o.array[t]=G.r,o.array[t+1]=G.g,o.array[t+2]=G.b,o.array[t+3]=K.r,o.array[t+4]=K.g,o.array[t+5]=K.b,o.array[t+6]=O.r,o.array[t+7]=O.g,o.array[t+8]=O.b):(o.array[t]=
|
|
|
-G.x,o.array[t+1]=G.y,o.array[t+2]=G.z,o.array[t+3]=K.x,o.array[t+4]=K.y,o.array[t+5]=K.z,o.array[t+6]=O.x,o.array[t+7]=O.y,o.array[t+8]=O.z),o.offset+=9):(o.array[t]=G.x,o.array[t+1]=G.y,o.array[t+2]=G.z,o.array[t+3]=G.w,o.array[t+4]=K.x,o.array[t+5]=K.y,o.array[t+6]=K.z,o.array[t+7]=K.w,o.array[t+8]=O.x,o.array[t+9]=O.y,o.array[t+10]=O.z,o.array[t+11]=O.w,o.offset+=12));if(Ea){t=0;for(o=Ha.length;t<o;t++)G=Ha[t].vertices[A.a].position,K=Ha[t].vertices[A.b].position,O=Ha[t].vertices[A.c].position,
|
|
|
+G.x,o.array[t+1]=G.y,o.array[t+2]=G.z,o.array[t+3]=K.x,o.array[t+4]=K.y,o.array[t+5]=K.z,o.array[t+6]=O.x,o.array[t+7]=O.y,o.array[t+8]=O.z),o.offset+=9):(o.array[t]=G.x,o.array[t+1]=G.y,o.array[t+2]=G.z,o.array[t+3]=G.w,o.array[t+4]=K.x,o.array[t+5]=K.y,o.array[t+6]=K.z,o.array[t+7]=K.w,o.array[t+8]=O.x,o.array[t+9]=O.y,o.array[t+10]=O.z,o.array[t+11]=O.w,o.offset+=12));if(Ea){t=0;for(o=Ia.length;t<o;t++)G=Ia[t].vertices[A.a].position,K=Ia[t].vertices[A.b].position,O=Ia[t].vertices[A.c].position,
|
|
|
z=qa[t],z[ma]=G.x,z[ma+1]=G.y,z[ma+2]=G.z,z[ma+3]=K.x,z[ma+4]=K.y,z[ma+5]=K.z,z[ma+6]=O.x,z[ma+7]=O.y,z[ma+8]=O.z;ma+=9}if(La.length)t=La[A.a],o=La[A.b],z=La[A.c],ea[x]=t.x,ea[x+1]=t.y,ea[x+2]=t.z,ea[x+3]=t.w,ea[x+4]=o.x,ea[x+5]=o.y,ea[x+6]=o.z,ea[x+7]=o.w,ea[x+8]=z.x,ea[x+9]=z.y,ea[x+10]=z.z,ea[x+11]=z.w,t=Pa[A.a],o=Pa[A.b],z=Pa[A.c],da[x]=t.x,da[x+1]=t.y,da[x+2]=t.z,da[x+3]=t.w,da[x+4]=o.x,da[x+5]=o.y,da[x+6]=o.z,da[x+7]=o.w,da[x+8]=z.x,da[x+9]=z.y,da[x+10]=z.z,da[x+11]=z.w,t=Na[A.a],o=Na[A.b],
|
|
|
z=Na[A.c],aa[x]=t.x,aa[x+1]=t.y,aa[x+2]=t.z,aa[x+3]=1,aa[x+4]=o.x,aa[x+5]=o.y,aa[x+6]=o.z,aa[x+7]=1,aa[x+8]=z.x,aa[x+9]=z.y,aa[x+10]=z.z,aa[x+11]=1,t=Oa[A.a],o=Oa[A.b],z=Oa[A.c],ca[x]=t.x,ca[x+1]=t.y,ca[x+2]=t.z,ca[x+3]=1,ca[x+4]=o.x,ca[x+5]=o.y,ca[x+6]=o.z,ca[x+7]=1,ca[x+8]=z.x,ca[x+9]=z.y,ca[x+10]=z.z,ca[x+11]=1,x+=12;if(Da&&r)F.length==3&&r==THREE.VertexColors?(A=F[0],t=F[1],o=F[2]):o=t=A=M,oa[ka]=A.r,oa[ka+1]=A.g,oa[ka+2]=A.b,oa[ka+3]=t.r,oa[ka+4]=t.g,oa[ka+5]=t.b,oa[ka+6]=o.r,oa[ka+7]=o.g,oa[ka+
|
|
|
8]=o.b,ka+=9;if(Ca&&ta.hasTangents)F=N[0],M=N[1],A=N[2],$[X]=F.x,$[X+1]=F.y,$[X+2]=F.z,$[X+3]=F.w,$[X+4]=M.x,$[X+5]=M.y,$[X+6]=M.z,$[X+7]=M.w,$[X+8]=A.x,$[X+9]=A.y,$[X+10]=A.z,$[X+11]=A.w,X+=12;if(Aa&&v)if(E.length==3&&wa)for(N=0;N<3;N++)J=E[N],V[Q]=J.x,V[Q+1]=J.y,V[Q+2]=J.z,Q+=3;else for(N=0;N<3;N++)V[Q]=J.x,V[Q+1]=J.y,V[Q+2]=J.z,Q+=3;if(sa&&y!==void 0&&q)for(N=0;N<3;N++)E=y[N],ia[W]=E.u,ia[W+1]=E.v,W+=2;if(sa&&s!==void 0&&q)for(N=0;N<3;N++)E=s[N],ja[Y]=E.u,ja[Y+1]=E.v,Y+=2;va&&(ga[T]=ha,ga[T+1]=
|
|
@@ -278,11 +278,11 @@ ha+1,ga[T+2]=ha+2,T+=3,Ba[R]=ha,Ba[R+1]=ha+1,Ba[R+2]=ha,Ba[R+3]=ha+2,Ba[R+4]=ha+
|
|
|
"vertices"?(o.array[t]=o.value[A.a],o.array[t+1]=o.value[A.b],o.array[t+2]=o.value[A.c],o.array[t+3]=o.value[A.d]):o.boundTo==="faces"?(z=o.value[z],o.array[t]=z,o.array[t+1]=z,o.array[t+2]=z,o.array[t+3]=z,o.offsetSrc++):o.boundTo==="faceVertices"&&(o.array[t]=o.value[z],o.array[t+1]=o.value[z+1],o.array[t+2]=o.value[z+2],o.array[t+3]=o.value[z+3],o.offsetSrc+=4),o.offset+=4):(o.boundTo===void 0||o.boundTo==="vertices"?(G=o.value[A.a],K=o.value[A.b],O=o.value[A.c],L=o.value[A.d]):o.boundTo==="faces"?
|
|
|
(L=O=K=G=z=o.value[z],o.offsetSrc++):o.boundTo==="faceVertices"&&(G=o.value[z],K=o.value[z+1],O=o.value[z+2],L=o.value[z+3],o.offsetSrc+=4),o.size===2?(o.array[t]=G.x,o.array[t+1]=G.y,o.array[t+2]=K.x,o.array[t+3]=K.y,o.array[t+4]=O.x,o.array[t+5]=O.y,o.array[t+6]=L.x,o.array[t+7]=L.y,o.offset+=8):o.size===3?(o.type==="c"?(o.array[t]=G.r,o.array[t+1]=G.g,o.array[t+2]=G.b,o.array[t+3]=K.r,o.array[t+4]=K.g,o.array[t+5]=K.b,o.array[t+6]=O.r,o.array[t+7]=O.g,o.array[t+8]=O.b,o.array[t+9]=L.r,o.array[t+
|
|
|
10]=L.g,o.array[t+11]=L.b):(o.array[t]=G.x,o.array[t+1]=G.y,o.array[t+2]=G.z,o.array[t+3]=K.x,o.array[t+4]=K.y,o.array[t+5]=K.z,o.array[t+6]=O.x,o.array[t+7]=O.y,o.array[t+8]=O.z,o.array[t+9]=L.x,o.array[t+10]=L.y,o.array[t+11]=L.z),o.offset+=12):(o.array[t]=G.x,o.array[t+1]=G.y,o.array[t+2]=G.z,o.array[t+3]=G.w,o.array[t+4]=K.x,o.array[t+5]=K.y,o.array[t+6]=K.z,o.array[t+7]=K.w,o.array[t+8]=O.x,o.array[t+9]=O.y,o.array[t+10]=O.z,o.array[t+11]=O.w,o.array[t+12]=L.x,o.array[t+13]=L.y,o.array[t+14]=
|
|
|
-L.z,o.array[t+15]=L.w,o.offset+=16));if(Ea){t=0;for(o=Ha.length;t<o;t++)G=Ha[t].vertices[A.a].position,K=Ha[t].vertices[A.b].position,O=Ha[t].vertices[A.c].position,L=Ha[t].vertices[A.d].position,z=qa[t],z[ma]=G.x,z[ma+1]=G.y,z[ma+2]=G.z,z[ma+3]=K.x,z[ma+4]=K.y,z[ma+5]=K.z,z[ma+6]=O.x,z[ma+7]=O.y,z[ma+8]=O.z,z[ma+9]=L.x,z[ma+10]=L.y,z[ma+11]=L.z;ma+=12}if(La.length)t=La[A.a],o=La[A.b],z=La[A.c],P=La[A.d],ea[x]=t.x,ea[x+1]=t.y,ea[x+2]=t.z,ea[x+3]=t.w,ea[x+4]=o.x,ea[x+5]=o.y,ea[x+6]=o.z,ea[x+7]=o.w,
|
|
|
+L.z,o.array[t+15]=L.w,o.offset+=16));if(Ea){t=0;for(o=Ia.length;t<o;t++)G=Ia[t].vertices[A.a].position,K=Ia[t].vertices[A.b].position,O=Ia[t].vertices[A.c].position,L=Ia[t].vertices[A.d].position,z=qa[t],z[ma]=G.x,z[ma+1]=G.y,z[ma+2]=G.z,z[ma+3]=K.x,z[ma+4]=K.y,z[ma+5]=K.z,z[ma+6]=O.x,z[ma+7]=O.y,z[ma+8]=O.z,z[ma+9]=L.x,z[ma+10]=L.y,z[ma+11]=L.z;ma+=12}if(La.length)t=La[A.a],o=La[A.b],z=La[A.c],P=La[A.d],ea[x]=t.x,ea[x+1]=t.y,ea[x+2]=t.z,ea[x+3]=t.w,ea[x+4]=o.x,ea[x+5]=o.y,ea[x+6]=o.z,ea[x+7]=o.w,
|
|
|
ea[x+8]=z.x,ea[x+9]=z.y,ea[x+10]=z.z,ea[x+11]=z.w,ea[x+12]=P.x,ea[x+13]=P.y,ea[x+14]=P.z,ea[x+15]=P.w,t=Pa[A.a],o=Pa[A.b],z=Pa[A.c],P=Pa[A.d],da[x]=t.x,da[x+1]=t.y,da[x+2]=t.z,da[x+3]=t.w,da[x+4]=o.x,da[x+5]=o.y,da[x+6]=o.z,da[x+7]=o.w,da[x+8]=z.x,da[x+9]=z.y,da[x+10]=z.z,da[x+11]=z.w,da[x+12]=P.x,da[x+13]=P.y,da[x+14]=P.z,da[x+15]=P.w,t=Na[A.a],o=Na[A.b],z=Na[A.c],P=Na[A.d],aa[x]=t.x,aa[x+1]=t.y,aa[x+2]=t.z,aa[x+3]=1,aa[x+4]=o.x,aa[x+5]=o.y,aa[x+6]=o.z,aa[x+7]=1,aa[x+8]=z.x,aa[x+9]=z.y,aa[x+10]=
|
|
|
z.z,aa[x+11]=1,aa[x+12]=P.x,aa[x+13]=P.y,aa[x+14]=P.z,aa[x+15]=1,t=Oa[A.a],o=Oa[A.b],z=Oa[A.c],A=Oa[A.d],ca[x]=t.x,ca[x+1]=t.y,ca[x+2]=t.z,ca[x+3]=1,ca[x+4]=o.x,ca[x+5]=o.y,ca[x+6]=o.z,ca[x+7]=1,ca[x+8]=z.x,ca[x+9]=z.y,ca[x+10]=z.z,ca[x+11]=1,ca[x+12]=A.x,ca[x+13]=A.y,ca[x+14]=A.z,ca[x+15]=1,x+=16;if(Da&&r)F.length==4&&r==THREE.VertexColors?(A=F[0],t=F[1],o=F[2],F=F[3]):F=o=t=A=M,oa[ka]=A.r,oa[ka+1]=A.g,oa[ka+2]=A.b,oa[ka+3]=t.r,oa[ka+4]=t.g,oa[ka+5]=t.b,oa[ka+6]=o.r,oa[ka+7]=o.g,oa[ka+8]=o.b,oa[ka+
|
|
|
9]=F.r,oa[ka+10]=F.g,oa[ka+11]=F.b,ka+=12;if(Ca&&ta.hasTangents)F=N[0],M=N[1],A=N[2],N=N[3],$[X]=F.x,$[X+1]=F.y,$[X+2]=F.z,$[X+3]=F.w,$[X+4]=M.x,$[X+5]=M.y,$[X+6]=M.z,$[X+7]=M.w,$[X+8]=A.x,$[X+9]=A.y,$[X+10]=A.z,$[X+11]=A.w,$[X+12]=N.x,$[X+13]=N.y,$[X+14]=N.z,$[X+15]=N.w,X+=16;if(Aa&&v)if(E.length==4&&wa)for(N=0;N<4;N++)J=E[N],V[Q]=J.x,V[Q+1]=J.y,V[Q+2]=J.z,Q+=3;else for(N=0;N<4;N++)V[Q]=J.x,V[Q+1]=J.y,V[Q+2]=J.z,Q+=3;if(sa&&y!==void 0&&q)for(N=0;N<4;N++)E=y[N],ia[W]=E.u,ia[W+1]=E.v,W+=2;if(sa&&s!==
|
|
|
-void 0&&q)for(N=0;N<4;N++)E=s[N],ja[Y]=E.u,ja[Y+1]=E.v,Y+=2;va&&(ga[T]=ha,ga[T+1]=ha+1,ga[T+2]=ha+3,ga[T+3]=ha+1,ga[T+4]=ha+2,ga[T+5]=ha+3,T+=6,Ba[R]=ha,Ba[R+1]=ha+1,Ba[R+2]=ha,Ba[R+3]=ha+3,Ba[R+4]=ha+1,Ba[R+5]=ha+2,Ba[R+6]=ha+2,Ba[R+7]=ha+3,R+=8,ha+=4)}ua&&(e.bindBuffer(e.ARRAY_BUFFER,n.__webglVertexBuffer),e.bufferData(e.ARRAY_BUFFER,na,C));if(Z)for(S in Z)o=Z[S],o.__original.needsUpdate&&(e.bindBuffer(e.ARRAY_BUFFER,o.buffer),e.bufferData(e.ARRAY_BUFFER,o.array,C));if(Ea){t=0;for(o=Ha.length;t<
|
|
|
+void 0&&q)for(N=0;N<4;N++)E=s[N],ja[Y]=E.u,ja[Y+1]=E.v,Y+=2;va&&(ga[T]=ha,ga[T+1]=ha+1,ga[T+2]=ha+3,ga[T+3]=ha+1,ga[T+4]=ha+2,ga[T+5]=ha+3,T+=6,Ba[R]=ha,Ba[R+1]=ha+1,Ba[R+2]=ha,Ba[R+3]=ha+3,Ba[R+4]=ha+1,Ba[R+5]=ha+2,Ba[R+6]=ha+2,Ba[R+7]=ha+3,R+=8,ha+=4)}ua&&(e.bindBuffer(e.ARRAY_BUFFER,n.__webglVertexBuffer),e.bufferData(e.ARRAY_BUFFER,na,C));if(Z)for(S in Z)o=Z[S],o.__original.needsUpdate&&(e.bindBuffer(e.ARRAY_BUFFER,o.buffer),e.bufferData(e.ARRAY_BUFFER,o.array,C));if(Ea){t=0;for(o=Ia.length;t<
|
|
|
o;t++)e.bindBuffer(e.ARRAY_BUFFER,n.__webglMorphTargetsBuffers[t]),e.bufferData(e.ARRAY_BUFFER,qa[t],C)}Da&&ka>0&&(e.bindBuffer(e.ARRAY_BUFFER,n.__webglColorBuffer),e.bufferData(e.ARRAY_BUFFER,oa,C));Aa&&(e.bindBuffer(e.ARRAY_BUFFER,n.__webglNormalBuffer),e.bufferData(e.ARRAY_BUFFER,V,C));Ca&&ta.hasTangents&&(e.bindBuffer(e.ARRAY_BUFFER,n.__webglTangentBuffer),e.bufferData(e.ARRAY_BUFFER,$,C));sa&&W>0&&(e.bindBuffer(e.ARRAY_BUFFER,n.__webglUVBuffer),e.bufferData(e.ARRAY_BUFFER,ia,C));sa&&Y>0&&(e.bindBuffer(e.ARRAY_BUFFER,
|
|
|
n.__webglUV2Buffer),e.bufferData(e.ARRAY_BUFFER,ja,C));va&&(e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n.__webglFaceBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,ga,C),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n.__webglLineBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,Ba,C));x>0&&(e.bindBuffer(e.ARRAY_BUFFER,n.__webglSkinVertexABuffer),e.bufferData(e.ARRAY_BUFFER,aa,C),e.bindBuffer(e.ARRAY_BUFFER,n.__webglSkinVertexBBuffer),e.bufferData(e.ARRAY_BUFFER,ca,C),e.bindBuffer(e.ARRAY_BUFFER,n.__webglSkinIndicesBuffer),
|
|
|
e.bufferData(e.ARRAY_BUFFER,da,C),e.bindBuffer(e.ARRAY_BUFFER,n.__webglSkinWeightsBuffer),e.bufferData(e.ARRAY_BUFFER,ea,C));w&&(delete n.__inittedArrays,delete n.__colorArray,delete n.__normalArray,delete n.__tangentArray,delete n.__uvArray,delete n.__uv2Array,delete n.__faceArray,delete n.__vertexArray,delete n.__lineArray,delete n.__skinVertexAArray,delete n.__skinVertexBArray,delete n.__skinIndexArray,delete n.__skinWeightArray)}j.__dirtyVertices=!1;j.__dirtyMorphTargets=!1;j.__dirtyElements=
|