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

Updated builds.

上级 30b37e7b
......@@ -14750,6 +14750,17 @@
var background = scene.background;
// Ignore background in AR
// TODO: Reconsider this.
var session = renderer.vr.getSession();
if ( session && session.environmentBlendMode === 'additive' ) {
background = null;
}
if ( background === null ) {
setClear( clearColor, clearAlpha );
......@@ -24,10 +24,10 @@ null;this.clipShadows=this.clipIntersection=!1;this.shadowSide=null;this.colorWr
"void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";this.linewidth=1;this.wireframe=!1;this.wireframeLinewidth=1;this.morphNormals=this.morphTargets=this.skinning=this.clipping=this.lights=this.fog=!1;this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1};this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]};this.index0AttributeName=void 0;this.uniformsNeedUpdate=!1;void 0!==a&&(void 0!==a.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
this.setValues(a))}function tb(a,b){this.origin=void 0!==a?a:new n;this.direction=void 0!==b?b:new n}function ua(a,b,c){this.a=void 0!==a?a:new n;this.b=void 0!==b?b:new n;this.c=void 0!==c?c:new n}function ya(a){M.call(this);this.type="MeshBasicMaterial";this.color=new K(16777215);this.lightMap=this.map=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.envMap=this.alphaMap=this.specularMap=null;this.combine=0;this.reflectivity=1;this.refractionRatio=.98;this.wireframe=!1;this.wireframeLinewidth=
1;this.wireframeLinejoin=this.wireframeLinecap="round";this.lights=this.morphTargets=this.skinning=!1;this.setValues(a)}function va(a,b){E.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new C;this.material=void 0!==b?b:new ya({color:16777215*Math.random()});this.drawMode=0;this.updateMorphTargets()}function Zf(a,b,c,d){function e(a,c){b.buffers.color.setClear(a.r,a.g,a.b,c,d)}var f=new K(0),g=0,h,k,m=null,p=0;return{getClearColor:function(){return f},setClearColor:function(a,b){f.set(a);g=
void 0!==b?b:1;e(f,g)},getClearAlpha:function(){return g},setClearAlpha:function(a){g=a;e(f,g)},render:function(b,d,t,l){d=d.background;null===d?(e(f,g),m=null,p=0):d&&d.isColor&&(e(d,1),l=!0,m=null,p=0);(a.autoClear||l)&&a.clear(a.autoClearColor,a.autoClearDepth,a.autoClearStencil);if(d&&(d.isCubeTexture||d.isWebGLRenderTargetCube)){void 0===k&&(k=new va(new rb(1,1,1),new Ca({type:"BackgroundCubeMaterial",uniforms:Mb(Ta.cube.uniforms),vertexShader:Ta.cube.vertexShader,fragmentShader:Ta.cube.fragmentShader,
side:1,depthTest:!1,depthWrite:!1,fog:!1})),k.geometry.removeAttribute("normal"),k.geometry.removeAttribute("uv"),k.onBeforeRender=function(a,b,c){this.matrixWorld.copyPosition(c.matrixWorld)},Object.defineProperty(k.material,"map",{get:function(){return this.uniforms.tCube.value}}),c.update(k));l=d.isWebGLRenderTargetCube?d.texture:d;k.material.uniforms.tCube.value=l;k.material.uniforms.tFlip.value=d.isWebGLRenderTargetCube?1:-1;if(m!==d||p!==l.version)k.material.needsUpdate=!0,m=d,p=l.version;b.unshift(k,
k.geometry,k.material,0,0,null)}else if(d&&d.isTexture){void 0===h&&(h=new va(new sb(2,2),new Ca({type:"BackgroundMaterial",uniforms:Mb(Ta.background.uniforms),vertexShader:Ta.background.vertexShader,fragmentShader:Ta.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.removeAttribute("normal"),Object.defineProperty(h.material,"map",{get:function(){return this.uniforms.t2D.value}}),c.update(h));h.material.uniforms.t2D.value=d;!0===d.matrixAutoUpdate&&d.updateMatrix();
h.material.uniforms.uvTransform.value.copy(d.matrix);if(m!==d||p!==d.version)h.material.needsUpdate=!0,m=d,p=d.version;b.unshift(h,h.geometry,h.material,0,0,null)}}}}function $f(a,b,c,d){var e;this.setMode=function(a){e=a};this.render=function(b,d){a.drawArrays(e,b,d);c.update(d,e)};this.renderInstances=function(f,g,h){if(d.isWebGL2)var k=a;else if(k=b.get("ANGLE_instanced_arrays"),null===k){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
void 0!==b?b:1;e(f,g)},getClearAlpha:function(){return g},setClearAlpha:function(a){g=a;e(f,g)},render:function(b,d,t,l){d=d.background;(t=a.vr.getSession())&&"additive"===t.environmentBlendMode&&(d=null);null===d?(e(f,g),m=null,p=0):d&&d.isColor&&(e(d,1),l=!0,m=null,p=0);(a.autoClear||l)&&a.clear(a.autoClearColor,a.autoClearDepth,a.autoClearStencil);if(d&&(d.isCubeTexture||d.isWebGLRenderTargetCube)){void 0===k&&(k=new va(new rb(1,1,1),new Ca({type:"BackgroundCubeMaterial",uniforms:Mb(Ta.cube.uniforms),
vertexShader:Ta.cube.vertexShader,fragmentShader:Ta.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),k.geometry.removeAttribute("normal"),k.geometry.removeAttribute("uv"),k.onBeforeRender=function(a,b,c){this.matrixWorld.copyPosition(c.matrixWorld)},Object.defineProperty(k.material,"map",{get:function(){return this.uniforms.tCube.value}}),c.update(k));l=d.isWebGLRenderTargetCube?d.texture:d;k.material.uniforms.tCube.value=l;k.material.uniforms.tFlip.value=d.isWebGLRenderTargetCube?
1:-1;if(m!==d||p!==l.version)k.material.needsUpdate=!0,m=d,p=l.version;b.unshift(k,k.geometry,k.material,0,0,null)}else if(d&&d.isTexture){void 0===h&&(h=new va(new sb(2,2),new Ca({type:"BackgroundMaterial",uniforms:Mb(Ta.background.uniforms),vertexShader:Ta.background.vertexShader,fragmentShader:Ta.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.removeAttribute("normal"),Object.defineProperty(h.material,"map",{get:function(){return this.uniforms.t2D.value}}),c.update(h));
h.material.uniforms.t2D.value=d;!0===d.matrixAutoUpdate&&d.updateMatrix();h.material.uniforms.uvTransform.value.copy(d.matrix);if(m!==d||p!==d.version)h.material.needsUpdate=!0,m=d,p=d.version;b.unshift(h,h.geometry,h.material,0,0,null)}}}}function $f(a,b,c,d){var e;this.setMode=function(a){e=a};this.render=function(b,d){a.drawArrays(e,b,d);c.update(d,e)};this.renderInstances=function(f,g,h){if(d.isWebGL2)var k=a;else if(k=b.get("ANGLE_instanced_arrays"),null===k){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
return}k[d.isWebGL2?"drawArraysInstanced":"drawArraysInstancedANGLE"](e,g,h,f.maxInstancedCount);c.update(h,e,f.maxInstancedCount)}}function ag(a,b,c){function d(b){if("highp"===b){if(0<a.getShaderPrecisionFormat(35633,36338).precision&&0<a.getShaderPrecisionFormat(35632,36338).precision)return"highp";b="mediump"}return"mediump"===b&&0<a.getShaderPrecisionFormat(35633,36337).precision&&0<a.getShaderPrecisionFormat(35632,36337).precision?"mediump":"lowp"}var e,f="undefined"!==typeof WebGL2RenderingContext&&
a instanceof WebGL2RenderingContext,g=void 0!==c.precision?c.precision:"highp",h=d(g);h!==g&&(console.warn("THREE.WebGLRenderer:",g,"not supported, using",h,"instead."),g=h);c=!0===c.logarithmicDepthBuffer;h=a.getParameter(34930);var k=a.getParameter(35660),m=a.getParameter(3379),p=a.getParameter(34076),q=a.getParameter(34921),v=a.getParameter(36347),t=a.getParameter(36348),l=a.getParameter(36349),u=0<k,w=f||!!b.get("OES_texture_float"),n=u&&w,x=f?a.getParameter(36183):0;return{isWebGL2:f,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:g,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:k,maxTextureSize:m,maxCubemapSize:p,maxAttributes:q,maxVertexUniforms:v,maxVaryings:t,maxFragmentUniforms:l,vertexTextures:u,floatFragmentTextures:w,floatVertexTextures:n,maxSamples:x}}function bg(){function a(){m.value!==d&&(m.value=d,m.needsUpdate=0<e);c.numPlanes=e;c.numIntersection=
......
......@@ -14744,6 +14744,17 @@ function WebGLBackground( renderer, state, objects, premultipliedAlpha ) {
var background = scene.background;
// Ignore background in AR
// TODO: Reconsider this.
var session = renderer.vr.getSession();
if ( session && session.environmentBlendMode === 'additive' ) {
background = null;
}
if ( background === null ) {
setClear( clearColor, clearAlpha );
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册