浏览代码

Added comments on render item in-place recycling.

tschw 10 年之前
父节点
当前提交
cc78fd5d13
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      src/renderers/WebGLRenderer.js

+ 8 - 0
src/renderers/WebGLRenderer.js

@@ -1249,6 +1249,8 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 		var array, index;
 
+		// allocate the next position in the appropriate array
+
 		if ( object.material.transparent ) {
 
 			array = transparentImmediateObjects;
@@ -1261,6 +1263,8 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 		}
 
+		// recycle existing position or grow the array
+
 		if ( index < array.length ) {
 
 			array[ index ] = object;
@@ -1279,6 +1283,8 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 		var array, index;
 
+		// allocate the next position in the appropriate array
+
 		if ( material.transparent ) {
 
 			array = transparentObjects;
@@ -1291,6 +1297,8 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 		}
 
+		// recycle existing render item or grow the array
+
 		var renderItem = array[ index ];
 
 		if ( renderItem !== undefined ) {