|
@@ -253,6 +253,8 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
var background, morphtargets, bufferRenderer, indexedBufferRenderer;
|
|
|
|
|
|
+ var opaqueSort, transparentSort;
|
|
|
+
|
|
|
var utils;
|
|
|
|
|
|
function initGLContext() {
|
|
@@ -505,6 +507,18 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
};
|
|
|
|
|
|
+ this.setOpaqueSort = function ( method ) {
|
|
|
+
|
|
|
+ opaqueSort = method;
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
+ this.setTransparentSort = function ( method ) {
|
|
|
+
|
|
|
+ transparentSort = method;
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
// Clearing
|
|
|
|
|
|
this.getClearColor = function () {
|
|
@@ -1154,7 +1168,7 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
if ( _this.sortObjects === true ) {
|
|
|
|
|
|
- currentRenderList.sort();
|
|
|
+ currentRenderList.sort( opaqueSort, transparentSort );
|
|
|
|
|
|
}
|
|
|
|