Search Unity

Lens Flare Showing Through Walls!?!

Discussion in 'Universal Render Pipeline' started by KingShadowClock, Jul 2, 2022.

  1. KingShadowClock

    KingShadowClock

    Joined:
    Feb 17, 2017
    Posts:
    10
    Hey there,

    Hopefully, this gets some traction because I'm thoroughly stumped on this one! There's little information out there, but my problem is this. I turned on the lens flare, and fixed a large lighting problem in my scenes (halo's are amazing!) but gained a big one in return. The flares shine through objects! I've tried...

    Mesh Collision,
    Box Collision,
    Depth Buffering,
    Light Culling
    Lens Flare occlusion (Seems to be completely based on the depth of the object to the camera though, does not fix it shining through objects.)
    and...
    Creating a brand new project and slapping a lens flare on.... same issue.

    What am I missing here? Youtube videos of lens flares seem just fine, and I believe lens flares should naturally be occluded by geometry and not only based on depth. Below is attached a pic of the issue, from the completely new project. Dir light has lens flare, lens flare is pointed towards the ship with a wall that should be occluding it. I can definitely take more pics, answer questions, show settings, etc. Whoever solves this will definitely be my hero!

    currently using Unity 2021.3.1f1 upload_2022-7-2_15-16-53.png
     
  2. watermelon35

    watermelon35

    Joined:
    Feb 6, 2023
    Posts:
    1
    I know right? I've been scratching my head for the longest time until I finally figured it out, all you have to do is enable occlusion. I hope this works for you. good luck!

    - sincerely, Watermelon35.
     

    Attached Files: