|
@@ -18842,10 +18842,10 @@ function WebGLRenderList() {
|
|
|
|
|
|
}
|
|
|
|
|
|
- function sort() {
|
|
|
+ function sort( customOpaqueSort, customTransparentSort ) {
|
|
|
|
|
|
- if ( opaque.length > 1 ) opaque.sort( painterSortStable );
|
|
|
- if ( transparent.length > 1 ) transparent.sort( reversePainterSortStable );
|
|
|
+ if ( opaque.length > 1 ) opaque.sort( customOpaqueSort || painterSortStable );
|
|
|
+ if ( transparent.length > 1 ) transparent.sort( customTransparentSort || reversePainterSortStable );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -23282,6 +23282,8 @@ function WebGLRenderer( parameters ) {
|
|
|
_height = _canvas.height,
|
|
|
|
|
|
_pixelRatio = 1,
|
|
|
+ _opaqueSort = null,
|
|
|
+ _transparentSort = null,
|
|
|
|
|
|
_viewport = new Vector4( 0, 0, _width, _height ),
|
|
|
_scissor = new Vector4( 0, 0, _width, _height ),
|
|
@@ -23628,6 +23630,18 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
};
|
|
|
|
|
|
+ this.setOpaqueSort = function ( method ) {
|
|
|
+
|
|
|
+ _opaqueSort = method;
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
+ this.setTransparentSort = function ( method ) {
|
|
|
+
|
|
|
+ _transparentSort = method;
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
// Clearing
|
|
|
|
|
|
this.getClearColor = function () {
|
|
@@ -24278,7 +24292,7 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
if ( _this.sortObjects === true ) {
|
|
|
|
|
|
- currentRenderList.sort();
|
|
|
+ currentRenderList.sort( _opaqueSort, _transparentSort );
|
|
|
|
|
|
}
|
|
|
|