Download

Change how Shadowing work or: Soft Shadows are impossible

For days I tried to find a good technique for shadowing and Lighting my levels and I couldn’t find any solution that looks good.
I encountered multiple issues with both Distance Field Shaodws and Cascaded Shadow Maps:

  • Cascaded Shadow Maps (CSMs) turn every shadowing into dynamic within the Dynamic Shadow Range

  • Baked Soft Shadows (Area Shadows) are only soft when they are out of the Range

[LIST]

  • Baked Shadows should stay baked, even in the CSMs
  • Only dynamic Objects should be put into the CSMs (isn’t that the actual purpose of them anyway?)

Distance Field Shadows are rendered behind the CSMs, which doesn’t really make sense to me

  • DFSs have the advantage that they are also soft/have the ability to appear soft. Having Soft Shadows is more important when I am near the shadow, not when I am far away(= behind the CSMs) from it

[/LIST]

https://i.imgur.com/aDUVQ5t.png

Soft Shadows can really improve the appearance of the scene, but I only manage to make them without CSMs and without DFSs (or they only appear far away, where they absolutely don’t matter anymore)

My suggestion:
Allow the developer to change the order of Shadowing.

Distance Field Shadows before (near the Camera) Cascaded Shadow Maps

Baked Shadows should not disappear when I am in the CSMs either, it destroys the purpose of Precomputed Shadows.

I’m curious, is your light Static or Stationary?

Stationary, otherwhise I wouldn’t have dynamic shadows

a Static Light will still give you dynamic shadows on movable objects, which I think is what you’re looking for

Static lights don’t affect dynamic objects at all except for the light probes.

Not really.

I want to have Baked Shadows (Soft shadows) together with CSMs or DFFs. But I can either have dynamic Shadows or static shadows. Not both at the same time within a certain range.
There is the possibility to don’t using CSMs or DFSs, but then the Dynamic Shadows disappear at a very low distance already.

my bad, stationary it is then.
and this switch to CSM happens with static objects? if so then it really is a bad behavior

Yeah, it’d be nice to keep Baked shadows together with CSM dynamic shadows. I mean they work with regular dynamic shadows, too…

You can enable percentage closer soft shadows to help with that. I think the console command was something like r.shadowfilteringmethod, set it to 1 to enable PCSS

You can use inset shadows for movable objects if you do not want to use CSM.

I also noticed something
(Working without DFSs and without CSMs):

Stationary Directional Light Shadows of Moveable objects disappear always at the same distance, regardless of Fade/Min/Max Resolution and radiusthreshold.
This is not the case for a moveable Directional Light. The console vars only work for Directional Moveable Lights!