Search Unity

Unity UI Cull a Screen Space - Overlay canvas on camera.

Discussion in 'UGUI & TextMesh Pro' started by robertslr, Aug 23, 2017.

  1. robertslr

    robertslr

    Joined:
    Sep 24, 2015
    Posts:
    11
    Hello all,
    I'm currently working on a project and struggling with a small issue.
    I'm almost done working on Blur Effect and the last issue I have is that I need to cull, or make invisible, a Screen Space - Overlay Canvas from a Camera.
    I'm currently using a main camera to draw the entire screen for gameplay purpose, and another one to create a Texture, Blur it using a RenderTexture and then apply it to an UI, creating an effect similar to the Apple system UI.
    I was able to include all UIs inside the Texture I make, in order to blur UIs on the background.
    The downside is that ALL the UIs are included inside the Texture before the "Blur" operations, including the one in foreground which shouldn't blurred. Of course this is not ideal.
    I thought I would be able to not show the foreground UI by simply set it on a Particular "Layer" and then remove the it from the second camera culling mask. Unlucky this effect (which work on Screen Space - Camera setting) is totally ignored on Screen Space - Camera Overlay UIs.
    At this time converting the entire UI to Screen Space - Camera is not a valuable option for us.
    Do anyone of you know if there's another way to cull a particular Screen Space - Camera Overlay UI from a camera?
    Thank you in advice.
     
    Griffo likes this.
  2. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    I would like to know the answer to this to ..
     
  3. AronTD

    AronTD

    Joined:
    Aug 31, 2013
    Posts:
    22
    Bump...is this even possible?
     
  4. FelipeMendez

    FelipeMendez

    Joined:
    Jan 26, 2014
    Posts:
    1
    This would cull all canvases you could narrow it to a tagged canvas perhaps

    Code (CSharp):
    1.  
    2. foreach (CanvasRenderer canvas in GameObject.FindObjectsOfType<CanvasRenderer>()) {
    3.             canvas.cull = true;
    4. }
    5.  
     
    xujinm likes this.
  5. xujinm

    xujinm

    Joined:
    Dec 11, 2018
    Posts:
    13
    just work!!! thank you