From d5df73e6946ac0f7dbc57a81989792ac86139f3f Mon Sep 17 00:00:00 2001 From: WestLangley Date: Fri, 17 Jan 2020 19:23:37 -0500 Subject: [PATCH] Prevent background material recompile in certain cases --- src/renderers/webgl/WebGLBackground.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/renderers/webgl/WebGLBackground.js b/src/renderers/webgl/WebGLBackground.js index 181273666386ac..6d84ce630105ad 100644 --- a/src/renderers/webgl/WebGLBackground.js +++ b/src/renderers/webgl/WebGLBackground.js @@ -18,8 +18,7 @@ function WebGLBackground( renderer, state, objects, premultipliedAlpha ) { var planeMesh; var boxMesh; - // Store the current background texture and its `version` - // so we can recompile the material accordingly. + var currentBackground = null; var currentBackgroundVersion = 0; var currentTonemapping = null; @@ -43,15 +42,11 @@ function WebGLBackground( renderer, state, objects, premultipliedAlpha ) { if ( background === null ) { setClear( clearColor, clearAlpha ); - currentBackground = null; - currentBackgroundVersion = 0; } else if ( background && background.isColor ) { setClear( background, 1 ); forceClear = true; - currentBackground = null; - currentBackgroundVersion = 0; }