Trouble with animations exported from blender in multiple renderers

Hi, please help. I exported a scene from blender with animation. Animation starts, its ok, but only in one renderer, when I try to display this scene in another renderer and with another camera, there is no animation in second. Moreover, when I don’t render the first one, is second - works. I don’t give u more code details, because I dont know, is it possible, what I want? I will attach a video of the problem.

Here: _Renderer.entity = THREE.WebGLRenderer = _Renderer2.entity, _Scene.entity = THREE.Scene(), _Camera.entity = THREE.PerspectiveCamera( fov, ratio, 0.1, 1000 ) = _Camera2.entity. All are identical. Scene was export in .glb format.

function render() {
	requestAnimationFrame(render);
	_Renderer.entity.render(_Scene.entity, _Camera.entity);
        _Renderer2.entity.render(_Scene.entity, _Camera2.entity);

       var delta = _Clock.getDelta();
       if ( mixer ) {
           mixer.update( delta );
       }
}
render();

Thank you.

There is usually no need for two or more renderers. If you want to display a 3D scene on more than one canvas, use the approach from webgl_multiple_canvases_grid.

Meaning you add two canvas elements to your HTML and use the internal canvas of the renderer (renderer.domElement) only as an intermediate canvas. So you render as usual but then copy the content of the intermediate canvas to the ones in the DOM via:

context.drawImage( renderer.domElement, 0, 0 );
1 Like

Thank you so much. This is work for me. Only for some reason I have to clean the canvas, unlike the your example. But it’s ok. Thank you Mugen87, you are one of the heroes of this forum :slight_smile:

1 Like