Multiple canvases in one app

Is it possible to have multiple canvases in one project? When I blur out of my game it shows a UI that covers the full screen in a see thru background. This is done with an absolute div. The reason for this is that I could implement mods in my game on a later state. But I was wondering if I could have a canvas in that UI. I can’t do this with layers as there is a div above the main canvas.

Hi @Powered and welcome,

What do you want to use the multiple canvases for? It’s definitely possible to have more than one PlayCanvas application instances running at the same time, each using it own canvas element.

At the same time you can also use multiple cameras rendering at the same time, examples project:

The multiple viewport rendering is still in the same canvas.
I want to have an animation in a different canvas which shows a running character with your skin.
Having 2 apps wouldn’t that be very resource expensive?

The WebGL context is tied to the canvas so no matter what, you will be having ‘two’ apps if you want to render WebGL to multiple canvases.

Do you have to use HTML DOMs here? Could you use PlayCanvas UI instead? This will allow you to render to texture that can be used in the UI here. eg Render 3D World to UI | Learn PlayCanvas

1 Like