|
@@ -155,6 +155,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 ),
|
|
@@ -501,6 +503,18 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
};
|
|
|
|
|
|
+ this.setOpaqueSort = function ( method ) {
|
|
|
+
|
|
|
+ _opaqueSort = method;
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
+ this.setTransparentSort = function ( method ) {
|
|
|
+
|
|
|
+ _transparentSort = method;
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
// Clearing
|
|
|
|
|
|
this.getClearColor = function () {
|
|
@@ -1151,7 +1165,7 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
if ( _this.sortObjects === true ) {
|
|
|
|
|
|
- currentRenderList.sort();
|
|
|
+ currentRenderList.sort( _opaqueSort, _transparentSort );
|
|
|
|
|
|
}
|
|
|
|