Search Unity

Resolved Multiple directional light shadow maps

Discussion in 'High Definition Render Pipeline' started by FOXAcemond, Dec 20, 2020.

  1. FOXAcemond

    FOXAcemond

    Joined:
    Jan 23, 2015
    Posts:
    99
    I'm stuck with using spot lights in my project to "simulate" additional directional lights and that just looks bad.

    I would really appreciate the possibility to enable multiple directional light shadow maps.
     
  2. DrSeltsam

    DrSeltsam

    Joined:
    Jul 24, 2019
    Posts:
    101
    Having more than one directional light casting shadows would be quite helpful. I've implemented a day-night-cylce and there is a short period of time where both the sun and moon are active (both are directional lights). I can't use shadows for the moon light currently due to this limitation (although I understand that such a feature won't come for "free" in terms of performance). AFAIK Unreal allows you to have more than 1 shadow casting directional light, but I'm not sure about that.
     
    FOXAcemond likes this.
  3. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Hi, our directional light used cascade shadow map and we support only one cascade shadow map in a view. Cascade shadow map are already expensive to render.

    You can have multiple directional casting shadow with using our Box shape with spot light, which allow to create a local direction light that can cast shadow (don't rely on cascade shadow map).

    To mimic both shadow from sun and moon at the same time, will suggest to fake it with one additional local directional light the time of the transition, having two cascade shadow map will be really performance heavy if it was possible.
     
  4. FOXAcemond

    FOXAcemond

    Joined:
    Jan 23, 2015
    Posts:
    99
    Hello @SebLagarde,

    The thing is, I'm not even using the cascade shadows since the camera is fixed in my project...

    BUT I just discovered the advanced setting "Range Attenuation". That mimics a directional light alright :)
    My problem was the non uniformity of the light that was cast. Great, problem solved for me. Thanks!
     
    himchancho likes this.
  5. FOXAcemond

    FOXAcemond

    Joined:
    Jan 23, 2015
    Posts:
    99
    I've also been reading UE forums, but from what I gathered, even though it's possible with UE4, it's very expensive. So maybe it wouldn't be wise to add that possibility at all. Box projectors (with the right settings) work just fine.