|
@@ -26,9 +26,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 ) {
|
|
@@ -38,6 +37,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 );
|
|
@@ -67,6 +75,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 ) {
|
|
@@ -247,7 +261,8 @@ function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha,
|
|
|
setClear( clearColor, clearAlpha );
|
|
|
|
|
|
},
|
|
|
- render: render
|
|
|
+ render: render,
|
|
|
+ addToRenderList: addToRenderList
|
|
|
|
|
|
};
|
|
|
|