Search Unity

Feedback Performance - Shadow filtering quality should have a mode that only affects Directional Lights

Discussion in 'High Definition Render Pipeline' started by PutridEx, Dec 16, 2022.

  1. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    Currently, high quality shadow filtering provides better shadows for directional light at an acceptable performance cost. This is not the case for other lights, like point lights, which can't be set to medium quality filtering without setting it for the directional light as well.

    Point light high quality shadow filtering has a massive cost that can't be cached. It will run no matter what, the additional performance cost is added to "deferred lighting", as seen on the GPU profiler.

    We really need separate filtering mode for the directional light, similar to how area lights have their own shadow filtering mode.

    And so, you can't have better soft directional light shadows if your project utilizes point light shadows at all, as point light shadows with high filtering cost an insane amount that can't be cached.

     
    Last edited: Dec 20, 2022
    florianBrn likes this.
  2. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    A single point light shadow with shadow filtering set to high costs 1.3ms + shadow cost.
    That 1.3ms is added to Deferred lighting on the GPU, and it can't be cached.

    so overall:
    1 point light shadow, high filtering: 1.3ms (deferred lighting cost), 0.1 (shadow cost)
    1 point light shadow, medium filtering: 0.1ms

    cached:
    1 point light shadow, high filtering: 1.3ms
    1 point light shadow, medium filtering: 0ms

    As you can see, pretty crazy. Directional light high filtering cost is reasonable and gives really good quality, but you can't use it without applying the same to point light shadows.
    GPU: RTX 2070 super

    scene for the test (one point light shadow):
    Unity_Y9bD7y5gvT.png
    performance measured with unity's GPU profiler, 2022.2.1
     
    Last edited: Dec 20, 2022
  3. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    this is probably the same for spotlight shadows as well, but to a lesser degree. Haven't tested it out though.
     
  4. Kabinet13

    Kabinet13

    Joined:
    Jun 13, 2019
    Posts:
    129
    This is finally an option in 2023.2!
     
    cLick1338 and PutridEx like this.