LWRP Multiple Directional Lights (only one with shadows)

Having trouble getting multiple directional lights to work with the LWRP.

It seems that feature was supposed to be supported once the LWRP came out of preview and the settings assets that the LWRP template generated do indeed appear to have options for additional lights.

I also found LWRP directional lights , which seems to be the only thread on this since the package came out of preview? I really don’t understand the suggestion in there, though. (Also I need the second light to be realtime.)

I have shadows turned off on the second directional light, and both are set to “realtime”.

All the LWRP settings are set to “per-pixel” and support 4 additional lights.

The second light doesn’t impact the scene unless the intensity is set so high it overrides the primary light so that only it is rendered…

Any idea what I might be doing wrong? I can post the full settings if necessary. Most things are the defaults, but Fog is off, I have a custom skybox, and SMAA is on.

1 Like

Ok, I can confirm that with the default LWRP template this issue is also present. Adding another directional light there does nothing, form any angle, unless it’s settings are so strong that it overrides the first.

My project is based off of the LWRP template. And also this is very to confirm as working in the default renderer.

Unity Issue Tracker - Only one directional light can emit light when using LWRP implies this is “fixed” but is is absolutely not.

Ok I found the following code block and comment in LightweightRenderPipeline.cs …

// LWRP doesn't support additional directional lights or point light shadows yet
if (visibleLights[i].lightType == LightType.Spot && light != null && light.shadows != LightShadows.None)
{
    additionalLightsCastShadows = true;
    break;
}

I am going to open another issue tracker issue since it appears that one was erroneously closed.

1 Like

They still haven’t fixed it.

I use multiple directional lights in URP. IT works fine. Unity 2019.3.10f1

This problem is still here.

Report a bug :slight_smile:

no :face_with_spiral_eyes:

Then you don’t have a problem, right?

Not with shadows, you don’t.

I don’t but I’ve definitely had multiple shadow casting lights in my project working as a test until i saw the framerate on device.

i think i had directional and spotlight shadows though, not multiple directional.

There is a problem, but it’s easier for me to solve it differently than to report and wait

Same here, did you solve it?

no

Still seeing this problem, not even using LWRP. How do we submit a big?

Is this intended or a bug? Can’t seem to find an official post about it(by a unity dev).

For anyone else coming across this its marked as by design

Dot product in shader with normal and a direction (for the fake-light) gives you basic directional lighting for free, for as many lights as you want. Obviously no shadows, but this is a very common way games would shade in the past when lacking lights.

Added in case it helps anyone.

1 Like

Still there. Feature is needed to emulate shadows different by stength for close and far (ambient) objects. Idea was to separate such objects by layers and use different culling mask for each directional light.