Shadows fading out with increased camera distance

Done. Thanks for all of your help so far!

Hmm, that’s weird - no, we’re not doing anything in code which should affect the lighting.

I guess the next thing would be for us to create a new blank project, add the same assets to it and reproduce it, no?

Hi -

So I have been testing using your assets at various scaling parameters and I have not had any luck reproducing your shadow problem. Are you doing anything in code which might affect your lighting?

Thank You

Eric Ketchum

Hi Neil!

I am just curious, does it matter what is under your mesh / receiving the shadows?

Have you tried various surfaces / meshes / materials to see if there’s any difference?

I’m just curious, trying to contribute to this research project :slight_smile:

Hi ! Yes, we’ve tried all kind of meshes - it happens on landscape meshes, plane meshes (like the one in the video) - it’s pretty consistent. That’s why I’m surprised that Eric can’t repro it - but I do understand that there are lots of variables involved here! :slight_smile:

Hi Neil -

Yes I would, as you suggest, make a new Blank (no code or anything just Blank template) level and try to reproduce it with the single directional light and one of your meshes. This is essentially what I have done and have had little success in getting it to behave as you are experiencing it.

Let me know -

Eric Ketchum

Hi Eric,

I think that’s the best plan. I appreciate all of your help thus far! :slight_smile:

I probably won’t have a chance to get anything to you before the 4th but this is a priority for me for early next week.

Neil

Hi Neil -

Hopefully you have solved this issue, and I am marking this answered for tracking purposes, but if you can reproduce the issue as we discussed please feel free to comment and we will continue to help.

Thank You

Eric Ketchum

#Still having this Issue

Dear Eric,

I am having the exact issue in this thread myself!

I tried all the console variables, and I tried playing with every shadow cascade setting

#The Issue

Dynamically spawned and placed structures in an RTS game view pop out toward the edge of the view, but are fine in the center, they dont fade out, they simply pop out of existence, and come back when the top down camera center gets closer to their locations.

#My analysis

It looks like its related to the viewing angle!

I am in a top down view, and structures/buildings (they have no scaling) that are toward the edge of the screen have their shadows pop out of existence!

If a shadow is toward the center of my top down view, its shadow remains, and blends in and out smoothly as I zoom camera close and far

and it never loses its shadow at great distances

but structures toward the edge of the camera view have their shadows simply pop out of existence!

#Question

Is there a way to tell the shadow vew frustrum thing to be bigger so it catches the structures toward the edge of the top down viewing camera?

#Repro

  1. Spawn mobility::movable structures at runtime (can use BP) to various points on the map, zoom out, have top down camera via SpectatorPawn

  2. Has to be in-game, you can’t be in-editor

  3. make sure have top down view

  4. move the top down view around, notice what happens as actors get toward edge of the top down view

Let me know how it goes

#Console vars I tried

Try playing with the following Console Variables, you can set the in your EngineConfigConsoleVaraibles.ini file.

r.Shadow.FadeResolution - controls how big the light has to be on the screen before it starts to fade out. - Default Value: 64 - Can lower this value to keep shadows from fading out at further distances

r.Shadow.MinResolution - controls how big the light has to be on the screen before it finishes fading out, at which point it no longer has cost. - Default Value: 32 - Lower values seem to increase shadow visibility.

r.Shadow.TexelsPerPixel - Causes a higher resolution to be assigned and then it should fade out less aggressively - Default Value: 1.27324 - Can increase this value to improve shadow rendering visibility & quality

r.Shadow.RadiusThreshold - Default Value: 0.03 - A lower value of 0.02 or 0.01 greatly increases shadow visibility at far camera distances (seems to have the most impact of all the console commands).

#Stationary Dynamic Light Settings I played With

All of them :slight_smile:

#Skylight

I tried using a skylight but they dont seem to work with dynamically placed actors at all, they just show up black.

#Further Analysis

To be honest it seems like the stationary dynamic light has a max range!

I set the Dynamic Shadow Distance number reaaally high and it stops having an effect pretty quickly.

Unless the viewing frustrum for shadows is really narrow somehow? but I dont know how to widen it…

shadow Radius

