提交 1dec0df6 编写于 作者: A alteredq

More garbage collection friendly particle sorting in WebGLRendering.

Also now sharing numericalSort between particles and morphs.
上级 f1a1f23b
......@@ -16744,7 +16744,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
sortArray.sort( function( a, b ) { return b[ 0 ] - a[ 0 ]; } );
sortArray.sort( numericalSort );
for ( v = 0; v < vl; v ++ ) {
......@@ -19511,7 +19511,7 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( influence > 0 ) {
activeInfluenceIndices.push( [ i, influence ] );
activeInfluenceIndices.push( [ influence, i ] );
}
......@@ -19538,7 +19538,7 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( activeInfluenceIndices[ m ] ) {
influenceIndex = activeInfluenceIndices[ m ][ 0 ];
influenceIndex = activeInfluenceIndices[ m ][ 1 ];
if ( attributes[ "morphTarget" + m ] >= 0 ) {
......@@ -19609,7 +19609,7 @@ THREE.WebGLRenderer = function ( parameters ) {
function numericalSort ( a, b ) {
return b[ 1 ] - a[ 1 ];
return b[ 0 ] - a[ 0 ];
};
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
......@@ -1031,7 +1031,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
sortArray.sort( function( a, b ) { return b[ 0 ] - a[ 0 ]; } );
sortArray.sort( numericalSort );
for ( v = 0; v < vl; v ++ ) {
......@@ -3798,7 +3798,7 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( influence > 0 ) {
activeInfluenceIndices.push( [ i, influence ] );
activeInfluenceIndices.push( [ influence, i ] );
}
......@@ -3825,7 +3825,7 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( activeInfluenceIndices[ m ] ) {
influenceIndex = activeInfluenceIndices[ m ][ 0 ];
influenceIndex = activeInfluenceIndices[ m ][ 1 ];
if ( attributes[ "morphTarget" + m ] >= 0 ) {
......@@ -3896,7 +3896,7 @@ THREE.WebGLRenderer = function ( parameters ) {
function numericalSort ( a, b ) {
return b[ 1 ] - a[ 1 ];
return b[ 0 ] - a[ 0 ];
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册