Search Unity

[SOLVED] UI being affected by camera effects

Discussion in 'UGUI & TextMesh Pro' started by Raitoning, Jul 18, 2015.

  1. Raitoning

    Raitoning

    Joined:
    Dec 13, 2014
    Posts:
    100
    Hi everyone,

    My UI is affected by camera effects. I set the Render Mode of the UI to "Screen Space - Camera" to do some kind of 3D effects based on the rotation of the Panels. But It get affected by camera effects. If I put the Render Mode to "Screen Space - Overlay", if won't get affected by effects, but I can't have the same 3D effects with Panels. Does anyone know how to have a Canvas with Render More set to "Screen Space - Camera" which is not affected by camera effects ? Thanks for reading me :D

    Edit: Solution: Add a second camera to your scene and put the "Culling Mask" to "UI", and on your first camera, uncheck "UI" from the "Culling Mask", and it's done. Thanks to BoredMormon for the solution.
     
    Last edited: Jul 19, 2015
  2. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Dual cameras.

    Have a separate camera to render the UI on top of the game, without the camera effect.
     
  3. Raitoning

    Raitoning

    Joined:
    Dec 13, 2014
    Posts:
    100
    Hi, this is working, thanks :D But that sounds like a workaround, is that legit to use multiple cameras on a scene to render different parts ? That seems strange... Does that have any performance impact, because there is two camera, so basically two renderer and drawcalls x2, and so on...
     
  4. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    It's reasonably common practice. It typically doesn't up the draw calls by much, you switch the layer masks around so that each object is only rendered by a single camera.
     
  5. Raitoning

    Raitoning

    Joined:
    Dec 13, 2014
    Posts:
    100
    Okay, so it's just like multiple layers in image editor like Gimp or Photoshop then ?
     
  6. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    I believe so. There are some cool things you can achieve this way, but it's getting outside of my area of expertise.
     
  7. Raitoning

    Raitoning

    Joined:
    Dec 13, 2014
    Posts:
    100
    Alright, thanks for your help ^^. I'll add your name in my credits as "UI debugger: BoredMormon" or something like this, if you want. I'll put "[SOLVED]" in the title of the thread and put the solution in the first message, if someone has the same problem as me. Thanks for everything :)