Search Unity

Camera stacking half performance - expected or any fix?

Discussion in 'Universal Render Pipeline' started by Xarbrough, Jan 12, 2021.

  1. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,188
    It's nice and convenient that camera stacking works in URP now, however, I'm running into performance issues, since our game's performance is twice as bad after switching to stacking. One camera renders our gameplay scene (2D sprites), and the overlay camera renders UI. If I use only a single camera, I get 60 frames to draw both gameplay and UI in one camera, but splitting them up results in 30 frames.

    Is this expected? Are there any ways around this performance hit?

    Since I'm rendering the same content I was expecting maybe only a very tiny overhead of managing two different cameras. Gameplay has a culling mask to render only gameplay elements, UI only renders UI layer.

    When I profile, I see that the time for Gfx.WaitForPresent increases for two cameras.

    upload_2021-1-12_10-17-42.png