Browse Source

fix: remove string concat

oguz 6 years ago
parent
commit
0ae4d897e5
1 changed files with 14 additions and 6 deletions
  1. 14 6
      src/renderers/webgl/WebGLRenderLists.js

+ 14 - 6
src/renderers/webgl/WebGLRenderLists.js

@@ -128,15 +128,23 @@ function WebGLRenderLists() {
 
 
 	function get( scene, camera ) {
 	function get( scene, camera ) {
 
 
-		var hash = scene.id + ',' + camera.id;
-		var list = lists[ hash ];
+		var cameras = lists[ scene.id ];
+		var list;
+		if ( cameras === undefined ) {
 
 
-		if ( list === undefined ) {
+			list = new WebGLRenderList();
+			lists[ scene.id ] = {};
+			lists[ scene.id ][ camera.id ] = list;
 
 
-			// console.log( 'THREE.WebGLRenderLists:', hash );
+		} else {
 
 
-			list = new WebGLRenderList();
-			lists[ hash ] = list;
+			list = cameras[ camera.id ];
+			if ( list === undefined ) {
+
+				list = new WebGLRenderList();
+				cameras[ camera.id ] = list;
+
+			}
 
 
 		}
 		}