Help pls with darkening shadow based on angle

Hi, can anyone help me with this? I use masked materials to cut off parts of the building at runtime. I use Ultra Dynamic Sky (and only ultra dinamic sky). I tried a huge amount of things, I could not list it all. But having a separate sky light didn’t solve it (didn’t try every settings).



From this angle it looks fine.


This is another angle where it’s bad.

I don’t know if you can tell me what the problem or the possible solution is trough these images. Maybe you’ve seen it already.

I need these shadows. And there are a lot of meshes, some bigger, some smaller. There are some double faces, but I tried to keep them to a minimum. I don’t really have the capacity to further clean it up. If there are settings that can help me, please tell me.

The one thing that helped (but did not solve my problem completely) is turning off “Use hardware ray tracing when available” at project settings. But even now it’s still bad. I made the images before using these settings so the problem can be seen better.

Thanks in advance!

Use the shadow pass switch node in the material to make the masked part only apply to the main pass and not the shadow pass. Then the interiors will have normal shadows that are unaffected by your cutaway.

Thanks, I’ll try it out right now.

I forgot to mention that beforee I was using 5.0 and 5.1, there was no such problem. But after a while I got back to this project, Ultra Dynamic Sky update had issues and I had to reimport and a few settings were reset (but I think I got the right settings), and I updated to 5.4. I’ll get back to you whether the material changes solved the problem or not.

Nothing changed sadly. The problem must be with something else.

Are you using raytracing? You may need to use the raytracing quality switch instead. Shadow pass switch only works with VSM and CSM shadows.

Yes I’m using ray tracing. In project settings all Ray Tracing options are ticked. Virtual shadow maps on/off, still didn’t help.

I list a few thing I tried since:
Turning off Ray Tracing, which helped somewhat, but introduced other problems (if we don’t find better options, it’ll do).
Changing Lumen to Screen Space (Beta) completely solved the problem, but the quality of the shadows obviously dropped everywhere else, which isn’t great.
I obviously tried changing UDS settings (most of them, maybe I missed some), ambient and sun light intensity, sun angle (sun angle helped a bit when set to max, but obviously that’s not a real option). Tried adding SkyLight, changing project and world settings. Maybe I just missed the right things to change, but nothing seemed to help aside from what I previously stated.

I think I found the solution: In UDS, under post processing, there is a Skylight Leaking option. I set it to 0.2, and now it’s all good.

The problem was that this setting did not apply instantly at runtime, so it was hard to find. I don’t exactly know what other effects this has, if I’ll have any problems later on because of this. But the initial problem is solved by this.

This did not completely solve the issue, in some angles the shadows still get stronger than then should, but it’s servicable now. If anyone knows what can make this better, please tell me.