Trouble with double camera

Hello, i have a button that enable a second camera but when it does the main screen become black, i have set the main camera as priority 1 and the minimap camera as priority 2. Any idea why i have this problem?

Probably your second camera clears the color buffer. You can check it in the camera component properties. Also, check the layers the second camera renders.

you can set this to true: app.scene.layers.logRenderActions
and open debug console. Make sure you use debug version of the engine.
This should print info about how the scene is rendered, including when it gets cleared. See example here:

That should give you an idea where the problem is. Or perhaps post the log here.


after adding posteffects to my cams I had a simular issue, only UI- layer was rendered…
to solve that, it turned out that you’ve to switch off all cams before switching on a new one…


I don’t want to switch @Gurki i want to overlap the two view since the second cam is the minimap view.
Tried to uncheck the clear color buffer option but nothing changed @LeXXik
Will read what you pointed out @mvaligursky and will let you know the result.


1 Like

@ayrin - any chance you could make your console window wider when taking this screenshot, so that each line is on a single line instead of on 3 lines? I’m struggling to read this :slight_smile:

but one thing is obvious from this … your mini map renders before the main camera … I think you need to set up priority on your cameras. Smaller number renders first. So minimap needs to have larger priority, lets say 2. Other two cameras maybe 0 and 1, in order you need them.


I have set the minimap camera to 4…no changes

How do you activate the second camera in the game?

Abilty hide in shadows a button that shown when the ability is picked in the ability tree menu

It looks to be post processing related. The minimap camera has a huesaturation post effect on it.

With it enabled, this is what it looks like:

With it disabled, we get:

I’ve updated the post effect in a fork to the latest version in GitHub but still get a black screen in the main camera

@mvaligursky I’ve created a smaller reproducible here:

What’s interesting is that it looks like the second camera’s viewport is rendering what should have been in the viewport in itself. The second camera viewport is rendering the first camera’s view.

Looking at Spector.js, it all looks fine up to this command

It feels like the problem is that the code detects these two cameras as a camera stack and tries to apply post processing to both. But as the second one is using a viewport, it fails to copy the render target to framebuffer … only copies the small area. I’ll investigate more soon, and if this is the case, I’ll connect cameras into a stack only if they have the same viewport.

I assume what you’re after is that the minimap is the only one using postprocessing right?


Yes @mvaligursky that’s exactly what i want to achieve. Thanks.
Thanks a lot @yaustar for your support too in this matter.

in that case this needs an engine fix to take the camera viewport into account when deciding what cameras are part of the stack. This should be easy fix for the next engine release in a week or so, in the meantime I hope you can either use older engine or disable the postproessing?

Yes @mvaligursky it’s not big deal i’m just checking all functions for abilities again since it’s long time after the making that i didn’t check them. So making sure everything works fine. I’m also making what it miss till player level 5 before to focus on the multiplayer. So once the login and multiplayer works users will be able to enjoy till level 5. When in beta i will develop further the players till level 10 and add new classes and abilites. So i am plenty busy and can wait for the fix with no problem :smiley:

1 Like

I have one fix ready
and one still outstanding for this … I should be able to get to this one in a week or so …


@ayrin - the issue with mini map and post processing on it should be fixed by this

(not released yet)

Thanks @mvaligursky i will wait for the release, i have my hands full with other tasks anyway so don’t worry about the speed :wink:
I have just few days of freedom before work sucks me in completely and i will be able to do just some random update to the project . But i’m happy since the project is coming out nice and it’s the biggest i ever saw on playcanvas. Thanks to all the crew for your work and support.

1 Like