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 Issues with Lens Flare and a dedicated ui camera

Discussion in 'General Graphics' started by chrfwow, May 19, 2023.

  1. chrfwow

    chrfwow

    Joined:
    May 19, 2023
    Posts:
    1
    I am currently facing the problem that my lens flare (srp) is blocked by my Ui Camera (?). My camera setup is as follows: a MainCamera, which renders everything except the ui layer, and a Ui Cam, which only renders the ui layer. The MainCamera is a depth -1, and the Ui Cam at 0. This ordering is necessary, because otherwise the ui would not be visible at all, as it would be rendered behind the Main Camera.

    In this ordering, the Lens Flare, which is attached to my directional light is not rendered in game view, but it is rendered in the Scene View, and also in the preview of the Main Camera in the Scene View.

    When I invert the ordering or disable the Ui Cam, the ui becomes invisible (as expected), and the Lens Flare becomes visible. So I assume that somehow the Ui Cam blocks the Lens Flare.

    I tried adding the Flare Layer to both cameras and disabling it on the Ui Cam, but to no avail.

    My project uses the HDRP.

    Does anyone have an idea how to fix this?