Shadows for distant, bright lights

Hi,

i came across an issue while trying to create a sunlight that is far away and is supposed to light my planet and the spaceships in the orbit. I noticed that the light doesn’t cast any shadows since ships were lit despite being behind the planet.

To reproduce, create an empty Level and place two objects directly behind each other (I used the material sphere that comes with the engine, which is 1m in diameter). Place one object at (0,0,0), the other directly behind at (-100,0,0).

Now create a Point light (I also tried a directional light without success) at (10000,0,0) (= 100m away). Set the intensity to 100000000.0 and the Attenuation Radius also to 100000000.0. You will see that both spheres are lit despite the fact that “Cast Shadow” is enabled in both objects and the light.

Another strange thing: The lighting intensity is different when i look at the light compared to when I look in the other direction.

The following two images illustrate the two problems:

The Problems don’t appear when the light is closer to the objects.

I don’t understand what is going on or what I am doing wrong. Is it forbidden to create distant lights and expect them to cast proper shadows.

Thanks for any advice or help!

David

Hey Oromis -

For the type of lighting that you are attempting to generate there are some things you will want to setup. First, Shadows from Lights are generated by a Source to Object calculation and if a light is too far away, Shadows will cull themselves out, a directional light will help some with this, but you will have to play with the Cascading Shadow Maps to ensure that the engine does not cull the shadows completely, there is a limitation in there, shadows will always eventually cull over extreme distances. The other thign that you may want to look at here, is to change the source radius of your light from a point to more of a large sphere which should also help the above issue and give you more of the effect of lighting come from a stellar body.

The change in light intensity is eye adaption which is something you may not need in your level. Add a Post Process Volume and set it to unbound (covers the whole map) and under Auto Exposure set the min and max values to 1.0 so no change in brightness should happen, if you want it overall brighter lower both values and vice versa.

Thank You

Eric Ketchum

Hi, thanks for your input. Unfortunately, it didn’t solve my Problem since it was much simpler:

I was looking at preview shadows in the editor all the time. I didn’t know that they are so much different compared to the finished shadows, but when I rebuilt the lighting, both problems vanished.

I feel stupid now, sorry for bothering you.