Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

Lens Flare Showing Through Walls!?!

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

  1. KingShadowClock


    Feb 17, 2017
    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.)
    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


    Feb 6, 2023
    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: