Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question URP and UI canvas Culling Mask

Discussion in 'Editor & General Support' started by Loki18000, Jan 11, 2021.

  1. Loki18000

    Loki18000

    Joined:
    Apr 1, 2015
    Posts:
    75
    Hello,

    I've never really had to fix this type of issue before although I have come across it.

    I'm using URP in building a VR game and I've added a Canvas set to World Space and I need to fix the whole seeing the UI through GameObjects rendering layer issue. I didn't know (I haven't done a lot of work in URP) that it doesn't support having another Camera render only the UI using the Flags and Culling mask and so on.

    So how would I go about fixing this issue? I'm a little lost on how to proceed. Thanks!
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,520
    You speak of this like it's a known thing. I just fired up an URP project and dropped a world space canvas in with some text, scaled it up to interfere with some objects, and it works as expected.

    This image is from the Unity default URP scene for Unity2019.4.15:

    Screen Shot 2021-01-11 at 4.19.03 PM.png

    And this is the canvas setup:


    Screen Shot 2021-01-11 at 4.19.16 PM.png
     
  3. Loki18000

    Loki18000

    Joined:
    Apr 1, 2015
    Posts:
    75
    Sorry to have wasted your time, Kurt. It was showing through GameObjects in the editor when the game is playing its working fine.

    I do remember having this issue a lot in the past and I had to create dual cameras to make it work correctly. I also remember having to use a shader to fix the issue too. Dear god I hope I haven't been doing it wrong all these years!

    Quick Edit:
    It's all working perfectly now. I was doing something wrong but I don't know what.

    Regardless thank you Kurt.
     
    Kurt-Dekker likes this.