|
@@ -252,8 +252,8 @@ t(o,h):t(n,h))}else(h=e)&&(h.transparent?t(o,h):t(n,h))}function z(b,e){return e
|
|
|
ja[w]||(ja[w]=new THREE.Matrix4);u=V.shadowMap[w];x=ja[w];ha.position.copy(t.position);ha.target.position.copy(t.target.position);ha.update(void 0,!0);b.update(void 0,!1,ha);x.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);x.multiplySelf(ha.projectionMatrix);x.multiplySelf(ha.matrixWorldInverse);ha.matrixWorldInverse.flattenToArray(sa);ha.projectionMatrix.flattenToArray(ua);qa.multiply(ha.projectionMatrix,ha.matrixWorldInverse);p(qa);V.initWebGLObjects(b);X(u);o.clearColor(1,1,1,1);V.clear();o.clearColor(ia.r,
|
|
|
ia.g,ia.b,W);x=b.__webglObjects.length;t=b.__webglObjectsImmediate.length;for(u=0;u<x;u++)L=b.__webglObjects[u],z=L.object,z.visible&&z.castShadow?!(z instanceof THREE.Mesh)||!z.frustumCulled||v(z)?(z.matrixWorld.flattenToArray(z._objectMatrixArray),E(z,ha,!1),L.render=!0):L.render=!1:L.render=!1;k(!0);K(THREE.NormalBlending);for(u=0;u<x;u++)if(L=b.__webglObjects[u],L.render)z=L.object,buffer=L.buffer,m(z),L=z.customDepthMaterial?z.customDepthMaterial:z.geometry.morphTargets.length?oa:ya,f(ha,y,null,
|
|
|
L,buffer,z);for(u=0;u<t;u++)L=b.__webglObjectsImmediate[u],z=L.object,z.visible&&z.castShadow&&(z.matrixAutoUpdate&&z.matrixWorld.flattenToArray(z._objectMatrixArray),E(z,ha,!1),m(z),program=e(ha,y,null,ya,z),z.render(function(b){h(b,program,ya.shading)}));w++}}function A(b,e){var c,f,h;c=ca.attributes;var k=ca.uniforms,m=J/va,n,p=[],t=va*0.5,u=J*0.5,w=!0;o.useProgram(ca.program);S=ca.program;ma=ka=-1;Aa||(o.enableVertexAttribArray(ca.attributes.position),o.enableVertexAttribArray(ca.attributes.uv),
|
|
|
-Aa=!0);o.disable(o.CULL_FACE);o.enable(o.BLEND);o.depthMask(!0);o.bindBuffer(o.ARRAY_BUFFER,ca.vertexBuffer);o.vertexAttribPointer(c.position,2,o.FLOAT,!1,16,0);o.vertexAttribPointer(c.uv,2,o.FLOAT,!1,16,8);o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,ca.elementBuffer);o.uniformMatrix4fv(k.projectionMatrix,!1,ua);o.activeTexture(o.TEXTURE0);o.uniform1i(k.map,0);c=0;for(f=b.__webglSprites.length;c<f;c++)if(h=b.__webglSprites[c],h.visible)h.useScreenCoordinates?h.z=-h.position.z:(h._modelViewMatrix.multiplyToArray(e.matrixWorldInverse,
|
|
|
-h.matrixWorld,h._modelViewMatrixArray),h.z=-h._modelViewMatrix.n34);b.__webglSprites.sort(z);c=0;for(f=b.__webglSprites.length;c<f;c++)h=b.__webglSprites[c],h.visible&&h.map&&h.map.image&&h.map.image.width&&(h.useScreenCoordinates?(o.uniform1i(k.useScreenCoordinates,1),o.uniform3f(k.screenPosition,(h.position.x-t)/t,(u-h.position.y)/u,Math.max(0,Math.min(1,h.position.z)))):(o.uniform1i(k.useScreenCoordinates,0),o.uniform1i(k.affectedByDistance,h.affectedByDistance?1:0),o.uniformMatrix4fv(k.modelViewMatrix,
|
|
|
+Aa=!0);o.disable(o.CULL_FACE);o.enable(o.BLEND);o.depthMask(!0);o.bindBuffer(o.ARRAY_BUFFER,ca.vertexBuffer);o.vertexAttribPointer(c.position,2,o.FLOAT,!1,16,0);o.vertexAttribPointer(c.uv,2,o.FLOAT,!1,16,8);o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,ca.elementBuffer);o.uniformMatrix4fv(k.projectionMatrix,!1,ua);o.activeTexture(o.TEXTURE0);o.uniform1i(k.map,0);c=0;for(f=b.__webglSprites.length;c<f;c++)if(h=b.__webglSprites[c],h.visible&&h.opacity!=0)h.useScreenCoordinates?h.z=-h.position.z:(h._modelViewMatrix.multiplyToArray(e.matrixWorldInverse,
|
|
|
+h.matrixWorld,h._modelViewMatrixArray),h.z=-h._modelViewMatrix.n34);b.__webglSprites.sort(z);c=0;for(f=b.__webglSprites.length;c<f;c++)h=b.__webglSprites[c],h.visible&&h.opacity!=0&&h.map&&h.map.image&&h.map.image.width&&(h.useScreenCoordinates?(o.uniform1i(k.useScreenCoordinates,1),o.uniform3f(k.screenPosition,(h.position.x-t)/t,(u-h.position.y)/u,Math.max(0,Math.min(1,h.position.z)))):(o.uniform1i(k.useScreenCoordinates,0),o.uniform1i(k.affectedByDistance,h.affectedByDistance?1:0),o.uniformMatrix4fv(k.modelViewMatrix,
|
|
|
!1,h._modelViewMatrixArray)),n=h.map.image.width/(h.scaleByViewport?J:1),p[0]=n*m*h.scale.x,p[1]=n*h.scale.y,o.uniform2f(k.uvScale,h.uvScale.x,h.uvScale.y),o.uniform2f(k.uvOffset,h.uvOffset.x,h.uvOffset.y),o.uniform2f(k.alignment,h.alignment.x,h.alignment.y),o.uniform1f(k.opacity,h.opacity),o.uniform3f(k.color,h.color.r,h.color.g,h.color.b),o.uniform1f(k.rotation,h.rotation),o.uniform2fv(k.scale,p),h.mergeWith3D&&!w?(o.enable(o.DEPTH_TEST),w=!0):!h.mergeWith3D&&w&&(o.disable(o.DEPTH_TEST),w=!1),K(h.blending),
|
|
|
M(h.map,0),o.drawElements(o.TRIANGLES,6,o.UNSIGNED_SHORT,0));o.enable(o.CULL_FACE);o.enable(o.DEPTH_TEST);o.depthMask(ea)}function E(b,e,c){b._modelViewMatrix.multiplyToArray(e.matrixWorldInverse,b.matrixWorld,b._modelViewMatrixArray);c&&THREE.Matrix4.makeInvert3x3(b._modelViewMatrix).transposeIntoArray(b._normalMatrixArray)}function D(b){var e,c,f,h;h=b.__materials;b=0;for(c=h.length;b<c;b++)if(f=h[b],f.attributes)for(e in f.attributes)if(f.attributes[e].needsUpdate)return!0;return!1}function F(b){var e,
|
|
|
c,f,h;h=b.__materials;b=0;for(c=h.length;b<c;b++)if(f=h[b],f.attributes)for(e in f.attributes)f.attributes[e].needsUpdate=!1}function G(b,e){var c;for(c=b.length-1;c>=0;c--)b[c].object==e&&b.splice(c,1)}function N(b){function e(b){var h=[];c=0;for(f=b.length;c<f;c++)b[c]==void 0?h.push("undefined"):h.push(b[c].id);return h.join("_")}var c,f,h,k,m,n,o,p,t={},w=b.morphTargets!==void 0?b.morphTargets.length:0;b.geometryGroups={};h=0;for(k=b.faces.length;h<k;h++)m=b.faces[h],n=m.materials,o=e(n),t[o]==
|