Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Resolved SRP Batch shadow glitch

Discussion in '2021.2 Beta' started by pez, Aug 12, 2021.

  1. pez

    pez

    Joined:
    Jul 6, 2013
    Posts:
    52
    Hi,

    So I have this massive shadow glitching on & off over my entire scene when certain conditions are met.

    Vid for ref (the game is paused) :


    It happens when I have more than 1 particle system emit & each have the render mode set to mesh with cube as the mesh. Mesh GPU instancing is also turned off on all the particle systems, as that was causing meshes from one system to appear in another.

    I've tried to find out what is happening with the frame debugger but it's not very helpful. Selecting the same SRP batch sometimes shows the glitchy shadow and sometimes doesn't, it's completely random.

    It also doesn't draw any mesh in the scene, just a shadow.

    Anyone know of a fix?
    Thanks,
     
  2. pez

    pez

    Joined:
    Jul 6, 2013
    Posts:
    52
    Did some debugging by periodically removing things from the scene to see when the glitch would stop.

    Turns out that it was caused by another shadow casting point light in the scene (a small campfire) which coupled with the particles was completely destroying the shadow map I guess.

    Quick fix for me was to just remove particles and fx from the culling mask on any additional lights in the scene.
     
    Ruchir and LeonhardP like this.