Shadows for direct lighting broken after LWRP 2.0.3 [Updated with example projects]

I have a scene with a direct lighting setup with the LWRP. As of version 2.3.0, the shadows looked how I wanted them. I recently upgraded the version to 3.0.0, and suddenly everything looks terrible. To double check things, I downgraded to 2.5.0 and it still looked bad. Moving all the way back to 2.3.0 returns my shadows to how I want them to look. I have two examples, the first at version 2.3.0, the second at 3.0.0.

Vs. 2.3.0
Project file: https://drive.google.com/file/d/1gHAbA0IQywTkZ43N3CQ1Ew72p2BgKi58/view?usp=sharing

Vs. 3.0.0
Project file: https://drive.google.com/file/d/14-dLiWUm096Q9-NUGCFajjH-m7_hGsUA/view?usp=sharing

My light is positioned right near the origin. If you run the example projects you can see the shadows projected on the back look ok near the center point, but as I move away from origin, things get very grainy and bloated. Once you reach a certain distance, the shadows disappear entirely. Between these two versions, no code or settings have been changed.

I think this is a bug with the shadow projection, but it’s possible the API changed and I’m missing a setting.

Any devs out there, should I be filing a bug report for this?

Hi,

This is due to a shadow cascade bug we have recently, its been causing some issues with how directional shadows are rendered if you have cascades set. We have fixed the bug and it’s in the process of being put out as a new package, so should be available next week, for now you can turn off cascades and lower the shadow distance.

If your project isn’t going to have far draw distances(the project looks like a side scrolling type of game?) then you will be paying extra cost of cascade shadows without the need, so it might be best to disable then on the pipeline asset anyway.

1 Like

Thanks for the response. Glad to hear that it’s resolved! Also, thanks for the recommendations. Indeed, we have a sidescroller project, but in our actual project, at least in one scene, we hope to have a pretty far background with long projected shadows to give it some depth and interest. Does your recommendation still stand in such a situation? In other situations, I will definitely look into your proposed suggestion.

In this case you will need shadow cascades, but depending on the separation between foreground and background layers you could get away with only two cascades vs the default 2 maybe, I would definitely have a play with the cascade distances and count to see whats best/what you can get away with as each cascade renders all your objects again from a great distance, doubling draw calls, in saying this the shadow draws are quite fast as they are simple.

1 Like