Search Unity

Layers pbs when culling with 2 cameras

Discussion in 'General Graphics' started by ERisine, Aug 10, 2017.

  1. ERisine

    ERisine

    Joined:
    Mar 3, 2017
    Posts:
    7
    Hi guys,

    not sure it's the right place for this, but here it is :
    I have 2 cameras, each rendering one different canvas (one in a rendering texture):
    Say, canvas1 with layer1 and canvas2 with layer2.
    But I want that some children objects of canvas1 to be rendered in cam2, so I set those objects layer to layer2.

    But it does not work, layer2 objects of canvas1(layer1) are still rendered in cam1, not cam2.
    Is it a bug or something I missed?
    Is there some workaround to this problem?

    Thanks!
     
  2. ERisine

    ERisine

    Joined:
    Mar 3, 2017
    Posts:
    7
    Ok, I found a (the) solution to this particular pb, for those having the same problem :
    The children of Canvas1 with Layer2 must ALSO have a canvas component attached to them. This way, these children (and their children too) will be properly rendered on Camera2.
     
  3. ERisine

    ERisine

    Joined:
    Mar 3, 2017
    Posts:
    7
    Ok,
    That solution works but only with a world camera, not with a screenspace camera.
    If someone has a solution for screenspace camera...