|
@@ -68,8 +68,9 @@ function WebGLRenderer( parameters ) {
|
|
let currentRenderState = null;
|
|
let currentRenderState = null;
|
|
|
|
|
|
// render() can be called from within a callback triggered by another render.
|
|
// render() can be called from within a callback triggered by another render.
|
|
- // We track this so that the nested render call gets its state isolated from the parent render call.
|
|
|
|
|
|
+ // We track this so that the nested render call gets its list and state isolated from the parent render call.
|
|
|
|
|
|
|
|
+ const renderListStack = [];
|
|
const renderStateStack = [];
|
|
const renderStateStack = [];
|
|
|
|
|
|
// public properties
|
|
// public properties
|
|
@@ -1023,9 +1024,11 @@ function WebGLRenderer( parameters ) {
|
|
_localClippingEnabled = this.localClippingEnabled;
|
|
_localClippingEnabled = this.localClippingEnabled;
|
|
_clippingEnabled = clipping.init( this.clippingPlanes, _localClippingEnabled, camera );
|
|
_clippingEnabled = clipping.init( this.clippingPlanes, _localClippingEnabled, camera );
|
|
|
|
|
|
- currentRenderList = renderLists.get( scene, camera );
|
|
|
|
|
|
+ currentRenderList = renderLists.get( scene, renderListStack.length );
|
|
currentRenderList.init();
|
|
currentRenderList.init();
|
|
|
|
|
|
|
|
+ renderListStack.push( currentRenderList );
|
|
|
|
+
|
|
projectObject( scene, camera, 0, _this.sortObjects );
|
|
projectObject( scene, camera, 0, _this.sortObjects );
|
|
|
|
|
|
currentRenderList.finish();
|
|
currentRenderList.finish();
|
|
@@ -1100,6 +1103,7 @@ function WebGLRenderer( parameters ) {
|
|
// _gl.finish();
|
|
// _gl.finish();
|
|
|
|
|
|
renderStateStack.pop();
|
|
renderStateStack.pop();
|
|
|
|
+
|
|
if ( renderStateStack.length > 0 ) {
|
|
if ( renderStateStack.length > 0 ) {
|
|
|
|
|
|
currentRenderState = renderStateStack[ renderStateStack.length - 1 ];
|
|
currentRenderState = renderStateStack[ renderStateStack.length - 1 ];
|
|
@@ -1110,7 +1114,17 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- currentRenderList = null;
|
|
|
|
|
|
+ renderListStack.pop();
|
|
|
|
+
|
|
|
|
+ if ( renderListStack.length > 0 ) {
|
|
|
|
+
|
|
|
|
+ currentRenderList = renderListStack[ renderListStack.length - 1 ];
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+
|
|
|
|
+ currentRenderList = null;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
@@ -1750,18 +1764,6 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
- this.getRenderList = function () {
|
|
|
|
-
|
|
|
|
- return currentRenderList;
|
|
|
|
-
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- this.setRenderList = function ( renderList ) {
|
|
|
|
-
|
|
|
|
- currentRenderList = renderList;
|
|
|
|
-
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
this.getRenderTarget = function () {
|
|
this.getRenderTarget = function () {
|
|
|
|
|
|
return _currentRenderTarget;
|
|
return _currentRenderTarget;
|