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

Updated builds.

上级 f6392b40
......@@ -9172,9 +9172,7 @@
function WebGLShadowMap( _renderer, _objects, maxTextureSize ) {
var _gl = _renderer.context,
_state = _renderer.state,
_frustum = new Frustum(),
var _frustum = new Frustum(),
_projScreenMatrix = new Matrix4(),
_shadowMapSize = new Vector2(),
......@@ -9260,6 +9258,10 @@
if ( lights.length === 0 ) return;
// TODO Clean up (needed in case of contextlost)
var _gl = _renderer.context;
var _state = _renderer.state;
// Set GL state for depth map.
_state.disable( _gl.BLEND );
_state.buffers.color.setClear( 1, 1, 1, 1 );
......
......@@ -40,9 +40,9 @@ c.matrixWorld);var q=b.update(c),p=c.material;if(Array.isArray(p))for(var r=q.gr
0,1),new n(0,0,-1),new n(0,1,0),new n(0,-1,0)],E=[new n(0,1,0),new n(0,1,0),new n(0,1,0),new n(0,1,0),new n(0,0,1),new n(0,0,-1)],y=[new ca,new ca,new ca,new ca,new ca,new ca];for(c=0;4!==c;++c){var F=0!==(c&1),z=0!==(c&2),J=new Va({depthPacking:3201,morphTargets:F,skinning:z});r[c]=J;F=new Wa({morphTargets:F,skinning:z});m[c]=F}var Z=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=1;this.renderSingleSided=this.renderReverseSided=!0;this.render=function(b,c,d){if(!1!==Z.enabled&&
(!1!==Z.autoUpdate||!1!==Z.needsUpdate)&&0!==b.length){g.disable(f.BLEND);g.buffers.color.setClear(1,1,1,1);g.buffers.depth.setTest(!0);g.setScissorTest(!1);for(var r,m=0,w=b.length;m<w;m++){var u=b[m];r=u.shadow;var F=u&&u.isPointLight;if(void 0===r)console.warn("THREE.WebGLShadowMap:",u,"has no shadow.");else{var z=r.camera;l.copy(r.mapSize);l.min(p);if(F){var n=l.x,J=l.y;y[0].set(2*n,J,n,J);y[1].set(0,J,n,J);y[2].set(3*n,J,n,J);y[3].set(n,J,n,J);y[4].set(3*n,0,n,J);y[5].set(n,0,n,J);l.x*=4;l.y*=
2}null===r.map&&(r.map=new zb(l.x,l.y,{minFilter:1003,magFilter:1003,format:1023}),r.map.texture.name=u.name+".shadowMap",z.updateProjectionMatrix());r.isSpotLightShadow&&r.update(u);n=r.map;J=r.matrix;t.setFromMatrixPosition(u.matrixWorld);z.position.copy(t);F?(r=6,J.makeTranslation(-t.x,-t.y,-t.z)):(r=1,q.setFromMatrixPosition(u.target.matrixWorld),z.lookAt(q),z.updateMatrixWorld(),J.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),J.multiply(z.projectionMatrix),J.multiply(z.matrixWorldInverse));a.setRenderTarget(n);
a.clear();for(u=0;u<r;u++)F&&(q.copy(z.position),q.add(v[u]),z.up.copy(E[u]),z.lookAt(q),z.updateMatrixWorld(),g.viewport(y[u])),k.multiplyMatrices(z.projectionMatrix,z.matrixWorldInverse),h.setFromMatrix(k),e(c,d,z,F)}}Z.needsUpdate=!1}}}function Of(a){var b={};return{get:function(a){a.isInterleavedBufferAttribute&&(a=a.data);return b[a.uuid]},remove:function(c){c.isInterleavedBufferAttribute&&(c=c.data);var d=b[c.uuid];d&&(a.deleteBuffer(d.buffer),delete b[c.uuid])},update:function(c,d){c.isInterleavedBufferAttribute&&
(c=c.data);var e=b[c.uuid];if(void 0===e){var e=c.uuid,f=c.array,g=c.dynamic?a.DYNAMIC_DRAW:a.STATIC_DRAW,h=a.createBuffer();a.bindBuffer(d,h);a.bufferData(d,f,g);c.onUploadCallback();d=a.FLOAT;f instanceof Float32Array?d=a.FLOAT:f instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):f instanceof Uint16Array?d=a.UNSIGNED_SHORT:f instanceof Int16Array?d=a.SHORT:f instanceof Uint32Array?d=a.UNSIGNED_INT:f instanceof Int32Array?d=a.INT:f instanceof
Int8Array?d=a.BYTE:f instanceof Uint8Array&&(d=a.UNSIGNED_BYTE);b[e]={buffer:h,type:d,bytesPerElement:f.BYTES_PER_ELEMENT,version:c.version}}else e.version<c.version&&(f=c,h=f.array,g=f.updateRange,a.bindBuffer(d,e.buffer),!1===f.dynamic?a.bufferData(d,h,a.STATIC_DRAW):-1===g.count?a.bufferSubData(d,0,h):0===g.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):
a.clear();for(u=0;u<r;u++)F&&(q.copy(z.position),q.add(v[u]),z.up.copy(E[u]),z.lookAt(q),z.updateMatrixWorld(),g.viewport(y[u])),k.multiplyMatrices(z.projectionMatrix,z.matrixWorldInverse),h.setFromMatrix(k),e(c,d,z,F)}}g.enable(f.BLEND);g.buffers.color.reset();Z.needsUpdate=!1}}}function Of(a){var b={};return{get:function(a){a.isInterleavedBufferAttribute&&(a=a.data);return b[a.uuid]},remove:function(c){c.isInterleavedBufferAttribute&&(c=c.data);var d=b[c.uuid];d&&(a.deleteBuffer(d.buffer),delete b[c.uuid])},
update:function(c,d){c.isInterleavedBufferAttribute&&(c=c.data);var e=b[c.uuid];if(void 0===e){var e=c.uuid,f=c.array,g=c.dynamic?a.DYNAMIC_DRAW:a.STATIC_DRAW,h=a.createBuffer();a.bindBuffer(d,h);a.bufferData(d,f,g);c.onUploadCallback();d=a.FLOAT;f instanceof Float32Array?d=a.FLOAT:f instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):f instanceof Uint16Array?d=a.UNSIGNED_SHORT:f instanceof Int16Array?d=a.SHORT:f instanceof Uint32Array?d=a.UNSIGNED_INT:
f instanceof Int32Array?d=a.INT:f instanceof Int8Array?d=a.BYTE:f instanceof Uint8Array&&(d=a.UNSIGNED_BYTE);b[e]={buffer:h,type:d,bytesPerElement:f.BYTES_PER_ELEMENT,version:c.version}}else e.version<c.version&&(f=c,h=f.array,g=f.updateRange,a.bindBuffer(d,e.buffer),!1===f.dynamic?a.bufferData(d,h,a.STATIC_DRAW):-1===g.count?a.bufferSubData(d,0,h):0===g.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):
(a.bufferSubData(d,g.offset*h.BYTES_PER_ELEMENT,h.subarray(g.offset,g.offset+g.count)),g.count=-1),e.version=c.version)}}}function Xa(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._order=d||Xa.DefaultOrder}function Td(){this.mask=1}function x(){Object.defineProperty(this,"id",{value:Pf++});this.uuid=L.generateUUID();this.name="";this.type="Object3D";this.parent=null;this.children=[];this.up=x.DefaultUp.clone();var a=new n,b=new Xa,c=new ka,d=new n(1,1,1);b.onChange(function(){c.setFromEuler(b,
!1)});c.onChange(function(){b.setFromQuaternion(c,void 0,!1)});Object.defineProperties(this,{position:{enumerable:!0,value:a},rotation:{enumerable:!0,value:b},quaternion:{enumerable:!0,value:c},scale:{enumerable:!0,value:d},modelViewMatrix:{value:new P},normalMatrix:{value:new qa}});this.matrix=new P;this.matrixWorld=new P;this.matrixAutoUpdate=x.DefaultMatrixAutoUpdate;this.matrixWorldNeedsUpdate=!1;this.layers=new Td;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this.renderOrder=
0;this.userData={}}function Ma(){x.call(this);this.type="Camera";this.matrixWorldInverse=new P;this.projectionMatrix=new P}function Cb(a,b,c,d,e,f){Ma.call(this);this.type="OrthographicCamera";this.zoom=1;this.view=null;this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:.1;this.far=void 0!==f?f:2E3;this.updateProjectionMatrix()}function X(a,b,c,d){Ma.call(this);this.type="PerspectiveCamera";this.fov=void 0!==a?a:50;this.zoom=1;this.near=void 0!==c?c:.1;this.far=void 0!==d?d:
......
......@@ -9166,9 +9166,7 @@ Object.assign( Frustum.prototype, {
function WebGLShadowMap( _renderer, _objects, maxTextureSize ) {
var _gl = _renderer.context,
_state = _renderer.state,
_frustum = new Frustum(),
var _frustum = new Frustum(),
_projScreenMatrix = new Matrix4(),
_shadowMapSize = new Vector2(),
......@@ -9254,6 +9252,10 @@ function WebGLShadowMap( _renderer, _objects, maxTextureSize ) {
if ( lights.length === 0 ) return;
// TODO Clean up (needed in case of contextlost)
var _gl = _renderer.context;
var _state = _renderer.state;
// Set GL state for depth map.
_state.disable( _gl.BLEND );
_state.buffers.color.setClear( 1, 1, 1, 1 );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册