Shadow Distance beyond 20000

Hi!

I’m trying to get the shadows to work on smaller objects in a “top down” game (camera boom length 1200 ), but haven’t manage to get to work!
Doesn’t look that good when the shadows start to appear right next to the player :confused:
Tried all kind of different settings and console commands but no luck.

Did find this thread https://answers.unrealengine.com/questions/60734/shadows-fading-out-with-increased-camera-distance.html

So is there any fix for this or is it still “broken”?

Hi Numbat,

This isn’t a broken feature, but just a limitation. With 4.8 some of this has been resolved to better support larger worlds.

We have some simple examples on our Wiki Lighting guide here that may help: A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums

There is also Distance Field Soft Shadows that would potentially work for shadows at further distances. You can read the documentation here: Distance Field Soft Shadows in Unreal Engine | Unreal Engine 5.1 Documentation

This feature was used with the GDC Kite Demo to get shadows at further distances. It was used in combination with Cascaded Shadow Maps.

In 4.8 there will be a feature added for “Far Shadows” that can be enabled per mesh to provide shadows at longer ranges. This would not be recommended for all meshes, but those that are needed at further distances can benefit from this. This feature will only work with Directional Lights though, so no support for Point or Spot lights.

I hope this helps.

1 Like

good news!

Thanks for the quick answer and the links.
Good to hear that some “far shadow” support are coming in 4.8.

Maybe a silly question but why just not allow us to use a higher number then 20000?
Or is it possible to override it with c++?

In 4.8 you can type in larger values and it’ll work, to a degree but you’re still limited in the number of cascades you can use. Using the larger values just means that the number of cascades will be stretched over a larger distance and will not look at good or as accurate.

Limiting your view distance and finding ways of using a combination of static lighting and dynamic is helpful as well. Not ideal in every situation, but in 4.8 with the far shadows option at least there will be a way to shadow larger objects in the distance. Again, I would not recommend this for every object, only larger pieces that absolutely need it.

Not every object needs to cast a shadow from a great distance. Games do not do this because of performance reasons. I always like to use GTA as an example because it is a large open world and uses dynamic lighting. If you pay attention to the shadows, you can you see how accurate the shadows are within range of the character. It’s not a very large draw distance that is accurate, but it’s enough to balance performance and what looks good for their needs.

Even in 4.7 you can use a value larger than 20k, just key it in. It’s only the slider that is limited to 20k.

You can set to 50000 and doesn’t make any different! Or have i missed something?
6f8aebc16a441b2ad59aef1cee8243859b564492.jpeg

Hey Numbat,

probably misunderstood the question. I’ll pass along a command he suggested that I try previously:

r.Shadow.RadiusThreshold

try various values. I believe 0.03 or so is the default. What this does is stop rendering shadows based on screen size as an optimization.

Alternatively, try increasing “BoundScale” in the mesh properties. It should be using bounds for this but increasing the bounds may have other unwanted side effects like making more objects render.

BoundScale ftw :slight_smile: thanks!

"UE 4.8 will have the ability to use “Far Shadow” with skeletal, static meshes, and landscapes.
This is only functional with Directional lights that are set to Movable.
By default this is turned off and needs to be enabled int he source light by adjusting the Far Shadow Cascade Count and distance.

Just because the far shadow flag is enabled does not guarantee it will have a shadow at great distances.
The bounds of the actor is still taken into consideration for when to stop rendering shadows for it. This is a way to keep the editor optimized and the game running smoothly.

If you are not seeing the results you need with far shadow, try bumping the mesh/actors bounds scale up just a little until you get the results you need.
I wouldn’t recommend this for lots of objects, but only necessary ones when needed.

I hope this helps.

Tim"
https://answers.unrealengine.com/questions/228298/does-skeletal-mesh-support-far-shadow.html

So this means that UE4 will continue to squeal over my to large bounds scales on my small objects when I build the light :slight_smile: ?
Or have i missed something.

Cheers!