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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Resolved Why do cached point light shadows still have a massive performance cost? No GPU cost improvements

Discussion in 'High Definition Render Pipeline' started by PutridEx, Oct 13, 2022.

  1. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,126
    I have a few point lights with shadows on, extremely low res 170.
    shadow update mode is set to on enable, and yet the cost is still significant compared to the same lights with disabled shadows. Actually, it doesn't give any gains for the GPU, based on the built-in GPU profiler module.


    Without shadows: (GPU cost)
    Deferred lighting: 3.1ms
    Volumetric lighting: 1.0ms

    With shadows (every frame) (GPU cost):
    Deferred lighting: 11ms
    Volumetric lighting: 1.8ms

    With shadows (on enable only) (GPU cost):
    Deferred lighting: 11ms
    Volumetric lighting: 1.8ms

    There's no noticeable improvement on the GPU, I can see improvements for the CPU.
    Is this expected? If so, why? is it a limitation, because from my experience with cached shadows in other engines it usually provides big perf gains for the GPU as well.

    Tested in-editor only. 2021.3.11
    I really need those shadows :D

    edit: updated, check first post
     
    Last edited: Oct 13, 2022
  2. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,126
    little findings: High quality filtering for point light shadows has a way bigger cost then I thought :D
    So, when using medium filtering, shadow caching does give a noticeable GPU improvement!

    when using high quality shadow filtering, it seems caching does actually improve the GPU Cost of shadows specifically. But when shadows are enabled, high filtering adds a massive performance increase to 'deferred lighting' that isn't affected by caching or not, if shadows are on, the cost will be there.
     
    Last edited: Oct 13, 2022
    tmonestudio, radiantboy and akent99 like this.
  3. merpheus

    merpheus

    Joined:
    Mar 5, 2013
    Posts:
    199
    What I dont get is why does the high filtering adds a giant cost to deferred lighting itself.
     
  4. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    That's the cost of sampling the shadow maps several times per pixel to smooth the shadows, for each shadow-enabled light that affects that pixel.