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

Resolved More performant Point Light Shadows?

Discussion in 'SRP Dev Blitz Day 2022 - Q&A' started by sacb0y, Sep 29, 2022.

  1. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    776
    I've heard some say URP is more performant than BIRP, but only if you exclude point light shadows. And the impact on my game (easily 20 FPS) rivals the impact of toggling raytraced shadows and certain games, maybe worse :p

    Is there a game plan to improve this?
     
  2. sabojako

    sabojako

    Joined:
    Jul 7, 2017
    Posts:
    48
    To add to this, it would be great if you could explain why Shadows in SRP are slower than in BIRP.
     
    tatoforever and joshcamas like this.
  3. LaireonGames

    LaireonGames

    Joined:
    Nov 16, 2013
    Posts:
    696
    It even feels like point light shadows are a bit extreme in BIRP. They are supposed to be expensive (6 draw calls after all) but it still baffles me just how expensive they are!
     
    Last edited: Sep 29, 2022
  4. jiaozi158

    jiaozi158

    Joined:
    May 24, 2020
    Posts:
    23
    I know that it is possible to render point light shadow with only 2 draws rather than 6.

    It's less accurate but faster.

    See this Godot Docs (Dual Paraboloid Mapping).

    Edited: I think cached shadow is a better solution for URP to have performant shadow.
     
    Last edited: Sep 29, 2022
  5. sabojako

    sabojako

    Joined:
    Jul 7, 2017
    Posts:
    48
    DPSM is only good for highly tesselated meshes and static non-moving shadowing point lights that are not too close to surfaces. Even so, there will always be some kind of artifact on the seam between the 2 hemispheres. This is because the pixel data in the shadowmap is stored in a non-linear space, where-as vertex shader can only do linear space transformation. I spent a good amount testing this method with moving lights, thinking it's a holy grail for perf, but there are always unwanted artifacts. Even with hacks. DualParaboloid is better suited for backed data like cubemaps/HDRI.

    Apart from that, there is also Tetrahedron shadowmapping which render 4 faces. :rolleyes:
     
    jiaozi158 likes this.
  6. Elvar_Orn

    Elvar_Orn

    Unity Technologies

    Joined:
    Dec 9, 2019
    Posts:
    158
    Heyhey!

    I mentioned in this thread that I'm currently gathering feedback/requests for shadows and improving performance of Point Light Shadows (and shadows in general) is on that list as well. So to answer your question. Yes there's a plan to improve shadow performance but it hasn't been fully designed right now while I'm still in the gathering phase.

    We consider issues, where performance is slower on URP than BiRP, to be very high priority.
    Can you file a bug report so I can investigate this?
     
    tatoforever likes this.
  7. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    776
    Thats good perhaps one consideration is screenspace point light shadows which Tales of Arise uses.





    I'm surprised this isn't already well documented, I've heard many mention it besides my own experience. XD
     

    Attached Files:

  8. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    On PC and consoles there are GPU features which allow rendering to a cubemap in a single pass instead of six. It would be nice if URP would take advantage of that.
     
    DevDunk likes this.