|
@@ -14764,9 +14764,8 @@ function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha,
|
|
|
let currentBackgroundVersion = 0;
|
|
|
let currentTonemapping = null;
|
|
|
|
|
|
- function render( renderList, scene ) {
|
|
|
+ function getBackground( scene ) {
|
|
|
|
|
|
- let forceClear = false;
|
|
|
let background = scene.isScene === true ? scene.background : null;
|
|
|
|
|
|
if ( background && background.isTexture ) {
|
|
@@ -14776,6 +14775,15 @@ function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha,
|
|
|
|
|
|
}
|
|
|
|
|
|
+ return background;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ function render( scene ) {
|
|
|
+
|
|
|
+ let forceClear = false;
|
|
|
+ const background = getBackground( scene );
|
|
|
+
|
|
|
if ( background === null ) {
|
|
|
|
|
|
setClear( clearColor, clearAlpha );
|
|
@@ -14805,6 +14813,12 @@ function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha,
|
|
|
|
|
|
}
|
|
|
|
|
|
+ }
|
|
|
+
|
|
|
+ function addToRenderList( renderList, scene ) {
|
|
|
+
|
|
|
+ const background = getBackground( scene );
|
|
|
+
|
|
|
if ( background && ( background.isCubeTexture || background.mapping === CubeUVReflectionMapping ) ) {
|
|
|
|
|
|
if ( boxMesh === undefined ) {
|
|
@@ -14985,7 +14999,8 @@ function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha,
|
|
|
setClear( clearColor, clearAlpha );
|
|
|
|
|
|
},
|
|
|
- render: render
|
|
|
+ render: render,
|
|
|
+ addToRenderList: addToRenderList
|
|
|
|
|
|
};
|
|
|
|
|
@@ -29269,6 +29284,13 @@ class WebGLRenderer {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ const renderBackground = xr.enabled === false || xr.isPresenting === false || xr.hasDepthSensing() === false;
|
|
|
+ if ( renderBackground ) {
|
|
|
+
|
|
|
+ background.addToRenderList( currentRenderList, scene );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
//
|
|
|
|
|
|
this.info.render.frame ++;
|
|
@@ -29285,15 +29307,6 @@ class WebGLRenderer {
|
|
|
|
|
|
if ( this.info.autoReset === true ) this.info.reset();
|
|
|
|
|
|
-
|
|
|
- //
|
|
|
-
|
|
|
- if ( xr.enabled === false || xr.isPresenting === false || xr.hasDepthSensing() === false ) {
|
|
|
-
|
|
|
- background.render( currentRenderList, scene );
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
// render scene
|
|
|
|
|
|
const opaqueObjects = currentRenderList.opaque;
|
|
@@ -29317,6 +29330,8 @@ class WebGLRenderer {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ if ( renderBackground ) background.render( scene );
|
|
|
+
|
|
|
for ( let i = 0, l = cameras.length; i < l; i ++ ) {
|
|
|
|
|
|
const camera2 = cameras[ i ];
|
|
@@ -29329,6 +29344,8 @@ class WebGLRenderer {
|
|
|
|
|
|
if ( transmissiveObjects.length > 0 ) renderTransmissionPass( opaqueObjects, transmissiveObjects, scene, camera );
|
|
|
|
|
|
+ if ( renderBackground ) background.render( scene );
|
|
|
+
|
|
|
renderScene( currentRenderList, scene, camera );
|
|
|
|
|
|
}
|