From 23466af1ac10a1e3728f5d358fd86446e61b11ea Mon Sep 17 00:00:00 2001 From: Mugen87 Date: Thu, 28 May 2020 11:26:41 +0200 Subject: [PATCH] WebGLRenderer: Call Scene.on*Render() only for scenes. --- src/renderers/WebGLRenderer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderers/WebGLRenderer.js b/src/renderers/WebGLRenderer.js index 2d3a542bb92465..bf7e418ebd777f 100644 --- a/src/renderers/WebGLRenderer.js +++ b/src/renderers/WebGLRenderer.js @@ -1171,7 +1171,7 @@ function WebGLRenderer( parameters ) { } // - scene.onBeforeRender( _this, scene, camera, renderTarget || _currentRenderTarget ); + if ( scene.isScene ) scene.onBeforeRender( _this, scene, camera, renderTarget || _currentRenderTarget ); currentRenderState = renderStates.get( scene, camera ); currentRenderState.init(); @@ -1247,7 +1247,7 @@ function WebGLRenderer( parameters ) { // - scene.onAfterRender( _this, scene, camera ); + if ( scene.isScene ) scene.onAfterRender( _this, scene, camera ); //