Low resolution shadow using Virtual Shadow Maps

Hi!

Since several weeks, I’m working on a shadow resolution issue that appears when I use Virtual Shadow Maps on Unreal Engine 5.1, here is an image:

As you can see, the shadow on the models are like chiseled, having a very bad resolution.

The setting of the room is simple: two stationary spotlights on the ceiling, lighting a rectangular room, and on the left wall, a circuit breaker panel. Everywhere in the room, the smallest objects are victims of this low resolution shadow, while the biggest and most “squarish” of them are not.

I have tried many solutions that I found on the internet, and nothing helps. I have for example increased the resolution of the lightmap from 64 to 256 on the big panel, but nothing helps. I even messed with the light settings, but nothing either. I have tried to enter countless commands in the console, poking around in the project settings to find the option that would solve all my problems …

But it is deprived of any solution that I come to you. If anyone could help me, I would be very happy!

1 Like

The resolution allocated to a given pixel is a function of the distance away from the clipmap origin — the camera. This is set by Shadow scalability with the console variable r.Shadow.Virtual.ResolutionLodBiasDirectional . A value of 0 picks the resolution required based on the perspective projection of the camera. Projective aliasing — when a shadow is cast on a surface almost parallel to the light direction — is still possible, even at high resolutions, but it can be reduced partly by biasing the resolution. Like Mip biasing in textures, lowering the value by -1 doubles the resolution of shadows with the associated performance tradeoffs. The default value of -1.5 on Epic Shadow scalability provides a reasonable balance for many scenes.

I typed the command into the editor, first assigning the value -1.5, then -3, then 3, but unfortunately nothing changes, even reloading the editor at each command and building the lighting.

Nobody manages to find a way out? I’m still looking, but I’m stumped.

1 Like

Same problem, and no one seems to know solution

Local light like spot , point, rect light will cause these low-quality shadow, if their cone angel and attenuation radius are too big.

It’s always better to have more small light source rather than big but few lights.
If you really need to keep their attenuation radius/cone angle big, bumping TexelDitherScale from 2 to a larger number might help a litter.

[/Script/Engine.RendererSettings]
r.Shadow.Virtual.SMRT.TexelDitherScaleLocal=8

this command will blur the shadow depends on how big the number you set, not sure will giving nagative preformance impact but worth a try.

You can increase source angle or source radius to increase the penumbra size (make it softer), which reduces visible aliasing.

For local lights, you can reduce r.Shadow.Virtual.ResolutionLodBiasLocal, e.g. to -1 to increase resolution.
For directional lights, there is a similar r.Shadow.Virtual.ResolutionLodBiasDirectional.
As mentioned above, local lights with large cone angles or large attenuation radii can also hit resolution limits.
In the viewport viewmodes menu, you can use the “Virtual Shadow Map → Clipmap/Mip Level” viewmode to see what resolution level is used for the shadows.