GPU lightmass doesn't cast shadow (stationary light, static geometry)

Hi, I’m having this section in my level where GPU lightmass doesn’t want to cast any shadow at all from my stationary spotlights. It works perfectly fine with the “standard” lighting build, though. (UE 5.2.1)

I’ve played with all options I could think of, put a big fat cube in the light cone, created a new spotlight in place of the old one, changed the light to static, but nothing helps.

Any ideas why the behavior is so different here? I would love to stick with GPU lightmass, because it produces much nicer shadows in other areas of my map.

Here’s what it looks like after a normal llighting build:

And this is with GPU lightmass - as if the walls aren’t there:

2 Likes

I am experiencing some similar issues with shadows not casted when using gpu lightmass with 5.2.1. The non gpu lightmass appears to work fine, but gpu lightmass indiscriminately seems to cast shadows from some objects but not from others. I am just in the process of porting my demo project to the 5.2.1 version of unreal.

1 Like

Same issue here with 5.2.1, some meshes cast shadows, some don’t and nothing seems to fix it.

2 Likes

Same for me. It feels very random. Sometimes the whole level, sometimes half of it.

It’s as if for some materials the cast ray traced shadows where unticked even though they are not.

I have skipped to 5.3 for now and it looks like the problems are mostly gone. (But some new ones are there)

Tried a lot of different things in 5.2.1 but couldn’t find a reliable cause. Could also be something with Nvidia, DX12…
A static mesh would cast shadows but a duplicate of it might not.

1 Like

I noticed it is some setting in my DefaultEngine.ini (I don’t know which setting), when I use a DefaultEngine.ini from a new project it works well.

1 Like

Okay I finally found the problem and fix:
The shaders wouldn’t compile correctly and use an outdated cache.

Changing the material will fix it because it will compile a new shader cache. But what helped was setting a local shader cache path so that new clean shaders would be compiled.
Here is where you can change the setting:

5 Likes

Great! Thank you so much, that fixed it.

1 Like

The cache solution above is working, but it breaks after a few tweaks so i have to rebuild my shaders very often and its a very long process… Is there any other way we could fix this permanently ? Thx

2 Likes

You are the hero of the day. I’ve been mowing through settings hundreds of times, with no results that were acceptable. It was a shader directory ref. How, did you figure this one out?

If this is still a problem, the post said that just the landscape material could have the shaders reloaded. If that’s true, you should only have change the landscape material to refresh, instead of the entire project.

From the behavior: once a material didn’t cast shadows anymore it would stay this way for this configuration. So I thought it had something to do with how shaders are generated and cached.
Like the material only compiles shader for what is required. So if there is no need for static shadows it would not compile it for it. But when later a need for it arises it would not trigger the correct recompile I think.

Changing the directory would provide a clean place to recompile the shaders properly. Deleting the shader’s from the shared directory should also work.

Okay for everybody having still problems you can look into this one for a fix:

Supposedly they fixed it in 5.4 and someone ported the fix to 5.3.

Look into the solution above:
@LEIT @ProletarianX @PabloNajurieta @kolja_k1 @Henri_arforia @brianegreen

Edit:
Another solution which might work: