Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Directional Light + Angular Diameter = Frames Drop

Discussion in 'High Definition Render Pipeline' started by BRGames_, Jul 3, 2023.

  1. BRGames_

    BRGames_

    Joined:
    Jun 24, 2021
    Posts:
    20
    I'm encountering a significant decrease in frame rate when I assign a value of 30 to the Angular Diameter of a Direction Light in Unity 2022.3.0 with HDRP. Even when using other non-zero values, I'm observing some frame-related problems. I'm curious to know if this issue is a software bug or if the mentioned parameter significantly impacts performance.

    value.PNG

    To provide additional context, I require the value to prevent the light shape from being reflected on reflective surfaces. As a temporary solution, I utilized light layers and completely excluded those meshes from receiving directional light. In my current setup, this approach is acceptable as the meshes receive light through reflection probes. However, I'm curious about alternative methods to address this problem.
     
  2. cLick1338

    cLick1338

    Joined:
    Feb 23, 2017
    Posts:
    74
    For your contextual issue, have you tried disabling "Include Sun In Baking" under the Physically Based Sky settings of your volume(s)?
    Maybe you want a copy of the light with "Affect Specular" disabled that only affects the objects in that layer?
    I'm just guessing here, images of what look you're getting vs what look you want would be helpful.

    As for the angular diameter, I think the framerate drops because (if shadow filtering is set to high) it forces it to compute extremely soft shadows, outside of the intended scope of the PCSS shadows feature.
     
    BRGames_ likes this.
  3. BRGames_

    BRGames_

    Joined:
    Jun 24, 2021
    Posts:
    20
    Thank you for your answer (my apologies for the delay). Even with Include Sun In Baking the issue is there. It seems that as you are suggesting the extremely soft shadows are killing the performance
     
  4. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    595

    My guess is that because it's one of the first points of lighting the size is related to processing needs of Specular highlights and shadows. Maybe check to see if the size affects them when profiling.