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. Dismiss Notice

Bug URP shadow flicker after upgrading to 2022.3.1f1 LTS

Discussion in 'Editor & General Support' started by makidrone, Jun 14, 2023.

  1. makidrone

    makidrone

    Joined:
    Apr 23, 2018
    Posts:
    2
    I upgraded my project from 2021 LTS to 2022.3.1f1 LTS and everything has been fine except for one of my scenes. In the editor, I don't have any issues but after I've made a build, I get terrible flickering (see video). I've messed will all kinds of settings and figured out the issue seems to be related to the "Universal Render Pipeline/Lit" shader (including the other lit shaders). If I replace the materials' shaders in question with custom Amplify shaders that also use opaque alpha cutout, the issue is gone. I've tried looking at the shadow caster pass but haven't been able to figure out what's causing the alpha clipping issue. I'm using 4 shadow cascades and the nearest one doesn't seem to have the issue, but the others do. If I set my project to 1 shadow cascade, the issue persists. If I remove most of the affected meshes and leave only a handful, the issue is gone. I never had any problems like this with the previous version of Unity.

    Thank you for taking a look. It's been frustrating trying to debug.

     
  2. LightJockey

    LightJockey

    Joined:
    Jan 24, 2014
    Posts:
    6
    Same thing here. Found this issue but that was not my case sadly. It seems to be related to LOD groups since shadows render fine with a single mesh renderer.

    Edit: disregard the last LOD part, more than a handful of renderers will cause the issue regardless of them having LODs or not, as you stated. Also this has been around for a while now, I think it showed up sometime around April in the 2022.2 release.
    I will try to see if I can repro'd it in a small project if you haven't done that already, then I'll open an issue on the tracker

    Edit 2: alright I've put together a small project with the issue and sent a bug report. Will report with updates
     
    Last edited: Jun 17, 2023
    TwiiK likes this.
  3. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    Experiencing the same. For me there are no visible issues in the editor in scene view if I'm not in play mode, but if I enter play mode I get issues both in the game view and the scene view. I get the same issues if I build as well.

    The most visible issue is that there seems to be a circle around my camera where I get no shadows or completely broken shadows for most objects, but not all objects. I found another post which led me to this article: https://docs.unity3d.com/Manual/ShadowPerformance.html
    But changing the shadow near plane offset or any other shadow or camera related setting made no real difference to this problem at all. Also shadows are constantly flickering or appearing/disappearing based on camera position/rotation like you show here.

    This is literally the first time I've decided to try and actually use URP for a project and it's broken straight out of the gate. This is ridiculous. I would change back to built-in in a heartbeat if it wasn't for the fact that this project is based on an asset only supporting URP. I chose Unity 2022 LTS for this project because I thought it had the best chance of not being broken, but I guess that's too much to ask.

    I was on 2022.3.0f1, and I just upgraded to 2022.3.2f1, but it made no difference.
     
    crandellbr likes this.
  4. LightJockey

    LightJockey

    Joined:
    Jan 24, 2014
    Posts:
    6
    Trigve, TwiiK and Lars-Steenhoff like this.
  5. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    Thanks for investigating, but this is not fixed in 2023.1.0f1 btw. I downloaded that and tested my project there now. Same exact problem for me. Insane flickering depending on camera movement seemingly both caused by shadows switching between casting from the entire polygon and the alpha clipped texture, as well as the shadows just toggling on/off constantly in the distance.

    This works like it should in 2021 LTS. I tested in 2021.3.27f1, but I still think I'll just revert this project to built-in. I'm sure it's just a question of time before I encounter the next glaring issue with URP in 2021 LTS that would require me to upgrade to a later version to fix it.

    I feel like in my 15+ years of using Unity I've never encountered an issue (in built-in) that was as glaringly obvious as this.
     
  6. LightJockey

    LightJockey

    Joined:
    Jan 24, 2014
    Posts:
    6
    Hmm, I tested mine and shadows look fine when building the player with 2023.1.1f1.

    I totally get what you're saying though, hopefully Unity will get their S*** together with URP sooner rather than later because it's getting ridiculous at this point. How long has it been in development now, 5+ years? Yet internals are still changing every major release.

    It's been a nightmare so far, found myself rewriting my custom renderer features at least 3 times already and for virtually no gains over built-in. Tbh I feel like URP should still be treated as an experimental package, dunno how HDRP is faring but at least it's got plenty of more features to justify the occasional mess up
     
    crandellbr likes this.
  7. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,001
    Don't use new LTS versions, they are generally as bad as their TECH releases, give it like 6 more months.
     
    LightJockey likes this.
  8. Sobrtonog

    Sobrtonog

    Joined:
    Sep 28, 2019
    Posts:
    15
    I'm having the same issue... kind of shocked that such a fundamental problem exists in a LTS version.
     
  9. Wintermute-

    Wintermute-

    Joined:
    Sep 5, 2017
    Posts:
    53
    I encountered this issue as well. Problem appears to occur with objects that have materials with alpha clipping and static batching on. A work around is to disable static batching, provided it doesn't affect your project's performance.

    I will try a 2023 version and see if it still occurs.
     
  10. Wintermute-

    Wintermute-

    Joined:
    Sep 5, 2017
    Posts:
    53
    I still get the error in 2023.2.0b7, less noticeable but still happens at times.
     
  11. Takaaki-Hoshiyama

    Takaaki-Hoshiyama

    Joined:
    Apr 6, 2014
    Posts:
    2
    2022.3.5.f1 -> NG
    2022.3.9.f1 -> Fine!
    (Maybe 2022.3.6.f1 fixed)