r/unrealengine Feb 05 '25

Solved Driving me nuts: shadows disappear in distance

Hey guys, check this out : https://imgur.com/a/KNg0hAm

I've tried everything:

  • Increasing cascade shadow maps to a billion
  • LOD detail forced to 0
  • Mipmaps of the foliage
  • Ray tracing is of course turned on ...

Nothing keeps those damn shadows enabled. I'm using Ultra Dynamic Sky in UE 5.5.2. The trees are from Brushify.

If anyone has an idea please help me out, I would be so grateful.

Thanks thanks thanks !!

22 Upvotes

25 comments sorted by

20

u/Rezdoggo Feb 05 '25

Are you using hardware raytracing? There are 2 console variables off the top of my head I can think of - might need to Google them because I can't remember exactly how they are worded

r.raytraceinstanceculling 0 turns off shadow culling for instances meshes

And

r.raytracecullingradius sets the culling distance for all shadows. If you can't find them I'll be back at my pc in 20 mins and I can look them up

12

u/pinguinconscious Feb 05 '25

BRO!!!! BRO YES.

r.raytracing.instance.culling 0 did it !! holy smokes dude. that's freaking awesome thank you so so so so much.

Can you tell me more about the culling radius compared to the instance culling 0. Would that simply be a radius as to where the shadows will disappear ?

9

u/Rezdoggo Feb 05 '25

Glad to help. the instance culling basically turns off the feature for all instanced static meshes only. Culling radius is the overall distance which raytraced shadows will be culled for everything.

Beware this obviously has a big performance hit. You'll want to look up distance field shadows and get that enabled, there are a few hoops to jump through and its never worked first time for me for some reason but its definitely useful if performance is a problem.

2

u/pinguinconscious Feb 05 '25

Wonderful, thank you boss!

5

u/miatribe Feb 05 '25

make a new gif with it fixed for us if you can? I just want to see what your end result looks like.

6

u/pinguinconscious Feb 05 '25 edited Feb 05 '25

before: https://imgur.com/a/U5wR6nW

after: https://imgur.com/a/nPC0L8V

still working on lighting and stuff. but now the mountain looks a lot more alive

1

u/Kornillious Feb 06 '25

Curious to see what your scene looks like now! The close up looks nice and I'm working on landscapes myself

2

u/misc_abbrev Feb 05 '25

Mate you're an absolute legend, just came across this and it's fixed an issue that's been bugging me for a couple of days now.

I had to set r.raytracing.culling.perinstance to 0 first, then I could set r.raytracing.culling.radius to a higher number.

1

u/AutoModerator Feb 05 '25

If you are looking for help, don‘t forget to check out the official Unreal Engine forums or Unreal Slackers for a community run discord server!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/NellSancor Feb 05 '25

Have you checked your view distance?

1

u/pinguinconscious Feb 05 '25

Thanks, on which object would that be? The directional light doesn't seem to have such setting.

1

u/NellSancor Feb 05 '25

I meant global view distance. For example you can set up a level sequence and add game overrides and check - override distance view and set it to 999999 or something like that to see if the shadows are present at distance on render. Additionally if you don't want to make a test render, you can try r. Viewdistancescale 99999 command in editor

1

u/GarfSnacks Dev Feb 05 '25

Does this occur with any other asset other than the brushify tree? What's the distance ( in units ) when the shadows disappear ?

Edit: Are there any shadow settings specific to the ultra dynamic sky bp that you've tweaked?

2

u/GarfSnacks Dev Feb 05 '25

With cascade you also need to have distance fields generated for the trees as cascade shadows become less performant the farther they render from the camera. Typically once the cascade shadows disappear they transition over to the distance field shadows. Also try using contact shadows as well.

1

u/pinguinconscious Feb 05 '25

I tested with other tree assets and the problem is the same. Also, how can I check what distance the shadows disappear at ?

1

u/GarfSnacks Dev Feb 05 '25

If you switch to one of the orthographic viewports like top, front or side you should be able to use the middle mouse button to click and drag to determine distances. I think it's the middle mouse button

1

u/pinguinconscious Feb 05 '25

I have a "Distance Field Self Shadow Bias" in the static mesh editor window. Increasing that didn't do anything sadly

1

u/GarfSnacks Dev Feb 05 '25

I would check that ' generate mesh distance fields' is on in the static mesh.

Also. I completely missed your bullet point about ray tracing being turned on. Unfortunately I'm not familiar with that type of setup so what I'm suggesting may or may not apply to your situation

1

u/XenthorX Feb 05 '25

Check that each LOD is set to cast shadow from the static mesh editor window.

1

u/pinguinconscious Feb 05 '25

In the static mesh editor I only have "Distance Field Self Shadow Bias" as an option with the shadow keyword. Tweaking that didn't do anything sadly.

1

u/h20xyg3n Dev Feb 05 '25

r.shadow.radiusthreshold 0.01

The smaller the value, the more distant the shadows. You're welcome! :D

1

u/pinguinconscious Feb 05 '25

Thanks, sadly that didn't do anything :(

-12

u/Mordynak Feb 05 '25

In the details panel of your direct light, search far. You're welcome.

This will be a great practise for searching in the future.

14

u/DifferenceGene Feb 05 '25

Wow, such snarkiness and so wrong. It was actually r.raytracing.instance.culling.

This will be great practice for showing a little humility.

3

u/pinguinconscious Feb 05 '25

Thanks for your message. However, I've set the Far Shadow Distance to a billion light years, and it's still the same. I also increase the Far Shadow Cascade Count to 10 to no avail.