Search Unity

Second camera using culling mask = slow frame rate?

Discussion in 'General Graphics' started by shmomo, Feb 29, 2016.

  1. shmomo

    shmomo

    Joined:
    Oct 11, 2011
    Posts:
    127
    ios performance is GOOD:
    one camera
    two objects

    ios performance is BAD:
    two cameras
    two objects
    (each camera is rendering one object by using culling masks)

    Why? I'm stuck, Any help appreciated,

    J
     
    Last edited: Mar 1, 2016
  2. shmomo

    shmomo

    Joined:
    Oct 11, 2011
    Posts:
    127
    Ok so, for future people this is the problem.

    More than one camera with any one of those cameras having a post effect = slow frame rate.

    Would love to know why.

    Thanks,

    J
     
  3. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Profiler knows why.

    Generally though, each camera does all culling again from scratch. This is why multiple cameras are a bad idea, especially if you have hundreds of objects, or thousands (even if not visible, they all need to be checked).
     
  4. shmomo

    shmomo

    Joined:
    Oct 11, 2011
    Posts:
    127
    If it does, i wish it would tell me in a way i understand :)

    Only difference between 2 cams vs 1 cam is..

    one extra draw call
    one extra render render texture switch <- what does this do?

    Does this reveal anything to you?

    Thanks,

    J
     
    Last edited: Mar 2, 2016
  5. shmomo

    shmomo

    Joined:
    Oct 11, 2011
    Posts:
    127
    Wish I knew more about rendering.

    Is there some reason why using a Render Texture and Graphics.Blit in the post effect script might effect performance is your using multiple cameras?