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

Shadow caching and static objects

Discussion in 'High Definition Render Pipeline' started by sebas77, Mar 21, 2022.

  1. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,594
    is there any kind of optimization that caches shadows for static lights and static objects while shadows are still computed for dynamic objects?

    I am not talking about baking, I am talking about run time shadow caching.
     
  2. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193
    Yes! But unfortunately will need to manually tag static object with a separate flag.

    More info in the docs under the mixed cached shadows section https://docs.unity3d.com/Packages/c...h-definition@14.0/manual/Shadows-in-HDRP.html

    In general everything shadow caching is under the Shadow Update Mode section.

    Note that for directional lights (though all the caveats mentioned in the doc very much hold) you need to enable the option on the HDRP asset as it is causing extra memory to be allocated.
     
    olavrv likes this.
  3. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,594
    thank you!
     
  4. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,008
    Just remember that when you use onDemand or onEnable for shadow generation you are still limited by the number of shadowmaps.
     
    sebas77 likes this.
  5. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    588
    where i can rise the number of shadowmaps ? the editor tells me i have to make the cashed shadow atlas bigger but was not able to figure out where ? the rendering light explorer doesn't allow me to change anything
     
  6. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193
    In the HDRP asset
     
    blackbird likes this.
  7. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    588
    thank you ! i did that but when i set it for the value of 4 didn't work out then i set it to 11 didn't work out too but when i set it at 10 and worked , is ths that bug ?

    it works only when the value is 10 any explaination why ?