Actor Shadows popping, how to fix?

Hello,

I’m hoping there is an easy solution to this as it is pretty irritating, I am generating procedural mazes using meshes as actors. But the shadows are not good at all, and as you can see, some objects shadows “pop” off as the camera moves away despite the cascade being much farther in the distance.

I have been googling and searching here for a solution, but I am just going round in circles with what I think must be an easily correctable issue.

As for the scene scale, the square/rectangle (multi-coloured) grids are 1 meter across, I don’t know if that is relevant or not. That would seem to me to be a normal scale.

The light is a directional set to movable.

I had heard some people mention “BoundScale” but I cant find this in the documentation, or where this parameter is on the objects.

If anyone has any insight or a fix for this I would really appreciate it, the shadow distance in general is terrible too, this limitation seems incredibly tight.

Thank-you!

https://scontent-lhr3-1.xx.fbcdn.net/hphotos-xaf1/t31.0-8/12291979_1034250909951130_948740480405123908_o.jpg

Hello GreyDesigns,

If you are using a single mesh and generating different shapes procedurally by scaling them non-uniformly, you might be experiencing a bounds scale issue for sure. Use the images below to toggle the visualizer for the Bounds of your selected objects in the scene, as well as the location on how to change the ‘Bounds Scale’ as well.

Toggle Show - Bounds

Original Bounds Scale - 1.0

Bounds Scale - 3.0

Here you can see how the bounds is affected when I set the ‘Bounds Scale’ value to 3.0 instead of it’s original of 1.0.

Hopefully this resolves your issue, but if you are still experiencing issues, let me know and we can try some more options.

Cheers,

Thank you, Andrew!

I enabled the bounds in view port, and can clearly see that the smaller of the spawned objects have small bounds, even relative to their own size (despite the fact that they are all scaled to 1,1,1 - I am assuming that being on flat planes with no thickness must be limiting the bound size, but that is not an issue.)

When I drag and drop the mesh into the view port, I can see and adjust the boundscale as per your last image. And it had exactly the effect I wanted, and that one small pieces shadow remained visible long past the rest of the meshes. Perfect!

https://scontent-lhr3-1.xx.fbcdn.net/hphotos-xfa1/t31.0-8/11049121_1035243503185204_3576015502241128480_o.jpg

However, I cant see a way of setting the boundscale in the content browser - so it will be applied to the meshes within the blueprints prior to spawning.

What is the best way of achieving this?

Thanks again Andrew, I really appreciate your help.

Happy to help :slight_smile:

I am glad to see the bounds scale fixed the issue somewhat. You will want to be careful not to increase the bounds too much, or you will see a drop in performance. The next thing you can do is to increase the number of cascades within the Cascaded Shadow Maps section. This allows you to modify the number of shadow cascades, the shadow resolution, and their relative distances in transition from Static to Dynamic shadows.

For more information about Cascaded Shadow Maps you can take a look at our documentation provided below.

Cascaded Shadow Maps - Dynamic Scene Shadows

Another technique you can try is Ray Traced Distance Field Soft Shadowing. There is an important limitation to this approach that requires you do not aggressively scale things non-uniformly. What I mean by this is, you mention you are scaling all of your objects 1,1,1 and you can get away with perhaps something like 1,2,1, but scaling too far will cause inaccurate shadowing and produce artifacts.

Ray Traced Distance Field Soft Shadows

Personally, I love this technique as it can really improve performance for large outdoor scenes with heavy foliage, but it also works well in other cases. The documentation will show you the process of enabling and using the shadowing technique, but if you are stuck and need some more assistance I will be glad to help.

Thank you,

Hi again Andrew,

Sorry to be a pain, but I am still stuck on this. I just need some clarification on how to set the bound scale in the content browser prior to spawning the blueprint with the mesh (since the game is procedural.)?

I did actually ask that in my last reply, but it was hidden after the picture which I can see is pretty misleading, Haha, Sorry about that. Thanks again, and for the details on the shadows, I’l have a read! :smiley:

Apologies, I must have gotten ahead of myself when explaining the shadowing set up! You will actually want to set the bound scale per component within the blueprint you are spawning itself. This can be done by opening up your Blueprint, clicking on the StaticMeshComponent, and navigating to the ‘Rendering’ section within the ‘Details’ panel (same as in editor viewport).

Blueprint - Bounds Scale

Let me know if you still need help.

Cheers,

Ah! That is so obvious I have no idea how I missed it before!

Thanks again, I owe you one! :smiley:

Is there a way to increase the universal bounds scale for all objects?

My game has long draw distances but isn’t very complex so I pretty much want my shadows to always draw, is there a good way to do that?

You can set that property via the Light actor itself using the Min/Max Draw Distance setting. If you are using CSM then you use the Shadow Distance there.