Rectangle light not working with distance field shadows

Rectangle light stops working as soon as I turn on Distance field shadows. How do I fix this? I am using mac book pro


Distnace Field shadows off


Distnace Field shadows on

What does it look like with RT shadows or VSMs?

VSM is on in the first image. I am getting hard shadows with VSM

That does make sense. In general, VSM can’t do plausible area light shadowing, so I see why you’d want to use DF shadows. Inadequate SDF resolution can often be the culprit, could you post a visualization of your mesh distance field scene? Ina

The light is too close to the wall/ceiling, move it away and it should be fine.

Worth noting that rect light shadows can’t be reasonably approximated by anything except hardware raytraced shadows. Distance field shadows still treat the light as if it were coming from an infinitely small point, same as shadowmaps.

1 Like


Not to be pedantic or anything, but the Epic documentation says that distance field shadows allow for a measure of soft shadows with area lights, and in my experience, it works quite well. I believe the game Stray makes extensive use of DF shadows to get the dynamic geo to match the lightmap presentation. Of course, that means nothing for rect lights.

It does provide plausible soft shadowing, but it’s simulated as if the light were an infinitely small point. This works fine for things like streetlights, table lamps, etc… but it becomes a problem when you have a large (or long) source area.

You can see that with an extremely long rect light such as the OP was using for strip lighting, the shadows are still being cast from a point at the center of the light (rather than a proper “area”), an issue that goes away when you switch to raytraced shadows:

Unrelated tangent

I would have agreed with you in UE4, in UE5 I frequently run into blocky artifacts and haven’t really figured out why. But that’s for another topic :slight_smile: