Browse Source

Hide scene background when XR Session environmentBlendMode is additive

Morgan Villedieu 6 năm trước cách đây
mục cha
commit
aca41425ee

+ 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 );