提交 a2985acc 编写于 作者: M Mr.doob

Updated builds.

上级 1d3cf6be
......@@ -14230,11 +14230,6 @@ Object.defineProperties( THREE.Light.prototype, {
this.shadow.map = value;
}
},
shadowMapSize: {
get: function () {
return this.shadow.mapSize;
}
},
shadowMapWidth: {
get: function () {
return this.shadow.mapSize.x;
......@@ -22321,10 +22316,9 @@ THREE.WebGLRenderer = function ( parameters ) {
var groupCount = group !== null ? group.count : Infinity;
var drawStart = Math.max( dataStart, rangeStart, groupStart );
var drawEnd = Math.min( dataStart + dataCount, rangeStart + rangeCount, groupStart + groupCount ) - 1;
var drawCount = drawEnd - drawStart + 1;
var drawCount = Math.max( 0, drawEnd - drawStart + 1 );
//
......@@ -23499,7 +23493,7 @@ THREE.WebGLRenderer = function ( parameters ) {
uniforms.shadowMatrix.value[ j ] = light.shadowMatrix;
uniforms.shadowMap.value[ j ] = light.shadowMap;
uniforms.shadowMapSize.value[ j ] = light.shadowMapSize;
uniforms.shadowMapSize.value[ j ] = light.shadow.mapSize;
uniforms.shadowBias.value[ j ] = light.shadowBias;
j ++;
......
......@@ -310,8 +310,8 @@ this.aspect,this.near,this.far)};THREE.PerspectiveCamera.prototype.copy=function
THREE.Light=function(a){THREE.Object3D.call(this);this.type="Light";this.color=new THREE.Color(a);this.receiveShadow=void 0};THREE.Light.prototype=Object.create(THREE.Object3D.prototype);THREE.Light.prototype.constructor=THREE.Light;
Object.defineProperties(THREE.Light.prototype,{onlyShadow:{set:function(a){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCamera:{get:function(){return this.shadow.camera}},shadowCameraFov:{get:function(){return this.shadow.camera.fov},set:function(a){this.shadow.camera.fov=a}},shadowCameraLeft:{get:function(){return this.shadow.camera.left},set:function(a){this.shadow.camera.left=a}},shadowCameraRight:{get:function(){return this.shadow.camera.right},set:function(a){this.shadow.camera.right=
a}},shadowCameraTop:{get:function(){return this.shadow.camera.top},set:function(a){this.shadow.camera.top=a}},shadowCameraBottom:{get:function(){return this.shadow.camera.bottom},set:function(a){this.shadow.camera.bottom=a}},shadowCameraNear:{get:function(){return this.shadow.camera.near},set:function(a){this.shadow.camera.near=a}},shadowCameraFar:{get:function(){return this.shadow.camera.far},set:function(a){this.shadow.camera.far=a}},shadowCameraVisible:{set:function(a){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow ) instead.")}},
shadowBias:{get:function(){return this.shadow.bias},set:function(a){this.shadow.bias=a}},shadowDarkness:{get:function(){return this.shadow.darkness},set:function(a){this.shadow.darkness=a}},shadowMap:{get:function(){return this.shadow.map},set:function(a){this.shadow.map=a}},shadowMapSize:{get:function(){return this.shadow.mapSize}},shadowMapWidth:{get:function(){return this.shadow.mapSize.x},set:function(a){this.shadow.mapSize.x=a}},shadowMapHeight:{get:function(){return this.shadow.mapSize.y},set:function(a){this.shadow.mapSize.y=
a}},shadowMatrix:{get:function(){return this.shadow.matrix},set:function(a){this.shadow.matrix=a}}});THREE.Light.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);this.color.copy(a.color);return this};
shadowBias:{get:function(){return this.shadow.bias},set:function(a){this.shadow.bias=a}},shadowDarkness:{get:function(){return this.shadow.darkness},set:function(a){this.shadow.darkness=a}},shadowMap:{get:function(){return this.shadow.map},set:function(a){this.shadow.map=a}},shadowMapWidth:{get:function(){return this.shadow.mapSize.x},set:function(a){this.shadow.mapSize.x=a}},shadowMapHeight:{get:function(){return this.shadow.mapSize.y},set:function(a){this.shadow.mapSize.y=a}},shadowMatrix:{get:function(){return this.shadow.matrix},
set:function(a){this.shadow.matrix=a}}});THREE.Light.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);this.color.copy(a.color);return this};
THREE.Light.prototype.toJSON=function(a){a=THREE.Object3D.prototype.toJSON.call(this,a);a.object.color=this.color.getHex();void 0!==this.groundColor&&(a.object.groundColor=this.groundColor.getHex());void 0!==this.intensity&&(a.object.intensity=this.intensity);void 0!==this.distance&&(a.object.distance=this.distance);void 0!==this.angle&&(a.object.angle=this.angle);void 0!==this.decay&&(a.object.decay=this.decay);void 0!==this.exponent&&(a.object.exponent=this.exponent);return a};
THREE.LightShadow=function(a){this.camera=a;this.bias=0;this.darkness=.5;this.mapSize=new THREE.Vector2(512,512);this.matrix=this.map=null};THREE.LightShadow.prototype={constructor:THREE.LightShadow,copy:function(a){this.camera=a.camera.clone();this.bias=a.bias;this.darkness=a.darkness;this.mapSize.copy(a.mapSize)},clone:function(){return(new this.constructor).copy(this)}};THREE.AmbientLight=function(a){THREE.Light.call(this,a);this.type="AmbientLight"};THREE.AmbientLight.prototype=Object.create(THREE.Light.prototype);
THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(a,b){THREE.Light.call(this,a);this.type="DirectionalLight";this.position.set(0,1,0);this.updateMatrix();this.target=new THREE.Object3D;this.intensity=void 0!==b?b:1;this.shadow=new THREE.LightShadow(new THREE.OrthographicCamera(-500,500,500,-500,50,5E3))};THREE.DirectionalLight.prototype=Object.create(THREE.Light.prototype);THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;
......@@ -551,7 +551,7 @@ d.emissiveMap);void 0!==N&&(N instanceof THREE.WebGLRenderTarget&&(N=N.texture),
d.dashSize,k.totalSize.value=d.dashSize+d.gapSize,k.scale.value=d.scale):d instanceof THREE.PointsMaterial?(k.psColor.value=d.color,k.opacity.value=d.opacity,k.size.value=d.size,k.scale.value=M.height/2,k.map.value=d.map,null!==d.map&&(a=d.map.offset,N=d.map.repeat,k.offsetRepeat.value.set(a.x,a.y,N.x,N.y))):d instanceof THREE.MeshPhongMaterial?(k.specular.value=d.specular,k.shininess.value=Math.max(d.shininess,1E-4),d.lightMap&&(k.lightMap.value=d.lightMap,k.lightMapIntensity.value=d.lightMapIntensity),
d.emissiveMap&&(k.emissiveMap.value=d.emissiveMap),d.bumpMap&&(k.bumpMap.value=d.bumpMap,k.bumpScale.value=d.bumpScale),d.normalMap&&(k.normalMap.value=d.normalMap,k.normalScale.value.copy(d.normalScale)),d.displacementMap&&(k.displacementMap.value=d.displacementMap,k.displacementScale.value=d.displacementScale,k.displacementBias.value=d.displacementBias)):d instanceof THREE.MeshDepthMaterial?(k.mNear.value=a.near,k.mFar.value=a.far,k.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&
(k.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&k.shadowMatrix)for(a=d=0,N=b.length;a<N;a++)m=b[a],m.castShadow&&(m instanceof THREE.PointLight||m instanceof THREE.SpotLight||m instanceof THREE.DirectionalLight)&&(m instanceof THREE.PointLight?(V.setFromMatrixPosition(m.matrixWorld).negate(),m.shadowMatrix.identity().setPosition(V),k.shadowDarkness.value[d]=-m.shadowDarkness):k.shadowDarkness.value[d]=m.shadowDarkness,k.shadowMatrix.value[d]=m.shadowMatrix,k.shadowMap.value[d]=m.shadowMap,
k.shadowMapSize.value[d]=m.shadowMapSize,k.shadowBias.value[d]=m.shadowBias,d++);b=f.uniformsList;f=0;for(d=b.length;f<d;f++)if(a=b[f][0],!1!==a.needsUpdate)switch(k=a.type,c=a.value,N=b[f][1],k){case "1i":r.uniform1i(N,c);break;case "1f":r.uniform1f(N,c);break;case "2f":r.uniform2f(N,c[0],c[1]);break;case "3f":r.uniform3f(N,c[0],c[1],c[2]);break;case "4f":r.uniform4f(N,c[0],c[1],c[2],c[3]);break;case "1iv":r.uniform1iv(N,c);break;case "3iv":r.uniform3iv(N,c);break;case "1fv":r.uniform1fv(N,c);break;
k.shadowMapSize.value[d]=m.shadow.mapSize,k.shadowBias.value[d]=m.shadowBias,d++);b=f.uniformsList;f=0;for(d=b.length;f<d;f++)if(a=b[f][0],!1!==a.needsUpdate)switch(k=a.type,c=a.value,N=b[f][1],k){case "1i":r.uniform1i(N,c);break;case "1f":r.uniform1f(N,c);break;case "2f":r.uniform2f(N,c[0],c[1]);break;case "3f":r.uniform3f(N,c[0],c[1],c[2]);break;case "4f":r.uniform4f(N,c[0],c[1],c[2],c[3]);break;case "1iv":r.uniform1iv(N,c);break;case "3iv":r.uniform3iv(N,c);break;case "1fv":r.uniform1fv(N,c);break;
case "2fv":r.uniform2fv(N,c);break;case "3fv":r.uniform3fv(N,c);break;case "4fv":r.uniform4fv(N,c);break;case "Matrix3fv":r.uniformMatrix3fv(N,!1,c);break;case "Matrix4fv":r.uniformMatrix4fv(N,!1,c);break;case "i":r.uniform1i(N,c);break;case "f":r.uniform1f(N,c);break;case "v2":r.uniform2f(N,c.x,c.y);break;case "v3":r.uniform3f(N,c.x,c.y,c.z);break;case "v4":r.uniform4f(N,c.x,c.y,c.z,c.w);break;case "c":r.uniform3f(N,c.r,c.g,c.b);break;case "iv1":r.uniform1iv(N,c);break;case "iv":r.uniform3iv(N,c);
break;case "fv1":r.uniform1fv(N,c);break;case "fv":r.uniform3fv(N,c);break;case "v2v":void 0===a._array&&(a._array=new Float32Array(2*c.length));n=k=0;for(m=c.length;k<m;k++,n+=2)a._array[n+0]=c[k].x,a._array[n+1]=c[k].y;r.uniform2fv(N,a._array);break;case "v3v":void 0===a._array&&(a._array=new Float32Array(3*c.length));n=k=0;for(m=c.length;k<m;k++,n+=3)a._array[n+0]=c[k].x,a._array[n+1]=c[k].y,a._array[n+2]=c[k].z;r.uniform3fv(N,a._array);break;case "v4v":void 0===a._array&&(a._array=new Float32Array(4*
c.length));n=k=0;for(m=c.length;k<m;k++,n+=4)a._array[n+0]=c[k].x,a._array[n+1]=c[k].y,a._array[n+2]=c[k].z,a._array[n+3]=c[k].w;r.uniform4fv(N,a._array);break;case "m3":r.uniformMatrix3fv(N,!1,c.elements);break;case "m3v":void 0===a._array&&(a._array=new Float32Array(9*c.length));k=0;for(m=c.length;k<m;k++)c[k].flattenToArrayOffset(a._array,9*k);r.uniformMatrix3fv(N,!1,a._array);break;case "m4":r.uniformMatrix4fv(N,!1,c.elements);break;case "m4v":void 0===a._array&&(a._array=new Float32Array(16*
......@@ -588,7 +588,7 @@ b){a=[];c=0;for(l=b.length;c<l;c++){var m=b[c];a.push([m,c])}a.sort(k);8<a.lengt
r.uniform1fv(a.morphTargetInfluences,ma);l=!0}b=d.index;c=d.attributes.position;!0===e.wireframe&&(b=va.getWireframeAttribute(d));null!==b?(a=Ga,a.setIndex(b)):a=Fa;if(l){a:{var l=void 0,q;if(d instanceof THREE.InstancedBufferGeometry&&(q=S.get("ANGLE_instanced_arrays"),null===q)){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}void 0===l&&(l=0);I.initAttributes();var m=d.attributes,
h=h.getAttributes(),n=e.defaultAttributeValues,p;for(p in h){var t=h[p];if(0<=t){var v=m[p];if(void 0!==v){var x=v.itemSize,w=va.getAttributeBuffer(v);if(v instanceof THREE.InterleavedBufferAttribute){var G=v.data,D=G.stride,v=v.offset;G instanceof THREE.InstancedInterleavedBuffer?(I.enableAttributeAndDivisor(t,G.meshPerAttribute,q),void 0===d.maxInstancedCount&&(d.maxInstancedCount=G.meshPerAttribute*G.count)):I.enableAttribute(t);r.bindBuffer(r.ARRAY_BUFFER,w);r.vertexAttribPointer(t,x,r.FLOAT,
!1,D*G.array.BYTES_PER_ELEMENT,(l*D+v)*G.array.BYTES_PER_ELEMENT)}else v instanceof THREE.InstancedBufferAttribute?(I.enableAttributeAndDivisor(t,v.meshPerAttribute,q),void 0===d.maxInstancedCount&&(d.maxInstancedCount=v.meshPerAttribute*v.count)):I.enableAttribute(t),r.bindBuffer(r.ARRAY_BUFFER,w),r.vertexAttribPointer(t,x,r.FLOAT,!1,0,l*x*4)}else if(void 0!==n&&(x=n[p],void 0!==x))switch(x.length){case 2:r.vertexAttrib2fv(t,x);break;case 3:r.vertexAttrib3fv(t,x);break;case 4:r.vertexAttrib4fv(t,
x);break;default:r.vertexAttrib1fv(t,x)}}}I.disableUnusedAttributes()}null!==b&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,va.getAttributeBuffer(b))}q=Infinity;null!==b?q=b.count:void 0!==c&&(q=c.count);p=d.drawRange.start;b=d.drawRange.count;c=null!==g?g.start:0;l=null!==g?g.count:Infinity;g=Math.max(0,p,c);q=Math.min(0+q,p+b,c+l)-1-g+1;f instanceof THREE.Mesh?(!0===e.wireframe?(I.setLineWidth(e.wireframeLinewidth*y),a.setMode(r.LINES)):a.setMode(r.TRIANGLES),d instanceof THREE.InstancedBufferGeometry&&
x);break;default:r.vertexAttrib1fv(t,x)}}}I.disableUnusedAttributes()}null!==b&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,va.getAttributeBuffer(b))}q=Infinity;null!==b?q=b.count:void 0!==c&&(q=c.count);p=d.drawRange.start;b=d.drawRange.count;c=null!==g?g.start:0;l=null!==g?g.count:Infinity;g=Math.max(0,p,c);q=Math.min(0+q,p+b,c+l)-1;q=Math.max(0,q-g+1);f instanceof THREE.Mesh?(!0===e.wireframe?(I.setLineWidth(e.wireframeLinewidth*y),a.setMode(r.LINES)):a.setMode(r.TRIANGLES),d instanceof THREE.InstancedBufferGeometry&&
0<d.maxInstancedCount?a.renderInstances(d):a.render(g,q)):f instanceof THREE.Line?(d=e.linewidth,void 0===d&&(d=1),I.setLineWidth(d*y),f instanceof THREE.LineSegments?a.setMode(r.LINES):a.setMode(r.LINE_STRIP),a.render(g,q)):f instanceof THREE.Points&&(a.setMode(r.POINTS),a.render(g,q))};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=a.fog;sa="";ta=-1;ra=null;wa=!0;!0===a.autoUpdate&&
a.updateMatrixWorld();null===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);xa.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);Aa.setFromMatrix(xa);Y.length=0;$=fa=-1;ja.length=0;da.length=0;q(a);ca.length=fa+1;ea.length=$+1;!0===aa.sortObjects&&(ca.sort(n),ea.sort(p));ha.render(a);ka.calls=0;ka.vertices=0;ka.faces=0;ka.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);a.overrideMaterial?
(d=a.overrideMaterial,t(ca,b,Y,e,d),t(ea,b,Y,e,d)):(I.setBlending(THREE.NoBlending),t(ca,b,Y,e),t(ea,b,Y,e));Ha.render(a,b);Ia.render(a,b,Ca,Da);c&&(a=c.texture,b=THREE.Math.isPowerOfTwo(c.width)&&THREE.Math.isPowerOfTwo(c.height),a.generateMipmaps&&b&&a.minFilter!==THREE.NearestFilter&&a.minFilter!==THREE.LinearFilter&&(a=c instanceof THREE.WebGLRenderTargetCube?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,c=X.get(c.texture).__webglTexture,I.bindTexture(a,c),r.generateMipmap(a),I.bindTexture(a,null)));I.setDepthTest(!0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册