Any solution for the artifacts (the black stripes) using dynamic light with cascade shadows?

I know this is a recurrent theme, but I can’t find a good solution for the dark stripes, like in this image:

With different values for the cascade, the artifacts appears more near or more far, but always appear.

With different values for CSMSplitDepthBiasScale, the same thing.

Using high values in shadowdepthbias the stripes are minimized, but then the shadows looks horrible.

I have modified a lot of values related to cascade shadows, bias, nearclipplane, etc, in the ini files, with no good result.

The only thing I can do is to try to align the meshes to not offer faces perpendicular to the light. But this is a serious limitation to create the maps.

Somebody have found any magical solution for this?

there was never a fix for this AFAIK. the shadow settings/values on the ini are pretty much all you can do to minimize the issue
anyway you have a day night cycle right? if so you’ll always have an angle where this will happen (unless your buildings have a pyramid-like shape)

you could also try the branching PCF shadows technique. I know it works for pointlights but I’m not sure if it also works for DominantDirectionalLights

scale set bEnableBranchingPCFShadows true
scale set ShadowFilterRadius 5
scale set ShadowFilterQualityBias 3

you’ll most likely have to adjust your shadow bias settings.
the issue with the branching PCF shadows is they are quite noisy, and the shadow filter doesnt smooth it enough. but more radius means more spreading which potentially could reduce your issue (which is called “shadow acne” btw)

Yes, I was testing with PCF shadows, but agravates the problem, the stripes are surrounded with noise… I was testing using low values to try more difuse shadows… but the result was horrible.

The best option is to place the meshes oriented to the sun. There are a day/night cycle, but the sun only rotates in one axis, so a cube properly oriented will avoid the problem at the morning hours and at the afternoon. And perhaps the bias a bit higher. I use 0.02, to 0.05 still looks enough good.

I have read in forums, and seems that others engines like Unity and Cry have the same problem with dynamic lights. In UE4 I think it’s possible to avoid using raytraced shadows (or area shadows, not sure).

Have you tried to up to 1000-2000 the whole scene dynamic shadows of the dominant directional light?
A solution(time related one)might be to bake the light and shadow in a different app to the texture and make the object unlit.(that will leave the ground shadow which coud be a baked shadow too, pasted on a plane with transparency)But as I said this might be too crazy to do.

In the UDKLightmass.ini there is a bAllowAdvancedOptions=false set it to true and now in the lightning build options in UDK you will have a extra button Advanced options.See if you can find something useful there.

Thanks for the tip, I can’t use Lightmass. The map is 100 square kilometers with a day/nick cycle, the lights needs to be dynamic (and the shadows too).

I have some presets for cascade shadows, with diferent ranges, cascades, exponents, and shadow map sizes. With some of them the stripes appears more near, with others more far…

Would adding a Skylight make a difference ?

Skylight hasn’t made much difference to mine.

Yes, I have a skylight but don’t fix anything.

The alingment with the sun light may solve partially the problem, but… with the day/night cycle, at 12:00 hours, the light are aligned with all the vertical surfaces and the problem appears again.

I’m thinking about modify progresivelly the shadow bias from 0.02 to 0.05, from 10 to 12 hours, and return to 0.02 until 14 hours. With the vertical light, the 0.05 bias are good. Will be a bias multiplier, so the user still can set the absolute bias value in the menus.

that’s why I said you can only get “rid of it” if your buildings have a pyramid-like shape (i.e. your walls would need to be sloped, not perfectly vertical) :wink:

But as the sun light are rotating, faces of the pyramid semi-aligned to the light have the same problem. If the acne appears in a cube at 12:00, in a pyramid appears at 11:00 and 13:00, for example.

I have testing with bias and when the light is perpendicular to the floor, you can use higher values. The typical shadow offset are less noticeable with this angle. So you can “torear” this (but not solve it completly).

uhmm yes there’s always going to be an angle
another trick to “bullfight” it a bit more could be to make your sun not have a straight equatorial trajectory. i.e. at 12:00 it should be tilted to the side, and not facing perfectly downward.

If you see the image, the house is not aligned with the sun exactly, has some inclination, and still there are stripes.

yes, you would need to tilt the sun even more :slight_smile:

Hi Colbolt, don’t know how old this thread is but thats the problem I had . . I turned of ‘Cast static shadows’ and that banding disappeared. It looks to be the same, it just effects the static meshes…

Had same Problem

I had the same problem and yours sounds very similar take a look at the picture… If your using dynamic lighting it negates the need to have cast static shadows ticked in the dynamic light. I turned mine off and immediately the stripes (Banding) disappeared…

Thanks for the idea, but there are no diference in my case. Perhaps you are using staticmeshes with precomputed shadows and a dynamic light with sorth range shadows? In that case the cascade only replaces the static shadows for the near objetcts.

I can’t say Colbolt. I was getting fed up with it so I replaced both the dominant directional light and the skylight with a fresh one ( I think Snipe recommended it) and worked through the settings watching the screen as I did so. The only setting I returned to the way I had it was using ‘don’t recompmpute static shadows’. I had that checkbox ticked and 'use global illumination unchecked. I had the dynamic shadow range set 20000 and in the skylight I had cast shadows unchecked (I don’t think it casts shadows anyhow) I worked down the list trying everything in the dominant light and when I reached cast static shadows the lines suddenly disappeared when I unchecked it. I checked it and they reappeared. I disabled the skylight so I could be sure it wasn’t being influenced by something else, but it done the same. It sort of made sense to me because I had don’t use precomputed shadows and the dominant light was casting realtime shadows then trying to use static shadows as well might be confusing it… Sorry it hasn’t worked for you… It’s bloody annoying. You’ll be pleased to know it was quickly followed by a different problem… The honymoon period is over…

I forgot to mention … Turn the shadow filter quality to ‘Low’ as well ‘medium’ & ‘High’ both produce the banding…

There are a lot of factors here, the cascade shadows values (distance, exponent, cascade number), the shadow map size, the CMS* variables like “CSMSplitDepthBiasScale”, the orientation of the faces to the light, or the shadowdepthbias. For example with this last:

With a bias of 0.05 the problem dissapears almost totally, but the shadows are less precise, some details are lost, like the belt shadow in the back of the character, or the woods in the house.

You can play with the values, for example with the cascade shadows. You can set the values and find some that don’t produce the stripes. Then move the camera, and the stripes appears again, at other distance, at other angle. It’s very frustrating.

So my plan is:

  • Try to align the meshes in the map to don’t be paralel with the sun. But this don’t works when the light is totally perpendicular to the ground (12 hours).

  • Shadow bias will change the value from 0.02 to 0.05, from 8:00 hours to 12, and from 0.05 from 12 to 16 hours. At 12 hours, the sun is vertical and a high bias are not too noticeable. As the day/night cyle are done with code and not matinee for performance reasons, it will be easy to add the bias to the interpolations.

I don’t know if there are any parameter in the ini’s to fix this, I have touched a lot and the only thing that seems work is the bias. Also the pfc shadows can mitigate a bit, but I don’t like the result too much. Perhaps some combination, some hidden option. Who knows (Epic staff appart).