|
|
@@ -358,13 +358,22 @@ class RenderList {
|
|
|
*
|
|
|
* @param {?function(any, any): number} customOpaqueSort - A custom sort function for opaque objects.
|
|
|
* @param {?function(any, any): number} customTransparentSort - A custom sort function for transparent objects.
|
|
|
+ * @param {boolean} reversedDepth - Whether a reversed depth buffer is used or not.
|
|
|
*/
|
|
|
- sort( customOpaqueSort, customTransparentSort ) {
|
|
|
+ sort( customOpaqueSort, customTransparentSort, reversedDepth ) {
|
|
|
|
|
|
if ( this.opaque.length > 1 ) this.opaque.sort( customOpaqueSort || painterSortStable );
|
|
|
if ( this.transparentDoublePass.length > 1 ) this.transparentDoublePass.sort( customTransparentSort || reversePainterSortStable );
|
|
|
if ( this.transparent.length > 1 ) this.transparent.sort( customTransparentSort || reversePainterSortStable );
|
|
|
|
|
|
+ if ( reversedDepth ) {
|
|
|
+
|
|
|
+ this.opaque.reverse();
|
|
|
+ this.transparentDoublePass.reverse();
|
|
|
+ this.transparent.reverse();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|