How do I fix spiky shadows in UE5 Preview 2

Hey,
For quite some time am I trying to fix those shadows, I tried multiple console commands and all different settings but couldn’t fix it. Whatever I do the shadows keep having those spikes.

sadly I cant use the Source Angle of my Direction Light because I use it as the sun in the render.
the problem also doesn’t come from the Mesh since I also tried it with the standard cubes from unreal engine.

Is there any way how I can fix those Shadows?

I think you’re using static lighting? In that case, it’s the lightmap density of the window sill.

An easy fix is to use a moveable directional light.

1 Like

the directional light is moveable but it still makes those shadows, unless I have to also change it other settings

On default settings, it shouldn’t do this.

No other lights?

no, its the only light source apart from the sky light.

These two are just cubes, right?

image

What happens when you put a cube where the sill is?

ye, those are standard cubes from UE and no matter where I move them the shadow doesnt change, the reason why the first shadow is stronger then the other is because there is glass in between the cubes and the lower part of the window and the glass makes the shadow look stronger.

Mmm, could be something to do with refraction. Can you try changing the glass material?

I changed the glass material to a full transparent material but the shadows stay the same

Ok, now I’m suspecting virtual shadow maps. I think if you turn that off, it goes away…

1 Like

ok, I changed it from virtual shadow maps to shadow maps, the shadows are a lot better now, just at some parts they look like they nearly completely disappeared but if there is not a better way I think that’s the best solution.
ty a lot ^-^

It’s because the sun is low in the sky ( I think? ). Here’s a a thread about it:

ah ty a lot, i will check that out ^-^

Do you have ray-traced shadows available? If so, switch to those and it massively increases general shadow quality. VSMs have CVars that can correct aliasing and clipmap errors, but I don’t know them off the top of my head unfortunately.

You can try “r.Shadow.Virtual.ResolutionLodBiasDirectional” with -1 to -2 if you still want to use virtual shadow maps.

It might just be the shadow terminator problem, normal lighting not aligning with a lower-poly mesh, but I wouldn’t know without an example. Is it self-shadowing or shadow-casting, or both?

Not sure if you still have this problem but I may have a fix for anyone still struggling with it.

If you have a post process volume in your scene, change the Exposure Metering Mode to ‘Auto Exposure Histogram’. Then change the Exposure Compensation to suit.