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

Updated builds.

上级 b44f0373
......@@ -19715,6 +19715,8 @@
}
var matrixWorldInverse = new THREE.Matrix4();
var cameraL = new THREE.PerspectiveCamera();
cameraL.bounds = new THREE.Vector4( 0.0, 0.0, 0.5, 1.0 );
cameraL.layers.enable( 1 );
......@@ -19815,8 +19817,10 @@
if ( parent !== null ) {
cameraL.matrixWorldInverse.multiply( parent.matrixWorldInverse );
cameraR.matrixWorldInverse.multiply( parent.matrixWorldInverse );
matrixWorldInverse.getInverse( parent.matrixWorld );
cameraL.matrixWorldInverse.multiply( matrixWorldInverse );
cameraR.matrixWorldInverse.multiply( matrixWorldInverse );
}
......
......@@ -125,15 +125,15 @@ m(b.polygonOffset,b.polygonOffsetFactor,b.polygonOffsetUnits)},setFlipSided:h,se
arguments)}catch(b){console.error("THREE.WebGLState:",b)}},texImage2D:function(){try{a.texImage2D.apply(a,arguments)}catch(b){console.error("THREE.WebGLState:",b)}},scissor:function(b){!1===G.equals(b)&&(a.scissor(b.x,b.y,b.z,b.w),G.copy(b))},viewport:function(b){!1===H.equals(b)&&(a.viewport(b.x,b.y,b.z,b.w),H.copy(b))},reset:function(){for(var b=0;b<p.length;b++)1===p[b]&&(a.disableVertexAttribArray(b),p[b]=0);v={};T=K=null;O={};D=L=w=null;u.reset();n.reset();q.reset()}}}function gg(a,b,c){function d(b){if("highp"===
b){if(0<a.getShaderPrecisionFormat(a.VERTEX_SHADER,a.HIGH_FLOAT).precision&&0<a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.HIGH_FLOAT).precision)return"highp";b="mediump"}return"mediump"===b&&0<a.getShaderPrecisionFormat(a.VERTEX_SHADER,a.MEDIUM_FLOAT).precision&&0<a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.MEDIUM_FLOAT).precision?"mediump":"lowp"}var e,f=void 0!==c.precision?c.precision:"highp",g=d(f);g!==f&&(console.warn("THREE.WebGLRenderer:",f,"not supported, using",g,"instead."),f=g);c=
!0===c.logarithmicDepthBuffer&&!!b.get("EXT_frag_depth");var g=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),h=a.getParameter(a.MAX_VERTEX_TEXTURE_IMAGE_UNITS),k=a.getParameter(a.MAX_TEXTURE_SIZE),m=a.getParameter(a.MAX_CUBE_MAP_TEXTURE_SIZE),r=a.getParameter(a.MAX_VERTEX_ATTRIBS),u=a.getParameter(a.MAX_VERTEX_UNIFORM_VECTORS),n=a.getParameter(a.MAX_VARYING_VECTORS),q=a.getParameter(a.MAX_FRAGMENT_UNIFORM_VECTORS),l=0<h,t=!!b.get("OES_texture_float");return{getMaxAnisotropy:function(){if(void 0!==e)return e;
var c=b.get("EXT_texture_filter_anisotropic");return e=null!==c?a.getParameter(c.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:d,precision:f,logarithmicDepthBuffer:c,maxTextures:g,maxVertexTextures:h,maxTextureSize:k,maxCubemapSize:m,maxAttributes:r,maxVertexUniforms:u,maxVaryings:n,maxFragmentUniforms:q,vertexTextures:l,floatFragmentTextures:t,floatVertexTextures:l&&t}}function hg(a){var b=this,c=null,d=null;"VRFrameData"in window&&(d=new window.VRFrameData);var e=new THREE.PerspectiveCamera;
e.bounds=new THREE.Vector4(0,0,.5,1);e.layers.enable(1);var f=new THREE.PerspectiveCamera;f.bounds=new THREE.Vector4(.5,0,.5,1);f.layers.enable(2);var g=new THREE.ArrayCamera([e,f]),h,k;window.addEventListener("vrdisplaypresentchange",function(){if(c.isPresenting){var d=c.getEyeParameters("left"),e=d.renderWidth,d=d.renderHeight;k=a.getPixelRatio();h=a.getSize();a.setPixelRatio(1);a.setSize(2*e,d,!1)}else b.enabled&&(a.setPixelRatio(k),a.setSize(h.width,h.height,!0))},!1);this.enabled=!1;this.getDevice=
function(){return c};this.setDevice=function(a){void 0!==a&&(c=a)};this.getCamera=function(a){if(null===c)return a;c.depthNear=a.near;c.depthFar=a.far;c.getFrameData(d);var b=d.pose;null!==b.position?a.position.fromArray(b.position):a.position.set(0,0,0);null!==b.orientation&&a.quaternion.fromArray(b.orientation);a.updateMatrixWorld();if(!1===c.isPresenting)return a;g.matrixWorld.copy(a.matrixWorld);g.matrixWorldInverse.copy(a.matrixWorldInverse);e.matrixWorldInverse.fromArray(d.leftViewMatrix);f.matrixWorldInverse.fromArray(d.rightViewMatrix);
a=a.parent;null!==a&&(e.matrixWorldInverse.multiply(a.matrixWorldInverse),f.matrixWorldInverse.multiply(a.matrixWorldInverse));e.projectionMatrix.fromArray(d.leftProjectionMatrix);f.projectionMatrix.fromArray(d.rightProjectionMatrix);g.projectionMatrix.copy(e.projectionMatrix);a=c.getLayers();a.length&&(a=a[0],null!==a.leftBounds&&4===a.leftBounds.length&&e.bounds.fromArray(a.leftBounds),null!==a.rightBounds&&4===a.rightBounds.length&&f.bounds.fromArray(a.rightBounds));return g};this.submitFrame=
function(){c&&c.isPresenting&&c.submitFrame()}}function ig(a){var b={};return{get:function(c){if(void 0!==b[c])return b[c];var d;switch(c){case "WEBGL_depth_texture":d=a.getExtension("WEBGL_depth_texture")||a.getExtension("MOZ_WEBGL_depth_texture")||a.getExtension("WEBKIT_WEBGL_depth_texture");break;case "EXT_texture_filter_anisotropic":d=a.getExtension("EXT_texture_filter_anisotropic")||a.getExtension("MOZ_EXT_texture_filter_anisotropic")||a.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
break;case "WEBGL_compressed_texture_s3tc":d=a.getExtension("WEBGL_compressed_texture_s3tc")||a.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case "WEBGL_compressed_texture_pvrtc":d=a.getExtension("WEBGL_compressed_texture_pvrtc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case "WEBGL_compressed_texture_etc1":d=a.getExtension("WEBGL_compressed_texture_etc1");break;default:d=a.getExtension(c)}null===d&&console.warn("THREE.WebGLRenderer: "+
c+" extension not supported.");return b[c]=d}}}function jg(){function a(){m.value!==d&&(m.value=d,m.needsUpdate=0<e);c.numPlanes=e;c.numIntersection=0}function b(a,b,d,e){var f=null!==a?a.length:0,g=null;if(0!==f){g=m.value;if(!0!==e||null===g){e=d+4*f;b=b.matrixWorldInverse;k.getNormalMatrix(b);if(null===g||g.length<e)g=new Float32Array(e);for(e=0;e!==f;++e,d+=4)h.copy(a[e]).applyMatrix4(b,k),h.normal.toArray(g,d),g[d+3]=h.constant}m.value=g;m.needsUpdate=!0}c.numPlanes=f;return g}var c=this,d=null,
e=0,f=!1,g=!1,h=new wa,k=new va,m={value:null,needsUpdate:!1};this.uniform=m;this.numIntersection=this.numPlanes=0;this.init=function(a,c,g){var h=0!==a.length||c||0!==e||f;f=c;d=b(a,g,0);e=a.length;return h};this.beginShadows=function(){g=!0;b(null)};this.endShadows=function(){g=!1;a()};this.setState=function(c,h,k,q,l,t){if(!f||null===c||0===c.length||g&&!k)g?b(null):a();else{k=g?0:e;var p=4*k,x=l.clippingState||null;m.value=x;x=b(c,q,p,t);for(c=0;c!==p;++c)x[c]=d[c];l.clippingState=x;this.numIntersection=
h?this.numPlanes:0;this.numPlanes+=k}}}function Wd(a){function b(){fa.init();fa.scissor(O.copy(ga).multiplyScalar(V));fa.viewport(U.copy(id).multiplyScalar(V));fa.buffers.color.setClear(Ia.r,Ia.g,Ia.b,aa,C)}function c(){T=B=null;ba="";W=-1;fa.reset()}function d(a){a.preventDefault();c();b();ha.clear();wa.clear()}function e(a){a=a.target;a.removeEventListener("dispose",e);f(a);ha.remove(a)}function f(a){var b=ha.get(a).program;a.program=void 0;void 0!==b&&ya.releaseProgram(b)}function g(a,b,c){a.render(function(a){z.renderBufferImmediate(a,
var c=b.get("EXT_texture_filter_anisotropic");return e=null!==c?a.getParameter(c.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:d,precision:f,logarithmicDepthBuffer:c,maxTextures:g,maxVertexTextures:h,maxTextureSize:k,maxCubemapSize:m,maxAttributes:r,maxVertexUniforms:u,maxVaryings:n,maxFragmentUniforms:q,vertexTextures:l,floatFragmentTextures:t,floatVertexTextures:l&&t}}function hg(a){var b=this,c=null,d=null;"VRFrameData"in window&&(d=new window.VRFrameData);var e=new THREE.Matrix4,f=new THREE.PerspectiveCamera;
f.bounds=new THREE.Vector4(0,0,.5,1);f.layers.enable(1);var g=new THREE.PerspectiveCamera;g.bounds=new THREE.Vector4(.5,0,.5,1);g.layers.enable(2);var h=new THREE.ArrayCamera([f,g]),k,m;window.addEventListener("vrdisplaypresentchange",function(){if(c.isPresenting){var d=c.getEyeParameters("left"),e=d.renderWidth,d=d.renderHeight;m=a.getPixelRatio();k=a.getSize();a.setPixelRatio(1);a.setSize(2*e,d,!1)}else b.enabled&&(a.setPixelRatio(m),a.setSize(k.width,k.height,!0))},!1);this.enabled=!1;this.getDevice=
function(){return c};this.setDevice=function(a){void 0!==a&&(c=a)};this.getCamera=function(a){if(null===c)return a;c.depthNear=a.near;c.depthFar=a.far;c.getFrameData(d);var b=d.pose;null!==b.position?a.position.fromArray(b.position):a.position.set(0,0,0);null!==b.orientation&&a.quaternion.fromArray(b.orientation);a.updateMatrixWorld();if(!1===c.isPresenting)return a;h.matrixWorld.copy(a.matrixWorld);h.matrixWorldInverse.copy(a.matrixWorldInverse);f.matrixWorldInverse.fromArray(d.leftViewMatrix);g.matrixWorldInverse.fromArray(d.rightViewMatrix);
a=a.parent;null!==a&&(e.getInverse(a.matrixWorld),f.matrixWorldInverse.multiply(e),g.matrixWorldInverse.multiply(e));f.projectionMatrix.fromArray(d.leftProjectionMatrix);g.projectionMatrix.fromArray(d.rightProjectionMatrix);h.projectionMatrix.copy(f.projectionMatrix);a=c.getLayers();a.length&&(a=a[0],null!==a.leftBounds&&4===a.leftBounds.length&&f.bounds.fromArray(a.leftBounds),null!==a.rightBounds&&4===a.rightBounds.length&&g.bounds.fromArray(a.rightBounds));return h};this.submitFrame=function(){c&&
c.isPresenting&&c.submitFrame()}}function ig(a){var b={};return{get:function(c){if(void 0!==b[c])return b[c];var d;switch(c){case "WEBGL_depth_texture":d=a.getExtension("WEBGL_depth_texture")||a.getExtension("MOZ_WEBGL_depth_texture")||a.getExtension("WEBKIT_WEBGL_depth_texture");break;case "EXT_texture_filter_anisotropic":d=a.getExtension("EXT_texture_filter_anisotropic")||a.getExtension("MOZ_EXT_texture_filter_anisotropic")||a.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case "WEBGL_compressed_texture_s3tc":d=
a.getExtension("WEBGL_compressed_texture_s3tc")||a.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case "WEBGL_compressed_texture_pvrtc":d=a.getExtension("WEBGL_compressed_texture_pvrtc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case "WEBGL_compressed_texture_etc1":d=a.getExtension("WEBGL_compressed_texture_etc1");break;default:d=a.getExtension(c)}null===d&&console.warn("THREE.WebGLRenderer: "+c+" extension not supported.");
return b[c]=d}}}function jg(){function a(){m.value!==d&&(m.value=d,m.needsUpdate=0<e);c.numPlanes=e;c.numIntersection=0}function b(a,b,d,e){var f=null!==a?a.length:0,g=null;if(0!==f){g=m.value;if(!0!==e||null===g){e=d+4*f;b=b.matrixWorldInverse;k.getNormalMatrix(b);if(null===g||g.length<e)g=new Float32Array(e);for(e=0;e!==f;++e,d+=4)h.copy(a[e]).applyMatrix4(b,k),h.normal.toArray(g,d),g[d+3]=h.constant}m.value=g;m.needsUpdate=!0}c.numPlanes=f;return g}var c=this,d=null,e=0,f=!1,g=!1,h=new wa,k=new va,
m={value:null,needsUpdate:!1};this.uniform=m;this.numIntersection=this.numPlanes=0;this.init=function(a,c,g){var h=0!==a.length||c||0!==e||f;f=c;d=b(a,g,0);e=a.length;return h};this.beginShadows=function(){g=!0;b(null)};this.endShadows=function(){g=!1;a()};this.setState=function(c,h,k,q,l,t){if(!f||null===c||0===c.length||g&&!k)g?b(null):a();else{k=g?0:e;var p=4*k,x=l.clippingState||null;m.value=x;x=b(c,q,p,t);for(c=0;c!==p;++c)x[c]=d[c];l.clippingState=x;this.numIntersection=h?this.numPlanes:0;this.numPlanes+=
k}}}function Wd(a){function b(){fa.init();fa.scissor(O.copy(ga).multiplyScalar(V));fa.viewport(U.copy(id).multiplyScalar(V));fa.buffers.color.setClear(Ia.r,Ia.g,Ia.b,aa,C)}function c(){T=B=null;ba="";W=-1;fa.reset()}function d(a){a.preventDefault();c();b();ha.clear();wa.clear()}function e(a){a=a.target;a.removeEventListener("dispose",e);f(a);ha.remove(a)}function f(a){var b=ha.get(a).program;a.program=void 0;void 0!==b&&ya.releaseProgram(b)}function g(a,b,c){a.render(function(a){z.renderBufferImmediate(a,
b,c)})}function h(a,b){return Math.abs(b[0])-Math.abs(a[0])}function k(a,b,c){if(a.visible){if(a.layers.test(b.layers))if(a.isLight)ca.push(a);else if(a.isSprite)a.frustumCulled&&!la.intersectsSprite(a)||L.push(a);else if(a.isLensFlare)D.push(a);else if(a.isImmediateRenderObject)c&&Qa.setFromMatrixPosition(a.matrixWorld).applyMatrix4(kd),E.push(a,null,a.material,Qa.z,null);else if(a.isMesh||a.isLine||a.isPoints)if(a.isSkinnedMesh&&a.skeleton.update(),!a.frustumCulled||la.intersectsObject(a)){c&&Qa.setFromMatrixPosition(a.matrixWorld).applyMatrix4(kd);
var d=wa.update(a),e=a.material;if(Array.isArray(e))for(var f=d.groups,g=0,h=f.length;g<h;g++){var m=f[g],n=e[m.materialIndex];n&&n.visible&&E.push(a,d,n,Qa.z,m)}else e.visible&&E.push(a,d,e,Qa.z,null)}a=a.children;g=0;for(h=a.length;g<h;g++)k(a[g],b,c)}}function m(a,b,c,d){for(var e=0,f=a.length;e<f;e++){var g=a[e],h=g.object,k=g.geometry,m=void 0===d?g.material:d,g=g.group;h.onBeforeRender(z,b,c,k,m,g);if(c.isArrayCamera)for(var n=c.cameras,u=0,q=n.length;u<q;u++){var l=n[u],t=l.bounds,p=t.x*P,
F=t.y*da,v=t.z*P,t=t.w*da;z.setViewport(p,F,v,t);z.setScissor(p,F,v,t);z.setScissorTest(!0);r(h,b,l,k,m,g)}else r(h,b,c,k,m,g);h.onAfterRender(z,b,c,k,m,g)}}function r(a,b,c,d,e,f){a.modelViewMatrix.multiplyMatrices(c.matrixWorldInverse,a.matrixWorld);a.normalMatrix.getNormalMatrix(a.modelViewMatrix);a.isImmediateRenderObject?(fa.setMaterial(e),b=n(c,b.fog,e,a),ba="",g(a,b,e)):z.renderBufferDirect(c,b.fog,d,e,a,f)}function u(a,b,c){var d=ha.get(a);c=ya.getParameters(a,ea,b,Pa.numPlanes,Pa.numIntersection,
......
......@@ -19709,6 +19709,8 @@ function WebVRManager( renderer ) {
}
var matrixWorldInverse = new THREE.Matrix4();
var cameraL = new THREE.PerspectiveCamera();
cameraL.bounds = new THREE.Vector4( 0.0, 0.0, 0.5, 1.0 );
cameraL.layers.enable( 1 );
......@@ -19809,8 +19811,10 @@ function WebVRManager( renderer ) {
if ( parent !== null ) {
cameraL.matrixWorldInverse.multiply( parent.matrixWorldInverse );
cameraR.matrixWorldInverse.multiply( parent.matrixWorldInverse );
matrixWorldInverse.getInverse( parent.matrixWorld );
cameraL.matrixWorldInverse.multiply( matrixWorldInverse );
cameraR.matrixWorldInverse.multiply( matrixWorldInverse );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册