浏览代码

Merge pull request #15894 from mvilledieu/WebGLBackground--Hide-background-on-additive-XR-devices

WebGLBackground: Hide scene background when XR Session environmentBlendMode is additive
Mr.doob 6 年之前
父节点
当前提交
9b72e6c7cf
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/renderers/webgl/WebGLBackground.js

+ 3 - 0
src/renderers/webgl/WebGLBackground.js

@@ -27,6 +27,9 @@ function WebGLBackground( renderer, state, objects, premultipliedAlpha ) {
 
 
 		var background = scene.background;
 		var background = scene.background;
 
 
+		var session = renderer.vr.getSession();
+		if ( session && session.environmentBlendMode === 'additive' ) background = null;
+
 		if ( background === null ) {
 		if ( background === null ) {
 
 
 			setClear( clearColor, clearAlpha );
 			setClear( clearColor, clearAlpha );