r.Shadow.RadiusThreshold - Default
Value: 0.03 - A lower value of 0.02 or
0.01 greatly increases shadow visibility at far camera distances
(seems to have the most impact of all
the console commands).

This doesnt do anything at all to help with the issue

#Need Help, Cascade Dynamic Shadows Capped at 20,000

I give up this so frustrating, dynamic shadowing on dynamicaly spawned and moveable static meshes, viewed from the top down, seems to be capped at crippingly small distance.

It honestly seems like the max distance is 20,000

because if I go any higher, the shadows just dont respond, but they do, if I scale down from 20,000 toward 0 !!

but if I go higher than 20,000, nothing, they just dont respond anymore

#Epic, Need Help

I cannot publish videos of my RTS game to secure funding until this is addressed.

#View Distance Versus View Angle

Just to clarify, when the top down camera is at the right spot the dynamic shadows of the runtime-spawned mobility moveable static meshes do show up correctly, and I can zoom in and out and they stay.

But once I scroll the camera (a la RTS games) so the structures are not at the apparently correct angle to the top down camera, the shadows simply pop out of existence.

So I am not sure the issue is related to the max distance, but definitely you can only repro this by spawning static meshes at runtime in a top down view and scrolling around.

video

It IS related to the max distance being so limited

As you can see in my video (hosted privately since this is a messy subject),

when I increase the distance to 1,200,000, or 600,000, shadows simply disappear

#No Distance Beyond 20,000, Just Fading Away

When I changed the distance to 4 times the normal value, 80,000, then shadows look faded all the time,

but they still fade out at exactly the same camera distance and in the same exact way as when the distance is 20,000 (the apparent maximum value)

video Link

You can just click the download button at bottom of screen, I dont recommend trying to view it via the link above.

I am hosting this entirely privately / not on you tube.

#Proven, 20,000 Limit

I think I’ve shown in this video that:

Dynamic shadows on runtime spawned structures that are movable have a max distance of 20,000 when cast from a stationary directional light

#This is entirely impossible to work with for a real RTS game

Again I am referring only to this specific case

-runtime spawning of static mesh actors

-directional light set to stationary

-in this case max distance of shadows appears to be 20,000 no matter what I
try

#Please Help

Please Help Epic,

Want make RTS game

want show world game

secure funding

keep making game

cant show any videos under current shadowing conditions

#Eager to be proven wrong

I am quite happy if someone can prove there’s an easy way to get around this and I am just confused, please do tell me the solution, I just want a solution, I dont need to be right about any of this :slight_smile:

I have the same issues with the shadows for my RTS game project aswell :slight_smile:

Hello Users -

I need some help testing this particular issue and narrowing down the root cause. The lighting system is robust and I want to make sure if there is an issue I can identify the causing factor or narrow it down. Here is a video of expected behavior in a Test Bed I created, it shows both Movable Static Meshes that are placed and dynamically spawning them via a blueprint.

http://youtu.be/0_OgVVcIQns

What I need is for people to download the Test Project (Dropbox link below) and see if it still behaves as it does in the video from above. In the Zip File, I have included a set of installation instructions which include a preset consolevariables.ini file. Also are instructions of how to post your results as a Comment below.

Dropbox - Error - Simplify your life

Thank You all for your help -

Eric Ketchum

Thanks … We’ll take a look!

Hi Eric,

Thank you for taking the time to put a quick test project together! I’ve just been taking a look at your test project and it behaves the same for me locally as it does in your video.

That said… If you change the mobility of “Light Source” from being Stationary to Movable (which our game is doing) then shadow rendering (of course) changes completely - and now you can start to reproduce the shadow popping problem that I reported originally. That’s the problem I would like addressed because the main light does need to be able to update its direction in our game - it’s the main way that we can demonstrate day/night cycles.

I wonder if that’s how 's lighting is set up as well?

It’s even worse when you’re using blueprints made up of multiple static mesh components - which is how the objects are set up that I was using in the video I had posted some months ago. To demonstrate the problem, I modified your project with the light source mobility and also a blueprint named CubeBP. Zoom in and out (slowly!) and you’ll see how some parts disappear before other parts. Shadowing appears to be calculated around the individual static mesh components rather than the blueprint itself - and the problem is magnified when dealing with meshes that are different sizes.

Neil