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
  3. Dismiss Notice

Question How to use HDRP mixed cache shadow map correctly?

Discussion in 'Graphics Dev Blitz Day 2023 - Q&A' started by jiraphatK, May 24, 2023.

  1. jiraphatK

    jiraphatK

    Joined:
    Sep 29, 2018
    Posts:
    312
    This feature on first glance seems good. More way to optimize shadow. But in real game environment that's larger than a simple room, with many light, the cached shadow map get filled up pretty quickly, and then all other lights wouldn't fit into the atlas anymore. and then...what? Is user expected to manage this themself?
    1.Disable light that doesn't have any shadow on the view to free up space on the cached shadow map?
    2.Rescale the shadow map resolution of light that is far away so it doesn't take up too much space in cached shadow map?
    3.Does mixed light(with Distance shadowmask) automatically unreserve its spot on the cached shadowmap if it is fallback on shadow mask?

    all this seems super hard for me and I'm struggling to find the use case for this feature currently. All my scenes need to support way more light than I can fit in to the cached shadow map. and I don't know how to do #2 or #1
     
    sabojako likes this.
  2. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    936
    Hi, yes as you highlight the shadow cache system isn't an automtic system to allow you to feed any numbers of shadowed lights. It is an additional tool to improve performance, but not a silver bullet depending on your scenario.
    What most game are doing with this system is some kind of management layer, where they define manually which lights need to be cached or not and decided when to refresh them via script.

    Typical dungeon game with lot of room will have such management layer, where cached light will be enabled on room loading /open/close door etc... We have seen great performance improvement on game mastering the system.
     
    jiraphatK likes this.