|
@@ -230,8 +230,8 @@ m.image.__webglTextureCube)}}else z(m,c);f.uniformMatrix4fv(j.modelViewMatrix,!1
|
|
|
THREE.MeshPhongMaterial||e instanceof THREE.MeshLambertMaterial||e instanceof THREE.MeshShaderMaterial||e.skinning)&&j.viewMatrix!==null&&f.uniformMatrix4fv(j.viewMatrix,!1,W);if(e instanceof THREE.ShadowVolumeDynamicMaterial)b=k.directionalLightDirection.value,b[0]=-d[1].position.x,b[1]=-d[1].position.y,b[2]=-d[1].position.z,f.uniform3fv(j.directionalLightDirection,b),f.uniformMatrix4fv(j.objectMatrix,!1,g._objectMatrixArray),f.uniformMatrix4fv(j.viewMatrix,!1,W);e.skinning&&(f.uniformMatrix4fv(j.cameraInverseMatrix,
|
|
|
!1,W),f.uniformMatrix4fv(j.boneGlobalMatrices,!1,g.boneMatrices));return h}function e(b,c,e,g,h,j){if(g.opacity!=0){var k,b=d(b,c,e,g,j).attributes;if(!g.morphTargets&&b.position>=0)f.bindBuffer(f.ARRAY_BUFFER,h.__webglVertexBuffer),f.vertexAttribPointer(b.position,3,f.FLOAT,!1,0,0);else{c=g.program.attributes;j.morphTargetBase!==-1?(f.bindBuffer(f.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[j.morphTargetBase]),f.vertexAttribPointer(c.position,3,f.FLOAT,!1,0,0)):c.position>=0&&(f.bindBuffer(f.ARRAY_BUFFER,
|
|
|
h.__webglVertexBuffer),f.vertexAttribPointer(c.position,3,f.FLOAT,!1,0,0));if(j.morphTargetForcedOrder.length)for(var e=0,m=j.morphTargetForcedOrder,n=j.morphTargetInfluences;e<g.numSupportedMorphTargets&&e<m.length;)f.bindBuffer(f.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[m[e]]),f.vertexAttribPointer(c["morphTarget"+e],3,f.FLOAT,!1,0,0),j.__webglMorphTargetInfluences[e]=n[m[e]],e++;else{var m=[],o=-1,p=0,n=j.morphTargetInfluences,t,u=n.length,e=0;for(j.morphTargetBase!==-1&&(m[j.morphTargetBase]=
|
|
|
-!0);e<g.numSupportedMorphTargets;){for(t=0;t<u;t++)!m[t]&&n[t]>o&&(p=t,o=n[p]);f.bindBuffer(f.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[p]);f.vertexAttribPointer(c["morphTarget"+e],3,f.FLOAT,!1,0,0);j.__webglMorphTargetInfluences[e]=o;m[p]=1;o=-1;e++}}g.program.uniforms.morphTargetInfluences!==null&&f.uniform1fv(g.program.uniforms.morphTargetInfluences,j.__webglMorphTargetInfluences)}if(g.attributes)for(k in g.attributes)b[k]!==void 0&&b[k]>=0&&(c=g.attributes[k],c.buffer&&(f.bindBuffer(f.ARRAY_BUFFER,
|
|
|
-c.buffer),f.vertexAttribPointer(b[k],c.size,f.FLOAT,!1,0,0)));b.color>=0&&(f.bindBuffer(f.ARRAY_BUFFER,h.__webglColorBuffer),f.vertexAttribPointer(b.color,3,f.FLOAT,!1,0,0));b.normal>=0&&(f.bindBuffer(f.ARRAY_BUFFER,h.__webglNormalBuffer),f.vertexAttribPointer(b.normal,3,f.FLOAT,!1,0,0));b.tangent>=0&&(f.bindBuffer(f.ARRAY_BUFFER,h.__webglTangentBuffer),f.vertexAttribPointer(b.tangent,4,f.FLOAT,!1,0,0));b.uv>=0&&(h.__webglUVBuffer?(f.bindBuffer(f.ARRAY_BUFFER,h.__webglUVBuffer),f.vertexAttribPointer(b.uv,
|
|
|
+!0);e<g.numSupportedMorphTargets;){for(t=0;t<u;t++)!m[t]&&n[t]>o&&(p=t,o=n[p]);f.bindBuffer(f.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[p]);f.vertexAttribPointer(c["morphTarget"+e],3,f.FLOAT,!1,0,0);j.__webglMorphTargetInfluences[e]=o;m[p]=1;o=-1;e++}}g.program.uniforms.morphTargetInfluences!==null&&f.uniform1fv(g.program.uniforms.morphTargetInfluences,j.__webglMorphTargetInfluences)}if(h.__webglCustomAttributes)for(k in h.__webglCustomAttributes)b[k]>=0&&(c=h.__webglCustomAttributes[k],f.bindBuffer(f.ARRAY_BUFFER,
|
|
|
+c.buffer),f.vertexAttribPointer(b[k],c.size,f.FLOAT,!1,0,0));b.color>=0&&(f.bindBuffer(f.ARRAY_BUFFER,h.__webglColorBuffer),f.vertexAttribPointer(b.color,3,f.FLOAT,!1,0,0));b.normal>=0&&(f.bindBuffer(f.ARRAY_BUFFER,h.__webglNormalBuffer),f.vertexAttribPointer(b.normal,3,f.FLOAT,!1,0,0));b.tangent>=0&&(f.bindBuffer(f.ARRAY_BUFFER,h.__webglTangentBuffer),f.vertexAttribPointer(b.tangent,4,f.FLOAT,!1,0,0));b.uv>=0&&(h.__webglUVBuffer?(f.bindBuffer(f.ARRAY_BUFFER,h.__webglUVBuffer),f.vertexAttribPointer(b.uv,
|
|
|
2,f.FLOAT,!1,0,0),f.enableVertexAttribArray(b.uv)):f.disableVertexAttribArray(b.uv));b.uv2>=0&&(h.__webglUV2Buffer?(f.bindBuffer(f.ARRAY_BUFFER,h.__webglUV2Buffer),f.vertexAttribPointer(b.uv2,2,f.FLOAT,!1,0,0),f.enableVertexAttribArray(b.uv2)):f.disableVertexAttribArray(b.uv2));g.skinning&&b.skinVertexA>=0&&b.skinVertexB>=0&&b.skinIndex>=0&&b.skinWeight>=0&&(f.bindBuffer(f.ARRAY_BUFFER,h.__webglSkinVertexABuffer),f.vertexAttribPointer(b.skinVertexA,4,f.FLOAT,!1,0,0),f.bindBuffer(f.ARRAY_BUFFER,h.__webglSkinVertexBBuffer),
|
|
|
f.vertexAttribPointer(b.skinVertexB,4,f.FLOAT,!1,0,0),f.bindBuffer(f.ARRAY_BUFFER,h.__webglSkinIndicesBuffer),f.vertexAttribPointer(b.skinIndex,4,f.FLOAT,!1,0,0),f.bindBuffer(f.ARRAY_BUFFER,h.__webglSkinWeightsBuffer),f.vertexAttribPointer(b.skinWeight,4,f.FLOAT,!1,0,0));j instanceof THREE.Mesh?(g.wireframe?(f.lineWidth(g.wireframeLinewidth),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,h.__webglLineBuffer),f.drawElements(f.LINES,h.__webglLineCount,f.UNSIGNED_SHORT,0)):(f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,
|
|
|
h.__webglFaceBuffer),f.drawElements(f.TRIANGLES,h.__webglFaceCount,f.UNSIGNED_SHORT,0)),N.data.vertices+=h.__webglFaceCount,N.data.faces+=h.__webglFaceCount/3,N.data.drawCalls++):j instanceof THREE.Line?(j=j.type==THREE.LineStrip?f.LINE_STRIP:f.LINES,f.lineWidth(g.linewidth),f.drawArrays(j,0,h.__webglLineCount),N.data.drawCalls++):j instanceof THREE.ParticleSystem?(f.drawArrays(f.POINTS,0,h.__webglParticleCount),N.data.drawCalls++):j instanceof THREE.Ribbon&&(f.drawArrays(f.TRIANGLE_STRIP,0,h.__webglVertexCount),
|
|
@@ -323,12 +323,12 @@ f.createBuffer();j.__webglNormalBuffer=f.createBuffer();j.__webglTangentBuffer=f
|
|
|
n.materials.length;z<l;z++)(E=n.materials[z])&&o.push(E)}else(E=z)&&o.push(E);n=o;a:{A=p=void 0;u=n.length;for(p=0;p<u;p++)if(A=n[p],A.map||A.lightMap||A instanceof THREE.MeshShaderMaterial){p=!0;break a}p=!1}a:{A=n;o=u=void 0;z=A.length;for(u=0;u<z;u++)if(o=A[u],!(o instanceof THREE.MeshBasicMaterial&&!o.envMap||o instanceof THREE.MeshDepthMaterial)){A=o&&o.shading!=void 0&&o.shading==THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading;break a}A=!1}a:{o=u=void 0;z=n.length;for(u=0;u<z;u++)if(o=
|
|
|
n[u],o.vertexColors){o=o.vertexColors;break a}o=!1}j.__vertexArray=new Float32Array(m*3);if(A)j.__normalArray=new Float32Array(m*3);if(t.hasTangents)j.__tangentArray=new Float32Array(m*4);if(o)j.__colorArray=new Float32Array(m*3);if(p){if(t.faceUvs.length>0||t.faceVertexUvs.length>0)j.__uvArray=new Float32Array(m*2);if(t.faceUvs.length>1||t.faceVertexUvs.length>1)j.__uv2Array=new Float32Array(m*2)}if(k.geometry.skinWeights.length&&k.geometry.skinIndices.length)j.__skinVertexAArray=new Float32Array(m*
|
|
|
4),j.__skinVertexBArray=new Float32Array(m*4),j.__skinIndexArray=new Float32Array(m*4),j.__skinWeightArray=new Float32Array(m*4);j.__faceArray=new Uint16Array(v*3+(k.geometry.edgeFaces?k.geometry.edgeFaces.length*6:0));j.__lineArray=new Uint16Array(J*2);if(j.numMorphTargets){j.__morphTargetsArrays=[];t=0;for(u=j.numMorphTargets;t<u;t++)j.__morphTargetsArrays.push(new Float32Array(m*3))}j.__needsSmoothNormals=A==THREE.SmoothShading;j.__uvType=p;j.__vertexColorType=o;j.__normalType=A;j.__webglFaceCount=
|
|
|
-v*3+(k.geometry.edgeFaces?k.geometry.edgeFaces.length*6:0);j.__webglLineCount=J*2;t=0;for(u=n.length;t<u;t++)if(n[t].attributes)for(a in j.__webglCustomAttributes={},n[t].attributes){p=n[t].attributes[a];if(!p.__webglInitialized||p.createUniqueBuffers)p.__webglInitialized=!0,v=1,p.type==="v2"?v=2:p.type==="v3"?v=3:p.type==="v4"?v=4:p.type==="c"&&(v=3),p.size=v,p.needsUpdate=!0,p.array=new Float32Array(m*v),p.buffer=f.createBuffer(),p.buffer.belongsToAttribute=a;j.__webglCustomAttributes[a]=p}j.__inittedArrays=
|
|
|
-!0;h.__dirtyVertices=!0;h.__dirtyMorphTargets=!0;h.__dirtyElements=!0;h.__dirtyUvs=!0;h.__dirtyNormals=!0;h.__dirtyTangents=!0;h.__dirtyColors=!0}d instanceof THREE.ShadowVolume?x(c.__webglShadowVolumes,g,d):x(c.__webglObjects,g,d)}else if(d instanceof THREE.LensFlare)x(c.__webglLensFlares,void 0,d);else if(d instanceof THREE.Ribbon){h=d.geometry;if(!h.__webglVertexBuffer)e=h,e.__webglVertexBuffer=f.createBuffer(),e.__webglColorBuffer=f.createBuffer(),e=h,g=e.vertices.length,e.__vertexArray=new Float32Array(g*
|
|
|
-3),e.__colorArray=new Float32Array(g*3),e.__webglVertexCount=g,h.__dirtyVertices=!0,h.__dirtyColors=!0;x(c.__webglObjects,h,d)}else if(d instanceof THREE.Line){h=d.geometry;if(!h.__webglVertexBuffer)e=h,e.__webglVertexBuffer=f.createBuffer(),e.__webglColorBuffer=f.createBuffer(),e=h,g=e.vertices.length,e.__vertexArray=new Float32Array(g*3),e.__colorArray=new Float32Array(g*3),e.__webglLineCount=g,h.__dirtyVertices=!0,h.__dirtyColors=!0;x(c.__webglObjects,h,d)}else if(d instanceof THREE.ParticleSystem){h=
|
|
|
-d.geometry;if(!h.__webglVertexBuffer)e=h,e.__webglVertexBuffer=f.createBuffer(),e.__webglColorBuffer=f.createBuffer(),e=h,g=e.vertices.length,e.__vertexArray=new Float32Array(g*3),e.__colorArray=new Float32Array(g*3),e.__sortArray=[],e.__webglParticleCount=g,h.__dirtyVertices=!0,h.__dirtyColors=!0;x(c.__webglObjects,h,d)}else THREE.MarchingCubes!==void 0&&d instanceof THREE.MarchingCubes?c.__webglObjectsImmediate.push({object:d,opaque:{list:[],count:0},transparent:{list:[],count:0}}):d instanceof
|
|
|
-THREE.Sprite&&c.__webglSprites.push(d);b.__objectsAdded.splice(0,1)}for(;b.__objectsRemoved.length;){d=b.__objectsRemoved[0];c=b;e=h=void 0;if(d instanceof THREE.Mesh)for(h=c.__webglObjects.length-1;h>=0;h--){if(e=c.__webglObjects[h].object,d==e){c.__webglObjects.splice(h,1);break}}else if(d instanceof THREE.Sprite)for(h=c.__webglSprites.length-1;h>=0;h--)if(e=c.__webglSprites[h],d==e){c.__webglSprites.splice(h,1);break}b.__objectsRemoved.splice(0,1)}d=0;for(c=b.__webglObjects.length;d<c;d++)y(b.__webglObjects[d].object,
|
|
|
-b);d=0;for(c=b.__webglShadowVolumes.length;d<c;d++)y(b.__webglShadowVolumes[d].object,b);d=0;for(c=b.__webglLensFlares.length;d<c;d++)y(b.__webglLensFlares[d].object,b)};this.setFaceCulling=function(b,d){b?(!d||d=="ccw"?f.frontFace(f.CCW):f.frontFace(f.CW),b=="back"?f.cullFace(f.BACK):b=="front"?f.cullFace(f.FRONT):f.cullFace(f.FRONT_AND_BACK),f.enable(f.CULL_FACE)):f.disable(f.CULL_FACE)};this.supportsVertexTextures=function(){return va}};
|
|
|
+v*3+(k.geometry.edgeFaces?k.geometry.edgeFaces.length*6:0);j.__webglLineCount=J*2;t=0;for(u=n.length;t<u;t++)if(n[t].attributes)for(a in j.__webglCustomAttributes={},n[t].attributes){p={};for(prop in n[t].attributes[a])p[prop]=n[t].attributes[a][prop];if(!p.__webglInitialized||p.createUniqueBuffers)p.__webglInitialized=!0,v=1,p.type==="v2"?v=2:p.type==="v3"?v=3:p.type==="v4"?v=4:p.type==="c"&&(v=3),p.size=v,p.needsUpdate=!0,p.array=new Float32Array(m*v),p.buffer=f.createBuffer(),p.buffer.belongsToAttribute=
|
|
|
+a;j.__webglCustomAttributes[a]=p}j.__inittedArrays=!0;h.__dirtyVertices=!0;h.__dirtyMorphTargets=!0;h.__dirtyElements=!0;h.__dirtyUvs=!0;h.__dirtyNormals=!0;h.__dirtyTangents=!0;h.__dirtyColors=!0}d instanceof THREE.ShadowVolume?x(c.__webglShadowVolumes,g,d):x(c.__webglObjects,g,d)}else if(d instanceof THREE.LensFlare)x(c.__webglLensFlares,void 0,d);else if(d instanceof THREE.Ribbon){h=d.geometry;if(!h.__webglVertexBuffer)e=h,e.__webglVertexBuffer=f.createBuffer(),e.__webglColorBuffer=f.createBuffer(),
|
|
|
+e=h,g=e.vertices.length,e.__vertexArray=new Float32Array(g*3),e.__colorArray=new Float32Array(g*3),e.__webglVertexCount=g,h.__dirtyVertices=!0,h.__dirtyColors=!0;x(c.__webglObjects,h,d)}else if(d instanceof THREE.Line){h=d.geometry;if(!h.__webglVertexBuffer)e=h,e.__webglVertexBuffer=f.createBuffer(),e.__webglColorBuffer=f.createBuffer(),e=h,g=e.vertices.length,e.__vertexArray=new Float32Array(g*3),e.__colorArray=new Float32Array(g*3),e.__webglLineCount=g,h.__dirtyVertices=!0,h.__dirtyColors=!0;x(c.__webglObjects,
|
|
|
+h,d)}else if(d instanceof THREE.ParticleSystem){h=d.geometry;if(!h.__webglVertexBuffer)e=h,e.__webglVertexBuffer=f.createBuffer(),e.__webglColorBuffer=f.createBuffer(),e=h,g=e.vertices.length,e.__vertexArray=new Float32Array(g*3),e.__colorArray=new Float32Array(g*3),e.__sortArray=[],e.__webglParticleCount=g,h.__dirtyVertices=!0,h.__dirtyColors=!0;x(c.__webglObjects,h,d)}else THREE.MarchingCubes!==void 0&&d instanceof THREE.MarchingCubes?c.__webglObjectsImmediate.push({object:d,opaque:{list:[],count:0},
|
|
|
+transparent:{list:[],count:0}}):d instanceof THREE.Sprite&&c.__webglSprites.push(d);b.__objectsAdded.splice(0,1)}for(;b.__objectsRemoved.length;){d=b.__objectsRemoved[0];c=b;e=h=void 0;if(d instanceof THREE.Mesh)for(h=c.__webglObjects.length-1;h>=0;h--){if(e=c.__webglObjects[h].object,d==e){c.__webglObjects.splice(h,1);break}}else if(d instanceof THREE.Sprite)for(h=c.__webglSprites.length-1;h>=0;h--)if(e=c.__webglSprites[h],d==e){c.__webglSprites.splice(h,1);break}b.__objectsRemoved.splice(0,1)}d=
|
|
|
+0;for(c=b.__webglObjects.length;d<c;d++)y(b.__webglObjects[d].object,b);d=0;for(c=b.__webglShadowVolumes.length;d<c;d++)y(b.__webglShadowVolumes[d].object,b);d=0;for(c=b.__webglLensFlares.length;d<c;d++)y(b.__webglLensFlares[d].object,b)};this.setFaceCulling=function(b,d){b?(!d||d=="ccw"?f.frontFace(f.CCW):f.frontFace(f.CW),b=="back"?f.cullFace(f.BACK):b=="front"?f.cullFace(f.FRONT):f.cullFace(f.FRONT_AND_BACK),f.enable(f.CULL_FACE)):f.disable(f.CULL_FACE)};this.supportsVertexTextures=function(){return va}};
|
|
|
THREE.WebGLRenderTarget=function(b,c,d){this.width=b;this.height=c;d=d||{};this.wrapS=d.wrapS!==void 0?d.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=d.wrapT!==void 0?d.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=d.magFilter!==void 0?d.magFilter:THREE.LinearFilter;this.minFilter=d.minFilter!==void 0?d.minFilter:THREE.LinearMipMapLinearFilter;this.format=d.format!==void 0?d.format:THREE.RGBAFormat;this.type=d.type!==void 0?d.type:THREE.UnsignedByteType;this.depthBuffer=d.depthBuffer!==void 0?d.depthBuffer:
|
|
|
!0;this.stencilBuffer=d.stencilBuffer!==void 0?d.stencilBuffer:!0};
|
|
|
THREE.SoundRenderer=function(){this.volume=1;this.domElement=document.createElement("div");this.domElement.id="THREESound";this.cameraPosition=new THREE.Vector3;this.soundPosition=new THREE.Vector3;this.render=function(b,c,d){d&&b.update(void 0,!1,c);var d=b.sounds,e,g=d.length;for(e=0;e<g;e++)b=d[e],this.soundPosition.set(b.matrixWorld.n14,b.matrixWorld.n24,b.matrixWorld.n34),this.soundPosition.subSelf(c.position),b.isPlaying&&b.isLoaded&&(b.isAddedToDOM||b.addToDOM(this.domElement),b.calculateVolumeAndPan(this.soundPosition))}};
|