Browse Source

Merge pull request #18420 from WestLangley/dev_webgl_background

WebGLBackground: prevent background material recompile in certain cases
WestLangley 5 years ago
parent
commit
617ea9ae91
1 changed files with 1 additions and 6 deletions
  1. 1 6
      src/renderers/webgl/WebGLBackground.js

+ 1 - 6
src/renderers/webgl/WebGLBackground.js

@@ -18,8 +18,7 @@ function WebGLBackground( renderer, state, objects, premultipliedAlpha ) {
 
 
 	var planeMesh;
 	var planeMesh;
 	var boxMesh;
 	var boxMesh;
-	// Store the current background texture and its `version`
-	// so we can recompile the material accordingly.
+
 	var currentBackground = null;
 	var currentBackground = null;
 	var currentBackgroundVersion = 0;
 	var currentBackgroundVersion = 0;
 	var currentTonemapping = null;
 	var currentTonemapping = null;
@@ -43,15 +42,11 @@ function WebGLBackground( renderer, state, objects, premultipliedAlpha ) {
 		if ( background === null ) {
 		if ( background === null ) {
 
 
 			setClear( clearColor, clearAlpha );
 			setClear( clearColor, clearAlpha );
-			currentBackground = null;
-			currentBackgroundVersion = 0;
 
 
 		} else if ( background && background.isColor ) {
 		} else if ( background && background.isColor ) {
 
 
 			setClear( background, 1 );
 			setClear( background, 1 );
 			forceClear = true;
 			forceClear = true;
-			currentBackground = null;
-			currentBackgroundVersion = 0;
 
 
 		}
 		}