فهرست منبع

Fix the renderList sort function to be truly stable

Multiple objects can have the same id. Using that id to compare the render
objects makes the sort function unstable. Use the webgl object's index in the
render list instead. That number is guaranteed to be unique.

This fixes #2966.
Tomas Carnecky 13 سال پیش
والد
کامیت
a7f53ec93f
1فایلهای تغییر یافته به همراه1 افزوده شده و 2 حذف شده
  1. 1 2
      src/renderers/WebGLRenderer.js

+ 1 - 2
src/renderers/WebGLRenderer.js

@@ -4037,6 +4037,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 			webglObject = renderList[ i ];
 			object = webglObject.object;
 
+			webglObject.id = i;
 			webglObject.render = false;
 
 			if ( object.visible ) {
@@ -4064,8 +4065,6 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 						}
 
-						webglObject.id = object.id;
-
 					}
 
 				}

粤ICP备19079148号