Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Enabling Camera cause fps drop.

Discussion in 'High Definition Render Pipeline' started by Toficor, Dec 3, 2020.

  1. Toficor

    Toficor

    Joined:
    May 6, 2015
    Posts:
    33
    Hello,
    I'm struggling with a serious performance spike when I enable a second camera on scene. I'm using this second camera to get output for render texture. Keeping it enable all the time is not an option because I have around 8 cameras set on scene to get different render texture. This frame drop occurs each time I enable camera.

    Also I tried to keep those cameras enabled with Culling Mask set to Nothing but I didn't work very well.

    Am I missing something or maybe there is a workaround for this?

    Also I leave a link for profiling data from build.

    https://drive.google.com/file/d/1hBInAAxYIpEHLO4wXcBC3zx0W2M22eD9/view?usp=sharing

    I will appreciate any help.
     
  2. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    431
    Hey, did you experiment with disabling certain rendering features in the camera's inspector, inside the "Custom Frame Settings" panel? Things such as fog, shadows, etc.
     
  3. Toficor

    Toficor

    Joined:
    May 6, 2015
    Posts:
    33
    Hello @pierred_unity,
    Thank you for such fast response.

    Custom Frame Settings checkbox is not even checked.
     
  4. Toficor

    Toficor

    Joined:
    May 6, 2015
    Posts:
    33
    Ok, I find what cause those spike. I was Volume - > Visual Enviroment

    There I have Physically Based Sky and Dynamic Ambient Mode, Can I turn this off from Custom Frame Setting level ?
     
  5. Julien_Unity

    Julien_Unity

    Unity Technologies

    Joined:
    Nov 17, 2015
    Posts:
    68
    The PBR sky has to precompute a bunch of data for rendering. This can be pretty GPU time consuming. It's done over several frames but it can still cause hitches.
    Do you actually need the PBR sky for those camera? If not you can also provide a different visual environment for this camera by using a different Volume Layer Mask. You can also change the background mode of the camera to color which should bypass any sky rendering.
     
  6. Toficor

    Toficor

    Joined:
    May 6, 2015
    Posts:
    33
    I changed Background Type for Color just for fast check and still get spike. Later I will check option with different visual enviroment for this camera.