Browse Source

Updated builds.

Mr.doob 4 years ago
parent
commit
00904c5041
3 changed files with 46 additions and 47 deletions
  1. 19 22
      build/three.js
  2. 0 0
      build/three.min.js
  3. 27 25
      build/three.module.js

+ 19 - 22
build/three.js

@@ -12356,13 +12356,11 @@
 						var image = texture.image;
 
 						if (image && image.height > 0) {
-							var currentRenderList = renderer.getRenderList();
 							var currentRenderTarget = renderer.getRenderTarget();
 							var renderTarget = new WebGLCubeRenderTarget(image.height / 2);
 							renderTarget.fromEquirectangularTexture(renderer, texture);
 							cubemaps.set(texture, renderTarget);
 							renderer.setRenderTarget(currentRenderTarget);
-							renderer.setRenderList(currentRenderList);
 							texture.addEventListener('dispose', onTextureDispose);
 							return mapTextureMapping(renderTarget.texture, texture.mapping);
 						} else {
@@ -14480,20 +14478,19 @@
 	function WebGLRenderLists(properties) {
 		var lists = new WeakMap();
 
-		function get(scene, camera) {
-			var cameras = lists.get(scene);
+		function get(scene, renderCallDepth) {
 			var list;
 
-			if (cameras === undefined) {
+			if (lists.has(scene) === false) {
 				list = new WebGLRenderList(properties);
-				lists.set(scene, new WeakMap());
-				lists.get(scene).set(camera, list);
+				lists.set(scene, []);
+				lists.get(scene).push(list);
 			} else {
-				list = cameras.get(camera);
-
-				if (list === undefined) {
+				if (renderCallDepth >= lists.get(scene).length) {
 					list = new WebGLRenderList(properties);
-					cameras.set(camera, list);
+					lists.get(scene).push(list);
+				} else {
+					list = lists.get(scene)[renderCallDepth];
 				}
 			}
 
@@ -18168,8 +18165,9 @@
 
 		var currentRenderList = null;
 		var currentRenderState = null; // render() can be called from within a callback triggered by another render.
-		// We track this so that the nested render call gets its state isolated from the parent render call.
+		// We track this so that the nested render call gets its list and state isolated from the parent render call.
 
+		var renderListStack = [];
 		var renderStateStack = []; // public properties
 
 		this.domElement = _canvas; // Debug configuration container
@@ -18838,8 +18836,9 @@
 
 			_localClippingEnabled = this.localClippingEnabled;
 			_clippingEnabled = clipping.init(this.clippingPlanes, _localClippingEnabled, camera);
-			currentRenderList = renderLists.get(scene, camera);
+			currentRenderList = renderLists.get(scene, renderListStack.length);
 			currentRenderList.init();
+			renderListStack.push(currentRenderList);
 			projectObject(scene, camera, 0, _this.sortObjects);
 			currentRenderList.finish();
 
@@ -18892,7 +18891,13 @@
 				currentRenderState = null;
 			}
 
-			currentRenderList = null;
+			renderListStack.pop();
+
+			if (renderListStack.length > 0) {
+				currentRenderList = renderListStack[renderListStack.length - 1];
+			} else {
+				currentRenderList = null;
+			}
 		};
 
 		function projectObject(object, camera, groupOrder, sortObjects) {
@@ -19308,14 +19313,6 @@
 			return _currentActiveMipmapLevel;
 		};
 
-		this.getRenderList = function () {
-			return currentRenderList;
-		};
-
-		this.setRenderList = function (renderList) {
-			currentRenderList = renderList;
-		};
-
 		this.getRenderTarget = function () {
 			return _currentRenderTarget;
 		};

File diff suppressed because it is too large
+ 0 - 0
build/three.min.js


+ 27 - 25
build/three.module.js

@@ -14682,7 +14682,6 @@ function WebGLCubeMaps( renderer ) {
 
 					if ( image && image.height > 0 ) {
 
-						const currentRenderList = renderer.getRenderList();
 						const currentRenderTarget = renderer.getRenderTarget();
 
 						const renderTarget = new WebGLCubeRenderTarget( image.height / 2 );
@@ -14690,7 +14689,6 @@ function WebGLCubeMaps( renderer ) {
 						cubemaps.set( texture, renderTarget );
 
 						renderer.setRenderTarget( currentRenderTarget );
-						renderer.setRenderList( currentRenderList );
 
 						texture.addEventListener( 'dispose', onTextureDispose );
 
@@ -17801,24 +17799,26 @@ function WebGLRenderLists( properties ) {
 
 	let lists = new WeakMap();
 
-	function get( scene, camera ) {
+	function get( scene, renderCallDepth ) {
 
-		const cameras = lists.get( scene );
 		let list;
 
-		if ( cameras === undefined ) {
+		if ( lists.has( scene ) === false ) {
 
 			list = new WebGLRenderList( properties );
-			lists.set( scene, new WeakMap() );
-			lists.get( scene ).set( camera, list );
+			lists.set( scene, [] );
+			lists.get( scene ).push( list );
 
 		} else {
 
-			list = cameras.get( camera );
-			if ( list === undefined ) {
+			if ( renderCallDepth >= lists.get( scene ).length ) {
 
 				list = new WebGLRenderList( properties );
-				cameras.set( camera, list );
+				lists.get( scene ).push( list );
+
+			} else {
+
+				list = lists.get( scene )[ renderCallDepth ];
 
 			}
 
@@ -22991,8 +22991,9 @@ function WebGLRenderer( parameters ) {
 	let currentRenderState = null;
 
 	// render() can be called from within a callback triggered by another render.
-	// We track this so that the nested render call gets its state isolated from the parent render call.
+	// We track this so that the nested render call gets its list and state isolated from the parent render call.
 
+	const renderListStack = [];
 	const renderStateStack = [];
 
 	// public properties
@@ -23946,9 +23947,11 @@ function WebGLRenderer( parameters ) {
 		_localClippingEnabled = this.localClippingEnabled;
 		_clippingEnabled = clipping.init( this.clippingPlanes, _localClippingEnabled, camera );
 
-		currentRenderList = renderLists.get( scene, camera );
+		currentRenderList = renderLists.get( scene, renderListStack.length );
 		currentRenderList.init();
 
+		renderListStack.push( currentRenderList );
+
 		projectObject( scene, camera, 0, _this.sortObjects );
 
 		currentRenderList.finish();
@@ -24023,6 +24026,7 @@ function WebGLRenderer( parameters ) {
 		// _gl.finish();
 
 		renderStateStack.pop();
+
 		if ( renderStateStack.length > 0 ) {
 
 			currentRenderState = renderStateStack[ renderStateStack.length - 1 ];
@@ -24033,7 +24037,17 @@ function WebGLRenderer( parameters ) {
 
 		}
 
-		currentRenderList = null;
+		renderListStack.pop();
+
+		if ( renderListStack.length > 0 ) {
+
+			currentRenderList = renderListStack[ renderListStack.length - 1 ];
+
+		} else {
+
+			currentRenderList = null;
+
+		}
 
 	};
 
@@ -24673,18 +24687,6 @@ function WebGLRenderer( parameters ) {
 
 	};
 
-	this.getRenderList = function () {
-
-		return currentRenderList;
-
-	};
-
-	this.setRenderList = function ( renderList ) {
-
-		currentRenderList = renderList;
-
-	};
-
 	this.getRenderTarget = function () {
 
 		return _currentRenderTarget;

Some files were not shown because too many files changed in this diff